diff options
author | kanreki <32443233+kanreki@users.noreply.github.com> | 2021-09-14 12:15:53 -0700 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2021-12-08 16:17:17 -0800 |
commit | 586abd208221761a6c93bc4568513e9cd4dc287d (patch) | |
tree | d3d6c8da7e4584665bb705c25a91c5c66083de65 /src/times.cc | |
parent | ed5886921bcce0d1a261a37aa83bf135259b7d21 (diff) | |
download | fork-ledger-586abd208221761a6c93bc4568513e9cd4dc287d.tar.gz fork-ledger-586abd208221761a6c93bc4568513e9cd4dc287d.tar.bz2 fork-ledger-586abd208221761a6c93bc4568513e9cd4dc287d.zip |
Use correct int return type for stream input operations
This makes it safe to compare results to -1 to indicate EOF,
regardless of whether char is considered signed or unsigned;
and so eliminates compiler warnings on platforms such as ARM.
Fixes bug #2058.
Diffstat (limited to 'src/times.cc')
-rw-r--r-- | src/times.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/times.cc b/src/times.cc index bab4e0de..127cdd69 100644 --- a/src/times.cc +++ b/src/times.cc @@ -1621,17 +1621,10 @@ void date_parser_t::lexer_t::token_t::unexpected() void date_parser_t::lexer_t::token_t::expected(char wanted, char c) { - if (c == '\0' || c == -1) { - if (wanted == '\0' || wanted == -1) - throw_(date_error, _("Unexpected end")); - else - throw_(date_error, _f("Missing '%1%'") % wanted); - } else { - if (wanted == '\0' || wanted == -1) - throw_(date_error, _f("Invalid char '%1%'") % c); - else - throw_(date_error, _f("Invalid char '%1%' (wanted '%2%')") % c % wanted); - } + if (wanted == '\0') + throw_(date_error, _f("Invalid char '%1%'") % c); + else + throw_(date_error, _f("Invalid char '%1%' (wanted '%2%')") % c % wanted); } namespace { |