summaryrefslogtreecommitdiff
path: root/src/townname.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/townname.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/townname.cpp')
-rw-r--r--src/townname.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/townname.cpp b/src/townname.cpp
index b6d55f1ef..d382adf34 100644
--- a/src/townname.cpp
+++ b/src/townname.cpp
@@ -31,7 +31,7 @@ TownNameParams::TownNameParams(const Town *t) :
grfid(t->townnamegrfid), // by default, use supplied data
type(t->townnametype)
{
- if (t->townnamegrfid != 0 && GetGRFTownName(t->townnamegrfid) == NULL) {
+ if (t->townnamegrfid != 0 && GetGRFTownName(t->townnamegrfid) == nullptr) {
/* Fallback to english original */
this->grfid = 0;
this->type = SPECSTR_TOWNNAME_ENGLISH;
@@ -92,7 +92,7 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names)
/* Check size and width */
if (Utf8StringLength(buf1) >= MAX_LENGTH_TOWN_NAME_CHARS) return false;
- if (town_names != NULL) {
+ if (town_names != nullptr) {
if (town_names->find(buf1) != town_names->end()) return false;
town_names->insert(buf1);
} else {
@@ -101,7 +101,7 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names)
/* We can't just compare the numbers since
* several numbers may map to a single name. */
const char *buf = t->name;
- if (buf == NULL) {
+ if (buf == nullptr) {
GetTownName(buf2, t, lastof(buf2));
buf = buf2;
}
@@ -504,8 +504,8 @@ static char *MakeFinnishTownName(char *buf, const char *last, uint32 seed)
char *end = buf - 1;
assert(end >= orig);
if (*end == 'i') *end = 'e';
- if (strstr(orig, "a") != NULL || strstr(orig, "o") != NULL || strstr(orig, "u") != NULL ||
- strstr(orig, "A") != NULL || strstr(orig, "O") != NULL || strstr(orig, "U") != NULL) {
+ if (strstr(orig, "a") != nullptr || strstr(orig, "o") != nullptr || strstr(orig, "u") != nullptr ||
+ strstr(orig, "A") != nullptr || strstr(orig, "O") != nullptr || strstr(orig, "U") != nullptr) {
buf = strecpy(buf, "la", last);
} else {
buf = strecpy(buf, "l\xC3\xA4", last);