Split Common.h into Numeric.h.

This commit is contained in:
chriseth
2021-09-23 15:27:29 +02:00
parent c8e6ef9657
commit 1531863835
65 changed files with 318 additions and 215 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
#include <libsolutil/Keccak256.h>
#include <libsolutil/StringUtils.h>
#include <libsolutil/Whiskers.h>
#include <libsolutil/Numeric.h>
#include <liblangutil/Exceptions.h>
@@ -505,7 +506,7 @@ public:
// Note: Don't change HexPrefix::Add. See comment in fixedByteValueAsString().
static std::string maskUnsignedIntToHex(unsigned _counter, unsigned _numMaskNibbles)
{
return toHex(maskUnsignedInt(_counter, _numMaskNibbles), util::HexPrefix::Add);
return "0x" + toHex(maskUnsignedInt(_counter, _numMaskNibbles));
}
/// Dynamically sized arrays can have a length of at least zero
@@ -29,6 +29,9 @@
#include <libevmasm/Instruction.h>
#include <libsolutil/Keccak256.h>
#include <libsolutil/Numeric.h>
#include <limits>
using namespace std;
using namespace solidity;
@@ -511,7 +514,7 @@ void EVMInstructionInterpreter::logTrace(std::string const& _pseudoInstruction,
{
string message = _pseudoInstruction + "(";
for (size_t i = 0; i < _arguments.size(); ++i)
message += (i > 0 ? ", " : "") + util::formatNumber(_arguments[i]);
message += (i > 0 ? ", " : "") + formatNumber(_arguments[i]);
message += ")";
if (!_data.empty())
message += " [" + util::toHex(_data) + "]";
@@ -24,6 +24,7 @@
#include <libyul/ASTForward.h>
#include <libsolutil/CommonData.h>
#include <libsolutil/Numeric.h>
#include <vector>
@@ -29,6 +29,9 @@
#include <libevmasm/Instruction.h>
#include <libsolutil/Keccak256.h>
#include <libsolutil/Numeric.h>
#include <limits>
using namespace std;
using namespace solidity;
@@ -601,7 +604,7 @@ void EwasmBuiltinInterpreter::logTrace(std::string const& _pseudoInstruction, st
{
string message = _pseudoInstruction + "(";
for (size_t i = 0; i < _arguments.size(); ++i)
message += (i > 0 ? ", " : "") + util::formatNumber(_arguments[i]);
message += (i > 0 ? ", " : "") + formatNumber(_arguments[i]);
message += ")";
if (!_data.empty())
message += " [" + util::toHex(_data) + "]";