mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Split Common.h into Numeric.h.
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include <libsolidity/ast/TypeProvider.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::frontend;
|
||||
|
||||
@@ -274,7 +274,7 @@ uint32_t ContractDefinition::interfaceId() const
|
||||
{
|
||||
uint32_t result{0};
|
||||
for (auto const& function: interfaceFunctionList(false))
|
||||
result ^= util::fromBigEndian<uint32_t>(function.first.ref());
|
||||
result ^= fromBigEndian<uint32_t>(function.first.ref());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1135,7 +1135,7 @@ IntegerType const* RationalNumberType::integerType() const
|
||||
return nullptr;
|
||||
else
|
||||
return TypeProvider::integer(
|
||||
max(util::numberEncodingSize(value), 1u) * 8,
|
||||
max(numberEncodingSize(value), 1u) * 8,
|
||||
negative ? IntegerType::Modifier::Signed : IntegerType::Modifier::Unsigned
|
||||
);
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ FixedPointType const* RationalNumberType::fixedPointType() const
|
||||
if (v > u256(-1))
|
||||
return nullptr;
|
||||
|
||||
unsigned totalBits = max(util::numberEncodingSize(v), 1u) * 8;
|
||||
unsigned totalBits = max(numberEncodingSize(v), 1u) * 8;
|
||||
solAssert(totalBits <= 256, "");
|
||||
|
||||
return TypeProvider::fixedPoint(
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <liblangutil/Exceptions.h>
|
||||
|
||||
#include <libsolutil/Common.h>
|
||||
#include <libsolutil/Numeric.h>
|
||||
#include <libsolutil/CommonIO.h>
|
||||
#include <libsolutil/LazyInit.h>
|
||||
#include <libsolutil/Result.h>
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <stack>
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
#include <limits>
|
||||
|
||||
namespace solidity::frontend
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace solidity::langutil;
|
||||
|
||||
using solidity::util::Whiskers;
|
||||
using solidity::util::h256;
|
||||
using solidity::util::toCompactHexWithPrefix;
|
||||
using solidity::toCompactHexWithPrefix;
|
||||
|
||||
unsigned const CompilerUtils::dataStartOffset = 4;
|
||||
size_t const CompilerUtils::freeMemoryPointer = 64;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <range/v3/view/reverse.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
|
||||
@@ -266,7 +266,7 @@ void IRGeneratorForStatements::initializeStateVar(VariableDeclaration const& _va
|
||||
_varDecl.immutable() ?
|
||||
IRLValue{*_varDecl.annotation().type, IRLValue::Immutable{&_varDecl}} :
|
||||
IRLValue{*_varDecl.annotation().type, IRLValue::Storage{
|
||||
util::toCompactHexWithPrefix(m_context.storageLocationOfStateVariable(_varDecl).first),
|
||||
toCompactHexWithPrefix(m_context.storageLocationOfStateVariable(_varDecl).first),
|
||||
m_context.storageLocationOfStateVariable(_varDecl).second
|
||||
}},
|
||||
*_varDecl.value()
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <range/v3/view.hpp>
|
||||
|
||||
|
||||
#include <limits>
|
||||
#include <deque>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -78,10 +78,11 @@
|
||||
|
||||
#include <json/json.h>
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
#include <utility>
|
||||
#include <map>
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <limits>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
@@ -1558,7 +1559,7 @@ public:
|
||||
// The already encoded key-value pairs
|
||||
ret += m_data;
|
||||
// 16-bit big endian length
|
||||
ret += util::toCompactBigEndian(size, 2);
|
||||
ret += toCompactBigEndian(size, 2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user