From 4b8be22fb68d833d8052729bf1e553ffe361f3ab Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Sat, 4 Sep 2010 14:47:39 +0000 Subject: [PATCH] Several compile/link fixes. --- client/CPreGame.cpp | 4 +++- client/Client.cpp | 2 +- lib/CGameState.cpp | 3 ++- lib/Connection.h | 2 +- server/CGameHandler.cpp | 6 ++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 763529495..c43b3edbf 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -102,6 +102,8 @@ static void clearInfo() playerNames.clear(); } +template class CApplyOnPG; + class CBaseForPGApply { public: @@ -123,7 +125,7 @@ public: } }; -CApplier *applier = NULL; +static CApplier *applier = NULL; void CMapInfo::countPlayers() { diff --git a/client/Client.cpp b/client/Client.cpp index c90189da5..1c790dd15 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -75,7 +75,7 @@ public: } }; -CApplier *applier = NULL; +static CApplier *applier = NULL; void CClient::init() { diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 6e8e4ac76..c6cee41cb 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -60,6 +60,7 @@ void foofoofoo() registerTypes((CTypeList&)*ccc); } +template class CApplyOnGS; class CBaseForGSApply { @@ -85,7 +86,7 @@ public: } }; -CApplier *applierGs = NULL; +static CApplier *applierGs = NULL; class IObjectCaller { diff --git a/lib/Connection.h b/lib/Connection.h index cd55c0d9f..fa2d183e8 100644 --- a/lib/Connection.h +++ b/lib/Connection.h @@ -876,7 +876,7 @@ public: ~CApplier() { - std::map::iterator iter; + typename std::map::iterator iter; for(iter = apps.begin(); iter != apps.end(); iter++) delete iter->second; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index dd132c57f..77f0ba986 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -60,6 +60,7 @@ CondSh battleResult(NULL); std::ptrdiff_t randomizer (ptrdiff_t i) {return rand();} std::ptrdiff_t (*p_myrandom)(std::ptrdiff_t) = randomizer; +template class CApplyOnGH; class CBaseForGHApply { @@ -71,6 +72,7 @@ public: return new CApplyOnGH; } }; + template class CApplyOnGH : public CBaseForGHApply { public: @@ -82,7 +84,7 @@ public: } }; -CApplier *applier = NULL; +static CApplier *applier = NULL; CMP_stack cmpst ; @@ -5220,4 +5222,4 @@ bool CGameHandler::sacrificeArtifact(const IMarket * m, const CGHeroInstance * h m->getOffer(artID, 0, dmp, expToGive, ARTIFACT_EXP); changePrimSkill(hero->id, 4, expToGive); return true; -} \ No newline at end of file +}