summaryrefslogtreecommitdiff
path: root/src/parser.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-25 04:35:19 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-25 05:01:39 -0400
commit588f2ef2f51d7bdf209820bfb244034863601939 (patch)
tree7a473de7c117bf71bb802398823826ca4dfbfdca /src/parser.cc
parentdc66840dd745863c06ad6513f9f66d589bcc29d8 (diff)
downloadfork-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.cc11
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;
}