From c3a9a7d2c584a7651426b3516f4e9991c8063e02 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 17 Feb 2012 15:17:52 -0600 Subject: Fixed many Clang type conversion warnings with static_cast --- src/commodity.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/commodity.cc') diff --git a/src/commodity.cc b/src/commodity.cc index 3431a4ee..5fd54d11 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -567,7 +567,7 @@ void commodity_t::parse_symbol(std::istream& in, string& symbol) while (_p - buf < 255 && in.good() && ! in.eof() && c != '\n') { std::size_t bytes = 0; std::ptrdiff_t size = _p - buf; - unsigned char d = c; + unsigned char d = static_cast(c); // Check for the start of a UTF-8 multi-byte encoded string if (d >= 192 && d <= 223 && size < 254) @@ -627,7 +627,7 @@ void commodity_t::parse_symbol(char *& p, string& symbol) char * q = std::strchr(p + 1, '"'); if (! q) throw_(amount_error, _("Quoted commodity symbol lacks closing quote")); - symbol = string(p + 1, 0, q - p - 1); + symbol = string(p + 1, 0, static_cast(q - p - 1)); p = q + 2; } else { char * q = next_element(p); -- cgit v1.2.3