From 182646188448f9fd8df0b4c0391a2db04575c49d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 28 Feb 2014 16:26:23 +0100 Subject: [PATCH] Fixed multiple gcc warnings about unused params. --- src/Entities/Painting.cpp | 11 +++++++++++ src/Entities/Painting.h | 2 +- src/HTTPServer/HTTPServer.cpp | 4 ++++ src/Items/ItemHandler.cpp | 26 +++++++++++++++++++++++++- src/OSSupport/BlockingTCPLink.cpp | 4 ++++ src/UI/SlotArea.cpp | 30 ++++++++++++++++++++++++++++++ src/UI/SlotArea.h | 6 +++--- 7 files changed, 78 insertions(+), 5 deletions(-) diff --git a/src/Entities/Painting.cpp b/src/Entities/Painting.cpp index b98c1e67a..e217556c7 100644 --- a/src/Entities/Painting.cpp +++ b/src/Entities/Painting.cpp @@ -4,6 +4,7 @@ #include "Painting.h" #include "ClientHandle.h" #include "Player.h" +#include "../Chunk.h" @@ -30,6 +31,16 @@ void cPainting::SpawnOn(cClientHandle & a_Client) +void cPainting::Tick(float a_Dt, cChunk & a_Chunk) +{ + UNUSED(a_Dt); + UNUSED(a_Chunk); +} + + + + + void cPainting::GetDrops(cItems & a_Items, cEntity * a_Killer) { if ((a_Killer != NULL) && a_Killer->IsPlayer() && !((cPlayer *)a_Killer)->IsGameModeCreative()) diff --git a/src/Entities/Painting.h b/src/Entities/Painting.h index 95afbed1e..c1024bd1b 100644 --- a/src/Entities/Painting.h +++ b/src/Entities/Painting.h @@ -24,7 +24,7 @@ public: private: virtual void SpawnOn(cClientHandle & a_Client) override; - virtual void Tick(float a_Dt, cChunk & a_Chunk) override {}; + virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual void GetDrops(cItems & a_Items, cEntity * a_Killer) override; virtual void KilledBy(cEntity * a_Killer) override { diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index f6f5b0f8b..4e9195a00 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -29,6 +29,8 @@ class cDebugCallbacks : { virtual void OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) override { + UNUSED(a_Connection); + if (cHTTPFormParser::HasFormData(a_Request)) { a_Request.SetUserData(new cHTTPFormParser(a_Request, *this)); @@ -38,6 +40,8 @@ class cDebugCallbacks : virtual void OnRequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, int a_Size) override { + UNUSED(a_Connection); + cHTTPFormParser * FormParser = (cHTTPFormParser *)(a_Request.GetUserData()); if (FormParser != NULL) { diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index c10d13edc..507f7fa86 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -248,6 +248,14 @@ cItemHandler::cItemHandler(int a_ItemType) bool cItemHandler::OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) { + UNUSED(a_World); + UNUSED(a_Player); + UNUSED(a_Item); + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_Dir); + return false; } @@ -257,6 +265,14 @@ bool cItemHandler::OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & bool cItemHandler::OnDiggingBlock(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) { + UNUSED(a_World); + UNUSED(a_Player); + UNUSED(a_Item); + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); + UNUSED(a_Dir); + return false; } @@ -266,6 +282,8 @@ bool cItemHandler::OnDiggingBlock(cWorld * a_World, cPlayer * a_Player, const cI void cItemHandler::OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ) { + UNUSED(a_Item); + BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); cBlockHandler * Handler = cBlockHandler::GetBlockHandler(Block); @@ -288,7 +306,9 @@ void cItemHandler::OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const void cItemHandler::OnFoodEaten(cWorld * a_World, cPlayer * a_Player, cItem * a_Item) { - + UNUSED(a_World); + UNUSED(a_Player); + UNUSED(a_Item); } @@ -461,6 +481,8 @@ bool cItemHandler::IsPlaceable(void) bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) { + UNUSED(a_BlockType); + return false; } @@ -499,6 +521,8 @@ bool cItemHandler::GetPlacementBlockTypeMeta( bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item) { + UNUSED(a_Item); + FoodInfo Info = GetFoodInfo(); if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f)) diff --git a/src/OSSupport/BlockingTCPLink.cpp b/src/OSSupport/BlockingTCPLink.cpp index af50eda5d..e9c00d6d4 100644 --- a/src/OSSupport/BlockingTCPLink.cpp +++ b/src/OSSupport/BlockingTCPLink.cpp @@ -89,6 +89,8 @@ bool cBlockingTCPLink::Connect(const char * iAddress, unsigned int iPort) int cBlockingTCPLink::Send(char * a_Data, unsigned int a_Size, int a_Flags /* = 0 */ ) { + UNUSED(a_Flags); + ASSERT(m_Socket.IsValid()); if (!m_Socket.IsValid()) { @@ -104,6 +106,8 @@ int cBlockingTCPLink::Send(char * a_Data, unsigned int a_Size, int a_Flags /* = int cBlockingTCPLink::SendMessage( const char* a_Message, int a_Flags /* = 0 */ ) { + UNUSED(a_Flags); + ASSERT(m_Socket.IsValid()); if (!m_Socket.IsValid()) { diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index bfcad3d92..88977e005 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -224,6 +224,24 @@ void cSlotArea::DblClicked(cPlayer & a_Player, int a_SlotNum) +void cSlotArea::OnPlayerAdded(cPlayer & a_Player) +{ + UNUSED(a_Player); +} + + + + + +void cSlotArea::OnPlayerRemoved(cPlayer & a_Player) +{ + UNUSED(a_Player); +} + + + + + void cSlotArea::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_Apply, bool a_KeepEmptySlots) { for (int i = 0; i < m_NumSlots; i++) @@ -447,6 +465,18 @@ void cSlotAreaCrafting::OnPlayerRemoved(cPlayer & a_Player) + +void cSlotAreaCrafting::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots) +{ + UNUSED(a_ItemStack); + UNUSED(a_Player); + UNUSED(a_ShouldApply); + UNUSED(a_KeepEmptySlots); +} + + + + void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player) { cItem & DraggingItem = a_Player.GetDraggingItem(); diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index d31c87e0c..25b367cff 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -48,10 +48,10 @@ public: virtual void DblClicked(cPlayer & a_Player, int a_SlotNum); /// Called when a new player opens the same parent window. The window already tracks the player. CS-locked. - virtual void OnPlayerAdded(cPlayer & a_Player) {} ; + virtual void OnPlayerAdded(cPlayer & a_Player); /// Called when one of the players closes the parent window. The window already doesn't track the player. CS-locked. - virtual void OnPlayerRemoved(cPlayer & a_Player) {} ; + virtual void OnPlayerRemoved(cPlayer & a_Player); /** Called to store as much of a_ItemStack in the area as possible. a_ItemStack is modified to reflect the change. The default implementation searches each slot for available space and distributes the stack there. @@ -226,7 +226,7 @@ public: virtual void OnPlayerRemoved(cPlayer & a_Player) override; // Distributing items into this area is completely disabled - virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots) override {} + virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots) override; protected: /// Maps player's EntityID -> current recipe; not a std::map because cCraftingGrid needs proper constructor params