summaryrefslogtreecommitdiff
path: root/src/commodity.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-17 15:17:52 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-17 15:17:52 -0600
commitc3a9a7d2c584a7651426b3516f4e9991c8063e02 (patch)
tree6a7748588d90d3d9e0032903548b3411d7277dd6 /src/commodity.cc
parentc6b51a2635bdf7da803dd2fc8251d6c290f134a4 (diff)
downloadfork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.tar.gz
fork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.tar.bz2
fork-ledger-c3a9a7d2c584a7651426b3516f4e9991c8063e02.zip
Fixed many Clang type conversion warnings with static_cast
Diffstat (limited to 'src/commodity.cc')
-rw-r--r--src/commodity.cc4
1 files changed, 2 insertions, 2 deletions
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<unsigned char>(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<std::string::size_type>(q - p - 1));
p = q + 2;
} else {
char * q = next_element(p);