Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Henry Wilson
2019-04-10 22:07:06 +01:00
committed by Michael Lutz
parent 3b4f224c0b
commit 7c8e7c6b6e
463 changed files with 5674 additions and 5674 deletions

View File

@@ -34,7 +34,7 @@ static Slope GetTileSlopeGivenHeight(int hnorth, int hwest, int heast, int hsout
int hmines = min(heast, hsouth);
int hmin = min(hminnw, hmines);
if (h != NULL) *h = hmin;
if (h != nullptr) *h = hmin;
int hmaxnw = max(hnorth, hwest);
int hmaxes = max(heast, hsouth);
@@ -55,7 +55,7 @@ static Slope GetTileSlopeGivenHeight(int hnorth, int hwest, int heast, int hsout
/**
* Return the slope of a given tile inside the map.
* @param tile Tile to compute slope of
* @param h If not \c NULL, pointer to storage of z height
* @param h If not \c nullptr, pointer to storage of z height
* @return Slope of the tile, except for the HALFTILE part
*/
Slope GetTileSlope(TileIndex tile, int *h)
@@ -78,7 +78,7 @@ Slope GetTileSlope(TileIndex tile, int *h)
*
* @param x X coordinate of the tile to compute slope of, may be ouside the map.
* @param y Y coordinate of the tile to compute slope of, may be ouside the map.
* @param h If not \c NULL, pointer to storage of z height.
* @param h If not \c nullptr, pointer to storage of z height.
* @return Slope of the tile, except for the HALFTILE part.
*/
Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h)
@@ -89,14 +89,14 @@ Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h)
int hsouth = TileHeightOutsideMap(x + 1, y + 1); // S corner.
Slope s = GetTileSlopeGivenHeight(hnorth, hwest, heast, hsouth, h);
if (h != NULL) *h *= TILE_HEIGHT;
if (h != nullptr) *h *= TILE_HEIGHT;
return s;
}
/**
* Check if a given tile is flat
* @param tile Tile to check
* @param h If not \c NULL, pointer to storage of z height (only if tile is flat)
* @param h If not \c nullptr, pointer to storage of z height (only if tile is flat)
* @return Whether the tile is flat
*/
bool IsTileFlat(TileIndex tile, int *h)
@@ -111,7 +111,7 @@ bool IsTileFlat(TileIndex tile, int *h)
if (TileHeight(TileXY(x1, y2)) != z) return false;
if (TileHeight(TileXY(x2, y2)) != z) return false;
if (h != NULL) *h = z;
if (h != nullptr) *h = z;
return true;
}