summaryrefslogtreecommitdiff
path: root/src/tgp.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/tgp.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r--src/tgp.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp
index 4dbb79aa8..3fd42e0fd 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -184,7 +184,7 @@ struct HeightMap
};
/** Global height map instance */
-static HeightMap _height_map = {NULL, 0, 0, 0, 0};
+static HeightMap _height_map = {nullptr, 0, 0, 0, 0};
/** Conversion: int to height_t */
#define I2H(i) ((i) << height_decimal_bits)
@@ -325,7 +325,7 @@ static inline bool AllocHeightMap()
static inline void FreeHeightMap()
{
free(_height_map.h);
- _height_map.h = NULL;
+ _height_map.h = nullptr;
}
/**
@@ -349,7 +349,7 @@ static inline height_t RandomHeight(amplitude_t rMax)
static void HeightMapGenerate()
{
/* Trying to apply noise to uninitialized height map */
- assert(_height_map.h != NULL);
+ assert(_height_map.h != nullptr);
int start = max(MAX_TGP_FREQUENCIES - (int)min(MapLogX(), MapLogY()), 0);
bool first = true;
@@ -423,9 +423,9 @@ static void HeightMapGetMinMaxAvg(height_t *min_ptr, height_t *max_ptr, height_t
h_avg = (height_t)(h_accu / (_height_map.size_x * _height_map.size_y));
/* Return required results */
- if (min_ptr != NULL) *min_ptr = h_min;
- if (max_ptr != NULL) *max_ptr = h_max;
- if (avg_ptr != NULL) *avg_ptr = h_avg;
+ if (min_ptr != nullptr) *min_ptr = h_min;
+ if (max_ptr != nullptr) *max_ptr = h_max;
+ if (avg_ptr != nullptr) *avg_ptr = h_avg;
}
/** Dill histogram and return pointer to its base point - to the count of zero heights */
@@ -1011,5 +1011,5 @@ void GenerateTerrainPerlin()
IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
FreeHeightMap();
- GenerateWorldSetAbortCallback(NULL);
+ GenerateWorldSetAbortCallback(nullptr);
}