diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-25 04:35:19 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-25 05:01:39 -0400 |
commit | 588f2ef2f51d7bdf209820bfb244034863601939 (patch) | |
tree | 7a473de7c117bf71bb802398823826ca4dfbfdca /src/parser.cc | |
parent | dc66840dd745863c06ad6513f9f66d589bcc29d8 (diff) | |
download | fork-ledger-588f2ef2f51d7bdf209820bfb244034863601939.tar.gz fork-ledger-588f2ef2f51d7bdf209820bfb244034863601939.tar.bz2 fork-ledger-588f2ef2f51d7bdf209820bfb244034863601939.zip |
Fixed many compiler warnings from g++ 4.4
Diffstat (limited to 'src/parser.cc')
-rw-r--r-- | src/parser.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/parser.cc b/src/parser.cc index 39004758..a6053d69 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -491,9 +491,10 @@ expr_t::parser_t::parse(std::istream& in, const parse_flags_t& flags, if (original_string) { add_error_context(_("While parsing value expression:")); - std::size_t end_pos = - in.good() ? static_cast<std::size_t>(in.tellg()) : 0; - std::size_t pos = static_cast<std::size_t>(end_pos); + std::streamoff end_pos = 0; + if (in.good()) + end_pos = in.tellg(); + std::streamoff pos = end_pos; if (pos > 0) pos -= lookahead.length; @@ -504,7 +505,9 @@ expr_t::parser_t::parse(std::istream& in, const parse_flags_t& flags, DEBUG("parser.error", " token kind = " << int(lookahead.kind)); DEBUG("parser.error", " token length = " << lookahead.length); - add_error_context(line_context(*original_string, pos, end_pos)); + add_error_context(line_context(*original_string, + static_cast<string::size_type>(pos), + static_cast<string::size_type>(end_pos))); } throw; } |