diff options
author | Aaron Hook <ahook@protonmail.com> | 2019-12-29 13:04:02 -0800 |
---|---|---|
committer | Rene Pickhardt <r.pickhardt@gmail.com> | 2020-06-22 12:12:22 +0200 |
commit | 1cabbddbca615b26aa4510c75f459c28d6fe0afd (patch) | |
tree | 04459232e1ee90d4e5a2ba8f625c903177beeff3 /src/serialize.h | |
parent | 8ef15e8a86038225afef2487ca23abc10ca5dffa (diff) |
refactor: Use uint16_t instead of unsigned short
removed trailing whitespace to make linter happy
Diffstat (limited to 'src/serialize.h')
-rw-r--r-- | src/serialize.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/serialize.h b/src/serialize.h index 71c2cfa164..7a94e704b2 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -9,13 +9,13 @@ #include <compat/endian.h> #include <algorithm> +#include <cstdint> #include <cstring> #include <ios> #include <limits> #include <map> #include <memory> #include <set> -#include <stdint.h> #include <string> #include <string.h> #include <utility> @@ -272,7 +272,7 @@ template<typename Stream> inline void Unserialize(Stream& s, bool& a) { char f=s inline unsigned int GetSizeOfCompactSize(uint64_t nSize) { if (nSize < 253) return sizeof(unsigned char); - else if (nSize <= std::numeric_limits<unsigned short>::max()) return sizeof(unsigned char) + sizeof(unsigned short); + else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t); else if (nSize <= std::numeric_limits<unsigned int>::max()) return sizeof(unsigned char) + sizeof(unsigned int); else return sizeof(unsigned char) + sizeof(uint64_t); } @@ -286,7 +286,7 @@ void WriteCompactSize(Stream& os, uint64_t nSize) { ser_writedata8(os, nSize); } - else if (nSize <= std::numeric_limits<unsigned short>::max()) + else if (nSize <= std::numeric_limits<uint16_t>::max()) { ser_writedata8(os, 253); ser_writedata16(os, nSize); |