summaryrefslogtreecommitdiffstats
path: root/src/Endianness.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-10 23:36:33 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-10 23:36:33 +0200
commitd8da11ca91cba780bf75dde3133bd5ef5f3fad95 (patch)
treef005bd76d8f22a28c1b95280642c73780c794e26 /src/Endianness.h
parentNetwork: Fixed ServerHandle's address formatting. (diff)
parentFixed misplaced parens (diff)
downloadcuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar.gz
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar.bz2
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar.lz
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar.xz
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.tar.zst
cuberite-d8da11ca91cba780bf75dde3133bd5ef5f3fad95.zip
Diffstat (limited to 'src/Endianness.h')
-rw-r--r--src/Endianness.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Endianness.h b/src/Endianness.h
index a415903a5..0e8bc8e99 100644
--- a/src/Endianness.h
+++ b/src/Endianness.h
@@ -2,7 +2,7 @@
#pragma once
#undef ntohll
-#define ntohll(x) ((((UInt64)ntohl((UInt32)x)) << 32) + ntohl(x >> 32))
+#define ntohll(x) (((static_cast<UInt64>(ntohl(static_cast<UInt32>(x)))) << 32) + ntohl(x >> 32))
@@ -13,7 +13,7 @@ inline UInt64 HostToNetwork8(const void * a_Value)
{
UInt64 buf;
memcpy( &buf, a_Value, sizeof( buf));
- buf = (( ( (UInt64)htonl((UInt32)buf)) << 32) + htonl(buf >> 32));
+ buf = (( ( static_cast<UInt64>(htonl(static_cast<UInt32>(buf)))) << 32) + htonl(buf >> 32));
return buf;
}