mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-02 19:39:12 +00:00
Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
committed by
Michael Lutz
parent
3b4f224c0b
commit
7c8e7c6b6e
@@ -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);
|
||||
|
Reference in New Issue
Block a user