mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-28 08:59:09 +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
@@ -45,7 +45,7 @@
|
||||
{
|
||||
CCountedPtr<Text> counter(name);
|
||||
|
||||
EnforcePrecondition(false, name != NULL);
|
||||
EnforcePrecondition(false, name != nullptr);
|
||||
const char *text = name->GetDecodedText();
|
||||
EnforcePreconditionEncodedText(false, text);
|
||||
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_COMPANY_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
||||
@@ -56,7 +56,7 @@
|
||||
/* static */ char *ScriptCompany::GetName(ScriptCompany::CompanyID company)
|
||||
{
|
||||
company = ResolveCompanyID(company);
|
||||
if (company == COMPANY_INVALID) return NULL;
|
||||
if (company == COMPANY_INVALID) return nullptr;
|
||||
|
||||
::SetDParam(0, company);
|
||||
return GetString(STR_COMPANY_NAME);
|
||||
@@ -66,7 +66,7 @@
|
||||
{
|
||||
CCountedPtr<Text> counter(name);
|
||||
|
||||
EnforcePrecondition(false, name != NULL);
|
||||
EnforcePrecondition(false, name != nullptr);
|
||||
const char *text = name->GetDecodedText();
|
||||
EnforcePreconditionEncodedText(false, text);
|
||||
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_PRESIDENT_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
||||
@@ -312,7 +312,7 @@
|
||||
if ((::LiveryScheme)scheme < LS_BEGIN || (::LiveryScheme)scheme >= LS_END) return COLOUR_INVALID;
|
||||
|
||||
const Company *c = ::Company::GetIfValid(_current_company);
|
||||
if (c == NULL) return COLOUR_INVALID;
|
||||
if (c == nullptr) return COLOUR_INVALID;
|
||||
|
||||
return (ScriptCompany::Colours)c->livery[scheme].colour1;
|
||||
}
|
||||
@@ -322,7 +322,7 @@
|
||||
if ((::LiveryScheme)scheme < LS_BEGIN || (::LiveryScheme)scheme >= LS_END) return COLOUR_INVALID;
|
||||
|
||||
const Company *c = ::Company::GetIfValid(_current_company);
|
||||
if (c == NULL) return COLOUR_INVALID;
|
||||
if (c == nullptr) return COLOUR_INVALID;
|
||||
|
||||
return (ScriptCompany::Colours)c->livery[scheme].colour2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user