summaryrefslogtreecommitdiffstats
path: root/src/Endianness.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Endianness.h')
-rw-r--r--src/Endianness.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Endianness.h b/src/Endianness.h
index 9aeb44986..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,10 +11,10 @@
// Changes endianness
inline UInt64 HostToNetwork8(const void * a_Value)
{
- unsigned long long __HostToNetwork8;
- memcpy( &__HostToNetwork8, a_Value, sizeof( __HostToNetwork8));
- __HostToNetwork8 = (( ( (unsigned long long)htonl((u_long)__HostToNetwork8)) << 32) + htonl(__HostToNetwork8 >> 32));
- return __HostToNetwork8;
+ UInt64 buf;
+ memcpy( &buf, a_Value, sizeof( buf));
+ buf = (( ( (UInt64)htonl((UInt32)buf)) << 32) + htonl(buf >> 32));
+ return buf;
}
@@ -23,10 +23,10 @@ inline UInt64 HostToNetwork8(const void * a_Value)
inline UInt32 HostToNetwork4(const void* a_Value)
{
- unsigned int __HostToNetwork4;
- memcpy( &__HostToNetwork4, a_Value, sizeof( __HostToNetwork4));
- __HostToNetwork4 = ntohl( __HostToNetwork4);
- return __HostToNetwork4;
+ UInt32 buf;
+ memcpy( &buf, a_Value, sizeof( buf));
+ buf = ntohl( buf);
+ return buf;
}