From 899a478a6ff2175ca3cc435388cd14913a3cbfa1 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Wed, 19 Feb 2014 23:06:01 +0000 Subject: [PATCH] Fix compile warnings on VS2013 (mainly size_t -> unsigned). --- libethereum/Instruction.cpp | 18 +++++++++--------- windows/LibEthereum.props | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libethereum/Instruction.cpp b/libethereum/Instruction.cpp index a396a176b..8b7eae18d 100644 --- a/libethereum/Instruction.cpp +++ b/libethereum/Instruction.cpp @@ -99,7 +99,7 @@ u256s eth::assemble(std::string const& _code, bool _quiet) if (isdigit(t[0])) ret.push_back(readNumeric(t, _quiet)); else if (t.back() == ':') - known[t.substr(0, t.size() - 1)] = ret.size(); + known[t.substr(0, t.size() - 1)] = (unsigned)ret.size(); else { auto it = c_instructions.find(boost::algorithm::to_upper_copy(t)); @@ -107,7 +107,7 @@ u256s eth::assemble(std::string const& _code, bool _quiet) ret.push_back((u256)it->second); else { - req[ret.size()] = t; + req[(unsigned)ret.size()] = t; ret.push_back(0); } } @@ -129,7 +129,7 @@ static void appendCode(u256s& o_code, vector& o_locs, u256s _code, vec for (auto i: _locs) { _code[i] += (u256)o_code.size(); - o_locs.push_back(i + o_code.size()); + o_locs.push_back(i + (unsigned)o_code.size()); } o_code.reserve(o_code.size() + _code.size()); for (auto i: _code) @@ -232,7 +232,7 @@ static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256 // Push the positive location. o_code.push_back(Instruction::PUSH); - unsigned posLocation = o_code.size(); + unsigned posLocation = (unsigned)o_code.size(); o_locs.push_back(posLocation); o_code.push_back(0); @@ -247,7 +247,7 @@ static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256 // Jump to end after negative. o_code.push_back(Instruction::PUSH); - unsigned endLocation = o_code.size(); + unsigned endLocation = (unsigned)o_code.size(); o_locs.push_back(endLocation); o_code.push_back(0); o_code.push_back(Instruction::JMP); @@ -272,7 +272,7 @@ static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256 // Push the positive location. o_code.push_back(Instruction::PUSH); - unsigned endLocation = o_code.size(); + unsigned endLocation = (unsigned)o_code.size(); o_locs.push_back(endLocation); o_code.push_back(0); @@ -301,11 +301,11 @@ static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256 if (compileLispFragment(d, e, _quiet, codes[2], locs[2])) return false; - unsigned startLocation = o_code.size(); + unsigned startLocation = (unsigned)o_code.size(); // Push the positive location. o_code.push_back(Instruction::PUSH); - unsigned endInsertion = o_code.size(); + unsigned endInsertion = (unsigned)o_code.size(); o_locs.push_back(endInsertion); o_code.push_back(0); @@ -321,7 +321,7 @@ static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256 // Jump to end after negative. o_code.push_back(Instruction::PUSH); - o_locs.push_back(o_code.size()); + o_locs.push_back((unsigned)o_code.size()); o_code.push_back(startLocation); o_code.push_back(Instruction::JMP); diff --git a/windows/LibEthereum.props b/windows/LibEthereum.props index 8af87a44d..b85a36b55 100644 --- a/windows/LibEthereum.props +++ b/windows/LibEthereum.props @@ -8,7 +8,7 @@ - 4100;4127;4505;4512;4706 + 4100;4127;4258;4505;4512;4706 Level4 true false