diff options
author | Christian Parpart <christian@ethereum.org> | 2018-11-07 19:04:46 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-11-07 19:17:57 +0800 |
commit | ab0de38f16a9eff13ee5a32a3408b890d87941f6 (patch) | |
tree | 3ff90d9e6afde63d1217b37ed62ab6e98d1139fc /libevmasm/Instruction.h | |
parent | 88aee34c22d86a004848ae8bdc818b5168dd94cb (diff) | |
download | dexon-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 'libevmasm/Instruction.h')
-rw-r--r-- | libevmasm/Instruction.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h index 63424eeb..539a83b0 100644 --- a/libevmasm/Instruction.h +++ b/libevmasm/Instruction.h @@ -228,25 +228,25 @@ inline bool isLogInstruction(Instruction _inst) /// @returns the number of PUSH Instruction _inst inline unsigned getPushNumber(Instruction _inst) { - return (byte)_inst - unsigned(Instruction::PUSH1) + 1; + return (uint8_t)_inst - unsigned(Instruction::PUSH1) + 1; } /// @returns the number of DUP Instruction _inst inline unsigned getDupNumber(Instruction _inst) { - return (byte)_inst - unsigned(Instruction::DUP1) + 1; + return (uint8_t)_inst - unsigned(Instruction::DUP1) + 1; } /// @returns the number of SWAP Instruction _inst inline unsigned getSwapNumber(Instruction _inst) { - return (byte)_inst - unsigned(Instruction::SWAP1) + 1; + return (uint8_t)_inst - unsigned(Instruction::SWAP1) + 1; } /// @returns the number of LOG Instruction _inst inline unsigned getLogNumber(Instruction _inst) { - return (byte)_inst - unsigned(Instruction::LOG0); + return (uint8_t)_inst - unsigned(Instruction::LOG0); } /// @returns the PUSH<_number> instruction |