summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-02 18:08:38 +0100
committermadmaxoft <github@xoft.cz>2014-01-02 18:08:38 +0100
commit15dddc77013f5366b77a73ca02f58680eaef9736 (patch)
tree528fe44f6bd189beabaf4553b30c63d273a13100 /src/WorldStorage
parentFixed unaligned memory access in FastNBT. (diff)
downloadcuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar.gz
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar.bz2
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar.lz
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar.xz
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.tar.zst
cuberite-15dddc77013f5366b77a73ca02f58680eaef9736.zip
Diffstat (limited to 'src/WorldStorage')
-rw-r--r--src/WorldStorage/FastNBT.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WorldStorage/FastNBT.h b/src/WorldStorage/FastNBT.h
index 7323c29cb..b84eda1a1 100644
--- a/src/WorldStorage/FastNBT.h
+++ b/src/WorldStorage/FastNBT.h
@@ -154,13 +154,13 @@ public:
inline Int16 GetShort(int a_Tag) const
{
ASSERT(m_Tags[a_Tag].m_Type == TAG_Short);
- return ntohs(*((Int16 *)(m_Data + m_Tags[a_Tag].m_DataStart)));
+ return GetBEShort(m_Data + m_Tags[a_Tag].m_DataStart);
}
inline Int32 GetInt(int a_Tag) const
{
ASSERT(m_Tags[a_Tag].m_Type == TAG_Int);
- return ntohl(*((Int32 *)(m_Data + m_Tags[a_Tag].m_DataStart)));
+ return GetBEInt(m_Data + m_Tags[a_Tag].m_DataStart);
}
inline Int64 GetLong(int a_Tag) const
@@ -172,7 +172,7 @@ public:
inline float GetFloat(int a_Tag) const
{
ASSERT(m_Tags[a_Tag].m_Type == TAG_Float);
- Int32 tmp = ntohl(*((Int32 *)(m_Data + m_Tags[a_Tag].m_DataStart)));
+ Int32 tmp = GetBEInt(m_Data + m_Tags[a_Tag].m_DataStart);
return *((float *)&tmp);
}