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/command.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/command.cpp b/src/command.cpp index b914563fc..7f5dd4309 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -361,7 +361,7 @@ static const Command _command_proc_table[] = { }; /*! - * This function range-checks a cmd, and checks if the cmd is not NULL + * This function range-checks a cmd, and checks if the cmd is not nullptr * * @param cmd The integer value of a command * @return true if the command is valid (and got a CommandProc function) @@ -370,7 +370,7 @@ bool IsValidCommand(uint32 cmd) { cmd &= CMD_ID_MASK; - return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != NULL; + return cmd < lengthof(_command_proc_table) && _command_proc_table[cmd].proc != nullptr; } /*! @@ -594,7 +594,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac ShowCostOrIncomeAnimation(x, y, GetSlopePixelZ(x, y), res.GetCost()); } - if (!estimate_only && !only_sending && callback != NULL) { + if (!estimate_only && !only_sending && callback != nullptr) { callback(res, tile, p1, p2); } @@ -637,7 +637,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandProc *proc = _command_proc_table[cmd_id].proc; /* Shouldn't happen, but you never know when someone adds * NULLs to the _command_proc_table. */ - assert(proc != NULL); + assert(proc != nullptr); /* Command flags are used internally */ CommandFlags cmd_flags = GetCommandFlags(cmd); @@ -750,7 +750,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, /* update last build coordinate of company. */ if (tile != 0) { Company *c = Company::GetIfValid(_current_company); - if (c != NULL) c->last_build_coordinate = tile; + if (c != nullptr) c->last_build_coordinate = tile; } SubtractMoneyFromCompany(res2); |