From ee15d4e08e90536afbb381a6d65a418e0027658d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 30 Dec 2013 17:41:59 +0100 Subject: [PATCH 01/13] Fixed compilation in VC2008. Also removed an unused inline header file (yuck). --- VC2008/MCServer.vcproj | 4 ---- src/BlockEntities/BlockEntity.h | 3 +-- src/Chunk.cpp | 20 +++++++------------ src/Chunk.h | 23 ---------------------- src/Chunk.inl.h | 34 --------------------------------- src/ChunkDef.h | 2 +- src/Entities/Entity.h | 6 ++++-- 7 files changed, 13 insertions(+), 79 deletions(-) delete mode 100644 src/Chunk.inl.h diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj index cb9867450..491e7740e 100644 --- a/VC2008/MCServer.vcproj +++ b/VC2008/MCServer.vcproj @@ -494,10 +494,6 @@ RelativePath="..\src\Chunk.h" > - - diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h index c3b8d41c0..7c6688f8d 100644 --- a/src/BlockEntities/BlockEntity.h +++ b/src/BlockEntities/BlockEntity.h @@ -87,10 +87,9 @@ public: virtual void SendTo(cClientHandle & a_Client) = 0; /// Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing. - virtual bool Tick(float a_Dt, cChunk & a_Chunk) + virtual bool Tick(float a_Dt, cChunk & /* a_Chunk */) { UNUSED(a_Dt); - UNUSED(a_Chunk); return false; } diff --git a/src/Chunk.cpp b/src/Chunk.cpp index a16d34f3b..b229a4aff 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -527,9 +527,10 @@ void cChunk::SpawnMobs(cMobSpawner& a_MobSpawner) // MG TODO : check that "Level" really means Y - /*NIBBLETYPE SkyLight = 0; - - NIBBLETYPE BlockLight = 0;*/ + /* + NIBBLETYPE SkyLight = 0; + NIBBLETYPE BlockLight = 0; + */ if (IsLightValid()) { @@ -2323,8 +2324,9 @@ BLOCKTYPE cChunk::GetBlock(int a_BlockIdx) const void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) { - a_BlockType = cChunkDef::GetBlock (m_BlockTypes, a_RelX, a_RelY, a_RelZ); - a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, a_RelX, a_RelY, a_RelZ); + int Idx = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY, a_RelZ); + a_BlockType = cChunkDef::GetBlock (m_BlockTypes, Idx); + a_BlockMeta = cChunkDef::GetNibble(m_BlockMeta, Idx); } @@ -2896,11 +2898,3 @@ NIBBLETYPE cChunk::GetTimeAlteredLight(NIBBLETYPE a_Skylight) const - -#if !C_CHUNK_USE_INLINE -# include "cChunk.inl.h" -#endif - - - - diff --git a/src/Chunk.h b/src/Chunk.h index 05a96d419..f0a50c3c4 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -12,19 +12,6 @@ -#define C_CHUNK_USE_INLINE 1 - -// Do not touch -#if C_CHUNK_USE_INLINE - #define __C_CHUNK_INLINE__ inline -#else - #define __C_CHUNK_INLINE__ -#endif - - - - - namespace Json { class Value; @@ -436,8 +423,6 @@ private: void RemoveBlockEntity(cBlockEntity * a_BlockEntity); void AddBlockEntity (cBlockEntity * a_BlockEntity); - void SpreadLightOfBlock(NIBBLETYPE * a_LightBuffer, int a_X, int a_Y, int a_Z, char a_Falloff); - /// Creates a block entity for each block that needs a block entity and doesn't have one in the list void CreateBlockEntities(void); @@ -482,11 +467,3 @@ typedef std::list cChunkPtrList; - -#if C_CHUNK_USE_INLINE - #include "Chunk.inl.h" -#endif - - - - diff --git a/src/Chunk.inl.h b/src/Chunk.inl.h deleted file mode 100644 index fb9c4dad1..000000000 --- a/src/Chunk.inl.h +++ /dev/null @@ -1,34 +0,0 @@ - -#ifndef __C_CHUNK_INL_H__ -#define __C_CHUNK_INL_H__ - -#ifndef MAX -# define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - - - - - -__C_CHUNK_INLINE__ -void cChunk::SpreadLightOfBlock(NIBBLETYPE * a_LightBuffer, int a_X, int a_Y, int a_Z, char a_Falloff) -{ - unsigned char CurrentLight = cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z ); - cChunkDef::SetNibble( a_LightBuffer, a_X-1, a_Y, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X-1, a_Y, a_Z ), MAX(0,CurrentLight-a_Falloff) ) ); - cChunkDef::SetNibble( a_LightBuffer, a_X+1, a_Y, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X+1, a_Y, a_Z ), MAX(0,CurrentLight-a_Falloff) ) ); - cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y-1, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y-1, a_Z ), MAX(0,CurrentLight-a_Falloff) ) ); - cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y+1, a_Z, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y+1, a_Z ), MAX(0,CurrentLight-a_Falloff) ) ); - cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y, a_Z-1, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z-1 ), MAX(0,CurrentLight-a_Falloff) ) ); - cChunkDef::SetNibble( a_LightBuffer, a_X, a_Y, a_Z+1, MAX(cChunkDef::GetNibble( a_LightBuffer, a_X, a_Y, a_Z+1 ), MAX(0,CurrentLight-a_Falloff) ) ); - MarkDirty(); -} - - - - - -#endif - - - - diff --git a/src/ChunkDef.h b/src/ChunkDef.h index bf41aa625..7d727a4d4 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -180,7 +180,7 @@ public: /// Converts absolute block coords into relative (chunk + block) coords: - inline static void AbsoluteToRelative(/* in-out */ int & a_X, int& a_Y, int & a_Z, /* out */ int & a_ChunkX, int & a_ChunkZ ) + inline static void AbsoluteToRelative(/* in-out */ int & a_X, int & a_Y, int & a_Z, /* out */ int & a_ChunkX, int & a_ChunkZ ) { UNUSED(a_Y); BlockToChunk(a_X, a_Z, a_ChunkX, a_ChunkZ); diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 3634f087c..2ba1b303d 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -424,11 +424,13 @@ protected: void Dereference( cEntity*& a_EntityPtr ); private: - // Measured in degrees (MAX 360 degrees) + // Measured in degrees, [-180, +180) double m_HeadYaw; + // Measured in meter/second (m/s) Vector3d m_Speed; - // Measured in degrees (MAX 360 degrees) + + // Measured in degrees, [-180, +180) Vector3d m_Rot; /// Position of the entity's XZ center and Y bottom From 782818ffb520553e772bc5a4638009664a821f90 Mon Sep 17 00:00:00 2001 From: Morgan Redshaw Date: Mon, 30 Dec 2013 21:30:20 -0700 Subject: [PATCH 02/13] Fixed a cPlayer::IsGameModeAdventure. It was determined based off of gmCreate rather than gmAdventure. --- CONTRIBUTORS | 1 + src/Entities/Player.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index bd6b204a4..150bcf09e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -19,5 +19,6 @@ SamJBarney worktycho Sxw1212 tonibm19 +Diusrex Please add yourself to this list if you contribute to MCServer. diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 67d5a47ef..bc92790aa 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -908,8 +908,8 @@ bool cPlayer::IsGameModeSurvival(void) const bool cPlayer::IsGameModeAdventure(void) const { - return (m_GameMode == gmCreative) || // Either the player is explicitly in Adventure - ((m_GameMode == gmNotSet) && m_World->IsGameModeCreative()); // or they inherit from the world and the world is Adventure + return (m_GameMode == gmAdventure) || // Either the player is explicitly in Adventure + ((m_GameMode == gmNotSet) && m_World->IsGameModeAdventure()); // or they inherit from the world and the world is Adventure } From 25d42c44d5d9cbd3eb1178fde50cf9b271e4a96e Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 13:55:06 +0000 Subject: [PATCH 03/13] fixed warnings in BlockArea.cpp --- src/BlockArea.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 1148908c6..dd8e0da31 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -28,6 +28,8 @@ template void InternalMergeBlocks( Combinator a_Combinator ) { + UNUSED(a_SrcSizeY); + UNUSED(a_DstSizeY); for (int y = 0; y < a_SizeY; y++) { int SrcBaseY = (y + a_SrcOffY) * a_SrcSizeX * a_SrcSizeZ; From 9ebc623a0a453c71add19eb67e05782248a7b7ab Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:00:32 +0000 Subject: [PATCH 04/13] fixed warnings in webadmin.cpp --- src/WebAdmin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp index a1f0842aa..e6a5a01b3 100644 --- a/src/WebAdmin.cpp +++ b/src/WebAdmin.cpp @@ -305,6 +305,7 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque void cWebAdmin::HandleRootRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) { + UNUSED(a_Request); static const char LoginForm[] = \ "

