diff options
author | worktycho <work.tycho@gmail.com> | 2015-03-17 18:56:14 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-03-17 18:56:14 +0100 |
commit | d16dc5a1dbfe0f92b3115eacef2b8c631067aae4 (patch) | |
tree | c6ddb297a41986600334f2d7e5374b0f50c19c62 | |
parent | Merge pull request #1810 from mc-server/paintings (diff) | |
parent | Fixed double underscore identifiers in the Endianess.h file, which are reserved for implementation use. Bug #1715 (diff) | |
download | cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar.gz cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar.bz2 cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar.lz cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar.xz cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.tar.zst cuberite-d16dc5a1dbfe0f92b3115eacef2b8c631067aae4.zip |
-rw-r--r-- | src/Endianness.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Endianness.h b/src/Endianness.h index 9aeb44986..609d46de9 100644 --- a/src/Endianness.h +++ b/src/Endianness.h @@ -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; + unsigned long long buf; + memcpy( &buf, a_Value, sizeof( buf)); + buf = (( ( (unsigned long long)htonl((u_long)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; + unsigned int buf; + memcpy( &buf, a_Value, sizeof( buf)); + buf = ntohl( buf); + return buf; } |