From a99bece3fa7922f939c4a5153effa170dad336cf Mon Sep 17 00:00:00 2001 From: worktycho Date: Mon, 9 Dec 2013 13:57:09 +0000 Subject: 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(-) (limited to 'src/UI') 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)); -- cgit v1.2.3 From cd7813f0f58d731c62f4a955c50c7dbc1915ca37 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:33:18 +0000 Subject: Removed unused variable ResultSlot --- src/UI/SlotArea.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/UI') 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: -- cgit v1.2.3 From ae369618ca54d004bd6e041d0a81b10fdc581c46 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:36:50 +0000 Subject: 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(-) (limited to 'src/UI') 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) { -- cgit v1.2.3 From c1dbe8a19eb6b10760ff4bf674d1a4ee124f9211 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sat, 7 Dec 2013 23:42:43 +0000 Subject: added default fallthrough clause to switch at line 178 of src/UI/Window.cpp --- src/UI/Window.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/UI') 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) -- cgit v1.2.3