Merge: Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Jonathan G Rennison
2019-04-11 18:14:13 +01:00
585 changed files with 6604 additions and 6604 deletions

View File

@@ -80,7 +80,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* Land info of nearby tiles */
case 0x60: return GetNearbyIndustryTileInformation(parameter, this->tile,
this->industry == NULL ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
this->industry == nullptr ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
/* Animation stage of nearby tiles */
case 0x61: {
@@ -103,7 +103,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* virtual */ uint32 IndustryTileScopeResolver::GetRandomBits() const
{
assert_tile(this->industry != NULL && IsValidTile(this->tile), this->tile);
assert_tile(this->industry != nullptr && IsValidTile(this->tile), this->tile);
assert_tile(this->industry->index == INVALID_INDUSTRY || IsTileType(this->tile, MP_INDUSTRY), this->tile);
return (this->industry->index != INVALID_INDUSTRY) ? GetIndustryRandomBits(this->tile) : 0;
@@ -111,7 +111,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* virtual */ uint32 IndustryTileScopeResolver::GetTriggers() const
{
assert_tile(this->industry != NULL && IsValidTile(this->tile), this->tile);
assert_tile(this->industry != nullptr && IsValidTile(this->tile), this->tile);
assert_tile(this->industry->index == INVALID_INDUSTRY || IsTileType(this->tile, MP_INDUSTRY), this->tile);
if (this->industry->index == INVALID_INDUSTRY) return 0;
return GetIndustryTriggers(this->tile);
@@ -125,7 +125,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
static const GRFFile *GetIndTileGrffile(IndustryGfx gfx)
{
const IndustryTileSpec *its = GetIndustryTileSpec(gfx);
return (its != NULL) ? its->grf_prop.grffile : NULL;
return (its != nullptr) ? its->grf_prop.grffile : nullptr;
}
/**
@@ -171,7 +171,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGro
uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile)
{
assert_tile(industry != NULL && IsValidTile(tile), tile);
assert_tile(industry != nullptr && IsValidTile(tile), tile);
assert_tile(industry->index == INVALID_INDUSTRY || IsTileType(tile, MP_INDUSTRY), tile);
IndustryTileResolverObject object(gfx_id, tile, industry, callback, param1, param2);
@@ -194,7 +194,7 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus
IndustryTileResolverObject object(gfx, ti->tile, i);
const SpriteGroup *group = object.Resolve();
if (group == NULL || group->type != SGT_TILELAYOUT) return false;
if (group == nullptr || group->type != SGT_TILELAYOUT) return false;
/* Limit the building stage to the number of stages supplied. */
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
@@ -259,7 +259,7 @@ struct IndustryAnimationBase : public AnimationBase<IndustryAnimationBase, Indus
void AnimateNewIndustryTile(TileIndex tile)
{
const IndustryTileSpec *itspec = GetIndustryTileSpec(GetIndustryGfx(tile));
if (itspec == NULL) return;
if (itspec == nullptr) return;
IndustryAnimationBase::AnimateTile(itspec, Industry::GetByTile(tile), tile, (itspec->special_flags & INDTILE_SPECIAL_NEXTFRAME_RANDOMBITS) != 0);
}
@@ -305,14 +305,14 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
IndustryGfx gfx = GetIndustryGfx(tile);
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
if (itspec->grf_prop.spritegroup[0] == NULL) return;
if (itspec->grf_prop.spritegroup[0] == nullptr) return;
IndustryTileResolverObject object(gfx, tile, ind, CBID_RANDOM_TRIGGER);
object.waiting_triggers = GetIndustryTriggers(tile) | trigger;
SetIndustryTriggers(tile, object.waiting_triggers); // store now for var 5F
const SpriteGroup *group = object.Resolve();
if (group == NULL) return;
if (group == nullptr) return;
/* Store remaining triggers. */
SetIndustryTriggers(tile, object.GetRemainingTriggers());
@@ -335,7 +335,7 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
*/
static void DoReseedIndustry(Industry *ind, uint32 reseed)
{
if (reseed == 0 || ind == NULL) return;
if (reseed == 0 || ind == nullptr) return;
uint16 random_bits = Random();
ind->random &= reseed;