From aee1e9f180798ef8962f00431b9e1114ec0a5a01 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 28 Nov 2011 14:02:33 -0800 Subject: [PATCH] Bugfix. Add 16-bit types. --- types.h | 2 ++ uint256.h | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types.h b/types.h index 52ea48e140..9b8de965bc 100644 --- a/types.h +++ b/types.h @@ -3,6 +3,7 @@ typedef __int64 int64; typedef unsigned __int64 uint64; typedef unsigned int uint32; +typedef unsigned short int uint16; typedef int int32; #else @@ -10,6 +11,7 @@ typedef int int32; typedef long long int64; typedef unsigned long long uint64; typedef unsigned int uint32; +typedef unsigned short int uint16; typedef int int32; #endif diff --git a/uint256.h b/uint256.h index 1394ec0cdf..ccbff31ac3 100644 --- a/uint256.h +++ b/uint256.h @@ -637,14 +637,14 @@ inline const uint256 operator-(const uint256& a, const uint256& b) { return static uint256 uint160to256(const uint160& u) { uint256 m; - memcpy(((char *) &m)+(sizeof(m)-sizeof(u)), &u, sizeof(u)); + memcpy(&m, &u, sizeof(u)); return m; } static uint160 uint256to160(const uint256& u) { uint160 m; - memcpy((char *) &m, &u, sizeof(m)); + memcpy(&m, &u, sizeof(m)); return m; } @@ -656,8 +656,6 @@ static uint160 uint256to160(const uint256& u) - - inline int Testuint256AdHoc(std::vector vArg) { uint256 g(0);