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 :-)
This commit is contained in:
Christian Parpart
2018-11-07 12:17:57 +01:00
parent 88aee34c22
commit ab0de38f16
15 changed files with 204 additions and 206 deletions
+2 -2
View File
@@ -147,11 +147,11 @@ public:
static std::pair<bool, std::string> compareAndCreateMessage(bytes const& _result, bytes const& _expectation);
static bytes encode(bool _value) { return encode(byte(_value)); }
static bytes encode(bool _value) { return encode(uint8_t(_value)); }
static bytes encode(int _value) { return encode(u256(_value)); }
static bytes encode(size_t _value) { return encode(u256(_value)); }
static bytes encode(char const* _value) { return encode(std::string(_value)); }
static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; }
static bytes encode(uint8_t _value) { return bytes(31, 0) + bytes{_value}; }
static bytes encode(u256 const& _value) { return toBigEndian(_value); }
/// @returns the fixed-point encoding of a rational number with a given
/// number of fractional bits.