From a99bece3fa7922f939c4a5153effa170dad336cf Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 9 Dec 2013 13:57:09 +0000 Subject: [PATCH 1/8] Fixed Warning Unhandeled enum values in switch as src/UI/SlotArea.cpp line 54 --- src/UI/SlotArea.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index e743f4bb3..2925d1226 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -1,4 +1,3 @@ - // SlotArea.cpp // Implements the cSlotArea class and its descendants @@ -65,6 +64,10 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA DblClicked(a_Player, a_SlotNum); return; } + default: + { + break; + } } cItem Slot(*GetSlot(a_SlotNum, a_Player)); From c78f67dcc0879441b4806c44f48fa87bc96aa01c Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 9 Dec 2013 14:05:32 +0000 Subject: [PATCH 2/8] Fixed warning unchecked enum value at Chunk.cpp line 841 --- src/Chunk.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 4386ffcb8..9c195fdf8 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #ifndef _WIN32 @@ -908,8 +907,11 @@ void cChunk::ApplyWeatherToTop() } break; } // case (snowy biomes) - // TODO: Rainy biomes should check for farmland and cauldrons + default: + { + break; + } } // switch (biome) } From 187449824c855d00802bebe13aab72aa6d76bd02 Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 9 Dec 2013 14:15:30 +0000 Subject: [PATCH 3/8] Fix Unused Variable Warning at FluidSimulator.cpp line 169 and 176 --- src/Simulator/FluidSimulator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index dac666484..72b2eb628 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" #include "FluidSimulator.h" @@ -138,7 +137,7 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a */ NIBBLETYPE LowestPoint = m_World.GetBlockMeta(a_X, a_Y, a_Z); //Current Block Meta so only lower points will be counted - int X = 0, Y = 0, Z = 0; //Lowest Pos will be stored here + int X = 0, Z = 0; //Lowest Pos will be stored here if (IsAllowedBlock(m_World.GetBlock(a_X, a_Y + 1, a_Z)) && a_Over) //check for upper block to flow because this also affects the flowing direction { @@ -167,14 +166,14 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a { LowestPoint = Meta; X = Pos->x; - Y = Pos->y; + Pos->y; //Remove if no side effects Z = Pos->z; } }else if(BlockID == E_BLOCK_AIR) { LowestPoint = 9; //This always dominates X = Pos->x; - Y = Pos->y; + Pos->y; //Remove if no side effects Z = Pos->z; } From 604c8fd9b9be46460c18e347bc4e7c0e6bc83761 Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 9 Dec 2013 14:17:39 +0000 Subject: [PATCH 4/8] Fix Undefined behavior at Bindings/LuaWindow line 32 --- src/Bindings/LuaWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bindings/LuaWindow.cpp b/src/Bindings/LuaWindow.cpp index 18d8b4467..733304eb2 100644 --- a/src/Bindings/LuaWindow.cpp +++ b/src/Bindings/LuaWindow.cpp @@ -1,4 +1,3 @@ - // LuaWindow.cpp // Implements the cLuaWindow class representing a virtual window that plugins may create and open for the player @@ -37,6 +36,10 @@ cLuaWindow::cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_Slo m_SlotAreas.push_back(new cSlotAreaArmor(*this)); break; } + default: + { + break; + } } m_SlotAreas.push_back(new cSlotAreaInventory(*this)); m_SlotAreas.push_back(new cSlotAreaHotBar(*this)); From cd7813f0f58d731c62f4a955c50c7dbc1915ca37 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:33:18 +0000 Subject: [PATCH 5/8] Removed unused variable ResultSlot --- src/UI/SlotArea.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 2925d1226..61e432665 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -446,7 +446,6 @@ void cSlotAreaCrafting::OnPlayerRemoved(cPlayer & a_Player) void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player) { - const cItem * ResultSlot = GetSlot(0, a_Player); cItem & DraggingItem = a_Player.GetDraggingItem(); // Get the current recipe: From ae369618ca54d004bd6e041d0a81b10fdc581c46 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:36:50 +0000 Subject: [PATCH 6/8] Reordered Listed Initalisation order in src/UI/Window.cpp Reordered the Listed Initalisation order for CWindow to the executed initalisation order. The compiler initalises values in the order the fields are declared not the initalisations listed --- src/UI/Window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index 5ca31fa3e..402a5cdf2 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -28,9 +28,9 @@ cWindow::cWindow(WindowType a_WindowType, const AString & a_WindowTitle) : m_WindowID((++m_WindowIDCounter) % 127), m_WindowType(a_WindowType), m_WindowTitle(a_WindowTitle), - m_Owner(NULL), m_IsDestroyed(false), - m_ShouldDistributeToHotbarFirst(true) + m_ShouldDistributeToHotbarFirst(true), + m_Owner(NULL) { if (a_WindowType == wtInventory) { From c1dbe8a19eb6b10760ff4bf674d1a4ee124f9211 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:42:43 +0000 Subject: [PATCH 7/8] added default fallthrough clause to switch at line 178 of src/UI/Window.cpp --- src/UI/Window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index 402a5cdf2..ee75921d1 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -201,6 +201,10 @@ void cWindow::Clicked( case caRightPaintProgress: OnPaintProgress(a_Player, a_SlotNum); return; case caLeftPaintEnd: OnLeftPaintEnd (a_Player); return; case caRightPaintEnd: OnRightPaintEnd(a_Player); return; + default: + { + break; + } } if (a_SlotNum < 0) From e32a224fe304a532e5743237888664466b968a8b Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:45:32 +0000 Subject: [PATCH 8/8] fixed warnings in src/Generating/BioGen.cpp removed unused variable at src/Generating/BioGen.cpp line 379 and added default fallthrough clause to switch at src/Generating/BioGen.cpp line 725 --- src/Generating/BioGen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index a0407a145..98999dee9 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -376,7 +376,6 @@ void cBioGenDistortedVoronoi::GenBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::B for (int z = 0; z < cChunkDef::Width; z++) { - int AbsoluteZ = BaseZ + z; for (int x = 0; x < cChunkDef::Width; x++) { int VoronoiCellValue = m_Voronoi.GetValueAt(DistortX[x][z], DistortZ[x][z]) / 8; @@ -727,6 +726,7 @@ void cBioGenMultiStepMap::FreezeWaterBiomes(cChunkDef::BiomeMap & a_BiomeMap, co { case biRiver: cChunkDef::SetBiome(a_BiomeMap, x, z, biFrozenRiver); break; case biOcean: cChunkDef::SetBiome(a_BiomeMap, x, z, biFrozenOcean); break; + default: break; } } // for x idx += 1;