From 0463dbdc9e5b39399765015c394e29dedaf7d041 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Apr 2014 20:13:33 +0000 Subject: (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values --- src/pathfinder/npf/aystar.cpp | 2 ++ src/pathfinder/npf/npf.cpp | 2 ++ src/pathfinder/npf/queue.cpp | 2 ++ src/pathfinder/opf/opf_ship.cpp | 2 ++ src/pathfinder/yapf/yapf_rail.cpp | 2 ++ src/pathfinder/yapf/yapf_road.cpp | 2 ++ src/pathfinder/yapf/yapf_ship.cpp | 2 ++ 7 files changed, 14 insertions(+) (limited to 'src/pathfinder') diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp index 153ffa8c1..9ef2bca47 100644 --- a/src/pathfinder/npf/aystar.cpp +++ b/src/pathfinder/npf/aystar.cpp @@ -27,6 +27,8 @@ #include "../../core/alloc_func.hpp" #include "aystar.h" +#include "../../safeguards.h" + /** * This looks in the hash whether a node exists in the closed list. * @param node Node to search. diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index 5c4ccb3cc..bb705e5f4 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -19,6 +19,8 @@ #include "../follow_track.hpp" #include "aystar.h" +#include "../../safeguards.h" + static const uint NPF_HASH_BITS = 12; ///< The size of the hash used in pathfinding. Just changing this value should be sufficient to change the hash size. Should be an even value. /* Do no change below values */ static const uint NPF_HASH_SIZE = 1 << NPF_HASH_BITS; diff --git a/src/pathfinder/npf/queue.cpp b/src/pathfinder/npf/queue.cpp index 45540c1b6..2afb41391 100644 --- a/src/pathfinder/npf/queue.cpp +++ b/src/pathfinder/npf/queue.cpp @@ -13,6 +13,8 @@ #include "../../core/alloc_func.hpp" #include "queue.h" +#include "../../safeguards.h" + /* * Binary Heap diff --git a/src/pathfinder/opf/opf_ship.cpp b/src/pathfinder/opf/opf_ship.cpp index 850577de1..023c6a4a0 100644 --- a/src/pathfinder/opf/opf_ship.cpp +++ b/src/pathfinder/opf/opf_ship.cpp @@ -15,6 +15,8 @@ #include "../../ship.h" #include "../../core/random_func.hpp" +#include "../../safeguards.h" + struct RememberData { uint16 cur_length; byte depth; diff --git a/src/pathfinder/yapf/yapf_rail.cpp b/src/pathfinder/yapf/yapf_rail.cpp index f66140046..dea4e28c1 100644 --- a/src/pathfinder/yapf/yapf_rail.cpp +++ b/src/pathfinder/yapf/yapf_rail.cpp @@ -19,6 +19,8 @@ #include "../../viewport_func.h" #include "../../newgrf_station.h" +#include "../../safeguards.h" + #define DEBUG_YAPF_CACHE 0 #if DEBUG_YAPF_CACHE diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp index 82493241f..711889b56 100644 --- a/src/pathfinder/yapf/yapf_road.cpp +++ b/src/pathfinder/yapf/yapf_road.cpp @@ -14,6 +14,8 @@ #include "yapf_node_road.hpp" #include "../../roadstop_base.h" +#include "../../safeguards.h" + template class CYapfCostRoadT diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index 5e1cd27e7..a01444a9e 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -15,6 +15,8 @@ #include "yapf.hpp" #include "yapf_node_ship.hpp" +#include "../../safeguards.h" + /** Node Follower module of YAPF for ships */ template class CYapfFollowShipT -- cgit v1.2.3-54-g00ecf