diff -Nur vcmi-0.89.orig/Global.h vcmi-0.89/Global.h --- vcmi-0.89.orig/Global.h 2012-05-28 03:06:35.000000000 +0800 +++ vcmi-0.89/Global.h 2012-06-21 14:39:37.104980437 +0800 @@ -330,7 +330,7 @@ { assert(r.size()); index %= r.size(); - auto itr = std::begin(r); + auto itr = r.begin(); std::advance(itr, index); return *itr; } diff -Nur vcmi-0.89.orig/lib/BattleState.cpp vcmi-0.89/lib/BattleState.cpp --- vcmi-0.89.orig/lib/BattleState.cpp 2012-05-30 07:22:28.000000000 +0800 +++ vcmi-0.89/lib/BattleState.cpp 2012-06-21 14:39:37.104980438 +0800 @@ -2594,7 +2594,7 @@ if(vstd::contains(obs->getAffectedTiles(), tile)) return obs; - return NULL; + return shared_ptr(); } const CStack * BattleInfo::getStackIf(boost::function pred) const diff -Nur vcmi-0.89.orig/lib/CGameState.cpp vcmi-0.89/lib/CGameState.cpp --- vcmi-0.89.orig/lib/CGameState.cpp 2012-06-01 19:35:31.000000000 +0800 +++ vcmi-0.89/lib/CGameState.cpp 2012-06-21 14:39:37.104980438 +0800 @@ -648,7 +648,7 @@ //golem factory is not in list of cregens but can be placed as random object static const int factoryCreatures[] = {32, 33, 116, 117}; - std::vector factory(std::begin(factoryCreatures), std::end(factoryCreatures)); + std::vector factory(factoryCreatures, factoryCreatures + sizeof(factoryCreatures)/sizeof(*factoryCreatures) - 1); if (vstd::contains(factory, cid)) result = std::pair(20, 1); diff -Nur vcmi-0.89.orig/lib/CObjectHandler.cpp vcmi-0.89/lib/CObjectHandler.cpp --- vcmi-0.89.orig/lib/CObjectHandler.cpp 2012-05-19 19:47:26.000000000 +0800 +++ vcmi-0.89/lib/CObjectHandler.cpp 2012-06-21 14:39:37.105980426 +0800 @@ -2360,7 +2360,7 @@ bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, int subtype /*= -1*/) { - return addBonusIfBuilt(building, type, val, NULL, subtype); + return addBonusIfBuilt(building, type, val, TPropagatorPtr(), subtype); } bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype /*= -1*/) diff -Nur vcmi-0.89.orig/lib/CObstacleInstance.cpp vcmi-0.89/lib/CObstacleInstance.cpp --- vcmi-0.89.orig/lib/CObstacleInstance.cpp 2012-05-19 04:50:16.000000000 +0800 +++ vcmi-0.89/lib/CObstacleInstance.cpp 2012-06-21 14:39:37.106980413 +0800 @@ -134,5 +134,5 @@ { //rrr... need initializer lists static const BattleHex moatHexes[] = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181}; - return std::vector(std::begin(moatHexes), std::end(moatHexes)); -} \ No newline at end of file + return std::vector(moatHexes, moatHexes + sizeof(moatHexes)/sizeof(*moatHexes) - 1); +} diff -Nur vcmi-0.89.orig/lib/IGameCallback.cpp vcmi-0.89/lib/IGameCallback.cpp --- vcmi-0.89.orig/lib/IGameCallback.cpp 2012-05-29 03:29:32.000000000 +0800 +++ vcmi-0.89/lib/IGameCallback.cpp 2012-06-21 14:39:37.106980413 +0800 @@ -416,7 +416,7 @@ shared_ptr CBattleInfoCallback::battleGetObstacleOnPos(BattleHex tile, bool onlyBlocking /*= true*/) { if(!gs->curB) - return NULL; + return shared_ptr(); BOOST_FOREACH(auto &obs, battleGetAllObstacles()) { @@ -426,7 +426,7 @@ return obs; } } - return NULL; + return shared_ptr(); } int CBattleInfoCallback::battleGetMoatDmg() diff -Nur vcmi-0.89.orig/server/CGameHandler.cpp vcmi-0.89/server/CGameHandler.cpp --- vcmi-0.89.orig/server/CGameHandler.cpp 2012-05-30 07:22:28.000000000 +0800 +++ vcmi-0.89/server/CGameHandler.cpp 2012-06-21 14:39:37.107980400 +0800 @@ -999,7 +999,7 @@ { // send one package with the creature path information - shared_ptr obstacle = NULL; //obstacle that interrupted movement + shared_ptr obstacle = shared_ptr(); //obstacle that interrupted movement std::vector tiles; int tilesToMove = std::max((int)(path.first.size() - creSpeed), 0); int v = path.first.size()-1; @@ -1036,7 +1036,7 @@ //if stack didn't die in explosion, continue movement if(!obstacle->stopsMovement() && curStack->alive()) { - obstacle = NULL; + obstacle = shared_ptr(); tiles.clear(); v--; goto startWalking; //TODO it's so evil