mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-05 08:48:03 +00:00
Bugfix. Add 16-bit types.
This commit is contained in:
2
types.h
2
types.h
@@ -3,6 +3,7 @@
|
|||||||
typedef __int64 int64;
|
typedef __int64 int64;
|
||||||
typedef unsigned __int64 uint64;
|
typedef unsigned __int64 uint64;
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
|
typedef unsigned short int uint16;
|
||||||
typedef int int32;
|
typedef int int32;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -10,6 +11,7 @@ typedef int int32;
|
|||||||
typedef long long int64;
|
typedef long long int64;
|
||||||
typedef unsigned long long uint64;
|
typedef unsigned long long uint64;
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
|
typedef unsigned short int uint16;
|
||||||
typedef int int32;
|
typedef int int32;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -637,14 +637,14 @@ inline const uint256 operator-(const uint256& a, const uint256& b) { return
|
|||||||
static uint256 uint160to256(const uint160& u)
|
static uint256 uint160to256(const uint160& u)
|
||||||
{
|
{
|
||||||
uint256 m;
|
uint256 m;
|
||||||
memcpy(((char *) &m)+(sizeof(m)-sizeof(u)), &u, sizeof(u));
|
memcpy(&m, &u, sizeof(u));
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint160 uint256to160(const uint256& u)
|
static uint160 uint256to160(const uint256& u)
|
||||||
{
|
{
|
||||||
uint160 m;
|
uint160 m;
|
||||||
memcpy((char *) &m, &u, sizeof(m));
|
memcpy(&m, &u, sizeof(m));
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,8 +656,6 @@ static uint160 uint256to160(const uint256& u)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline int Testuint256AdHoc(std::vector<std::string> vArg)
|
inline int Testuint256AdHoc(std::vector<std::string> vArg)
|
||||||
{
|
{
|
||||||
uint256 g(0);
|
uint256 g(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user