From 887c8c317aa8b142ebf6470a98552d8b64f5ca08 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 14 Sep 2026 19:29:13 +0300
Subject: [PATCH 67/67] generator/: Replace NULL with nullptr

See RM #2246

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/generator/mapgen_topology.c | 21 ++++++++++-----------
 server/generator/temperature_map.c | 17 +++++++++--------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/server/generator/mapgen_topology.c b/server/generator/mapgen_topology.c
index 38b904abc0..c79fe84767 100644
--- a/server/generator/mapgen_topology.c
+++ b/server/generator/mapgen_topology.c
@@ -28,17 +28,17 @@
 int ice_base_colatitude = 0 ;
 
 /************************************************************************//**
-  Returns the colatitude of this map position.  This is a value in the
+  Returns the colatitude of this map position. This is a value in the
   range of 0 to MAX_COLATITUDE (inclusive).
-  This function is wanted to concentrate the topology information
-  all generator code has to use  colatitude and others topology safe
-  functions instead (x,y) coordinate to place terrains
-  colatitude is 0 at poles and MAX_COLATITUDE at equator
+  This function is wanted to concentrate the topology information.
+  All generator code has to use colatitude and other topology safe
+  functions instead (x, y) coordinate to place terrains.
+  Colatitude is 0 at poles and MAX_COLATITUDE at equator.
 ****************************************************************************/
 int map_colatitude(const struct tile *ptile)
 {
   int latitude;
-  fc_assert_ret_val(ptile != NULL, MAX_COLATITUDE / 2);
+  fc_assert_ret_val(ptile != nullptr, MAX_COLATITUDE / 2);
 
   latitude = map_signed_latitude(ptile);
   latitude = MAX(latitude, -latitude);
@@ -47,7 +47,7 @@ int map_colatitude(const struct tile *ptile)
 }
 
 /************************************************************************//**
-  Return TRUE if the map in a typical city radius is SINGULAR.  This is
+  Return TRUE if the map in a typical city radius is SINGULAR. This is
   used to avoid putting (non-polar) land near the edge of the map.
 ****************************************************************************/
 bool near_singularity(const struct tile *ptile)
@@ -55,7 +55,6 @@ bool near_singularity(const struct tile *ptile)
   return is_singular_tile(ptile, CITY_MAP_DEFAULT_RADIUS);
 }
 
-
 /************************************************************************//**
   Set the map xsize and ysize based on a base size and ratio (in natural
   coordinates).
@@ -91,7 +90,7 @@ static void set_sizes(double size, int Xratio, int Yratio)
    */
   const int i_size
     = sqrt((float)(size)
-	   / (float)(Xratio * Yratio * iso * even * even)) + 0.49;
+           / (float)(Xratio * Yratio * iso * even * even)) + 0.49;
 
   /* Now build xsize and ysize value as described above. */
   wld.map.xsize = Xratio * i_size * even;
@@ -129,8 +128,8 @@ static void set_sizes(double size, int Xratio, int Yratio)
 /************************************************************************//**
   Return the default ratios for known topologies.
 
- The factor x_ratio * y_ratio determines the accuracy of the size.
- Small ratios work better than large ones; 3:2 is not the same as 6:4
+  The factor x_ratio * y_ratio determines the accuracy of the size.
+  Small ratios work better than large ones; 3:2 is not the same as 6:4
 ****************************************************************************/
 static void get_ratios(int *x_ratio, int *y_ratio)
 {
diff --git a/server/generator/temperature_map.c b/server/generator/temperature_map.c
index cf43e1eb2b..9c958ce5e4 100644
--- a/server/generator/temperature_map.c
+++ b/server/generator/temperature_map.c
@@ -72,11 +72,11 @@ static char *tmap_y2str(int ycoor)
 #endif /* FREECIV_DEBUG */
 
 /**********************************************************************//**
-  Return TRUE if temperateure_map is initialized
+  Return TRUE if temperature_map is initialized
 **************************************************************************/
 bool temperature_is_initialized(void)
 {
-  return temperature_map != NULL;
+  return temperature_map != nullptr;
 }
 
 /**********************************************************************//**
@@ -95,7 +95,7 @@ bool is_temperature_type_near(const struct tile *ptile, temperature_type tt)
   adjc_iterate(&(wld.map), ptile, tile1) {
     if (BOOL_VAL(tmap(tile1) & (tt))) {
       return TRUE;
-    };
+    }
   } adjc_iterate_end;
 
   return FALSE;
@@ -106,14 +106,15 @@ bool is_temperature_type_near(const struct tile *ptile, temperature_type tt)
 **************************************************************************/
 void destroy_tmap(void)
 {
-  fc_assert_ret(NULL != temperature_map);
+  fc_assert_ret(temperature_map != nullptr);
+
   free(temperature_map);
-  temperature_map = NULL;
+  temperature_map = nullptr;
 }
 
 /**********************************************************************//**
-  Initialize the temperature_map
-  if arg is FALSE, create a dummy tmap == map_colatitude
+  Initialize the temperature_map.
+  If arg is FALSE, create a dummy tmap == map_colatitude
   to be used if hmap or oceans are not placed gen 2-4
 **************************************************************************/
 void create_tmap(bool real)
@@ -123,7 +124,7 @@ void create_tmap(bool real)
   /* If map is defined this is not changed. */
   /* TODO: Load if from scenario game with tmap */
   /* to debug, never load at this time */
-  fc_assert_ret(NULL == temperature_map);
+  fc_assert_ret(temperature_map == nullptr);
 
   temperature_map = fc_malloc(sizeof(*temperature_map) * MAP_INDEX_SIZE);
   whole_map_iterate(&(wld.map), ptile) {
-- 
2.53.0

