summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-03-17 21:42:13 +0100
committerworktycho <work.tycho@gmail.com>2015-03-17 21:42:13 +0100
commit29e267cac0b4569fea4309ae700e4f4110535a49 (patch)
tree9eba0b9aef3df98276d2bfee15b07fa8f764ec5b
parentMerge pull request #1816 from bibo38/bugfix1715 (diff)
parentChanged Variable types of Endianness.h to uniform UInt* types from Globals.h (diff)
downloadcuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar.gz
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar.bz2
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar.lz
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar.xz
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.tar.zst
cuberite-29e267cac0b4569fea4309ae700e4f4110535a49.zip
-rw-r--r--src/Endianness.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Endianness.h b/src/Endianness.h
index 609d46de9..5692b3811 100644
--- a/src/Endianness.h
+++ b/src/Endianness.h
@@ -2,7 +2,7 @@
#pragma once
#undef ntohll
-#define ntohll(x) ((((UInt64)ntohl((u_long)x)) << 32) + ntohl(x >> 32))
+#define ntohll(x) ((((UInt64)ntohl((UInt32)x)) << 32) + ntohl(x >> 32))
@@ -11,9 +11,9 @@
// Changes endianness
inline UInt64 HostToNetwork8(const void * a_Value)
{
- unsigned long long buf;
+ UInt64 buf;
memcpy( &buf, a_Value, sizeof( buf));
- buf = (( ( (unsigned long long)htonl((u_long)buf)) << 32) + htonl(buf >> 32));
+ buf = (( ( (UInt64)htonl((UInt32)buf)) << 32) + htonl(buf >> 32));
return buf;
}
@@ -23,7 +23,7 @@ inline UInt64 HostToNetwork8(const void * a_Value)
inline UInt32 HostToNetwork4(const void* a_Value)
{
- unsigned int buf;
+ UInt32 buf;
memcpy( &buf, a_Value, sizeof( buf));
buf = ntohl( buf);
return buf;