diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-06-21 01:40:40 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-06-21 01:40:40 +0000 |
commit | 13829c6c99b8c763e60a17dad9508226a96abc44 (patch) | |
tree | 0395b224ba187cd0ff0aae6c26da54e16acb5256 /src/bignum.h | |
parent | 0969343320e4ccca5893a913afdc4ca1ffb0b5c4 (diff) | |
parent | fad2231f8664434e913ad5c6d458fa9139492390 (diff) | |
download | bitcoin-13829c6c99b8c763e60a17dad9508226a96abc44.tar.xz |
Merge branch '0.5.x' into 0.6.0.x
Conflicts:
doc/unit-tests.txt
src/serialize.h
Diffstat (limited to 'src/bignum.h')
-rw-r--r-- | src/bignum.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bignum.h b/src/bignum.h index abcc052efe..9f75d7c789 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -122,16 +122,22 @@ public: return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n); } - void setint64(int64 n) + void setint64(int64 sn) { - unsigned char pch[sizeof(n) + 6]; + unsigned char pch[sizeof(sn) + 6]; unsigned char* p = pch + 4; - bool fNegative = false; - if (n < (int64)0) + bool fNegative; + uint64 n; + + if (sn < (int64)0) { - n = -n; + n = -sn; fNegative = true; + } else { + n = sn; + fNegative = false; } + bool fLeadingZeroes = true; for (int i = 0; i < 8; i++) { |