From 588f2ef2f51d7bdf209820bfb244034863601939 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 25 Oct 2009 04:35:19 -0400 Subject: Fixed many compiler warnings from g++ 4.4 --- src/parser.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/parser.cc') 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(in.tellg()) : 0; - std::size_t pos = static_cast(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(pos), + static_cast(end_pos))); } throw; } -- cgit v1.2.3