diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-01-30 09:29:42 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-01-30 09:29:42 -0330 |
commit | 0a2a4d818fb5c276e6ba008c29b591683d5025bd (patch) | |
tree | bef463540bcd1ba853b75c8f265845251e819fd6 /cpp/demo/Manual/map_filesystem/Parser.cpp | |
parent | Fixed (ICE-6276) - Add support for JavaScript source maps (diff) | |
download | ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.tar.bz2 ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.tar.xz ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.zip |
ICE-5814 allow demos to be built with /W4 on Windows
Diffstat (limited to 'cpp/demo/Manual/map_filesystem/Parser.cpp')
-rw-r--r-- | cpp/demo/Manual/map_filesystem/Parser.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/cpp/demo/Manual/map_filesystem/Parser.cpp b/cpp/demo/Manual/map_filesystem/Parser.cpp index 8f8644234b1..6bd3c139efe 100644 --- a/cpp/demo/Manual/map_filesystem/Parser.cpp +++ b/cpp/demo/Manual/map_filesystem/Parser.cpp @@ -44,7 +44,7 @@ Parser::usage() } // Print the contents of directory "dir". If recursive is true, -// print in tree fashion. +// print in tree fashion. // For files, show the contents of each file. The "depth" // parameter is the current nesting level (for indentation). @@ -294,7 +294,7 @@ Parser::destroy(const std::list<string>& names) } // -// With older flex version <= 2.5.35 YY_INPUT second +// With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& // @@ -344,25 +344,22 @@ Parser::getInput(char* buf, size_t& result, size_t maxSize) cout << parser->getPrompt() << flush; string line; - while(true) + char c; + do { - char c = static_cast<char>(getc(yyin)); + c = static_cast<char>(getc(yyin)); if(c == EOF) { if(line.size()) { line += '\n'; } - break; } - - line += c; - - if(c == '\n') + else { - break; + line += c; } - } + } while(c != EOF && c != '\n'); result = line.length(); if(result > maxSize) |