MCServer WebAdmin

" \ "
" \ @@ -450,6 +451,7 @@ AString cWebAdmin::GetBaseURL(const AStringVector & a_URLSplit) void cWebAdmin::OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) { + UNUSED(a_Connection); const AString & URL = a_Request.GetURL(); if ( (strncmp(URL.c_str(), "/webadmin", 9) == 0) || @@ -473,6 +475,7 @@ void cWebAdmin::OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_ void cWebAdmin::OnRequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, int a_Size) { + UNUSED(a_Connection); cRequestData * Data = (cRequestData *)(a_Request.GetUserData()); if (Data == NULL) { From e41dec458c690c5c99ef75fe4baf6dc7371e5b64 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:05:53 +0000 Subject: [PATCH 05/13] fixed ClientHandle warnings --- src/ClientHandle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 99df47bfb..17412c265 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1409,6 +1409,7 @@ void cClientHandle::SendData(const char * a_Data, int a_Size) void cClientHandle::MoveToWorld(cWorld & a_World, bool a_SendRespawnPacket) { + UNUSED(a_World); ASSERT(m_Player != NULL); if (a_SendRespawnPacket) From c83dfdb66e096f16805d0a842e0492645dc086c2 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:19:29 +0000 Subject: [PATCH 06/13] fixed warnings in bytebuffer.cpp --- src/ByteBuffer.cpp | 6 +++--- src/ByteBuffer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index 64c03d0d3..510018005 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -773,7 +773,7 @@ void cByteBuffer::ReadAll(AString & a_Data) -bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes) +bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes) { if (!a_Dst.CanWriteBytes(a_NumBytes) || !CanReadBytes(a_NumBytes)) { @@ -781,9 +781,9 @@ bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes) return false; } char buf[1024]; - while (a_NumBytes > 0) + while (a_NumBytes > static_cast(0)) { - int num = (a_NumBytes > sizeof(buf)) ? sizeof(buf) : a_NumBytes; + size_t num = (a_NumBytes > sizeof(buf)) ? sizeof(buf) : a_NumBytes; VERIFY(ReadBuf(buf, num)); VERIFY(a_Dst.Write(buf, num)); a_NumBytes -= num; diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h index 06c846fa9..cbce119b1 100644 --- a/src/ByteBuffer.h +++ b/src/ByteBuffer.h @@ -110,7 +110,7 @@ public: void ReadAll(AString & a_Data); /// Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success. - bool ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes); + bool ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes); /// Removes the bytes that have been read from the ringbuffer void CommitRead(void); From 3152c7295983418a905f3f6404a54cc7b038ead9 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:28:47 +0000 Subject: [PATCH 07/13] fixed warnings in Inventory.cpp --- src/Inventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Inventory.cpp b/src/Inventory.cpp index a9b4ab9c5..a7f77cf6d 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -57,6 +57,8 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, bool a_ConsiderEmptySlo int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int a_EndSlotNum, bool a_ConsiderEmptySlots) { + + UNUSED(a_ConsiderEmptySlots); if ((a_BeginSlotNum < 0) || (a_BeginSlotNum >= invNumSlots)) { LOGWARNING("%s: Bad BeginSlotNum, got %d, there are %d slots; correcting to 0.", __FUNCTION__, a_BeginSlotNum, invNumSlots - 1); @@ -96,8 +98,6 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int - - int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks, bool a_tryToFillEquippedFirst) { cItem ToAdd(a_Item); From 2e113c63f9dce41beea8597b173f072487e07d34 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:42:17 +0000 Subject: [PATCH 08/13] fixxed warnings in Server.cpp --- src/Server.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Server.cpp b/src/Server.cpp index a93be9a5b..7dedc3904 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -173,6 +173,7 @@ void cServer::ClientMovedToWorld(const cClientHandle * a_Client) void cServer::PlayerCreated(const cPlayer * a_Player) { + UNUSED(a_Player); // To avoid deadlocks, the player count is not handled directly, but rather posted onto the tick thread cCSLock Lock(m_CSPlayerCountDiff); m_PlayerCountDiff += 1; @@ -184,6 +185,7 @@ void cServer::PlayerCreated(const cPlayer * a_Player) void cServer::PlayerDestroying(const cPlayer * a_Player) { + UNUSED(a_Player); // To avoid deadlocks, the player count is not handled directly, but rather posted onto the tick thread cCSLock Lock(m_CSPlayerCountDiff); m_PlayerCountDiff -= 1; @@ -514,6 +516,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac void cServer::PrintHelp(const AStringVector & a_Split, cCommandOutputCallback & a_Output) { + UNUSED(a_Split); typedef std::pair AStringPair; typedef std::vector AStringPairs; @@ -525,6 +528,8 @@ void cServer::PrintHelp(const AStringVector & a_Split, cCommandOutputCallback & virtual bool Command(const AString & a_Command, const cPlugin * a_Plugin, const AString & a_Permission, const AString & a_HelpString) override { + UNUSED(a_Plugin); + UNUSED(a_Permission); if (!a_HelpString.empty()) { m_Commands.push_back(AStringPair(a_Command, a_HelpString)); From 2e1588820d3c27a82d4bd6401dc9af728130908c Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 14:55:24 +0000 Subject: [PATCH 09/13] fixed warnings in World.cpp --- src/BlockTracer.h | 25 ++++++++++++++++++++++--- src/Simulator/NoopFluidSimulator.h | 10 ++++++++-- src/World.cpp | 4 +++- src/World.h | 1 + 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/BlockTracer.h b/src/BlockTracer.h index d0a34811d..40d80da1a 100644 --- a/src/BlockTracer.h +++ b/src/BlockTracer.h @@ -36,7 +36,14 @@ public: /** Called on each block encountered along the path, including the first block (path start), if chunk data is not loaded When this callback returns true, the tracing is aborted. */ - virtual bool OnNextBlockNoData(int a_BlockX, int a_BlockY, int a_BlockZ, char a_EntryFace) { return false; } + virtual bool OnNextBlockNoData(int a_BlockX, int a_BlockY, int a_BlockZ, char a_EntryFace) + { + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_EntryFace); + return false; + } /** Called when the path goes out of world, either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height) The coords specify the exact point at which the path exited the world. @@ -44,7 +51,13 @@ public: Note that some paths can go out of the world and come back again (parabola), in such a case this callback is followed by OnIntoWorld() and further OnNextBlock() calls */ - virtual bool OnOutOfWorld(double a_BlockX, double a_BlockY, double a_BlockZ) { return false; } + virtual bool OnOutOfWorld(double a_BlockX, double a_BlockY, double a_BlockZ) + { + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + return false; + } /** Called when the path goes into the world, from either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height) The coords specify the exact point at which the path entered the world. @@ -52,7 +65,13 @@ public: Note that some paths can go out of the world and come back again (parabola), in such a case this callback is followed by further OnNextBlock() calls */ - virtual bool OnIntoWorld(double a_BlockX, double a_BlockY, double a_BlockZ) { return false; } + virtual bool OnIntoWorld(double a_BlockX, double a_BlockY, double a_BlockZ) + { + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + return false; + } /** Called when the path is sure not to hit any more blocks. Note that for some shapes this might never happen (line with constant Y) diff --git a/src/Simulator/NoopFluidSimulator.h b/src/Simulator/NoopFluidSimulator.h index 8f894433f..9113aec3c 100644 --- a/src/Simulator/NoopFluidSimulator.h +++ b/src/Simulator/NoopFluidSimulator.h @@ -27,8 +27,14 @@ public: } // cSimulator overrides: - virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override {} - virtual void Simulate(float a_Dt) override {} + virtual void AddBlock(int a_BlockX, int a_BlockY, int a_BlockZ, cChunk * a_Chunk) override + { + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_Chunk); + } + virtual void Simulate(float a_Dt) override { UNUSED(a_Dt);} } ; diff --git a/src/World.cpp b/src/World.cpp index 28c46c27e..cc543d460 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -723,6 +723,7 @@ void cWorld::Tick(float a_Dt, int a_LastTickDurationMSec) void cWorld::TickWeather(float a_Dt) { + UNUSED(a_Dt); // There are no weather changes anywhere but in the Overworld: if (GetDimension() != dimOverworld) { @@ -794,7 +795,7 @@ void cWorld::TickMobs(float a_Dt) cMonster::mfAmbient, cMonster::mfWater, } ; - for (int i = 0; i < ARRAYCOUNT(AllFamilies); i++) + for (size_t i = 0; i < ARRAYCOUNT(AllFamilies); i++) { cMonster::eFamily Family = AllFamilies[i]; int SpawnDelay = cMonster::GetSpawnDelay(Family); @@ -1643,6 +1644,7 @@ int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward) void cWorld::SpawnPrimedTNT(double a_X, double a_Y, double a_Z, double a_FuseTimeInSec, double a_InitialVelocityCoeff) { + UNUSED(a_InitialVelocityCoeff); cTNTEntity * TNT = new cTNTEntity(a_X, a_Y, a_Z, a_FuseTimeInSec); TNT->Initialize(this); // TODO: Add a bit of speed in horiz and vert axes, based on the a_InitialVelocityCoeff diff --git a/src/World.h b/src/World.h index c067252d9..67f1275c0 100644 --- a/src/World.h +++ b/src/World.h @@ -78,6 +78,7 @@ public: class cTask { public: + virtual ~cTask(){}; virtual void Run(cWorld & a_World) = 0; } ; From 3da41de5539337438e6091dd1830505b755124eb Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:01:04 +0000 Subject: [PATCH 10/13] take Z axis into account when calculating neighboors in LightingThread::ChunkReady --- src/LightingThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index d7e60e458..d9c41481a 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -189,7 +189,7 @@ void cLightingThread::ChunkReady(int a_ChunkX, int a_ChunkZ) { if ( (itr->x - a_ChunkX >= -1) && (itr->x - a_ChunkX <= 1) && - (itr->x - a_ChunkX >= -1) && (itr->x - a_ChunkX <= 1) + (itr->z - a_ChunkZ >= -1) && (itr->z - a_ChunkZ <= 1) ) { // It is a neighbor From 8e7e990cfe5be08030ff2b7e0323c9bf64b15201 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:04:29 +0000 Subject: [PATCH 11/13] fixed warnings in LightingThread.cpp --- src/LightingThread.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index d9c41481a..7c3cc9c76 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -495,6 +495,7 @@ void cLightingThread::CalcLightStep( int & a_NumSeedsOut, unsigned char * a_IsSeedOut, unsigned int * a_SeedIdxOut ) { + UNUSED(a_IsSeedIn); int NumSeedsOut = 0; for (int i = 0; i < a_NumSeedsIn; i++) { From 1957f982bc7be250f52bac2ccc0450e60c965fba Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:06:41 +0000 Subject: [PATCH 12/13] fixed warnings in LineBlockTracer.cpp --- src/LineBlockTracer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index 9fcbca915..110c6b5dc 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -196,7 +196,6 @@ 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. - bool Finished = false; while (true) { // Report the current block through the callbacks: From c3e34ee81af71c70514d53f4e54e3a6c2ac5a976 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 17:02:36 +0000 Subject: [PATCH 13/13] removed unneccisary cast --- src/ByteBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index 510018005..e06f63a0e 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -781,7 +781,8 @@ bool cByteBuffer::ReadToByteBuffer(cByteBuffer & a_Dst, size_t a_NumBytes) return false; } char buf[1024]; - while (a_NumBytes > static_cast(0)) + // > 0 without generating warnings about unsigned comparisons where size_t is unsigned + while (a_NumBytes != 0) { size_t num = (a_NumBytes > sizeof(buf)) ? sizeof(buf) : a_NumBytes; VERIFY(ReadBuf(buf, num));