summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/FastNBT.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-28 15:29:50 +0100
committerHowaner <franzi.moos@googlemail.com>2014-02-28 15:29:50 +0100
commit27b98dec2b62a1fe88130c6a5c2c840dde293a5e (patch)
tree6c92a2e4f8614e74362d2695961a9ffba8d08965 /src/WorldStorage/FastNBT.h
parentFix Double Slabs, fix Slab Meta and add more things to burnable (diff)
parentMerge pull request #709 from Howaner/GlobalFixes (diff)
downloadcuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar.gz
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar.bz2
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar.lz
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar.xz
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.tar.zst
cuberite-27b98dec2b62a1fe88130c6a5c2c840dde293a5e.zip
Diffstat (limited to 'src/WorldStorage/FastNBT.h')
-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;