mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
refactor: Use uint16_t instead of unsigned short
removed trailing whitespace to make linter happy
This commit is contained in:
committed by
Rene Pickhardt
parent
8ef15e8a86
commit
1cabbddbca
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user