Browse Source

fix warnings: array subscript is of type 'char' [-Wchar-subscripts]

0.8
Wladimir J. van der Laan 12 years ago
parent
commit
8add7822ce
  1. 2
      src/bignum.h
  2. 2
      src/uint256.h
  3. 6
      src/util.cpp

2
src/bignum.h

@ -301,7 +301,7 @@ public:
while (isxdigit(*psz)) while (isxdigit(*psz))
{ {
*this <<= 4; *this <<= 4;
int n = phexdigit[*psz++]; int n = phexdigit[(unsigned char)*psz++];
*this += n; *this += n;
} }
if (fNegative) if (fNegative)

2
src/uint256.h

@ -308,7 +308,7 @@ public:
// hex string to uint // 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 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; const char* pbegin = psz;
while (phexdigit[*psz] || *psz == '0') while (phexdigit[(unsigned char)*psz] || *psz == '0')
psz++; psz++;
psz--; psz--;
unsigned char* p1 = (unsigned char*)pn; unsigned char* p1 = (unsigned char*)pn;

6
src/util.cpp

@ -636,7 +636,7 @@ vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
while (1) while (1)
{ {
int dec = decode64_table[*p]; int dec = decode64_table[(unsigned char)*p];
if (dec == -1) break; if (dec == -1) break;
p++; p++;
switch (mode) switch (mode)
@ -676,12 +676,12 @@ vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
break; break;
case 2: // 4n+2 base64 characters processed: require '==' case 2: // 4n+2 base64 characters processed: require '=='
if (left || p[0] != '=' || p[1] != '=' || decode64_table[p[2]] != -1) if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1)
*pfInvalid = true; *pfInvalid = true;
break; break;
case 3: // 4n+3 base64 characters processed: require '=' case 3: // 4n+3 base64 characters processed: require '='
if (left || p[0] != '=' || decode64_table[p[1]] != -1) if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1)
*pfInvalid = true; *pfInvalid = true;
break; break;
} }

Loading…
Cancel
Save