diff options
Diffstat (limited to '')
-rw-r--r-- | CONTRIBUTING.md | 5 | ||||
-rw-r--r-- | VC2013/CryptoPP.vcxproj | 1 | ||||
-rw-r--r-- | VC2013/CryptoPP.vcxproj.filters | 6 | ||||
-rw-r--r-- | VC2013/MCServer.vcxproj | 7 | ||||
-rw-r--r-- | VC2013/MCServer.vcxproj.filters | 67 | ||||
-rw-r--r-- | VC2013/ToLua.vcxproj | 1 | ||||
-rw-r--r-- | VC2013/ToLua.vcxproj.filters | 3 | ||||
-rw-r--r-- | src/BlockArea.cpp | 6 | ||||
-rw-r--r-- | src/Generating/Caves.cpp | 8 | ||||
-rw-r--r-- | src/Generating/DistortedHeightmap.cpp | 3 | ||||
-rw-r--r-- | src/Generating/FinishGen.cpp | 2 | ||||
-rw-r--r-- | src/Items/ItemSeeds.h | 1 | ||||
-rw-r--r-- | src/Protocol/Protocol132.h | 4 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 2 | ||||
-rw-r--r-- | src/WorldStorage/FastNBT.cpp | 13 |
15 files changed, 71 insertions, 58 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5aba6ac9e..83173a6af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,3 @@ - Code Stuff ---------- @@ -23,7 +22,9 @@ Code Stuff - This helps prevent mistakes such as "if (a & 1 == 0)" * White space is free, so use it freely - "freely" as in "plentifully", not "arbitrarily" - * Please leave the first line of all files blank, to get around an IDE bug. + * Each and every control statement deserves its braces. This helps maintainability later on when the file is edited, lines added or removed - the control logic doesn't break so easily. + * Please leave the first line of all source files blank, to get around an IDE bug. + * Also leave the last line of all source files blank (GCC and GIT can complain otherwise) Copyright diff --git a/VC2013/CryptoPP.vcxproj b/VC2013/CryptoPP.vcxproj index 7ad8edaf6..6f7ddae0c 100644 --- a/VC2013/CryptoPP.vcxproj +++ b/VC2013/CryptoPP.vcxproj @@ -186,6 +186,7 @@ <WarningLevel>Level3</WarningLevel> <SuppressStartupBanner>true</SuppressStartupBanner> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <ResourceCompile> <Culture>0x0409</Culture> diff --git a/VC2013/CryptoPP.vcxproj.filters b/VC2013/CryptoPP.vcxproj.filters index d9d18befa..becd042b8 100644 --- a/VC2013/CryptoPP.vcxproj.filters +++ b/VC2013/CryptoPP.vcxproj.filters @@ -2,15 +2,15 @@ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> - <UniqueIdentifier>{de7b3b89-9cfa-4441-97a1-a41eb499d273}</UniqueIdentifier> + <UniqueIdentifier>{3c30caed-20a3-4bd8-b12e-fdd1e13455e5}</UniqueIdentifier> <Extensions>.cpp</Extensions> </Filter> <Filter Include="Header Files"> - <UniqueIdentifier>{1ddea6e2-83c2-4c5f-962a-7ad7f117cc85}</UniqueIdentifier> + <UniqueIdentifier>{770573d2-b90d-43f4-ac1c-464ab10c46ec}</UniqueIdentifier> <Extensions>.;.h</Extensions> </Filter> <Filter Include="Miscellaneous"> - <UniqueIdentifier>{41edc228-f641-4aea-ad4b-14a4918be0a3}</UniqueIdentifier> + <UniqueIdentifier>{1ac058bb-f217-4ac3-a14b-9c6ba021e030}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> diff --git a/VC2013/MCServer.vcxproj b/VC2013/MCServer.vcxproj index 50a938ad2..9daecba07 100644 --- a/VC2013/MCServer.vcxproj +++ b/VC2013/MCServer.vcxproj @@ -224,7 +224,6 @@ <ResourceCompile Include="MCServer.rc" /> </ItemGroup> <ItemGroup> - <ClInclude Include="..\src\Entities\Floater.h" /> <ClInclude Include="resource_MCServer.h" /> <ClInclude Include="..\src\Authenticator.h" /> <ClInclude Include="..\src\BlockArea.h" /> @@ -234,7 +233,6 @@ <ClInclude Include="..\src\ByteBuffer.h" /> <ClInclude Include="..\src\ChatColor.h" /> <ClInclude Include="..\src\Chunk.h" /> - <ClInclude Include="..\src\Chunk.inl.h" /> <ClInclude Include="..\src\ChunkDef.h" /> <ClInclude Include="..\src\ChunkMap.h" /> <ClInclude Include="..\src\ChunkSender.h" /> @@ -325,6 +323,7 @@ <ClInclude Include="..\src\Entities\Entity.h" /> <ClInclude Include="..\src\Entities\ExpOrb.h" /> <ClInclude Include="..\src\Entities\FallingBlock.h" /> + <ClInclude Include="..\src\Entities\Floater.h" /> <ClInclude Include="..\src\Entities\Minecart.h" /> <ClInclude Include="..\src\Entities\Pawn.h" /> <ClInclude Include="..\src\Entities\Pickup.h" /> @@ -351,6 +350,7 @@ <ClInclude Include="..\src\OSSupport\GZipFile.h" /> <ClInclude Include="..\src\OSSupport\IsThread.h" /> <ClInclude Include="..\src\OSSupport\ListenThread.h" /> + <ClInclude Include="..\src\OSSupport\Queue.h" /> <ClInclude Include="..\src\OSSupport\Semaphore.h" /> <ClInclude Include="..\src\OSSupport\Sleep.h" /> <ClInclude Include="..\src\OSSupport\Socket.h" /> @@ -468,6 +468,7 @@ <ClInclude Include="..\src\Items\ItemComparator.h" /> <ClInclude Include="..\src\items\ItemDoor.h" /> <ClInclude Include="..\src\items\ItemDye.h" /> + <ClInclude Include="..\src\Items\ItemFishingRod.h" /> <ClInclude Include="..\src\Items\ItemFlowerPot.h" /> <ClInclude Include="..\src\items\ItemFood.h" /> <ClInclude Include="..\src\items\ItemHandler.h" /> @@ -629,7 +630,6 @@ <ClCompile Include="..\src\Cuboid.cpp" /> <ClCompile Include="..\src\DeadlockDetect.cpp" /> <ClCompile Include="..\src\Enchantments.cpp" /> - <ClCompile Include="..\src\Entities\Floater.cpp" /> <ClCompile Include="..\src\FastRandom.cpp" /> <ClCompile Include="..\src\FurnaceRecipe.cpp" /> <ClCompile Include="..\src\Globals.cpp"> @@ -763,6 +763,7 @@ <ClCompile Include="..\src\Entities\Entity.cpp" /> <ClCompile Include="..\src\Entities\ExpOrb.cpp" /> <ClCompile Include="..\src\Entities\FallingBlock.cpp" /> + <ClCompile Include="..\src\Entities\Floater.cpp" /> <ClCompile Include="..\src\Entities\Minecart.cpp" /> <ClCompile Include="..\src\Entities\Pawn.cpp" /> <ClCompile Include="..\src\Entities\Pickup.cpp" /> diff --git a/VC2013/MCServer.vcxproj.filters b/VC2013/MCServer.vcxproj.filters index 74ddfafa8..30e90a9b0 100644 --- a/VC2013/MCServer.vcxproj.filters +++ b/VC2013/MCServer.vcxproj.filters @@ -10,73 +10,73 @@ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> <Filter Include="Source Files\Mobs"> - <UniqueIdentifier>{977716f7-b383-498a-950f-49afc6d551f6}</UniqueIdentifier> + <UniqueIdentifier>{813698c3-b2c1-4f3d-a89c-7ac6239fff97}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Entities"> - <UniqueIdentifier>{14ac2998-63d0-4bb3-97e3-1bd0007ffc74}</UniqueIdentifier> + <UniqueIdentifier>{b120a538-d8b9-4576-8675-36cf01fd69fc}</UniqueIdentifier> </Filter> <Filter Include="Source Files\UI"> - <UniqueIdentifier>{272cba2d-aa26-4c69-b6fa-94465078e351}</UniqueIdentifier> + <UniqueIdentifier>{85037cf1-81a5-47c7-8c2e-899ea706b8e7}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Simulator"> - <UniqueIdentifier>{1fabcea5-dba3-4265-b691-5795c69c4471}</UniqueIdentifier> + <UniqueIdentifier>{46c9cb22-7c7f-4589-b9b2-1fc79d2bdbdf}</UniqueIdentifier> </Filter> <Filter Include="Source Files\OSSupport"> - <UniqueIdentifier>{c29beffd-33f6-44eb-8310-3e0462cdddf9}</UniqueIdentifier> + <UniqueIdentifier>{f12178cb-2ecb-4e48-9a8d-ba3e2e73cfbc}</UniqueIdentifier> </Filter> <Filter Include="Source Files\OSSupport\Android Specific"> - <UniqueIdentifier>{430cae6d-cfb2-49a2-9fb2-614fde244868}</UniqueIdentifier> + <UniqueIdentifier>{488bc224-735f-405c-83de-870373cb52cb}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Bindings"> - <UniqueIdentifier>{87060076-8ef4-4535-88ee-7a609e4391ae}</UniqueIdentifier> + <UniqueIdentifier>{41c0d7c9-43b5-4d17-b50e-3c8ac3aa2905}</UniqueIdentifier> </Filter> <Filter Include="Source Files\External"> - <UniqueIdentifier>{4e33e863-d055-4476-bb95-efd5ebc115d3}</UniqueIdentifier> + <UniqueIdentifier>{2c71a15a-8c65-4be7-bdfb-e083f4841c4a}</UniqueIdentifier> </Filter> <Filter Include="Source Files\WorldStorage"> - <UniqueIdentifier>{ae97007e-0940-4f87-9786-8ed1d201e52c}</UniqueIdentifier> + <UniqueIdentifier>{2227f719-f0ac-444e-af14-230853017c45}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Generating"> - <UniqueIdentifier>{99483c91-c76c-47c7-838d-ba25c2066c79}</UniqueIdentifier> + <UniqueIdentifier>{eb070b55-ba10-4bce-ba06-5d785a055e54}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Blocks"> - <UniqueIdentifier>{51b8f5f3-83b3-4068-8825-503f19b42542}</UniqueIdentifier> + <UniqueIdentifier>{779dac55-c718-4fe1-8b67-547d431b9ebc}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Items"> - <UniqueIdentifier>{959da118-757d-44c1-a4bd-d3345cfeb637}</UniqueIdentifier> + <UniqueIdentifier>{89847a5d-608a-4137-a766-1557276b4fcf}</UniqueIdentifier> </Filter> <Filter Include="Source Files\Protocol"> - <UniqueIdentifier>{be413233-b7df-4ef1-9eb3-8aa1de96bf3e}</UniqueIdentifier> + <UniqueIdentifier>{e159d08d-daec-46de-9b60-9f8e660da91d}</UniqueIdentifier> </Filter> <Filter Include="Source Files\SQLite"> - <UniqueIdentifier>{224e8323-4bcc-4d7e-bdba-09fa22f42d66}</UniqueIdentifier> + <UniqueIdentifier>{0278092b-abe5-4276-81cf-59e4079e5bc7}</UniqueIdentifier> </Filter> <Filter Include="Source Files\LuaExpat"> - <UniqueIdentifier>{f9ad84f7-9199-45d1-a609-128f60baa996}</UniqueIdentifier> + <UniqueIdentifier>{e4879cf2-e769-4e1d-8905-0f6c40ee5bc1}</UniqueIdentifier> </Filter> <Filter Include="Source Files\BlockEntities"> - <UniqueIdentifier>{74088e2e-f7dc-478a-ae7f-bcfcb1a13dcc}</UniqueIdentifier> + <UniqueIdentifier>{d641a9d4-f5dc-4808-bee6-194306505244}</UniqueIdentifier> </Filter> <Filter Include="Source Files\HTTPServer"> - <UniqueIdentifier>{5e5eae6e-3154-4f85-868e-2682d072a5b2}</UniqueIdentifier> + <UniqueIdentifier>{a1e39415-2aca-4779-a558-2567a9de304f}</UniqueIdentifier> </Filter> <Filter Include="Config files"> - <UniqueIdentifier>{124dfea0-3dcd-45c0-a196-ec9bd6e00b6a}</UniqueIdentifier> + <UniqueIdentifier>{eb5f3060-03ed-4548-8bde-340454d3d23a}</UniqueIdentifier> </Filter> <Filter Include="Plugins"> - <UniqueIdentifier>{bc156df0-b3f8-4bf2-a434-59e63f5eafcc}</UniqueIdentifier> + <UniqueIdentifier>{7c681450-041a-4846-acf6-951c1f4e32a4}</UniqueIdentifier> </Filter> <Filter Include="Plugins\Core"> - <UniqueIdentifier>{2bbb71f4-860a-4fc4-b9d9-ac05f806fea1}</UniqueIdentifier> + <UniqueIdentifier>{e961964c-9fb7-4513-89fa-05e0b760e0f1}</UniqueIdentifier> </Filter> <Filter Include="Plugins\ChatLog"> - <UniqueIdentifier>{05facd8b-76e8-4bc5-9135-831b49ac5c65}</UniqueIdentifier> + <UniqueIdentifier>{70696c83-2307-43c6-8851-81aa3baa8523}</UniqueIdentifier> </Filter> <Filter Include="Plugins\Debuggers"> - <UniqueIdentifier>{6b70646e-a784-4617-8b26-941de4f8fd20}</UniqueIdentifier> + <UniqueIdentifier>{d3b692db-0684-4b89-9d38-2e5af12e9a6e}</UniqueIdentifier> </Filter> <Filter Include="Plugins\APIDump"> - <UniqueIdentifier>{a2b234d1-1013-47c0-8a44-f3b294d83d19}</UniqueIdentifier> + <UniqueIdentifier>{6eee304c-f055-4758-a248-a125e1af7e73}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> @@ -117,9 +117,6 @@ <ClInclude Include="..\src\Chunk.h"> <Filter>Source Files</Filter> </ClInclude> - <ClInclude Include="..\src\Chunk.inl.h"> - <Filter>Source Files</Filter> - </ClInclude> <ClInclude Include="..\src\ChunkDef.h"> <Filter>Source Files</Filter> </ClInclude> @@ -390,6 +387,9 @@ <ClInclude Include="..\src\Entities\FallingBlock.h"> <Filter>Source Files\Entities</Filter> </ClInclude> + <ClInclude Include="..\src\Entities\Floater.h"> + <Filter>Source Files\Entities</Filter> + </ClInclude> <ClInclude Include="..\src\Entities\Minecart.h"> <Filter>Source Files\Entities</Filter> </ClInclude> @@ -468,6 +468,9 @@ <ClInclude Include="..\src\OSSupport\ListenThread.h"> <Filter>Source Files\OSSupport</Filter> </ClInclude> + <ClInclude Include="..\src\OSSupport\Queue.h"> + <Filter>Source Files\OSSupport</Filter> + </ClInclude> <ClInclude Include="..\src\OSSupport\Semaphore.h"> <Filter>Source Files\OSSupport</Filter> </ClInclude> @@ -798,6 +801,9 @@ <ClInclude Include="..\src\items\ItemDye.h"> <Filter>Source Files\Items</Filter> </ClInclude> + <ClInclude Include="..\src\Items\ItemFishingRod.h"> + <Filter>Source Files\Items</Filter> + </ClInclude> <ClInclude Include="..\src\Items\ItemFlowerPot.h"> <Filter>Source Files\Items</Filter> </ClInclude> @@ -945,9 +951,6 @@ <ClInclude Include="..\src\HTTPServer\NameValueParser.h"> <Filter>Source Files\HTTPServer</Filter> </ClInclude> - <ClInclude Include="..\src\Entities\Floater.h"> - <Filter>Source Files\Entities</Filter> - </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\webadmin\template.html"> @@ -1372,6 +1375,9 @@ <ClCompile Include="..\src\Entities\FallingBlock.cpp"> <Filter>Source Files\Entities</Filter> </ClCompile> + <ClCompile Include="..\src\Entities\Floater.cpp"> + <Filter>Source Files\Entities</Filter> + </ClCompile> <ClCompile Include="..\src\Entities\Minecart.cpp"> <Filter>Source Files\Entities</Filter> </ClCompile> @@ -1660,9 +1666,6 @@ <ClCompile Include="..\src\HTTPServer\NameValueParser.cpp"> <Filter>Source Files\HTTPServer</Filter> </ClCompile> - <ClCompile Include="..\src\Entities\Floater.cpp"> - <Filter>Source Files\Entities</Filter> - </ClCompile> </ItemGroup> <ItemGroup> <Text Include="..\lib\sqlite\urls.txt"> diff --git a/VC2013/ToLua.vcxproj b/VC2013/ToLua.vcxproj index 86f80d691..309d9635a 100644 --- a/VC2013/ToLua.vcxproj +++ b/VC2013/ToLua.vcxproj @@ -163,6 +163,7 @@ </ClCompile> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\lib\tolua++\src\bin\tolua.c" /> <ClCompile Include="..\lib\tolua++\src\lib\tolua_event.c" /> <ClCompile Include="..\lib\tolua++\src\lib\tolua_is.c" /> <ClCompile Include="..\lib\tolua++\src\lib\tolua_map.c" /> diff --git a/VC2013/ToLua.vcxproj.filters b/VC2013/ToLua.vcxproj.filters index 095111dc8..5d104d7d0 100644 --- a/VC2013/ToLua.vcxproj.filters +++ b/VC2013/ToLua.vcxproj.filters @@ -7,6 +7,9 @@ </Filter> </ItemGroup> <ItemGroup> + <ClCompile Include="..\lib\tolua++\src\bin\tolua.c"> + <Filter>Source Files</Filter> + </ClCompile> <ClCompile Include="..\lib\tolua++\src\lib\tolua_event.c"> <Filter>Source Files</Filter> </ClCompile> diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index dd8e0da31..910661f60 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -828,7 +828,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int int yd = dy - dx / 2; int zd = dz - dx / 2; - while (true) + for (;;) { RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight); @@ -860,7 +860,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int int xd = dx - dy / 2; int zd = dz - dy / 2; - while (true) + for (;;) { RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight); @@ -894,7 +894,7 @@ void cBlockArea::RelLine(int a_RelX1, int a_RelY1, int a_RelZ1, int a_RelX2, int int xd = dx - dz / 2; int yd = dy - dz / 2; - while (true) + for (;;) { RelSetData(a_RelX1, a_RelY1, a_RelZ1, a_DataTypes, a_BlockType, a_BlockMeta, a_BlockLight, a_BlockSkyLight); diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp index df45bb4c2..c94113f5c 100644 --- a/src/Generating/Caves.cpp +++ b/src/Generating/Caves.cpp @@ -285,7 +285,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints & void cCaveTunnel::Smooth(void) { cCaveDefPoints Pts; - while (true) + for (;;) { if (!RefineDefPoints(m_Points, Pts)) { @@ -331,7 +331,7 @@ void cCaveTunnel::FinishLinear(void) int yd = dy - dx / 2; int zd = dz - dx / 2; - while (true) + for (;;) { m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R)); @@ -363,7 +363,7 @@ void cCaveTunnel::FinishLinear(void) int xd = dx - dy / 2; int zd = dz - dy / 2; - while (true) + for (;;) { m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R)); @@ -397,7 +397,7 @@ void cCaveTunnel::FinishLinear(void) int xd = dx - dz / 2; int yd = dy - dz / 2; - while (true) + for (;;) { m_Points.push_back(cCaveDefPoint(PrevX, PrevY, PrevZ, R)); diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index 15e352e30..eb9fe92ba 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -774,10 +774,11 @@ void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, in return; } default: + { ASSERT(!"Unhandled biome"); return; + } } // switch (Biome) - ASSERT(!"Unexpected fallthrough"); } diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 866551e8a..145fe22e0 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -528,7 +528,7 @@ cFinishGenFluidSprings::cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cI bool IsWater = (a_Fluid == E_BLOCK_WATER); AString SectionName = IsWater ? "WaterSprings" : "LavaSprings"; AString DefaultHeightDistribution; - int DefaultChance; + int DefaultChance = 0; switch (a_World.GetDimension()) { case dimNether: diff --git a/src/Items/ItemSeeds.h b/src/Items/ItemSeeds.h index 8ca86663f..67f0d38bd 100644 --- a/src/Items/ItemSeeds.h +++ b/src/Items/ItemSeeds.h @@ -56,7 +56,6 @@ public: case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true; default: a_BlockType = E_BLOCK_AIR; return true; } - return false; } } ; diff --git a/src/Protocol/Protocol132.h b/src/Protocol/Protocol132.h index d36384a88..80fc8740a 100644 --- a/src/Protocol/Protocol132.h +++ b/src/Protocol/Protocol132.h @@ -14,9 +14,9 @@ #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) - #pragma warning(disable:4244) - #pragma warning(disable:4231) #pragma warning(disable:4189) + #pragma warning(disable:4231) + #pragma warning(disable:4244) #pragma warning(disable:4702) #endif diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 8536689c3..7d1f723a3 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -983,7 +983,7 @@ void cProtocol172::AddReceivedData(const char * a_Data, int a_Size) } // Handle all complete packets: - while (true) + for (;;) { UInt32 PacketLen; if (!m_ReceivedData.ReadVarInt(PacketLen)) diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp index 64220f09a..8f80c3f75 100644 --- a/src/WorldStorage/FastNBT.cpp +++ b/src/WorldStorage/FastNBT.cpp @@ -16,9 +16,12 @@ #define NBT_RESERVE_SIZE 200 #endif // NBT_RESERVE_SIZE -#define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while (0) - - +#ifdef _MSC_VER + // Dodge a C4127 (conditional expression is constant) for this specific macro usage + #define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while ((false, false)) +#else + #define RETURN_FALSE_IF_FALSE(X) do { if (!X) return false; } while (false) +#endif @@ -99,7 +102,7 @@ bool cParsedNBT::ReadCompound(void) // Reads the latest tag as a compound int ParentIdx = m_Tags.size() - 1; int PrevSibling = -1; - while (true) + for (;;) { NEEDBYTES(1); eTagType TagType = (eTagType)(m_Data[m_Pos]); @@ -276,7 +279,7 @@ int cParsedNBT::FindChildByName(int a_Tag, const char * a_Name, size_t a_NameLen for (int Child = m_Tags[a_Tag].m_FirstChild; Child != -1; Child = m_Tags[Child].m_NextSibling) { if ( - (m_Tags[Child].m_NameLength == a_NameLength) && + (m_Tags[Child].m_NameLength == (int)a_NameLength) && (memcmp(m_Data + m_Tags[Child].m_NameStart, a_Name, a_NameLength) == 0) ) { |