diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/newgrf_storage.h | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/newgrf_storage.h')
-rw-r--r-- | src/newgrf_storage.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h index a0c1558f8..e9155dc5c 100644 --- a/src/newgrf_storage.h +++ b/src/newgrf_storage.h @@ -70,7 +70,7 @@ struct PersistentStorageArray : BasePersistentStorageArray { TYPE *prev_storage; ///< Memory to store "old" states so we can revert them on the performance of test cases for commands etc. /** Simply construct the array */ - PersistentStorageArray() : prev_storage(NULL) + PersistentStorageArray() : prev_storage(nullptr) { memset(this->storage, 0, sizeof(this->storage)); } @@ -105,8 +105,8 @@ struct PersistentStorageArray : BasePersistentStorageArray { /* We do not have made a backup; lets do so */ if (AreChangesPersistent()) { - assert(this->prev_storage == NULL); - } else if (this->prev_storage == NULL) { + assert(this->prev_storage == nullptr); + } else if (this->prev_storage == nullptr) { this->prev_storage = MallocT<TYPE>(SIZE); memcpy(this->prev_storage, this->storage, sizeof(this->storage)); @@ -133,10 +133,10 @@ struct PersistentStorageArray : BasePersistentStorageArray { void ClearChanges() { - if (this->prev_storage != NULL) { + if (this->prev_storage != nullptr) { memcpy(this->storage, this->prev_storage, sizeof(this->storage)); free(this->prev_storage); - this->prev_storage = NULL; + this->prev_storage = nullptr; } } }; |