From 52899294ee625a9111fe6d15907ae4c2c2c1c5d5 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 24 May 2025 12:52:13 +0300
Subject: [PATCH 72/72] nation.[ch]: Replace NULL with nullptr

See RM #1438

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/nation.c | 207 ++++++++++++++++++++++++++++--------------------
 common/nation.h |  14 ++--
 2 files changed, 131 insertions(+), 90 deletions(-)

diff --git a/common/nation.c b/common/nation.c
index fe262b1373..422e253c20 100644
--- a/common/nation.c
+++ b/common/nation.c
@@ -43,7 +43,7 @@ struct nation_set {
   char description[MAX_LEN_MSG];
 };
 
-static struct nation_type *nations = NULL;
+static struct nation_type *nations = nullptr;
 
 static int num_nation_sets;
 static struct nation_set nation_sets[MAX_NUM_NATION_SETS];
@@ -75,10 +75,10 @@ static inline bool nation_check(const struct nation_type *pnation,
     }
     return FALSE;
   }
-  if (NULL == pnation) {
+  if (pnation == nullptr) {
     if (do_output) {
       do_log(file, function, line, TRUE, LOG_ERROR,
-             "This function has NULL nation argument.");
+             "This function has nullptr nation argument.");
     }
     return FALSE;
   }
