aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2011-12-20 16:52:59 -0500
committerLuke Dashjr <luke-jr+git@utopios.org>2011-12-20 16:52:59 -0500
commit21d9f36781604e4ca9fc35dc65265593423b73e9 (patch)
tree223bf70418e43a0b9c8366c65db214780f77d61a /src/bignum.h
parent781c06c0f534913321a415a4fb64a60734e43101 (diff)
downloadbitcoin-21d9f36781604e4ca9fc35dc65265593423b73e9.tar.xz
Use standard C99 (and Qt) types for 64-bit integers
Diffstat (limited to 'src/bignum.h')
-rw-r--r--src/bignum.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bignum.h b/src/bignum.h
index 135eade679..baa9cb55da 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -5,6 +5,8 @@
#ifndef BITCOIN_BIGNUM_H
#define BITCOIN_BIGNUM_H
+#include <stdint.h>
+
#include <stdexcept>
#include <vector>
#include <openssl/bn.h>
@@ -81,12 +83,12 @@ public:
CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
- CBigNum(int64 n) { BN_init(this); setint64(n); }
+ CBigNum(int64_t n) { BN_init(this); setint64(n); }
CBigNum(unsigned char n) { BN_init(this); setulong(n); }
CBigNum(unsigned short n) { BN_init(this); setulong(n); }
CBigNum(unsigned int n) { BN_init(this); setulong(n); }
CBigNum(unsigned long n) { BN_init(this); setulong(n); }
- CBigNum(uint64 n) { BN_init(this); setuint64(n); }
+ CBigNum(uint64_t n) { BN_init(this); setuint64(n); }
explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); }
explicit CBigNum(const std::vector<unsigned char>& vch)
@@ -120,12 +122,12 @@ public:
return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}
- void setint64(int64 n)
+ void setint64(int64_t n)
{
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;
bool fNegative = false;
- if (n < (int64)0)
+ if (n < (int64_t)0)
{
n = -n;
fNegative = true;
@@ -155,7 +157,7 @@ public:
BN_mpi2bn(pch, p - pch, this);
}
- void setuint64(uint64 n)
+ void setuint64(uint64_t n)
{
unsigned char pch[sizeof(n) + 6];
unsigned char* p = pch + 4;