summaryrefslogtreecommitdiff
path: root/src/core/smallmatrix_type.hpp
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/core/smallmatrix_type.hpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/core/smallmatrix_type.hpp')
-rw-r--r--src/core/smallmatrix_type.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/smallmatrix_type.hpp b/src/core/smallmatrix_type.hpp
index cd4dee4e3..faa531d5f 100644
--- a/src/core/smallmatrix_type.hpp
+++ b/src/core/smallmatrix_type.hpp
@@ -46,13 +46,13 @@ protected:
public:
- SmallMatrix() : data(NULL), width(0), height(0), capacity(0) {}
+ SmallMatrix() : data(nullptr), width(0), height(0), capacity(0) {}
/**
* Copy constructor.
* @param other The other matrix to copy.
*/
- SmallMatrix(const SmallMatrix &other) : data(NULL), width(0), height(0), capacity(0)
+ SmallMatrix(const SmallMatrix &other) : data(nullptr), width(0), height(0), capacity(0)
{
this->Assign(other);
}
@@ -112,7 +112,7 @@ public:
this->width = 0;
this->capacity = 0;
free(this->data);
- this->data = NULL;
+ this->data = nullptr;
}
/**
@@ -216,8 +216,8 @@ public:
inline void Resize(uint new_width, uint new_height)
{
uint new_capacity = new_width * new_height;
- T *new_data = NULL;
- void (*copy)(T *dest, const T *src, size_t count) = NULL;
+ T *new_data = nullptr;
+ void (*copy)(T *dest, const T *src, size_t count) = nullptr;
if (new_capacity > this->capacity) {
/* If the data doesn't fit into current capacity, resize and copy ... */
new_data = MallocT<T>(new_capacity);