Explorar o código

- vcmi can be compiled with clang-3.1

Ivan Savenko %!s(int64=13) %!d(string=hai) anos
pai
achega
61ccabde53

+ 1 - 1
Global.h

@@ -118,7 +118,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
 //defining available c++11 features
 
 //initialization lists - only gcc-4.4 or later
-#if defined(__GNUC__) && (GCC_VERSION >= 404)
+#if defined(__clang__) || (defined(__GNUC__) && (GCC_VERSION >= 404))
 #define CPP11_USE_INITIALIZERS_LIST
 #endif
 

+ 1 - 1
client/BattleInterface/CBattleAnimations.cpp

@@ -993,7 +993,7 @@ bool CSpellEffectAnimation::init()
 
 			switch (effect)
 			{
-			case -1:
+			case ui32(-1):
 				be.x = x;
 				be.y = y;
 				break;

+ 1 - 1
client/BattleInterface/CBattleInterface.cpp

@@ -2098,7 +2098,7 @@ void CBattleInterface::getPossibleActionsForStack(const CStack * stack)
 		possibleActions.push_back(ATTACK); //all active stacks can attack
 		possibleActions.push_back(WALK_AND_ATTACK); //not all stacks can always walk, but we will check this elsewhere
 
-		if (stack->canMove() && stack->Speed()); //probably no reason to try move war machines or bound stacks
+		if (stack->canMove() && stack->Speed()) //probably no reason to try move war machines or bound stacks
 			possibleActions.push_back (MOVE_STACK); //all active stacks can attack
 
 		if (siegeH && stack->hasBonusOfType (Bonus::CATAPULT)) //TODO: check shots

+ 1 - 1
client/CCreatureWindow.cpp

@@ -336,7 +336,7 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode *
 				}
 				file += sufix += ".bmp";
 
-				auto skillGraphics = new CPicture(file, 37 + i * 84, 224);
+				new CPicture(file, 37 + i * 84, 224);
 			}
 		}
 		//print commander level

+ 2 - 2
server/CGameHandler.cpp

@@ -1010,7 +1010,7 @@ startWalking:
 			BattleHex hex = path.first[v];
 			tiles.push_back(hex);	
 
-			if(obstacle = battleGetObstacleOnPos(hex, false))
+			if((obstacle = battleGetObstacleOnPos(hex, false)))
 			{
 				//we walked onto something, so we finalize this portion of stack movement check into obstacle
 				break; 
@@ -4518,7 +4518,7 @@ void CGameHandler::stackTurnTrigger(const CStack * st)
 		{
 			int index = rand() % bl.size();
 			int spellID = bl[index]->subtype; //spell ID
-			if (gs->curB->battleCanCastThisSpell(st->owner, VLC->spellh->spells[spellID], ECastingMode::ENCHANTER_CASTING)); //TODO: select another?
+			if (gs->curB->battleCanCastThisSpell(st->owner, VLC->spellh->spells[spellID], ECastingMode::ENCHANTER_CASTING)) //TODO: select another?
 			{
 				int spellLeveL = bl[index]->val; //spell level
 				const CGHeroInstance * enemyHero = gs->curB->getHero(gs->curB->theOtherPlayer(st->owner));