From 39a1bcdea0a5897a7090748529e3b903918882ec Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 7 Jan 2014 16:00:19 +0100 Subject: [PATCH] More MSVC warning fixes. --- src/ChunkMap.cpp | 2 +- src/Generating/Ravines.cpp | 2 +- src/HTTPServer/MultipartParser.cpp | 2 +- src/LightingThread.cpp | 2 +- src/LineBlockTracer.cpp | 2 +- src/Server.cpp | 2 +- src/StringCompression.cpp | 4 ++-- src/StringUtils.cpp | 2 +- src/UI/SlotArea.cpp | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 86fbceff7..e14090b18 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -991,7 +991,7 @@ bool cChunkMap::HasChunkAnyClients(int a_ChunkX, int a_ChunkZ) int cChunkMap::GetHeight(int a_BlockX, int a_BlockZ) { - while (true) + for (;;) { cCSLock Lock(m_CSLayers); int ChunkX, ChunkZ, BlockY = 0; diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp index 6413b963b..cfda47e32 100644 --- a/src/Generating/Ravines.cpp +++ b/src/Generating/Ravines.cpp @@ -381,7 +381,7 @@ void cStructGenRavines::cRavine::FinishLinear(void) int R = itr->m_Radius; int T = itr->m_Top; int B = itr->m_Bottom; - while (true) + for (;;) { m_Points.push_back(cRavDefPoint(PrevX, PrevZ, R, T, B)); if ((PrevX == x1) && (PrevZ == z1)) diff --git a/src/HTTPServer/MultipartParser.cpp b/src/HTTPServer/MultipartParser.cpp index b49f6ec07..14c2c00fa 100644 --- a/src/HTTPServer/MultipartParser.cpp +++ b/src/HTTPServer/MultipartParser.cpp @@ -156,7 +156,7 @@ void cMultipartParser::Parse(const char * a_Data, int a_Size) // Append to buffer, then parse it: m_IncomingData.append(a_Data, a_Size); - while (true) + for (;;) { if (m_EnvelopeParser.IsInHeaders()) { diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 7c3cc9c76..a823c08cc 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -216,7 +216,7 @@ void cLightingThread::ChunkReady(int a_ChunkX, int a_ChunkZ) void cLightingThread::Execute(void) { - while (true) + for (;;) { { cCSLock Lock(m_CS); diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index 110c6b5dc..da1c7f2fd 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -196,7 +196,7 @@ bool cLineBlockTracer::Item(cChunk * a_Chunk) ASSERT((m_CurrentY >= 0) && (m_CurrentY < cChunkDef::Height)); // This should be provided by FixStartAboveWorld() / FixStartBelowWorld() // This is the actual line tracing loop. - while (true) + for (;;) { // Report the current block through the callbacks: if (a_Chunk == NULL) diff --git a/src/Server.cpp b/src/Server.cpp index 7dedc3904..e707235a8 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -493,7 +493,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac if (split[0].compare("killmem") == 0) { - while (true) + for (;;) { new char[100 * 1024 * 1024]; // Allocate and leak 100 MiB in a loop -> fill memory and kill MCS } diff --git a/src/StringCompression.cpp b/src/StringCompression.cpp index 36946b282..e15058840 100644 --- a/src/StringCompression.cpp +++ b/src/StringCompression.cpp @@ -74,7 +74,7 @@ int CompressStringGZIP(const char * a_Data, int a_Length, AString & a_Compressed return res; } - while (true) + for (;;) { res = deflate(&strm, Z_FINISH); switch (res) @@ -137,7 +137,7 @@ extern int UncompressStringGZIP(const char * a_Data, int a_Length, AString & a_U return res; } - while (true) + for (;;) { res = inflate(&strm, Z_FINISH); switch (res) diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index 8d2352331..e6deb0705 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -612,7 +612,7 @@ AString StripColorCodes(const AString & a_Message) { AString res(a_Message); size_t idx = 0; - while (true) + for (;;) { idx = res.find("\xc2\xa7", idx); if (idx == AString::npos) diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 61e432665..a721e6b7e 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -491,7 +491,7 @@ void cSlotAreaCrafting::ShiftClickedResult(cPlayer & a_Player) return; } cItem * PlayerSlots = GetPlayerSlots(a_Player) + 1; - do + for (;;) { // Try distributing the result. If it fails, bail out: cItem ResultCopy(Result); @@ -517,7 +517,7 @@ void cSlotAreaCrafting::ShiftClickedResult(cPlayer & a_Player) // The recipe has changed, bail out return; } - } while (true); + } }