summaryrefslogtreecommitdiff
path: root/src/newgrf_class_func.h
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/newgrf_class_func.h
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/newgrf_class_func.h')
-rw-r--r--src/newgrf_class_func.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf_class_func.h b/src/newgrf_class_func.h
index c2a30992a..0a90bf80e 100644
--- a/src/newgrf_class_func.h
+++ b/src/newgrf_class_func.h
@@ -34,7 +34,7 @@ DEFINE_NEWGRF_CLASS_METHOD(void)::ResetClass()
this->ui_count = 0;
free(this->spec);
- this->spec = NULL;
+ this->spec = nullptr;
}
/** Reset the classes, i.e. clear everything. */
@@ -154,7 +154,7 @@ DEFINE_NEWGRF_CLASS_METHOD(Tid)::GetUIClass(uint index)
DEFINE_NEWGRF_CLASS_METHOD(const Tspec *)::GetSpec(uint index) const
{
/* If the custom spec isn't defined any more, then the GRF file probably was not loaded. */
- return index < this->GetSpecCount() ? this->spec[index] : NULL;
+ return index < this->GetSpecCount() ? this->spec[index] : nullptr;
}
/**
@@ -191,7 +191,7 @@ DEFINE_NEWGRF_CLASS_METHOD(int)::GetUIFromIndex(int index) const
* Retrieve a spec by GRF location.
* @param grfid GRF ID of spec.
* @param local_id Index within GRF file of spec.
- * @param index Pointer to return the index of the spec in its class. If NULL then not used.
+ * @param index Pointer to return the index of the spec in its class. If nullptr then not used.
* @return The spec.
*/
DEFINE_NEWGRF_CLASS_METHOD(const Tspec *)::GetByGrf(uint32 grfid, byte local_id, int *index)
@@ -201,15 +201,15 @@ DEFINE_NEWGRF_CLASS_METHOD(const Tspec *)::GetByGrf(uint32 grfid, byte local_id,
for (Tid i = (Tid)0; i < Tmax; i++) {
for (j = 0; j < classes[i].count; j++) {
const Tspec *spec = classes[i].spec[j];
- if (spec == NULL) continue;
+ if (spec == nullptr) continue;
if (spec->grf_prop.grffile->grfid == grfid && spec->grf_prop.local_id == local_id) {
- if (index != NULL) *index = j;
+ if (index != nullptr) *index = j;
return spec;
}
}
}
- return NULL;
+ return nullptr;
}
#undef DEFINE_NEWGRF_CLASS_METHOD