1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Fixed lots of warnings.

Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
This commit is contained in:
John Bolton
2020-10-01 01:38:06 -07:00
parent ff471af3de
commit a05ae78e67
142 changed files with 854 additions and 839 deletions
+13 -13
View File
@@ -46,10 +46,10 @@ struct armyStructure
armyStructure evaluateArmyStructure(const CArmedInstance * army)
{
ui64 totalStrenght = army->getArmyStrength();
double walkersStrenght = 0;
double flyersStrenght = 0;
double shootersStrenght = 0;
ui64 totalStrength = army->getArmyStrength();
double walkersStrength = 0;
double flyersStrength = 0;
double shootersStrength = 0;
ui32 maxSpeed = 0;
static const CSelector selectorSHOOTER = Selector::type(Bonus::SHOOTER);
@@ -67,23 +67,23 @@ armyStructure evaluateArmyStructure(const CArmedInstance * army)
const CCreature * creature = s.second->type;
if(creature->hasBonus(selectorSHOOTER, keySHOOTER))
{
shootersStrenght += s.second->getPower();
shootersStrength += s.second->getPower();
walker = false;
}
if(creature->hasBonus(selectorFLYING, keyFLYING))
{
flyersStrenght += s.second->getPower();
flyersStrength += s.second->getPower();
walker = false;
}
if(walker)
walkersStrenght += s.second->getPower();
walkersStrength += s.second->getPower();
vstd::amax(maxSpeed, creature->valOfBonuses(selectorSTACKS_SPEED, keySTACKS_SPEED));
}
armyStructure as;
as.walkers = walkersStrenght / totalStrenght;
as.shooters = shootersStrenght / totalStrenght;
as.flyers = flyersStrenght / totalStrenght;
as.walkers = static_cast<float>(walkersStrength / totalStrength);
as.shooters = static_cast<float>(shootersStrength / totalStrength);
as.flyers = static_cast<float>(flyersStrength / totalStrength);
as.maxSpeed = maxSpeed;
assert(as.walkers || as.flyers || as.shooters);
return as;
@@ -346,7 +346,7 @@ void HeroMovementGoalEngineBase::setSharedFuzzyVariables(Goals::AbstractGoal & g
float strengthRatioData = 10.0f; //we are much stronger than enemy
ui64 danger = fh->evaluateDanger(goal.tile, goal.hero.h);
if(danger)
strengthRatioData = (fl::scalar)goal.hero.h->getTotalStrength() / danger;
strengthRatioData = static_cast<float>((fl::scalar)goal.hero.h->getTotalStrength() / danger);
try
{
@@ -419,7 +419,7 @@ float VisitObjEngine::evaluate(Goals::VisitObj & goal)
{
objectValue->setValue(objValue);
engine.process();
output = value->getValue();
output = static_cast<float>(value->getValue());
}
catch(fl::Exception & fe)
{
@@ -448,7 +448,7 @@ float VisitTileEngine::evaluate(Goals::VisitTile & goal)
{
engine.process();
goal.priority = value->getValue();
goal.priority = static_cast<float>(value->getValue());
}
catch(fl::Exception & fe)
{