X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fuint256.h;h=b7a5c3bf7766bf99106b3bd47788c59744b42b85;hb=58ac600b2c94f12309fc5e18933891590dc1eb4c;hp=3e20201387b5d76a0d00e006076e2fb1bfe380ac;hpb=b2120e223a9a2282b26080cb126db9aad95b1282;p=novacoin.git diff --git a/src/uint256.h b/src/uint256.h index 3e20201..b7a5c3b 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,13 +1,14 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UINT256_H #define BITCOIN_UINT256_H #include "serialize.h" #include +#include #include #include @@ -100,13 +101,6 @@ public: return *this; } - base_uint& operator&=(uint64 b) - { - pn[0] &= (unsigned int)b; - pn[1] &= (unsigned int)(b >> 32); - return *this; - } - base_uint& operator|=(uint64 b) { pn[0] |= (unsigned int)b; @@ -301,7 +295,7 @@ public: std::string GetHex() const { char psz[sizeof(pn)*2 + 1]; - for (int i = 0; i < sizeof(pn); i++) + for (unsigned int i = 0; i < sizeof(pn); i++) sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); return std::string(psz, psz + sizeof(pn)*2); } @@ -320,9 +314,9 @@ public: psz += 2; // hex string to uint - static char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; + static unsigned char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; const char* pbegin = psz; - while (phexdigit[*psz] || *psz == '0') + while (phexdigit[(unsigned char)*psz] || *psz == '0') psz++; psz--; unsigned char* p1 = (unsigned char*)pn;