diff options
author | Mattes D <github@xoft.cz> | 2016-08-25 09:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-25 09:04:17 +0200 |
commit | d52afadad491474f63e8184cb5a08c0ca21ab48c (patch) | |
tree | d5afab6035ca6bb0b58fd03ad5cfe3b3f8e1da55 /src/WorldStorage/FastNBT.cpp | |
parent | Merge pull request #3342 from cuberite/FixEmptyHeader (diff) | |
parent | Fixed type-casting-related warnings. (diff) | |
download | cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.gz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.bz2 cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.lz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.xz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.zst cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.zip |
Diffstat (limited to 'src/WorldStorage/FastNBT.cpp')
-rw-r--r-- | src/WorldStorage/FastNBT.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp index 608269aad..7d99b927a 100644 --- a/src/WorldStorage/FastNBT.cpp +++ b/src/WorldStorage/FastNBT.cpp @@ -439,7 +439,7 @@ void cFastNBTWriter::AddByte(const AString & a_Name, unsigned char a_Value) void cFastNBTWriter::AddShort(const AString & a_Name, Int16 a_Value) { TagCommon(a_Name, TAG_Short); - UInt16 Value = htons(a_Value); + UInt16 Value = htons(static_cast<UInt16>(a_Value)); m_Result.append(reinterpret_cast<const char *>(&Value), 2); } @@ -450,7 +450,7 @@ void cFastNBTWriter::AddShort(const AString & a_Name, Int16 a_Value) void cFastNBTWriter::AddInt(const AString & a_Name, Int32 a_Value) { TagCommon(a_Name, TAG_Int); - UInt32 Value = htonl(a_Value); + UInt32 Value = htonl(static_cast<UInt32>(a_Value)); m_Result.append(reinterpret_cast<const char *>(&Value), 4); } @@ -494,7 +494,7 @@ void cFastNBTWriter::AddDouble(const AString & a_Name, double a_Value) void cFastNBTWriter::AddString(const AString & a_Name, const AString & a_Value) { TagCommon(a_Name, TAG_String); - UInt16 len = htons(static_cast<short>(a_Value.size())); + UInt16 len = htons(static_cast<UInt16>(a_Value.size())); m_Result.append(reinterpret_cast<const char *>(&len), 2); m_Result.append(a_Value.c_str(), a_Value.size()); } @@ -506,7 +506,7 @@ void cFastNBTWriter::AddString(const AString & a_Name, const AString & a_Value) void cFastNBTWriter::AddByteArray(const AString & a_Name, const char * a_Value, size_t a_NumElements) { TagCommon(a_Name, TAG_ByteArray); - u_int len = htonl(static_cast<u_int>(a_NumElements)); + UInt32 len = htonl(static_cast<UInt32>(a_NumElements)); m_Result.append(reinterpret_cast<const char *>(&len), 4); m_Result.append(a_Value, a_NumElements); } @@ -518,7 +518,7 @@ void cFastNBTWriter::AddByteArray(const AString & a_Name, const char * a_Value, void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, size_t a_NumElements) { TagCommon(a_Name, TAG_IntArray); - u_int len = htonl(static_cast<u_int>(a_NumElements)); + UInt32 len = htonl(static_cast<UInt32>(a_NumElements)); size_t cap = m_Result.capacity(); size_t size = m_Result.length(); if ((cap - size) < (4 + a_NumElements * 4)) @@ -528,7 +528,7 @@ void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, si m_Result.append(reinterpret_cast<const char *>(&len), 4); for (size_t i = 0; i < a_NumElements; i++) { - UInt32 Element = htonl(a_Value[i]); + UInt32 Element = htonl(static_cast<UInt32>(a_Value[i])); m_Result.append(reinterpret_cast<const char *>(&Element), 4); } } |