1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +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

@@ -15,7 +15,7 @@
#include "../AIUtility.h"
#include "../Goals/AbstractGoal.h"
class AIPathNode;
struct AIPathNode;
class ISpecialAction
{

View File

@@ -410,12 +410,11 @@ namespace AIPathfinding
class AIMovementToDestinationRule : public MovementToDestinationRule
{
private:
CPlayerSpecificInfoCallback * cb;
std::shared_ptr<AINodeStorage> nodeStorage;
public:
AIMovementToDestinationRule(CPlayerSpecificInfoCallback * cb, std::shared_ptr<AINodeStorage> nodeStorage)
:cb(cb), nodeStorage(nodeStorage)
AIMovementToDestinationRule(std::shared_ptr<AINodeStorage> nodeStorage)
: nodeStorage(nodeStorage)
{
}
@@ -455,12 +454,11 @@ namespace AIPathfinding
class AIPreviousNodeRule : public MovementToDestinationRule
{
private:
CPlayerSpecificInfoCallback * cb;
std::shared_ptr<AINodeStorage> nodeStorage;
public:
AIPreviousNodeRule(CPlayerSpecificInfoCallback * cb, std::shared_ptr<AINodeStorage> nodeStorage)
:cb(cb), nodeStorage(nodeStorage)
AIPreviousNodeRule(std::shared_ptr<AINodeStorage> nodeStorage)
: nodeStorage(nodeStorage)
{
}
@@ -501,9 +499,9 @@ namespace AIPathfinding
std::vector<std::shared_ptr<IPathfindingRule>> rules = {
std::make_shared<AILayerTransitionRule>(cb, ai, nodeStorage),
std::make_shared<DestinationActionRule>(),
std::make_shared<AIMovementToDestinationRule>(cb, nodeStorage),
std::make_shared<AIMovementToDestinationRule>(nodeStorage),
std::make_shared<MovementCostRule>(),
std::make_shared<AIPreviousNodeRule>(cb, nodeStorage),
std::make_shared<AIPreviousNodeRule>(nodeStorage),
std::make_shared<AIMovementAfterDestinationRule>(cb, nodeStorage)
};

View File

@@ -13,7 +13,7 @@
#include "../VCAI.h"
#include "AINodeStorage.h"
class IPathfindingManager
class DLL_EXPORT IPathfindingManager
{
public:
virtual ~IPathfindingManager() = default;
@@ -28,8 +28,8 @@ public:
virtual std::vector<AIPath> getPathsToTile(HeroPtr hero, int3 tile) = 0;
virtual bool isTileAccessible(HeroPtr hero, int3 tile) = 0;
};
class PathfindingManager : public IPathfindingManager
class DLL_EXPORT PathfindingManager : public IPathfindingManager
{
friend class AIhelper;
@@ -55,9 +55,9 @@ private:
void setAI(VCAI * AI) override;
Goals::TGoalVec findPath(
HeroPtr hero,
HeroPtr hero,
crint3 dest,
bool allowGatherArmy,
bool allowGatherArmy,
const std::function<Goals::TSubgoal(int3)> goalFactory);
Goals::TSubgoal clearWayTo(HeroPtr hero, int3 firstTileToGet);