aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-04-15 12:22:30 +0200
committerLuke Dashjr <luke-jr+git@utopios.org>2012-04-15 19:28:09 -0400
commit85e975f37907848ad28240da5b5e682ceb565eb2 (patch)
treecda44dcaba517339e1b65d497c93c0ae07a8d53f
parentcb1035a00882405fac47eb92e7086c7231062e3d (diff)
downloadbitcoin-85e975f37907848ad28240da5b5e682ceb565eb2.tar.xz
fix warnings: array subscript is of type 'char' [-Wchar-subscripts]
-rw-r--r--src/bignum.h2
-rw-r--r--src/uint256.h2
-rw-r--r--src/util.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/bignum.h b/src/bignum.h
index 6e8d3cb8ab..641ebf4b05 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -300,7 +300,7 @@ public:
while (isxdigit(*psz))
{
*this <<= 4;
- int n = phexdigit[*psz++];
+ int n = phexdigit[(unsigned char)*psz++];
*this += n;
}
if (fNegative)
diff --git a/src/uint256.h b/src/uint256.h
index ae263346a8..07809e49a8 100644
--- a/src/uint256.h
+++ b/src/uint256.h
@@ -315,7 +315,7 @@ public:
// 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 };
const char* pbegin = psz;
- while (phexdigit[*psz] || *psz == '0')
+ while (phexdigit[(unsigned char)*psz] || *psz == '0')
psz++;
psz--;
unsigned char* p1 = (unsigned char*)pn;
diff --git a/src/util.cpp b/src/util.cpp
index f6c37a2d1f..a9111673e7 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -567,7 +567,7 @@ vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
while (1)
{
- int dec = decode64_table[*p];
+ int dec = decode64_table[(unsigned char)*p];
if (dec == -1) break;
p++;
switch (mode)
@@ -607,12 +607,12 @@ vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
break;
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;
break;
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;
break;
}