X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.h;h=5ecc4900da4fd2e3a23178b6c50535aca52c358b;hp=c7784ccf651d6a70704048f43152f4d3dce266d1;hb=4978be72a4a823bec7c9b6656e8162ce44a29dce;hpb=f9b0c909fcd5c7840dce02568aa4da9078cfb2b3 diff --git a/src/main.h b/src/main.h index c7784cc..5ecc490 100644 --- a/src/main.h +++ b/src/main.h @@ -165,8 +165,8 @@ public: } IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); ) - void SetNull() { nFile = (unsigned int) -1; nBlockPos = 0; nTxPos = 0; } - bool IsNull() const { return (nFile == (unsigned int) -1); } + void SetNull() { nFile = std::numeric_limits::max(); nBlockPos = 0; nTxPos = 0; } + bool IsNull() const { return (nFile == std::numeric_limits::max()); } friend bool operator==(const CDiskTxPos& a, const CDiskTxPos& b) { @@ -206,8 +206,8 @@ public: CInPoint() { SetNull(); } CInPoint(CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; } - void SetNull() { ptx = NULL; n = (unsigned int) -1; } - bool IsNull() const { return (ptx == NULL && n == (unsigned int) -1); } + void SetNull() { ptx = NULL; n = std::numeric_limits::max(); } + bool IsNull() const { return (ptx == NULL && n == std::numeric_limits::max()); } }; @@ -222,8 +222,8 @@ public: COutPoint() { SetNull(); } COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; } IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); ) - void SetNull() { hash = 0; n = (unsigned int) -1; } - bool IsNull() const { return (hash == 0 && n == (unsigned int) -1); } + void SetNull() { hash = 0; n = std::numeric_limits::max(); } + bool IsNull() const { return (hash == 0 && n == std::numeric_limits::max()); } friend bool operator<(const COutPoint& a, const COutPoint& b) {