@@ -229,7 +229,8 @@ struct nation_leader {
 const struct nation_leader_list *
 nation_leaders(const struct nation_type *pnation)
 {
-  NATION_CHECK(pnation, return NULL);
+  NATION_CHECK(pnation, return nullptr);
+
   return pnation->leaders;
 }
 
@@ -241,12 +242,14 @@ struct nation_leader *nation_leader_new(struct nation_type *pnation,
 {
   struct nation_leader *pleader;
 
-  NATION_CHECK(pnation, return NULL);
+  NATION_CHECK(pnation, return nullptr);
+
   pleader = fc_malloc(sizeof(*pleader));
   pleader->name = fc_strdup(name);
   pleader->is_male = is_male;
 
   nation_leader_list_append(pnation->leaders, pleader);
+
   return pleader;
 }
 
@@ -260,19 +263,21 @@ static void nation_leader_destroy(struct nation_leader *pleader)
 }
 
 /************************************************************************//**
-  Returns the nation leader structure which match 'name' or NULL if not
+  Returns the nation leader structure which match 'name' or nullptr if not
   found.
 ****************************************************************************/
 struct nation_leader *
 nation_leader_by_name(const struct nation_type *pnation, const char *name)
 {
-  NATION_CHECK(pnation, return NULL);
+  NATION_CHECK(pnation, return nullptr);
+
   nation_leader_list_iterate(pnation->leaders, pleader) {
-    if (0 == fc_strcasecmp(name, pleader->name)) {
+    if (!fc_strcasecmp(name, pleader->name)) {
       return pleader;
     }
   } nation_leader_list_iterate_end;
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -280,7 +285,8 @@ nation_leader_by_name(const struct nation_type *pnation, const char *name)
 ****************************************************************************/
 const char *nation_leader_name(const struct nation_leader *pleader)
 {
-  fc_assert_ret_val(NULL != pleader, NULL);
+  fc_assert_ret_val(pleader != nullptr, nullptr);
+
   return pleader->name;
 }
 
@@ -289,7 +295,8 @@ const char *nation_leader_name(const struct nation_leader *pleader)
 ****************************************************************************/
 bool nation_leader_is_male(const struct nation_leader *pleader)
 {
-  fc_assert_ret_val(NULL != pleader, TRUE);
+  fc_assert_ret_val(pleader != nullptr, TRUE);
+
   return pleader->is_male;
 }
 
@@ -299,7 +306,7 @@ bool nation_leader_is_male(const struct nation_leader *pleader)
 const char *nation_legend_translation(const struct nation_type *pnation,
                                       const char *legend)
 {
-  if (pnation->translation_domain == NULL) {
+  if (pnation->translation_domain == nullptr) {
     return _(legend);
   }
 
@@ -330,8 +337,9 @@ struct nation_city {
 const struct nation_city_list *
 nation_cities(const struct nation_type *pnation)
 {
-  NATION_CHECK(pnation, return NULL);
-  fc_assert_ret_val(is_server(), NULL);
+  NATION_CHECK(pnation, return nullptr);
+
+  fc_assert_ret_val(is_server(), nullptr);
 
   return pnation->server.default_cities;
 }
@@ -344,14 +352,16 @@ struct nation_city *nation_city_new(struct nation_type *pnation,
 {
   struct nation_city *pncity;
 
-  NATION_CHECK(pnation, return NULL);
-  fc_assert_ret_val(is_server(), NULL);
+  NATION_CHECK(pnation, return nullptr);
+
+  fc_assert_ret_val(is_server(), nullptr);
+  fc_assert(NCP_NONE == 0);
 
-  fc_assert(0 == NCP_NONE);
   pncity = fc_calloc(1, sizeof(*pncity));       /* Set NCP_NONE. */
   pncity->name = fc_strdup(name);
 
   nation_city_list_append(pnation->server.default_cities, pncity);
+
   return pncity;
 }
 
@@ -391,8 +401,9 @@ void nation_city_set_terrain_preference(struct nation_city *pncity,
                                         const struct terrain *pterrain,
                                         enum nation_city_preference prefer)
 {
-  fc_assert_ret(NULL != pncity);
-  fc_assert_ret(NULL != pterrain);
+  fc_assert_ret(pncity != nullptr);
+  fc_assert_ret(pterrain != nullptr);
+
   pncity->terrain[terrain_index(pterrain)] = prefer;
 }
 
@@ -402,7 +413,8 @@ void nation_city_set_terrain_preference(struct nation_city *pncity,
 void nation_city_set_river_preference(struct nation_city *pncity,
                                       enum nation_city_preference prefer)
 {
-  fc_assert_ret(NULL != pncity);
+  fc_assert_ret(pncity != nullptr);
+
   pncity->river = prefer;
 }
 
@@ -411,7 +423,8 @@ void nation_city_set_river_preference(struct nation_city *pncity,
 ****************************************************************************/
 const char *nation_city_name(const struct nation_city *pncity)
 {
-  fc_assert_ret_val(NULL != pncity, NULL);
+  fc_assert_ret_val(pncity != nullptr, nullptr);
+
   return pncity->name;
 }
 
@@ -422,8 +435,9 @@ enum nation_city_preference
 nation_city_terrain_preference(const struct nation_city *pncity,
                                const struct terrain *pterrain)
 {
-  fc_assert_ret_val(NULL != pncity, NCP_DISLIKE);
-  fc_assert_ret_val(NULL != pterrain, NCP_DISLIKE);
+  fc_assert_ret_val(pncity != nullptr, NCP_DISLIKE);
+  fc_assert_ret_val(pterrain != nullptr, NCP_DISLIKE);
+
   return pncity->terrain[terrain_index(pterrain)];
 }
 
@@ -433,18 +447,20 @@ nation_city_terrain_preference(const struct nation_city *pncity,
 enum nation_city_preference
 nation_city_river_preference(const struct nation_city *pncity)
 {
-  fc_assert_ret_val(NULL != pncity, NCP_DISLIKE);
+  fc_assert_ret_val(pncity != nullptr, NCP_DISLIKE);
+
   return pncity->river;
 }
 
-
 /************************************************************************//**
   Return the nation of a player.
 ****************************************************************************/
 struct nation_type *nation_of_player(const struct player *pplayer)
 {
-  fc_assert_ret_val(NULL != pplayer, NULL);
-  NATION_CHECK(pplayer->nation, return NULL);
+  fc_assert_ret_val(pplayer != nullptr, nullptr);
+
+  NATION_CHECK(pplayer->nation, return nullptr);
+
   return pplayer->nation;
 }
 
@@ -453,7 +469,8 @@ struct nation_type *nation_of_player(const struct player *pplayer)
 ****************************************************************************/
 struct nation_type *nation_of_city(const struct city *pcity)
 {
-  fc_assert_ret_val(pcity != NULL, NULL);
+  fc_assert_ret_val(pcity != nullptr, nullptr);
+
   return nation_of_player(city_owner(pcity));
 }
 
@@ -462,21 +479,23 @@ struct nation_type *nation_of_city(const struct city *pcity)
 ****************************************************************************/
 struct nation_type *nation_of_unit(const struct unit *punit)
 {
-  fc_assert_ret_val(punit != NULL, NULL);
+  fc_assert_ret_val(punit != nullptr, nullptr);
+
   return nation_of_player(unit_owner(punit));
 }
 
 /************************************************************************//**
   Return the nation with the given index.
 
-  This function returns NULL for an out-of-range index (some callers
+  This function returns nullptr for an out-of-range index (some callers
   rely on this).
 ****************************************************************************/
 struct nation_type *nation_by_number(const Nation_type_id nation)
 {
   if (nation < 0 || nation >= game.control.nation_count) {
-    return NULL;
+    return nullptr;
   }
+
   return nations + nation;
 }
 
@@ -485,7 +504,8 @@ struct nation_type *nation_by_number(const Nation_type_id nation)
 ****************************************************************************/
 Nation_type_id nation_number(const struct nation_type *pnation)
 {
-  fc_assert_ret_val(NULL != pnation, -1);
+  fc_assert_ret_val(pnation != nullptr, -1);
+
   return pnation->item_number;
 }
 
@@ -497,7 +517,8 @@ Nation_type_id nation_number(const struct nation_type *pnation)
 ****************************************************************************/
 Nation_type_id nation_index(const struct nation_type *pnation)
 {
-  fc_assert_ret_val(NULL != pnation, -1);
+  fc_assert_ret_val(pnation != nullptr, -1);
+
   return pnation - nations;
 }
 
@@ -560,11 +581,13 @@ struct iterator *nation_iter_init(struct nation_iter *it)
   it->vtable.get = nation_iter_get;
   it->vtable.valid = nation_iter_valid;
   it->p = nations;
-  if (nations == NULL) {
-    it->end = NULL;
+
+  if (nations == nullptr) {
+    it->end = nullptr;
   } else {
     it->end = nations + nation_count();
   }
+
   return ITERATOR(it);
 }
 
@@ -576,7 +599,7 @@ static void nation_init(struct nation_type *pnation)
   memset(pnation, 0, sizeof(*pnation));
 
   pnation->item_number = pnation - nations;
-  pnation->translation_domain = NULL;
+  pnation->translation_domain = nullptr;
   pnation->leaders = nation_leader_list_new_full(nation_leader_destroy);
   pnation->sets = nation_set_list_new();
   pnation->groups = nation_group_list_new();
@@ -587,7 +610,7 @@ static void nation_init(struct nation_type *pnation)
     pnation->server.civilwar_nations = nation_list_new();
     pnation->server.parent_nations = nation_list_new();
     pnation->server.conflicts_with = nation_list_new();
-    /* server.rgb starts out NULL */
+    /* server.rgb starts out nullptr */
     pnation->server.traits = fc_calloc(TRAIT_COUNT,
                                        sizeof(*pnation->server.traits));
   }
@@ -638,7 +661,7 @@ void nations_free(void)
 {
   int i;
 
-  if (NULL == nations) {
+  if (nations == nullptr) {
     return;
   }
 
@@ -647,13 +670,13 @@ void nations_free(void)
   }
 
   free(nations);
-  nations = NULL;
+  nations = nullptr;
   game.control.nation_count = 0;
 }
 
 /************************************************************************//**
   Returns initial government type for this nation.
-  Always returns non-NULL -- nation-specific government or failing that
+  Always returns non-nullptr -- nation-specific government or failing that
   ruleset default government.
 ****************************************************************************/
 struct government *init_government_of_nation(const struct nation_type *pnation)
@@ -676,12 +699,13 @@ struct nation_style *style_of_nation(const struct nation_type *pnation)
 }
 
 /************************************************************************//**
-  Returns nation's player color preference, or NULL if none.
+  Returns nation's player color preference, or nullptr if none.
   Server only function.
 ****************************************************************************/
 const struct rgbcolor *nation_color(const struct nation_type *pnation)
 {
-  NATION_CHECK(pnation, return NULL);
+  NATION_CHECK(pnation, return nullptr);
+
   return pnation->server.rgb;
 }
 
@@ -698,7 +722,8 @@ int nation_set_count(void)
 ****************************************************************************/
 int nation_set_index(const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pset, -1);
+  fc_assert_ret_val(pset != nullptr, -1);
+
   return pset - nation_sets;
 }
 
@@ -722,30 +747,32 @@ struct nation_set *nation_set_new(const char *set_name,
   if (game.control.num_nation_sets <= num_nation_sets) {
     log_error("More nation sets than reported (%d).",
               game.control.num_nation_sets);
-    return NULL;
+    return nullptr;
   }
 
   if (MAX_NUM_NATION_SETS <= num_nation_sets) {
     log_error("Too many nation sets (%d is the maximum).",
               MAX_NUM_NATION_SETS);
-    return NULL;
+    return nullptr;
   }
 
   /* Print the name and truncate if needed. */
   pset = nation_sets + num_nation_sets;
-  names_set(&pset->name, NULL, set_name, set_rule_name);
+  names_set(&pset->name, nullptr, set_name, set_rule_name);
   (void) sz_loud_strlcpy(pset->description, set_description,
                          "Nation set description \"%s\" too long; truncating.");
 
-  if (NULL != nation_set_by_rule_name(rule_name_get(&pset->name))) {
+  if (nation_set_by_rule_name(rule_name_get(&pset->name)) != nullptr) {
     log_error("Duplicate nation set name %s.", rule_name_get(&pset->name));
-    return NULL;
+
+    return nullptr;
   }
 
-  if (NULL != nation_group_by_rule_name(rule_name_get(&pset->name))) {
+  if (nation_group_by_rule_name(rule_name_get(&pset->name)) != nullptr) {
     log_error("Nation set name %s is already used for a group.",
               rule_name_get(&pset->name));
-    return NULL;
+
+    return nullptr;
   }
 
   num_nation_sets++;
@@ -756,7 +783,7 @@ struct nation_set *nation_set_new(const char *set_name,
 /************************************************************************//**
   Return the nation set with the given index.
 
-  This function returns NULL for an out-of-range index (some callers
+  This function returns nullptr for an out-of-range index (some callers
   rely on this).
 ****************************************************************************/
 struct nation_set *nation_set_by_number(int id)
@@ -766,7 +793,7 @@ struct nation_set *nation_set_by_number(int id)
    * of sets (game.control.num_nation_sets) and not
    * what we have already set up (num_nation_sets) */
   if (id < 0 || id >= game.control.num_nation_sets) {
-    return NULL;
+    return nullptr;
   }
 
   return nation_sets + id;
@@ -774,7 +801,7 @@ struct nation_set *nation_set_by_number(int id)
 
 /************************************************************************//**
   Return the nation set that has the given (untranslated) rule name.
-  Returns NULL if no set is found.
+  Returns nullptr if no set is found.
 ****************************************************************************/
 struct nation_set *nation_set_by_rule_name(const char *name)
 {
@@ -786,7 +813,7 @@ struct nation_set *nation_set_by_rule_name(const char *name)
     }
   } nation_sets_iterate_end;
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -796,7 +823,8 @@ struct nation_set *nation_set_by_rule_name(const char *name)
 ****************************************************************************/
 const char *nation_set_untranslated_name(const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
+
   return untranslated_name(&pset->name);
 }
 
@@ -806,7 +834,7 @@ const char *nation_set_untranslated_name(const struct nation_set *pset)
 ****************************************************************************/
 const char *nation_set_rule_name(const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
 
   return rule_name_get(&pset->name);
 }
@@ -817,7 +845,8 @@ const char *nation_set_rule_name(const struct nation_set *pset)
 ****************************************************************************/
 const char *nation_set_name_translation(const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
+
   return name_translation_get(&pset->name);
 }
 
@@ -827,7 +856,8 @@ const char *nation_set_name_translation(const struct nation_set *pset)
 ****************************************************************************/
 const char *nation_set_description(const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
+
   return pset->description;
 }
 
@@ -837,13 +867,14 @@ const char *nation_set_description(const struct nation_set *pset)
 bool nation_is_in_set(const struct nation_type *pnation,
                       const struct nation_set *pset)
 {
-  fc_assert_ret_val(NULL != pnation, FALSE);
+  fc_assert_ret_val(pnation != nullptr, FALSE);
 
   nation_set_list_iterate(pnation->sets, aset) {
     if (aset == pset) {
       return TRUE;
     }
   } nation_set_list_iterate_end;
+
   return FALSE;
 }
 
@@ -858,18 +889,18 @@ bool nation_is_in_set(const struct nation_type *pnation,
 ****************************************************************************/
 struct nation_set *nation_set_by_setting_value(const char *setting)
 {
-  struct nation_set *pset = NULL;
+  struct nation_set *pset = nullptr;
 
   if (strlen(setting) > 0) {
     pset = nation_set_by_rule_name(setting);
   }
-  if (pset == NULL) {
+  if (pset == nullptr) {
     /* Either no nation set specified, or the specified one isn't in the
      * current ruleset. Default to the first nation set specified by
      * the ruleset. */
     pset = nation_set_by_number(0);
   }
-  fc_assert(pset != NULL);
+  fc_assert(pset != nullptr);
 
   return pset;
 }
@@ -942,7 +973,8 @@ int nation_group_count(void)
 ****************************************************************************/
 int nation_group_index(const struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pgroup, -1);
+  fc_assert_ret_val(pgroup != nullptr, -1);
+
   return pgroup - nation_groups;
 }
 
@@ -964,27 +996,29 @@ struct nation_group *nation_group_new(const char *name)
   if (game.control.num_nation_groups <= num_nation_groups) {
     log_error("More nation groups than reported (%d).",
               game.control.num_nation_groups);
-    return NULL;
+    return nullptr;
   }
 
    if (MAX_NUM_NATION_GROUPS <= num_nation_groups) {
     log_error("Too many nation groups (%d is the maximum).",
               MAX_NUM_NATION_GROUPS);
-    return NULL;
+    return nullptr;
   }
 
   /* Print the name and truncate if needed. */
   pgroup = nation_groups + num_nation_groups;
-  name_set(&pgroup->name, NULL, name);
-  if (NULL != nation_group_by_rule_name(rule_name_get(&pgroup->name))) {
+  name_set(&pgroup->name, nullptr, name);
+  if (nation_group_by_rule_name(rule_name_get(&pgroup->name)) != nullptr) {
     log_error("Duplicate nation group name %s.", rule_name_get(&pgroup->name));
-    return NULL;
+
+    return nullptr;
   }
 
-  if (NULL != nation_set_by_rule_name(rule_name_get(&pgroup->name))) {
+  if (nation_set_by_rule_name(rule_name_get(&pgroup->name)) != nullptr) {
     log_error("Nation group name %s is already used for a set.",
               rule_name_get(&pgroup->name));
-    return NULL;
+
+    return nullptr;
   }
 
   if (is_server()) {
@@ -998,7 +1032,7 @@ struct nation_group *nation_group_new(const char *name)
 /************************************************************************//**
   Return the nation group with the given index.
 
-  This function returns NULL for an out-of-range index (some callers
+  This function returns nullptr for an out-of-range index (some callers
   rely on this).
 ****************************************************************************/
 struct nation_group *nation_group_by_number(int id)
@@ -1008,7 +1042,7 @@ struct nation_group *nation_group_by_number(int id)
    * of groups (game.control.num_nation_groups) and not
    * what we have already set up (num_nation_groups) */
   if (id < 0 || id >= game.control.num_nation_groups) {
-    return NULL;
+    return nullptr;
   }
 
   return nation_groups + id;
@@ -1016,7 +1050,7 @@ struct nation_group *nation_group_by_number(int id)
 
 /************************************************************************//**
   Return the nation group that has the given (untranslated) rule name.
-  Returns NULL if no group is found.
+  Returns nullptr if no group is found.
 ****************************************************************************/
 struct nation_group *nation_group_by_rule_name(const char *name)
 {
@@ -1028,7 +1062,7 @@ struct nation_group *nation_group_by_rule_name(const char *name)
     }
   } nation_groups_iterate_end;
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -1036,7 +1070,8 @@ struct nation_group *nation_group_by_rule_name(const char *name)
 ****************************************************************************/
 void nation_group_set_hidden(struct nation_group *pgroup, bool hidden)
 {
-  fc_assert_ret(NULL != pgroup);
+  fc_assert_ret(pgroup != nullptr);
+
   pgroup->hidden = hidden;
 }
 
@@ -1047,7 +1082,8 @@ void nation_group_set_hidden(struct nation_group *pgroup, bool hidden)
 void nation_group_set_match(struct nation_group *pgroup, int match)
 {
   fc_assert_ret(is_server());
-  fc_assert_ret(NULL != pgroup);
+  fc_assert_ret(pgroup != nullptr);
+
   pgroup->server.match = match;
 }
 
@@ -1056,7 +1092,8 @@ void nation_group_set_match(struct nation_group *pgroup, int match)
 ****************************************************************************/
 bool is_nation_group_hidden(struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pgroup, TRUE);
+  fc_assert_ret_val(pgroup != nullptr, TRUE);
+
   return pgroup->hidden;
 }
 
@@ -1068,7 +1105,8 @@ bool is_nation_group_hidden(struct nation_group *pgroup)
 ****************************************************************************/
 const char *nation_group_untranslated_name(const struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pgroup, NULL);
+  fc_assert_ret_val(pgroup != nullptr, nullptr);
+
   return untranslated_name(&pgroup->name);
 }
 
@@ -1078,7 +1116,7 @@ const char *nation_group_untranslated_name(const struct nation_group *pgroup)
 ****************************************************************************/
 const char *nation_group_rule_name(const struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pgroup, NULL);
+  fc_assert_ret_val(pgroup != nullptr, nullptr);
 
   return rule_name_get(&pgroup->name);
 }
@@ -1089,7 +1127,8 @@ const char *nation_group_rule_name(const struct nation_group *pgroup)
 ****************************************************************************/
 const char *nation_group_name_translation(const struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pgroup, NULL);
+  fc_assert_ret_val(pgroup != nullptr, nullptr);
+
   return name_translation_get(&pgroup->name);
 }
 
@@ -1099,7 +1138,7 @@ const char *nation_group_name_translation(const struct nation_group *pgroup)
 bool nation_is_in_group(const struct nation_type *pnation,
                         const struct nation_group *pgroup)
 {
-  fc_assert_ret_val(NULL != pnation, FALSE);
+  fc_assert_ret_val(pnation != nullptr, FALSE);
 
   nation_group_list_iterate(pnation->groups, agroup) {
     if (agroup == pgroup) {
@@ -1185,12 +1224,12 @@ void nation_sets_groups_free(void)
   pregame.
 ****************************************************************************/
 bool can_conn_edit_players_nation(const struct connection *pconn,
-				  const struct player *pplayer)
+                                  const struct player *pplayer)
 {
   return (can_conn_edit(pconn)
           || (game.info.is_new_game
-	      && ((!pconn->observer && pconn->playing == pplayer)
-	           || pconn->access_level >= ALLOW_CTRL)));
+              && ((!pconn->observer && pconn->playing == pplayer)
+                  || pconn->access_level >= ALLOW_CTRL)));
 }
 
 /************************************************************************//**
diff --git a/common/nation.h b/common/nation.h
index 33373e5723..0deec2a516 100644
--- a/common/nation.h
+++ b/common/nation.h
@@ -27,7 +27,7 @@ extern "C" {
 
 struct rgbcolor;
 
-#define NO_NATION_SELECTED (NULL)
+#define NO_NATION_SELECTED (nullptr)
 
 /* Changing this value will break network compatibility. */
 #define NATION_NONE -1
@@ -115,13 +115,15 @@ struct nation_type {
   /* Groups which this nation is assigned to */
   struct nation_group_list *groups;
 
-  struct player *player; /* Who's using the nation, or NULL. */
+  struct player *player; /* Who's using the nation, or nullptr. */
 
   /* Items given to this nation at game start. */
   /* (Only used in the client for documentation purposes.) */
   int init_techs[MAX_NUM_TECH_LIST];
   int init_buildings[MAX_NUM_BUILDING_LIST];
-  struct government *init_government; /* use game default_government if NULL */
+
+  /* Use game default_government if nullptr */
+  struct government *init_government;
   struct unit_type *init_units[MAX_NUM_UNIT_LIST];
 
   union {
@@ -139,7 +141,7 @@ struct nation_type {
        * British and English. */
       struct nation_list *conflicts_with;
 
-      /* Nation's associated player color (NULL if none). */
+      /* Nation's associated player color (nullptr if none). */
       struct rgbcolor *rgb;
 
       struct trait_limits *traits;
@@ -211,7 +213,7 @@ bool is_nation_pickable(const struct nation_type *nation);
 bool is_nation_playable(const struct nation_type *nation);
 enum barbarian_type nation_barbarian_type(const struct nation_type *nation);
 bool can_conn_edit_players_nation(const struct connection *pconn,
-				  const struct player *pplayer);
+                                  const struct player *pplayer);
 
 /* General nation leader accessor functions. */
 const struct nation_leader_list *
@@ -326,7 +328,7 @@ struct nation_iter;
 size_t nation_iter_sizeof(void);
 struct iterator *nation_iter_init(struct nation_iter *it);
 
-/* Iterate over nations.  This iterates over _all_ nations, including
+/* Iterate over nations. This iterates over _all_ nations, including
  * unplayable ones (use is_nation_playable to filter if necessary).
  * This does not take account of the current nationset! -- on the
  * server, use allowed_nations_iterate() for that. */
-- 
2.47.2

