https://github.com/zcash/zcash/blob/master/src/serialize.h#L238-L276
The assumption here is that unsigned short is exactly 16 bits and unsigned int is exactly 32 bits. Either add an assertion to that effect, or (better) just use 0xFFFFu in place of std::numeric_limits<unsigned short>::max() and 0xFFFFFFFFu in place of std::numeric_limits<unsigned int>::max().
https://github.com/zcash/zcash/blob/master/src/serialize.h#L238-L276
The assumption here is that
unsigned shortis exactly 16 bits andunsigned intis exactly 32 bits. Either add an assertion to that effect, or (better) just use0xFFFFuin place ofstd::numeric_limits<unsigned short>::max()and0xFFFFFFFFuin place ofstd::numeric_limits<unsigned int>::max().