Fixed clang-tidy warnings
This commit is contained in:
@@ -102,7 +102,9 @@ void Map::PaintLine(TilePos start_tile, TilePos stop_tile, double width,
|
||||
const vec<double, 2> ortho = step.GetOrthogonal();
|
||||
LOG_DEBUG("step = ", step, " ortho = ", ortho);
|
||||
|
||||
// NOLINTNEXTLINE(clang-analyzer-security.FloatLoopCounter)
|
||||
for (double t = 0; t < line_length; t += 1.0) {
|
||||
// NOLINTNEXTLINE(clang-analyzer-security.FloatLoopCounter)
|
||||
for (double ortho_t = 0; ortho_t < width; ortho_t += 0.1) {
|
||||
auto tile_pos = start + step * t + ortho * ortho_t;
|
||||
TilePos tile_pos_int{static_cast<int32_t>(tile_pos.x()),
|
||||
|
||||
@@ -22,7 +22,7 @@ enum class PathFinderType {
|
||||
class PathFinderBase {
|
||||
public:
|
||||
PathFinderBase(const Map *m);
|
||||
~PathFinderBase() = default;
|
||||
virtual ~PathFinderBase() = default;
|
||||
|
||||
PathFinderBase(const PathFinderBase &) = delete;
|
||||
PathFinderBase(PathFinderBase &&) = delete;
|
||||
@@ -36,7 +36,7 @@ protected:
|
||||
const Map *m_Map;
|
||||
};
|
||||
|
||||
class LinearPathFinder : public PathFinderBase {
|
||||
class LinearPathFinder final : public PathFinderBase {
|
||||
|
||||
public:
|
||||
LinearPathFinder(const Map *m) : PathFinderBase(m) {}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace pathfinder {
|
||||
|
||||
class BFS : public PathFinderBase {
|
||||
class BFS final : public PathFinderBase {
|
||||
|
||||
public:
|
||||
BFS(const Map *m) : PathFinderBase(m) {}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace pathfinder {
|
||||
|
||||
class Dijkstra : public PathFinderBase {
|
||||
class Dijkstra final : public PathFinderBase {
|
||||
|
||||
public:
|
||||
Dijkstra(const Map *m) : PathFinderBase(m) {}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace pathfinder {
|
||||
|
||||
class GBFS : public PathFinderBase {
|
||||
class GBFS final : public PathFinderBase {
|
||||
|
||||
public:
|
||||
GBFS(const Map *m) : PathFinderBase(m) {}
|
||||
|
||||
@@ -17,13 +17,13 @@ std::unique_ptr<PathFinderBase> create(PathFinderType type, const Map *map) {
|
||||
using namespace pathfinder;
|
||||
switch (type) {
|
||||
case PathFinderType::LINEAR:
|
||||
return std::move(std::make_unique<LinearPathFinder>(map));
|
||||
return std::make_unique<LinearPathFinder>(map);
|
||||
case PathFinderType::BFS:
|
||||
return std::move(std::make_unique<BFS>(map));
|
||||
return std::make_unique<BFS>(map);
|
||||
case PathFinderType::DIJKSTRA:
|
||||
return std::move(std::make_unique<Dijkstra>(map));
|
||||
return std::make_unique<Dijkstra>(map);
|
||||
case PathFinderType::GBFS:
|
||||
return std::move(std::make_unique<GBFS>(map));
|
||||
return std::make_unique<GBFS>(map);
|
||||
case PathFinderType::COUNT:
|
||||
LOG_WARNING("Incorrect pathfinder type");
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user