summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-28 08:31:35 +0100
committermadmaxoft <github@xoft.cz>2014-02-28 08:31:35 +0100
commit0aac17874c25a2c1be36a8b5d691331852cec49f (patch)
tree8cdc0006caa948bd4ca69fbb63003ad5fee3d392 /src
parentFixed compatibility with ZeroBraneStudio and LuaRocks. (diff)
downloadcuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar.gz
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar.bz2
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar.lz
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar.xz
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.tar.zst
cuberite-0aac17874c25a2c1be36a8b5d691331852cec49f.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/FastNBT.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/WorldStorage/FastNBT.h b/src/WorldStorage/FastNBT.h
index a78b610cb..49f97c458 100644
--- a/src/WorldStorage/FastNBT.h
+++ b/src/WorldStorage/FastNBT.h
@@ -173,13 +173,14 @@ public:
{
ASSERT(m_Tags[a_Tag].m_Type == TAG_Float);
- // Cause a compile-time error if sizeof(int) != sizeof(float)
- char Check1[sizeof(int) - sizeof(float) + 1]; // sizeof(int) >= sizeof(float)
- char Check2[sizeof(float) - sizeof(int) + 1]; // sizeof(float) >= sizeof(int)
+ // Cause a compile-time error if sizeof(float) != 4
+ // If your platform produces a compiler error here, you'll need to add code that manually decodes 32-bit floats
+ char Check1[5 - sizeof(float)]; // sizeof(float) <= 4
+ char Check2[sizeof(float) - 3]; // sizeof(float) >= 4
UNUSED(Check1);
UNUSED(Check2);
- int i = GetBEInt(m_Data + m_Tags[a_Tag].m_DataStart);
+ Int32 i = GetBEInt(m_Data + m_Tags[a_Tag].m_DataStart);
float f;
memcpy(&f, &i, sizeof(f));
return f;