mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
Use std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1
This commit is contained in:
committed by
Hennadii Stepanov
parent
6b82fc59eb
commit
cf4b0327ed
@@ -761,7 +761,7 @@ protected:
|
||||
|
||||
public:
|
||||
CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) :
|
||||
nType(nTypeIn), nVersion(nVersionIn), nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0)
|
||||
nType(nTypeIn), nVersion(nVersionIn), nSrcPos(0), nReadPos(0), nReadLimit(std::numeric_limits<uint64_t>::max()), nRewind(nRewindIn), vchBuf(nBufSize, 0)
|
||||
{
|
||||
src = fileIn;
|
||||
}
|
||||
@@ -846,7 +846,7 @@ public:
|
||||
|
||||
// prevent reading beyond a certain position
|
||||
// no argument removes the limit
|
||||
bool SetLimit(uint64_t nPos = (uint64_t)(-1)) {
|
||||
bool SetLimit(uint64_t nPos = std::numeric_limits<uint64_t>::max()) {
|
||||
if (nPos < nReadPos)
|
||||
return false;
|
||||
nReadLimit = nPos;
|
||||
|
Reference in New Issue
Block a user