1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Warnings fixes (#538)

Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
This commit is contained in:
Alexander Shishkin
2019-01-19 13:52:02 +03:00
committed by GitHub
parent 419fee1fb2
commit b00e935e4d
34 changed files with 67 additions and 71 deletions

View File

@@ -79,9 +79,8 @@ namespace spells
class ObstacleCasterProxy : public Caster
{
public:
ObstacleCasterProxy(const CGameHandler * gh_, const PlayerColor owner_, const CGHeroInstance * hero_, const SpellCreatedObstacle * obs_)
: gh(gh_),
owner(owner_),
ObstacleCasterProxy(const PlayerColor owner_, const CGHeroInstance * hero_, const SpellCreatedObstacle * obs_)
: owner(owner_),
hero(hero_),
obs(obs_)
{
@@ -163,7 +162,6 @@ public:
private:
const CGHeroInstance * hero;
const CGameHandler * gh;
const PlayerColor owner;
const SpellCreatedObstacle * obs;
};
@@ -4804,7 +4802,7 @@ bool CGameHandler::handleDamageFromObstacle(const CStack * curStack, bool stackI
if(!(spellObstacle->hidden && gs->curB->battleIsObstacleVisibleForSide(*obstacle, (BattlePerspective::BattlePerspective)side)))
{
const CGHeroInstance * hero = gs->curB->battleGetFightingHero(spellObstacle->casterSide);
spells::ObstacleCasterProxy caster(this, gs->curB->sides.at(spellObstacle->casterSide).color, hero, spellObstacle);
spells::ObstacleCasterProxy caster(gs->curB->sides.at(spellObstacle->casterSide).color, hero, spellObstacle);
const CSpell * sp = SpellID(spellObstacle->ID).toSpell();
if(!sp)