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/saveload/oldloader.h | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/saveload/oldloader.h')
-rw-r--r-- | src/saveload/oldloader.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/saveload/oldloader.h b/src/saveload/oldloader.h index 5483440ea..a2953196b 100644 --- a/src/saveload/oldloader.h +++ b/src/saveload/oldloader.h @@ -90,7 +90,7 @@ struct OldChunks { uint32 amount; ///< Amount of fields void *ptr; ///< Pointer where to save the data (may only be set if offset is 0) - uint offset; ///< Offset from basepointer (may only be set if ptr is NULL) + uint offset; ///< Offset from basepointer (may only be set if ptr is nullptr) OldChunkProc *proc; ///< Pointer to function that is called with OC_CHUNK }; @@ -125,12 +125,12 @@ static inline uint32 ReadUint32(LoadgameState *ls) * - OCL_CHUNK: load another proc to load a part of the savegame, 'amount' times * - OCL_ASSERT: to check if we are really at the place we expect to be.. because old savegames are too binary to be sure ;) */ -#define OCL_SVAR(type, base, offset) { type, 1, NULL, (uint)cpp_offsetof(base, offset), NULL } -#define OCL_VAR(type, amount, pointer) { type, amount, pointer, 0, NULL } -#define OCL_END() { OC_END, 0, NULL, 0, NULL } -#define OCL_CNULL(type, amount) { OC_NULL | type, amount, NULL, 0, NULL } -#define OCL_CCHUNK(type, amount, proc) { OC_CHUNK | type, amount, NULL, 0, proc } -#define OCL_ASSERT(type, size) { OC_ASSERT | type, 1, NULL, size, NULL } +#define OCL_SVAR(type, base, offset) { type, 1, nullptr, (uint)cpp_offsetof(base, offset), nullptr } +#define OCL_VAR(type, amount, pointer) { type, amount, pointer, 0, nullptr } +#define OCL_END() { OC_END, 0, nullptr, 0, nullptr } +#define OCL_CNULL(type, amount) { OC_NULL | type, amount, nullptr, 0, nullptr } +#define OCL_CCHUNK(type, amount, proc) { OC_CHUNK | type, amount, nullptr, 0, proc } +#define OCL_ASSERT(type, size) { OC_ASSERT | type, 1, nullptr, size, nullptr } #define OCL_NULL(amount) OCL_CNULL((OldChunkType)0, amount) #define OCL_CHUNK(amount, proc) OCL_CCHUNK((OldChunkType)0, amount, proc) |