From dcd0a0e89c689c90e57bc151f8cbfcdd98dece4d Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Fri, 19 Dec 2014 15:16:02 +0200 Subject: [PATCH] Fix linux build and warnings --- CorpseMethods.h | 6 +++--- ElunaEventMgr.h | 1 - GlobalMethods.h | 2 +- HookMgr.cpp | 4 +--- LuaEngine.cpp | 6 +++--- LuaFunctions.cpp | 4 ++-- PlayerMethods.h | 4 ++-- UnitMethods.h | 18 +++++++++--------- WorldObjectMethods.h | 2 +- 9 files changed, 22 insertions(+), 25 deletions(-) diff --git a/CorpseMethods.h b/CorpseMethods.h index fb85184..6da4ad9 100644 --- a/CorpseMethods.h +++ b/CorpseMethods.h @@ -59,7 +59,7 @@ namespace LuaCorpse * Resets the [Corpse] ghost time. * */ - int ResetGhostTime(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int ResetGhostTime(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) { corpse->ResetGhostTime(); return 0; @@ -69,7 +69,7 @@ namespace LuaCorpse * Saves the [Corpse] to the database. * */ - int SaveToDB(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int SaveToDB(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) { corpse->SaveToDB(); return 0; @@ -79,7 +79,7 @@ namespace LuaCorpse * Deletes the [Corpse] from the world. * */ - int DeleteBonesFromWorld(Eluna* /*E*/, lua_State* L, Corpse* corpse) + int DeleteBonesFromWorld(Eluna* /*E*/, lua_State* /*L*/, Corpse* corpse) { corpse->DeleteBonesFromWorld(); return 0; diff --git a/ElunaEventMgr.h b/ElunaEventMgr.h index 2575fe7..b1ae301 100644 --- a/ElunaEventMgr.h +++ b/ElunaEventMgr.h @@ -65,7 +65,6 @@ public: private: void RemoveEvents_internal(); void AddEvent(LuaEvent* Event); - bool removeAllEvents; EventList eventList; uint64 m_time; WorldObject* obj; diff --git a/GlobalMethods.h b/GlobalMethods.h index 5f08647..fda2407 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -2010,7 +2010,7 @@ namespace LuaGlobalFunctions * Removes old [Corpse]s from the world * */ - int RemoveOldCorpses(Eluna* /*E*/, lua_State* L) + int RemoveOldCorpses(Eluna* /*E*/, lua_State* /*L*/) { eObjectAccessor->RemoveOldCorpses(); return 0; diff --git a/HookMgr.cpp b/HookMgr.cpp index c54554f..eeb1266 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -47,7 +47,6 @@ using namespace HookMgr; if (!BINDMAP->HasEvents(EVENT)) \ RET; \ lua_State* L = this->L; \ - ElunaBind* _LuaBind = this->BINDMAP; \ const char* _LuaBindType = this->BINDMAP->groupName; \ uint32 _LuaEvent = EVENT; \ int _LuaStackTop = lua_gettop(L); \ @@ -81,8 +80,7 @@ using namespace HookMgr; if (!BINDMAP->HasEvents(ENTRY, EVENT)) \ RET; \ lua_State* L = this->L; \ - ElunaBind* _LuaBind = this->BINDMAP; \ - const char* _LuaBindType = _LuaBind->groupName; \ + const char* _LuaBindType = this->BINDMAP->groupName; \ uint32 _LuaEvent = EVENT; \ int _LuaStackTop = lua_gettop(L); \ this->BINDMAP->PushFuncRefs(L, _LuaEvent, ENTRY); \ diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 20845f6..7305386 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -680,7 +680,7 @@ template<> Object* Eluna::CHECKOBJ(lua_State* L, int narg, bool error) if (!obj) obj = CHECKOBJ(L, narg, false); if (!obj) - obj = ElunaTemplate::Check(L, narg, false); + obj = ElunaTemplate::Check(L, narg, error); return obj; } template<> WorldObject* Eluna::CHECKOBJ(lua_State* L, int narg, bool error) @@ -691,7 +691,7 @@ template<> WorldObject* Eluna::CHECKOBJ(lua_State* L, int narg, boo if (!obj) obj = CHECKOBJ(L, narg, false); if (!obj) - obj = ElunaTemplate::Check(L, narg, false); + obj = ElunaTemplate::Check(L, narg, error); return obj; } template<> Unit* Eluna::CHECKOBJ(lua_State* L, int narg, bool error) @@ -700,7 +700,7 @@ template<> Unit* Eluna::CHECKOBJ(lua_State* L, int narg, bool error) if (!obj) obj = CHECKOBJ(L, narg, false); if (!obj) - obj = ElunaTemplate::Check(L, narg, false); + obj = ElunaTemplate::Check(L, narg, error); return obj; } diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index e2bd1d0..8f958a4 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -1279,7 +1279,7 @@ template<> int ElunaTemplate::Less(lua_State* L) { Eluna::Pu template<> int ElunaTemplate::LessOrEqual(lua_State* L) { Eluna::Push(L, Eluna::CHECKVAL(L, 1) <= Eluna::CHECKVAL(L, 2)); return 1; } template<> int ElunaTemplate::Pow(lua_State* L) { - Eluna::Push(L, static_cast(std::powl(static_cast(Eluna::CHECKVAL(L, 1)), static_cast(Eluna::CHECKVAL(L, 2))))); + Eluna::Push(L, static_cast(powl(static_cast(Eluna::CHECKVAL(L, 1)), static_cast(Eluna::CHECKVAL(L, 2))))); return 1; } template<> int ElunaTemplate::ToString(lua_State* L) @@ -1302,7 +1302,7 @@ template<> int ElunaTemplate::Less(lua_State* L) { Eluna::Push(L, Elu template<> int ElunaTemplate::LessOrEqual(lua_State* L) { Eluna::Push(L, Eluna::CHECKVAL(L, 1) <= Eluna::CHECKVAL(L, 2)); return 1; } template<> int ElunaTemplate::Pow(lua_State* L) { - Eluna::Push(L, static_cast(std::powl(static_cast(Eluna::CHECKVAL(L, 1)), static_cast(Eluna::CHECKVAL(L, 2))))); + Eluna::Push(L, static_cast(powl(static_cast(Eluna::CHECKVAL(L, 1)), static_cast(Eluna::CHECKVAL(L, 2))))); return 1; } template<> int ElunaTemplate::ToString(lua_State* L) diff --git a/PlayerMethods.h b/PlayerMethods.h index 12943cd..bebb8f0 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1317,7 +1317,7 @@ namespace LuaPlayer /* OTHER */ #if (!defined(TBC) && !defined(CLASSIC)) - int ResetPetTalents(Eluna* /*E*/, lua_State* L, Player* player) + int ResetPetTalents(Eluna* /*E*/, lua_State* /*L*/, Player* player) { #ifndef TRINITY Pet* pet = player->GetPet(); @@ -1331,7 +1331,7 @@ namespace LuaPlayer return 0; } - int ResetAchievements(Eluna* /*E*/, lua_State* L, Player* player) + int ResetAchievements(Eluna* /*E*/, lua_State* /*L*/, Player* player) { #ifndef TRINITY player->GetAchievementMgr().Reset(); diff --git a/UnitMethods.h b/UnitMethods.h index ac2ad98..f796734 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1212,7 +1212,7 @@ namespace LuaUnit }*/ /* OTHER */ - int ClearThreatList(Eluna* /*E*/, lua_State* L, Unit* unit) + int ClearThreatList(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { #ifdef MANGOS unit->GetThreatManager().clearReferences(); @@ -1230,7 +1230,7 @@ namespace LuaUnit return 0; } - int Dismount(Eluna* /*E*/, lua_State* L, Unit* unit) + int Dismount(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { if (unit->IsMounted()) { @@ -1293,7 +1293,7 @@ namespace LuaUnit // unit->GetMotionMaster()->Clear(); // all // } - int MoveStop(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveStop(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->StopMoving(); return 0; @@ -1313,7 +1313,7 @@ namespace LuaUnit return 0; } - int MoveIdle(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveIdle(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveIdle(); return 0; @@ -1332,7 +1332,7 @@ namespace LuaUnit return 0; } - int MoveHome(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveHome(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveTargetedHome(); return 0; @@ -1356,7 +1356,7 @@ namespace LuaUnit return 0; } - int MoveConfused(Eluna* /*E*/, lua_State* L, Unit* unit) + int MoveConfused(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->GetMotionMaster()->MoveConfused(); return 0; @@ -1450,7 +1450,7 @@ namespace LuaUnit return 0; } - int DeMorph(Eluna* /*E*/, lua_State* L, Unit* unit) + int DeMorph(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->DeMorph(); return 0; @@ -1511,7 +1511,7 @@ namespace LuaUnit return 0; } - int ClearInCombat(Eluna* /*E*/, lua_State* L, Unit* unit) + int ClearInCombat(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->ClearInCombat(); return 0; @@ -1591,7 +1591,7 @@ namespace LuaUnit return 0; } - int RemoveAllAuras(Eluna* /*E*/, lua_State* L, Unit* unit) + int RemoveAllAuras(Eluna* /*E*/, lua_State* /*L*/, Unit* unit) { unit->RemoveAllAuras(); return 0; diff --git a/WorldObjectMethods.h b/WorldObjectMethods.h index 1dd6ad9..2f69b83 100644 --- a/WorldObjectMethods.h +++ b/WorldObjectMethods.h @@ -653,7 +653,7 @@ namespace LuaWorldObject * Removes all timed events from a [WorldObject] * */ - int RemoveEvents(Eluna* /*E*/, lua_State* L, WorldObject* obj) + int RemoveEvents(Eluna* /*E*/, lua_State* /*L*/, WorldObject* obj) { obj->elunaEvents->RemoveEvents(); return 0;