summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-23 20:13:33 +0000
committerrubidium <rubidium@openttd.org>2014-04-23 20:13:33 +0000
commit0463dbdc9e5b39399765015c394e29dedaf7d041 (patch)
tree0d115f2027997f6c452d59d63919f9a6d05cb8be /src/core
parent287ecd158249628a9b12aa5567e0e188499084f5 (diff)
downloadopenttd-0463dbdc9e5b39399765015c394e29dedaf7d041.tar.xz
(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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/alloc_func.cpp2
-rw-r--r--src/core/bitmath_func.cpp2
-rw-r--r--src/core/geometry_func.cpp2
-rw-r--r--src/core/math_func.cpp2
-rw-r--r--src/core/pool_func.cpp2
-rw-r--r--src/core/random_func.cpp2
6 files changed, 12 insertions, 0 deletions
diff --git a/src/core/alloc_func.cpp b/src/core/alloc_func.cpp
index d2b3a4b6c..b78023f4d 100644
--- a/src/core/alloc_func.cpp
+++ b/src/core/alloc_func.cpp
@@ -11,6 +11,8 @@
#include "../stdafx.h"
+#include "../safeguards.h"
+
/**
* Function to exit with an error message after malloc() or calloc() have failed
* @param size number of bytes we tried to allocate
diff --git a/src/core/bitmath_func.cpp b/src/core/bitmath_func.cpp
index af0200bcb..776322731 100644
--- a/src/core/bitmath_func.cpp
+++ b/src/core/bitmath_func.cpp
@@ -12,6 +12,8 @@
#include "../stdafx.h"
#include "bitmath_func.hpp"
+#include "../safeguards.h"
+
const uint8 _ffb_64[64] = {
0, 0, 1, 0, 2, 0, 1, 0,
3, 0, 1, 0, 2, 0, 1, 0,
diff --git a/src/core/geometry_func.cpp b/src/core/geometry_func.cpp
index 1a1588738..86f317a37 100644
--- a/src/core/geometry_func.cpp
+++ b/src/core/geometry_func.cpp
@@ -13,6 +13,8 @@
#include "geometry_func.hpp"
#include "math_func.hpp"
+#include "../safeguards.h"
+
/**
* Compute bounding box of both dimensions.
* @param d1 First dimension.
diff --git a/src/core/math_func.cpp b/src/core/math_func.cpp
index 8c136c0bb..d92770208 100644
--- a/src/core/math_func.cpp
+++ b/src/core/math_func.cpp
@@ -12,6 +12,8 @@
#include "../stdafx.h"
#include "math_func.hpp"
+#include "../safeguards.h"
+
/**
* Compute least common multiple (lcm) of arguments \a a and \a b, the smallest
* integer value that is a multiple of both \a a and \a b.
diff --git a/src/core/pool_func.cpp b/src/core/pool_func.cpp
index fa410850f..f8ff93cec 100644
--- a/src/core/pool_func.cpp
+++ b/src/core/pool_func.cpp
@@ -12,6 +12,8 @@
#include "../stdafx.h"
#include "pool_type.hpp"
+#include "../safeguards.h"
+
/**
* Destructor removes this object from the pool vector and
* deletes the vector itself if this was the last item removed.
diff --git a/src/core/random_func.cpp b/src/core/random_func.cpp
index 8cf21b54f..5c1d07940 100644
--- a/src/core/random_func.cpp
+++ b/src/core/random_func.cpp
@@ -13,6 +13,8 @@
#include "random_func.hpp"
#include "bitmath_func.hpp"
+#include "../safeguards.h"
+
Randomizer _random, _interactive_random;
/**