aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/backends
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-11-07 19:04:46 +0800
committerChristian Parpart <christian@ethereum.org>2018-11-07 19:17:57 +0800
commitab0de38f16a9eff13ee5a32a3408b890d87941f6 (patch)
tree3ff90d9e6afde63d1217b37ed62ab6e98d1139fc /libyul/backends
parent88aee34c22d86a004848ae8bdc818b5168dd94cb (diff)
downloaddexon-solidity-ab0de38f16a9eff13ee5a32a3408b890d87941f6.tar.gz
dexon-solidity-ab0de38f16a9eff13ee5a32a3408b890d87941f6.tar.zst
dexon-solidity-ab0de38f16a9eff13ee5a32a3408b890d87941f6.zip
Eliminate `byte`-typedef and use `uint8_t` in all their places instead.
This change is made to (easily) be forward compatible with future C++ standards, in order to allow compiling the code with newer standards at some point in the future. * Removed the `using byte = uint8_t;` line from Common.h * Mechanically change all uses of `byte` to `uint8_t`. Tested with GCC 7.3 in C++11/14/17 modes :-)
Diffstat (limited to 'libyul/backends')
-rw-r--r--libyul/backends/evm/EVMAssembly.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libyul/backends/evm/EVMAssembly.cpp b/libyul/backends/evm/EVMAssembly.cpp
index b2f0878f..b37a3231 100644
--- a/libyul/backends/evm/EVMAssembly.cpp
+++ b/libyul/backends/evm/EVMAssembly.cpp
@@ -44,7 +44,7 @@ void EVMAssembly::setSourceLocation(SourceLocation const&)
void EVMAssembly::appendInstruction(solidity::Instruction _instr)
{
- m_bytecode.push_back(byte(_instr));
+ m_bytecode.push_back(uint8_t(_instr));
m_stackHeight += solidity::instructionInfo(_instr).ret - solidity::instructionInfo(_instr).args;
}
@@ -101,7 +101,7 @@ void EVMAssembly::appendJumpTo(LabelID _labelId, int _stackDiffAfter)
{
if (m_evm15)
{
- m_bytecode.push_back(byte(solidity::Instruction::JUMPTO));
+ m_bytecode.push_back(uint8_t(solidity::Instruction::JUMPTO));
appendLabelReferenceInternal(_labelId);
m_stackHeight += _stackDiffAfter;
}
@@ -116,7 +116,7 @@ void EVMAssembly::appendJumpToIf(LabelID _labelId)
{
if (m_evm15)
{
- m_bytecode.push_back(byte(solidity::Instruction::JUMPIF));
+ m_bytecode.push_back(uint8_t(solidity::Instruction::JUMPIF));
appendLabelReferenceInternal(_labelId);
m_stackHeight--;
}
@@ -132,7 +132,7 @@ void EVMAssembly::appendBeginsub(LabelID _labelId, int _arguments)
solAssert(m_evm15, "BEGINSUB used for EVM 1.0");
solAssert(_arguments >= 0, "");
setLabelToCurrentPosition(_labelId);
- m_bytecode.push_back(byte(solidity::Instruction::BEGINSUB));
+ m_bytecode.push_back(uint8_t(solidity::Instruction::BEGINSUB));
m_stackHeight += _arguments;
}
@@ -140,7 +140,7 @@ void EVMAssembly::appendJumpsub(LabelID _labelId, int _arguments, int _returns)
{
solAssert(m_evm15, "JUMPSUB used for EVM 1.0");
solAssert(_arguments >= 0 && _returns >= 0, "");
- m_bytecode.push_back(byte(solidity::Instruction::JUMPSUB));
+ m_bytecode.push_back(uint8_t(solidity::Instruction::JUMPSUB));
appendLabelReferenceInternal(_labelId);
m_stackHeight += _returns - _arguments;
}
@@ -149,7 +149,7 @@ void EVMAssembly::appendReturnsub(int _returns, int _stackDiffAfter)
{
solAssert(m_evm15, "RETURNSUB used for EVM 1.0");
solAssert(_returns >= 0, "");
- m_bytecode.push_back(byte(solidity::Instruction::RETURNSUB));
+ m_bytecode.push_back(uint8_t(solidity::Instruction::RETURNSUB));
m_stackHeight += _stackDiffAfter - _returns;
}
@@ -198,5 +198,5 @@ void EVMAssembly::updateReference(size_t pos, size_t size, u256 value)
solAssert(m_bytecode.size() >= size && pos <= m_bytecode.size() - size, "");
solAssert(value < (u256(1) << (8 * size)), "");
for (size_t i = 0; i < size; i++)
- m_bytecode[pos + i] = byte((value >> (8 * (size - i - 1))) & 0xff);
+ m_bytecode[pos + i] = uint8_t((value >> (8 * (size - i - 1))) & 0xff);
}