From fb5ce8bdc46fe5f40b217d09b618fbcbdcea11a5 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 8 Jul 2025 16:58:30 +0300
Subject: [PATCH 80/80] settings.[ch]: Improve coding style

See RM #1589

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/settings.c | 685 ++++++++++++++++++++++++----------------------
 server/settings.h |  10 +-
 2 files changed, 370 insertions(+), 325 deletions(-)

diff --git a/server/settings.c b/server/settings.c
index 735276935d..6d3682fe1e 100644
--- a/server/settings.c
+++ b/server/settings.c
@@ -119,7 +119,7 @@ struct setting {
   enum sset_level slevel;
 
   /*
-   * About the *_validate functions: If the function is non-NULL, it
+   * About the *_validate functions: If the function is non-nullptr, it
    * is called with the new value, and returns whether the change is
    * legal. The char * is an error message in the case of reject.
    */
@@ -204,7 +204,7 @@ int settings_list_cmp(const struct setting *const *pset1,
                       const struct setting *const *pset2);
 
 #define settings_snprintf(_buf, _buf_len, format, ...)                      \
-  if (_buf != NULL) {                                                       \
+  if (_buf != nullptr) {                                                    \
     fc_snprintf(_buf, _buf_len, format, ## __VA_ARGS__);                    \
   }
 
@@ -239,7 +239,7 @@ static const struct sset_val_name *caravanbonusstyle_name(int caravanbonus)
   NAME_CASE(CBS_LOGARITHMIC, "LOGARITHMIC", N_("Log^2 N style"));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -253,7 +253,8 @@ static const struct sset_val_name *mapsize_name(int mapsize)
   NAME_CASE(MAPSIZE_PLAYER, "PLAYER", N_("Tiles per player"));
   NAME_CASE(MAPSIZE_XYSIZE, "XYSIZE", N_("Width and height"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -266,7 +267,7 @@ static const struct sset_val_name *topology_name(int topology_bit)
   NAME_CASE(TF_HEX, "HEX", N_("Hexagonal"));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -279,7 +280,7 @@ static const struct sset_val_name *wrap_name(int wrap_bit)
   NAME_CASE(WRAP_Y, "WRAPY", N_("Wrap North-South"));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -293,7 +294,7 @@ static const struct sset_val_name *traderevenuestyle_name(int revenue_style)
   NAME_CASE(TRS_SIMPLE, "SIMPLE", N_("Proportional to tile trade"));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -309,7 +310,8 @@ static const struct sset_val_name *generator_name(int generator)
   NAME_CASE(MAPGEN_FAIR, "FAIR", N_("Fair islands"));
   NAME_CASE(MAPGEN_FRACTURE, "FRACTURE", N_("Fracture map"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -329,7 +331,8 @@ static const struct sset_val_name *startpos_name(int startpos)
   NAME_CASE(MAPSTARTPOS_VARIABLE, "VARIABLE",
             N_("Depending on size of continents"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -349,7 +352,8 @@ static const struct sset_val_name *teamplacement_name(int team_placement)
   NAME_CASE(TEAM_PLACEMENT_VERTICAL, "VERTICAL",
             N_("Vertical placement"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -364,7 +368,7 @@ static const struct sset_val_name *persistentready_name(int persistent_ready)
             N_("As long as connected"));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -395,7 +399,7 @@ static const struct sset_val_name *autosaves_name(int autosaves_bit)
   NAME_CASE(AS_TIMER, "TIMER", N_("Timer"));
   };
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -411,7 +415,8 @@ static const struct sset_val_name *borders_name(int borders)
   NAME_CASE(BORDERS_EXPAND, "EXPAND",
             N_("Borders expand to unknown, revealing tiles"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -423,7 +428,8 @@ static const struct sset_val_name *trait_dist_name(int trait_dist)
   NAME_CASE(TDM_FIXED, "FIXED", N_("Fixed"));
   NAME_CASE(TDM_EVEN, "EVEN", N_("Even"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -438,7 +444,8 @@ static const struct sset_val_name *plrcol_name(int plrcol)
   NAME_CASE(PLRCOL_TEAM_ORDER,   "TEAM_ORDER",   N_("Per-team, in order"));
   NAME_CASE(PLRCOL_NATION_ORDER, "NATION_ORDER", N_("Per-nation, in order"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -451,7 +458,8 @@ static const struct sset_val_name *happyborders_name(int happyborders)
   NAME_CASE(HB_NATIONAL, "NATIONAL", N_("Happy within own borders"));
   NAME_CASE(HB_ALLIANCE, "ALLIED", N_("Happy within allied borders"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -469,7 +477,8 @@ static const struct sset_val_name *diplomacy_name(int diplomacy)
   NAME_CASE(DIPLO_FOR_TEAMS, "TEAM", N_("Restricted to teams"));
   NAME_CASE(DIPLO_DISABLED, "DISABLED", N_("Disabled for everyone"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -483,7 +492,8 @@ static const struct sset_val_name *citynames_name(int citynames)
   NAME_CASE(CNM_GLOBAL_UNIQUE, "GLOBAL_UNIQUE", N_("Globally unique"));
   NAME_CASE(CNM_NO_STEALING, "NO_STEALING", N_("No city name stealing"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -498,7 +508,8 @@ static const struct sset_val_name *barbarians_name(int barbarians)
   NAME_CASE(BARBS_FREQUENT, "FREQUENT", N_("Frequent barbarian uprising"));
   NAME_CASE(BARBS_HORDES, "HORDES", N_("Raging hordes"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -512,7 +523,8 @@ static const struct sset_val_name *revolentype_name(int revolentype)
   NAME_CASE(REVOLEN_QUICKENING, "QUICKENING", N_("First time 'revolen', then always quicker"));
   NAME_CASE(REVOLEN_RANDQUICK, "RANDQUICK", N_("Random, max always quicker"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -524,7 +536,8 @@ static const struct sset_val_name *revealmap_name(int bit)
   NAME_CASE(REVEAL_MAP_START, "START", N_("Reveal map at game start"));
   NAME_CASE(REVEAL_MAP_DEAD, "DEAD", N_("Unfog map for dead players"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -542,7 +555,8 @@ static const struct sset_val_name *airliftingstyle_name(int bit)
   NAME_CASE(AIRLIFTING_UNLIMITED_DEST, "DEST_UNLIMITED",
             N_("Unlimited units to destination city"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -556,20 +570,22 @@ static const struct sset_val_name *phasemode_name(int phasemode)
             "PLAYER", N_("All players alternate movement"));
   NAME_CASE(PMT_TEAMS_ALTERNATE, "TEAM", N_("Team alternate movement"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
   Scorelog level names accessor.
 ****************************************************************************/
 static const struct sset_val_name *
-scoreloglevel_name(enum scorelog_level sl_level) 
+scoreloglevel_name(enum scorelog_level sl_level)
 {
   switch (sl_level) {
   NAME_CASE(SL_ALL, "ALL",       N_("All players"));
   NAME_CASE(SL_HUMANS, "HUMANS", N_("Human players only"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -595,7 +611,7 @@ compresstype_name(enum fz_method compresstype)
 #endif
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -607,12 +623,12 @@ ailevel_name(enum ai_level lvl)
   const char *lvlname;
 
   if (lvl >= AI_LEVEL_AWAY) {
-    return NULL;
+    return nullptr;
   }
 
   lvlname = ai_level_name(lvl);
 
-  if (lvlname != NULL) {
+  if (lvlname != nullptr) {
     static struct sset_val_name name[AI_LEVEL_COUNT];
 
     name[lvl].support = lvlname;
@@ -621,7 +637,7 @@ ailevel_name(enum ai_level lvl)
     return &name[lvl];
   }
 
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -633,7 +649,8 @@ static const struct sset_val_name *bool_name(int enable)
   NAME_CASE(FALSE, "DISABLED", N_("disabled"));
   NAME_CASE(TRUE, "ENABLED", N_("enabled"));
   }
-  return NULL;
+
+  return nullptr;
 }
 
 #undef NAME_CASE
@@ -707,7 +724,7 @@ static void aifill_action(const struct setting *pset)
   const char *msg = aifill(*pset->integer.pvalue);
   if (msg) {
     log_normal(_("Warning: aifill not met: %s."), msg);
-    notify_conn(NULL, NULL, E_SETTING, ftc_server,
+    notify_conn(nullptr, nullptr, E_SETTING, ftc_server,
                 _("Warning: aifill not met: %s."), msg);
   }
 }
@@ -719,7 +736,7 @@ static void nationset_action(const struct setting *pset)
 {
   /* If any player's existing selection is invalid, abort it */
   players_iterate(pplayer) {
-    if (pplayer->nation != NULL) {
+    if (pplayer->nation != nullptr) {
       if (!nation_is_in_current_set(pplayer->nation)) {
         (void) player_set_nation(pplayer, NO_NATION_SELECTED);
         send_player_info_c(pplayer, game.est_connections);
@@ -737,7 +754,7 @@ static void nationset_action(const struct setting *pset)
    * accidentally and transiently set to an unintended value.
    * (However, new connections will start out detached.) */
   if (normal_player_count() > server.playable_nations) {
-    notify_conn(NULL, NULL, E_SETTING, ftc_server, "%s",
+    notify_conn(nullptr, nullptr, E_SETTING, ftc_server, "%s",
                 _("Warning: not enough nations in this nation set "
                   "for all current players."));
   }
@@ -753,11 +770,12 @@ static void plrcol_action(const struct setting *pset)
   if (!game_was_started()) {
     if (read_enum_value(pset) != PLRCOL_PLR_SET) {
       players_iterate(pplayer) {
-        server_player_set_color(pplayer, NULL);
+        server_player_set_color(pplayer, nullptr);
       } players_iterate_end;
     }
+
     /* Update clients with new color scheme. */
-    send_player_info_c(NULL, NULL);
+    send_player_info_c(nullptr, nullptr);
   }
 }
 
@@ -769,7 +787,7 @@ static void autotoggle_action(const struct setting *pset)
   if (*pset->boolean.pvalue) {
     players_iterate(pplayer) {
       if (is_human(pplayer) && !pplayer->is_connected) {
-        toggle_ai_player_direct(NULL, pplayer);
+        toggle_ai_player_direct(nullptr, pplayer);
         send_player_info_c(pplayer, game.est_connections);
       }
     } players_iterate_end;
@@ -789,7 +807,8 @@ static void timeout_action(const struct setting *pset)
       /* This may cause the current turn to end immediately. */
       game.tinfo.seconds_to_phasedone = timeout;
     }
-    send_game_info(NULL);
+
+    send_game_info(nullptr);
   }
 }
 
@@ -810,7 +829,8 @@ static void first_timeout_action(const struct setting *pset)
         game.tinfo.seconds_to_phasedone = game.info.timeout;
       }
     }
-    send_game_info(NULL);
+
+    send_game_info(nullptr);
   }
 }
 
@@ -891,7 +911,7 @@ static bool savename_validate(const char *value, struct connection *caller,
 {
   char buf[MAX_LEN_PATH];
 
-  generate_save_name(value, buf, sizeof(buf), NULL);
+  generate_save_name(value, buf, sizeof(buf), nullptr);
 
   if (!is_safe_filename(buf)) {
     settings_snprintf(reject_msg, reject_msg_len,
@@ -912,7 +932,7 @@ static bool generator_validate(int value, struct connection *caller,
 {
   if (map_is_empty()) {
     if (MAPGEN_SCENARIO == value
-        && (NULL != caller || !game.scenario.is_scenario)) {
+        && (caller != nullptr || !game.scenario.is_scenario)) {
       settings_snprintf(reject_msg, reject_msg_len,
                         _("You cannot disable the map generator."));
       return FALSE;
@@ -978,14 +998,14 @@ static bool autosaves_callback(unsigned value, struct connection *caller,
         && !(game.server.autosaves & (1 << AS_TIMER))) {
       game.server.save_timer = timer_renew(game.server.save_timer,
                                            TIMER_USER, TIMER_ACTIVE,
-                                           game.server.save_timer != NULL
-                                           ? NULL : "save interval");
+                                           game.server.save_timer != nullptr
+                                           ? nullptr : "save interval");
       timer_start(game.server.save_timer);
     } else if (!(value & (1 << AS_TIMER))
                && (game.server.autosaves & (1 << AS_TIMER))) {
       timer_stop(game.server.save_timer);
       timer_destroy(game.server.save_timer);
-      game.server.save_timer = NULL;
+      game.server.save_timer = nullptr;
     }
   }
 
@@ -1357,7 +1377,7 @@ static bool topology_callback(unsigned value, struct connection *caller,
 static bool aitype_callback(const char *value, struct connection *caller,
                             char *reject_msg, size_t reject_msg_len)
 {
-  if (ai_type_by_name(value) == NULL) {
+  if (ai_type_by_name(value) == nullptr) {
     settings_snprintf(reject_msg, reject_msg_len,
                       _("No such AI type loaded."));
 
@@ -1412,7 +1432,7 @@ static bool plrcol_validate(int value, struct connection *caller,
 #define GEN_BOOL(name, value, sclass, scateg, slevel, al_read, al_write,    \
                  short_help, extra_help, func_validate, func_action,        \
                  _default)                                                  \
-  {name, sclass, al_read, al_write, short_help, extra_help, NULL, SST_BOOL, \
+  {name, sclass, al_read, al_write, short_help, extra_help, nullptr, SST_BOOL, \
       scateg, slevel,                                                       \
       INIT_BRACE_BEGIN                                                      \
       .boolean = {&value, _default, func_validate, bool_name,               \
@@ -1432,7 +1452,7 @@ static bool plrcol_validate(int value, struct connection *caller,
 #define GEN_STRING(name, value, sclass, scateg, slevel, al_read, al_write, \
                    short_help, extra_help, func_validate, func_action,  \
                    _default)                                            \
-  {name, sclass, al_read, al_write, short_help, extra_help, NULL,       \
+  {name, sclass, al_read, al_write, short_help, extra_help, nullptr,    \
       SST_STRING, scateg, slevel,                                       \
       INIT_BRACE_BEGIN                                                  \
       .string = {value, _default, sizeof(value), func_validate, ""}     \
@@ -1442,7 +1462,7 @@ static bool plrcol_validate(int value, struct connection *caller,
 #define GEN_STRING_NRS(name, value, sclass, scateg, slevel, al_read, al_write, \
                        short_help, extra_help, func_validate, func_action, \
                        _default)                                        \
-  {name, sclass, al_read, al_write, short_help, extra_help, NULL,       \
+  {name, sclass, al_read, al_write, short_help, extra_help, nullptr,    \
       SST_STRING, scateg, slevel,                                       \
       INIT_BRACE_BEGIN                                                  \
       .string = {value, _default, sizeof(value), func_validate, ""}     \
@@ -1463,7 +1483,7 @@ static bool plrcol_validate(int value, struct connection *caller,
 #define GEN_BITWISE(name, value, sclass, scateg, slevel, al_read, al_write, \
                    short_help, extra_help, func_validate, func_action,      \
                    func_name, _default)                                     \
-  { name, sclass, al_read, al_write, short_help, extra_help, NULL,          \
+  { name, sclass, al_read, al_write, short_help, extra_help, nullptr,       \
     SST_BITWISE, scateg, slevel,                                            \
       INIT_BRACE_BEGIN                                                      \
       .bitwise = { (unsigned *) (void *) &value, _default, func_validate,   \
@@ -1490,8 +1510,8 @@ static struct setting settings[] = {
              "- \"Tiles per player\" (PLAYER): Number of (land) tiles per "
              "player (option 'tilesperplayer').\n"
              "- \"Width and height\" (XYSIZE): Map width and height in "
-             "tiles (options 'xsize' and 'ysize')."), NULL,
-          mapsize_callback, NULL, mapsize_name, MAP_DEFAULT_MAPSIZE)
+             "tiles (options 'xsize' and 'ysize')."), nullptr,
+          mapsize_callback, nullptr, mapsize_name, MAP_DEFAULT_MAPSIZE)
 
   GEN_INT("size", wld.map.server.size, SSET_MAP_SIZE,
           SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
@@ -1506,7 +1526,7 @@ static struct setting settings[] = {
              "  size = 20 is a huge map of 20,000 tiles\n"
              "For this option to take effect, the \"Map size definition\" "
              "option ('mapsize') must be set to \"Number of tiles\" "
-             "(FULLSIZE)."), NULL, NULL, NULL,
+             "(FULLSIZE)."), nullptr, nullptr, nullptr,
           MAP_MIN_SIZE, MAP_MAX_SIZE, MAP_DEFAULT_SIZE)
 
   GEN_INT("tilesperplayer", wld.map.server.tilesperplayer, SSET_MAP_SIZE,
@@ -1523,7 +1543,7 @@ static struct setting settings[] = {
              "For this option to take effect, the \"Map size definition\" "
              "option ('mapsize') must be set to \"Tiles per player\" "
              "(PLAYER)."),
-          NULL, NULL, NULL, MAP_MIN_TILESPERPLAYER,
+          nullptr, nullptr, nullptr, MAP_MIN_TILESPERPLAYER,
           MAP_MAX_TILESPERPLAYER, MAP_DEFAULT_TILESPERPLAYER)
 
   GEN_INT("xsize", wld.map.xsize, SSET_MAP_SIZE,
@@ -1538,7 +1558,7 @@ static struct setting settings[] = {
              "For this option to take effect, the \"Map size definition\" "
              "option ('mapsize') must be set to \"Width and height\" "
              "(XYSIZE)."),
-          NULL, xsize_callback, NULL,
+          nullptr, xsize_callback, nullptr,
           MAP_MIN_LINEAR_SIZE, MAP_MAX_LINEAR_SIZE, MAP_DEFAULT_LINEAR_SIZE)
   GEN_INT("ysize", wld.map.ysize, SSET_MAP_SIZE,
           SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
@@ -1552,7 +1572,7 @@ static struct setting settings[] = {
              "For this option to take effect, the \"Map size definition\" "
              "option ('mapsize') must be set to \"Width and height\" "
              "(XYSIZE)."),
-          NULL, ysize_callback, NULL,
+          nullptr, ysize_callback, nullptr,
           MAP_MIN_LINEAR_SIZE, MAP_MAX_LINEAR_SIZE, MAP_DEFAULT_LINEAR_SIZE)
 
   GEN_BITWISE("topology", wld.map.topology_id, SSET_MAP_SIZE,
@@ -1636,7 +1656,8 @@ static struct setting settings[] = {
               "of the continents.\n"
               "If the requested generator is incompatible with other server "
               "settings, the server may fall back to another generator."),
-           NULL, generator_validate, NULL, generator_name, MAP_DEFAULT_GENERATOR)
+           nullptr, generator_validate, nullptr, generator_name,
+           MAP_DEFAULT_GENERATOR)
 
   GEN_ENUM("startpos", wld.map.server.startpos,
            SSET_MAP_GEN, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
@@ -1671,7 +1692,7 @@ static struct setting settings[] = {
               "create the right number of continents for the choice of this "
               "'startpos' setting and the number of players, so this is "
               "unlikely to occur.)"),
-           NULL, NULL, NULL, startpos_name, MAP_DEFAULT_STARTPOS)
+           nullptr, nullptr, nullptr, startpos_name, MAP_DEFAULT_STARTPOS)
 
   GEN_ENUM("teamplacement", wld.map.server.team_placement,
            SSET_MAP_GEN, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
@@ -1696,13 +1717,14 @@ static struct setting settings[] = {
               "team will be placed horizontally.\n"
               "- \"Vertical placement\" (VERTICAL): players of the same "
               "team will be placed vertically."),
-           NULL, NULL, NULL, teamplacement_name, MAP_DEFAULT_TEAM_PLACEMENT)
+           nullptr, nullptr, nullptr, teamplacement_name,
+           MAP_DEFAULT_TEAM_PLACEMENT)
 
   GEN_BOOL("tinyisles", wld.map.server.tinyisles,
            SSET_MAP_GEN, SSET_GEOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
            N_("Presence of 1x1 islands"),
            N_("This setting controls whether the map generator is allowed "
-              "to make islands of one only tile size."), NULL, NULL,
+              "to make islands of one only tile size."), nullptr, nullptr,
            MAP_DEFAULT_TINYISLES)
 
   GEN_BOOL("separatepoles", wld.map.server.separatepoles,
@@ -1710,7 +1732,7 @@ static struct setting settings[] = {
            ALLOW_NONE, ALLOW_BASIC,
            N_("Whether the poles are separate continents"),
            N_("If this setting is disabled, the continents may attach to "
-              "poles."), NULL, NULL, MAP_DEFAULT_SEPARATE_POLES)
+              "poles."), nullptr, nullptr, MAP_DEFAULT_SEPARATE_POLES)
 
   GEN_INT("flatpoles", wld.map.server.flatpoles,
           SSET_MAP_GEN, SSET_GEOLOGY, SSET_SITUATIONAL, ALLOW_NONE, ALLOW_BASIC,
@@ -1720,8 +1742,8 @@ static struct setting settings[] = {
              "during map generation, preventing a diversity of land "
              "terrain there. 0 is no flattening, 100 is maximum "
              "flattening. Only affects the 'RANDOM' and 'FRACTAL' "
-             "map generators."), NULL,
-          NULL, NULL,
+             "map generators."), nullptr,
+          nullptr, nullptr,
           MAP_MIN_FLATPOLES, MAP_MAX_FLATPOLES, MAP_DEFAULT_FLATPOLES)
 
   GEN_INT("northlatitude", wld.map.north_latitude,
@@ -1741,8 +1763,8 @@ static struct setting settings[] = {
              " 300 and  -300 gives an equatorial map.\n"
              "\n"
              "In rulesets that support it, latitude may also have certain "
-             "effects during gameplay."), NULL,
-          NULL, NULL,
+             "effects during gameplay."), nullptr,
+          nullptr, nullptr,
           MAP_MIN_LATITUDE_BOUND, MAP_MAX_LATITUDE_BOUND,
           MAP_DEFAULT_NORTH_LATITUDE)
   GEN_INT("southlatitude", wld.map.south_latitude,
@@ -1762,8 +1784,8 @@ static struct setting settings[] = {
              " 300 and  -300 gives an equatorial map.\n"
              "\n"
              "In rulesets that support it, latitude may also have certain "
-             "effects during gameplay."), NULL,
-          NULL, NULL,
+             "effects during gameplay."), nullptr,
+          nullptr, nullptr,
           MAP_MIN_LATITUDE_BOUND, MAP_MAX_LATITUDE_BOUND,
           MAP_DEFAULT_SOUTH_LATITUDE)
 
@@ -1783,15 +1805,15 @@ static struct setting settings[] = {
              " 30 means a cold planet with small tropical zones.\n"
              "  0 means a very cold planet with large polar zones and no "
              "tropics."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           MAP_MIN_TEMPERATURE, MAP_MAX_TEMPERATURE, MAP_DEFAULT_TEMPERATURE)
- 
+
   GEN_INT("landmass", wld.map.server.landpercent,
           SSET_MAP_GEN, SSET_GEOLOGY, SSET_SITUATIONAL,
           ALLOW_NONE, ALLOW_BASIC,
           N_("Percentage of the map that is land"),
           N_("This setting gives the approximate percentage of the map "
-             "that will be made into land."), NULL, NULL, NULL,
+             "that will be made into land."), nullptr, nullptr, nullptr,
           MAP_MIN_LANDMASS, MAP_MAX_LANDMASS, MAP_DEFAULT_LANDMASS)
 
   GEN_INT("steepness", wld.map.server.steepness,
@@ -1800,16 +1822,16 @@ static struct setting settings[] = {
           N_("Amount of hills/mountains"),
           N_("Small values give flat maps, while higher values give a "
              "steeper map with more hills and mountains."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           MAP_MIN_STEEPNESS, MAP_MAX_STEEPNESS, MAP_DEFAULT_STEEPNESS)
 
   GEN_INT("wetness", wld.map.server.wetness,
           SSET_MAP_GEN, SSET_GEOLOGY, SSET_SITUATIONAL,
           ALLOW_NONE, ALLOW_BASIC,
-          N_("Amount of water on landmasses"), 
+          N_("Amount of water on landmasses"),
           N_("Small values mean lots of dry, desert-like land; "
              "higher values give a wetter map with more swamps, "
-             "jungles, and rivers."), NULL, NULL, NULL,
+             "jungles, and rivers."), nullptr, nullptr, nullptr,
           MAP_MIN_WETNESS, MAP_MAX_WETNESS, MAP_DEFAULT_WETNESS)
 
   GEN_BOOL("globalwarming", game.info.global_warming,
@@ -1817,14 +1839,14 @@ static struct setting settings[] = {
            N_("Global warming"),
            N_("If turned off, global warming will not occur "
               "as a result of pollution. This setting does not "
-              "affect pollution."), NULL, NULL,
+              "affect pollution."), nullptr, nullptr,
            GAME_DEFAULT_GLOBAL_WARMING)
 
   GEN_INT("globalwarming_percent", game.server.global_warming_percent,
            SSET_RULES, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
            N_("Global warming percent"),
            N_("This is a multiplier for the rate of accumulation of global "
-              "warming."), NULL, NULL, NULL,
+              "warming."), nullptr, nullptr, nullptr,
            GAME_MIN_GLOBAL_WARMING_PERCENT,
            GAME_MAX_GLOBAL_WARMING_PERCENT,
            GAME_DEFAULT_GLOBAL_WARMING_PERCENT)
@@ -1833,14 +1855,14 @@ static struct setting settings[] = {
            SSET_RULES, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
            N_("Nuclear winter"),
            N_("If turned off, nuclear winter will not occur "
-              "as a result of nuclear war."), NULL, NULL,
+              "as a result of nuclear war."), nullptr, nullptr,
            GAME_DEFAULT_NUCLEAR_WINTER)
 
   GEN_INT("nuclearwinter_percent", game.server.nuclear_winter_percent,
            SSET_RULES, SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
            N_("Nuclear winter percent"),
            N_("This is a multiplier for the rate of accumulation of nuclear "
-              "winter."), NULL, NULL, NULL,
+              "winter."), nullptr, nullptr, nullptr,
            GAME_MIN_NUCLEAR_WINTER_PERCENT,
            GAME_MAX_NUCLEAR_WINTER_PERCENT,
            GAME_DEFAULT_NUCLEAR_WINTER_PERCENT)
@@ -1857,10 +1879,10 @@ static struct setting settings[] = {
              "for zero (the default) a seed will be generated randomly, "
              "based on gameseed. If also gameseed is zero, "
              "the map will be completely random."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           MAP_MIN_SEED, MAP_MAX_SEED, MAP_DEFAULT_SEED)
 
-  /* Map additional stuff: huts and specials.  gameseed also goes here
+  /* Map additional stuff: huts and specials. gameseed also goes here
    * because huts and specials are the first time the gameseed gets used (?)
    * These are done when the game starts, so these are historical and
    * fixed after the game has started.
@@ -1875,7 +1897,7 @@ static struct setting settings[] = {
           N_("Game random seed"),
           N_("For zero (the default) a seed will be chosen based "
              "on system entropy or, failing that, the current time."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_SEED, GAME_MAX_SEED, GAME_DEFAULT_SEED)
 
   GEN_INT("specials", wld.map.server.riches,
@@ -1883,7 +1905,7 @@ static struct setting settings[] = {
           N_("Amount of \"special\" resource tiles"),
           N_("Special resources improve the basic terrain type they "
              "are on. The server variable's scale is parts per "
-             "thousand."), NULL, NULL, NULL,
+             "thousand."), nullptr, nullptr, nullptr,
           MAP_MIN_RICHES, MAP_MAX_RICHES, MAP_DEFAULT_RICHES)
 
   GEN_INT("huts", wld.map.server.huts,
@@ -1892,7 +1914,7 @@ static struct setting settings[] = {
           N_("Huts are tile extras that usually may be investigated by "
              "units. "
              "The server variable's scale is huts per thousand tiles."),
-          huts_help, NULL, huts_action,
+          huts_help, nullptr, huts_action,
           MAP_MIN_HUTS, MAP_MAX_HUTS, MAP_DEFAULT_HUTS)
 
   GEN_INT("animals", wld.map.server.animals,
@@ -1901,10 +1923,10 @@ static struct setting settings[] = {
           N_("Number of animals initially created on terrains "
              "defined for them in the ruleset (if the ruleset supports it). "
              "The server variable's scale is animals per "
-             "thousand tiles."), NULL, NULL, NULL,
+             "thousand tiles."), nullptr, nullptr, nullptr,
           MAP_MIN_ANIMALS, MAP_MAX_ANIMALS, MAP_DEFAULT_ANIMALS)
 
-  /* Options affecting numbers of players and AI players.  These only
+  /* Options affecting numbers of players and AI players. These only
    * affect the start of the game and can not be adjusted after that.
    */
   GEN_INT("minplayers", game.server.min_players,
@@ -1913,7 +1935,7 @@ static struct setting settings[] = {
           N_("Minimum number of players"),
           N_("There must be at least this many players (connected "
              "human players) before the game can start."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_MIN_PLAYERS, GAME_MAX_MIN_PLAYERS, GAME_DEFAULT_MIN_PLAYERS)
 
   GEN_INT("maxplayers", game.server.max_players,
@@ -1926,7 +1948,7 @@ static struct setting settings[] = {
              "When playing a scenario which defines player start positions, "
              "this setting cannot be set to greater than the number of "
              "defined start positions."),
-          NULL, maxplayers_callback, NULL,
+          nullptr, maxplayers_callback, nullptr,
           GAME_MIN_MAX_PLAYERS, GAME_MAX_MAX_PLAYERS, GAME_DEFAULT_MAX_PLAYERS)
 
   GEN_INT("aifill", game.info.aifill,
@@ -1937,17 +1959,18 @@ static struct setting settings[] = {
              "number of players at this amount. As more players join, "
              "these AI players will be replaced. When set to zero, "
              "all AI players will be removed."),
-          NULL, NULL, aifill_action,
+          nullptr, nullptr, aifill_action,
           GAME_MIN_AIFILL, GAME_MAX_AIFILL, GAME_DEFAULT_AIFILL)
 
   GEN_ENUM("persistentready", game.info.persistent_ready,
            SSET_META, SSET_NETWORK, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
-	  N_("When the Readiness of a player gets autotoggled off"),
-	  N_("In pre-game, usually when new players join or old ones leave, "
+          N_("When the Readiness of a player gets autotoggled off"),
+          N_("In pre-game, usually when new players join or old ones leave, "
              "those who have already accepted game to start by toggling \"Ready\" "
              "get that autotoggled off in the changed situation. This setting "
              "can be used to make readiness more persistent."),
-           NULL, NULL, NULL, persistentready_name, GAME_DEFAULT_PERSISTENTREADY)
+           nullptr, nullptr, nullptr, persistentready_name,
+           GAME_DEFAULT_PERSISTENTREADY)
 
   GEN_STRING("nationset", game.server.nationset,
              SSET_PLAYERS, SSET_INTERNAL, SSET_RARE,
@@ -1971,15 +1994,15 @@ static struct setting settings[] = {
           N_("Event cache for this number of turns"),
           N_("Event messages are saved for this number of turns. A value of "
              "0 deactivates the event cache."),
-          NULL, NULL, NULL, GAME_MIN_EVENT_CACHE_TURNS, GAME_MAX_EVENT_CACHE_TURNS,
-          GAME_DEFAULT_EVENT_CACHE_TURNS)
+          nullptr, nullptr, nullptr, GAME_MIN_EVENT_CACHE_TURNS,
+          GAME_MAX_EVENT_CACHE_TURNS, GAME_DEFAULT_EVENT_CACHE_TURNS)
 
   GEN_INT("ec_max_size", game.server.event_cache.max_size,
           SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
           ALLOW_NONE, ALLOW_BASIC,
           N_("Size of the event cache"),
           N_("This defines the maximal number of events in the event cache."),
-          NULL, NULL, NULL, GAME_MIN_EVENT_CACHE_MAX_SIZE,
+          nullptr, nullptr, nullptr, GAME_MIN_EVENT_CACHE_MAX_SIZE,
           GAME_MAX_EVENT_CACHE_MAX_SIZE, GAME_DEFAULT_EVENT_CACHE_MAX_SIZE)
 
   GEN_BOOL("ec_chat", game.server.event_cache.chat,
@@ -1987,7 +2010,7 @@ static struct setting settings[] = {
            ALLOW_NONE, ALLOW_BASIC,
            N_("Save chat messages in the event cache"),
            N_("If turned on, chat messages will be saved in the event "
-              "cache."), NULL, NULL, GAME_DEFAULT_EVENT_CACHE_CHAT)
+              "cache."), nullptr, nullptr, GAME_DEFAULT_EVENT_CACHE_CHAT)
 
   GEN_BOOL("ec_info", game.server.event_cache.info,
            SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
@@ -1996,30 +2019,30 @@ static struct setting settings[] = {
            /* TRANS: Don't translate the text between single quotes. */
            N_("If turned on, all cached events will be marked by the turn "
               "and time of the event like '(T2 - 15:29:52)'."),
-           NULL, NULL, GAME_DEFAULT_EVENT_CACHE_INFO)
+           nullptr, nullptr, GAME_DEFAULT_EVENT_CACHE_INFO)
 
   /* Game initialization parameters (only affect the first start of the game,
-   * and not reloads).  Can not be changed after first start of game.
+   * and not reloads). Can not be changed after first start of game.
    */
   GEN_STRING("startunits", game.server.start_units,
              SSET_GAME_INIT, SSET_SOCIOLOGY, SSET_VITAL,
              ALLOW_NONE, ALLOW_BASIC,
              N_("List of players' initial units"),
              N_("This should be a string of characters, each of which "
-		"specifies a unit role. The first character must be native to "
+                "specifies a unit role. The first character must be native to "
                 "at least one \"Starter\" terrain. The characters and their "
-		"meanings are:\n"
-		"    c   = City founder (eg., Settlers)\n"
-		"    w   = Terrain worker (eg., Engineers)\n"
-		"    x   = Explorer (eg., Explorer)\n"
-		"    k   = Gameloss (eg., King)\n"
-		"    s   = Diplomat (eg., Diplomat)\n"
+                "meanings are:\n"
+                "    c   = City founder (eg., Settlers)\n"
+                "    w   = Terrain worker (eg., Engineers)\n"
+                "    x   = Explorer (eg., Explorer)\n"
+                "    k   = Gameloss (eg., King)\n"
+                "    s   = Diplomat (eg., Diplomat)\n"
                 "    f   = Ferryboat (eg., Trireme)\n"
-		"    d   = Ok defense unit (eg., Warriors)\n"
-		"    D   = Good defense unit (eg., Phalanx)\n"
-		"    a   = Fast attack unit (eg., Horsemen)\n"
-		"    A   = Strong attack unit (eg., Catapult)\n"),
-             startunits_callback, NULL, GAME_DEFAULT_START_UNITS)
+                "    d   = Ok defense unit (eg., Warriors)\n"
+                "    D   = Good defense unit (eg., Phalanx)\n"
+                "    a   = Fast attack unit (eg., Horsemen)\n"
+                "    A   = Strong attack unit (eg., Catapult)\n"),
+             startunits_callback, nullptr, GAME_DEFAULT_START_UNITS)
 
   GEN_BOOL("startcity", game.server.start_city,
            SSET_GAME_INIT, SSET_SOCIOLOGY, SSET_VITAL,
@@ -2027,7 +2050,7 @@ static struct setting settings[] = {
            N_("Whether player starts with a city"),
            N_("If this is set, game will start with player's first "
               "city already founded to starting location."),
-           NULL, NULL, GAME_DEFAULT_START_CITY)         
+           nullptr, nullptr, GAME_DEFAULT_START_CITY)
 
   GEN_INT("dispersion", game.server.dispersion,
           SSET_GAME_INIT, SSET_SOCIOLOGY, SSET_SITUATIONAL,
@@ -2035,15 +2058,15 @@ static struct setting settings[] = {
           N_("Area where initial units are located"),
           N_("This is the radius within "
              "which the initial units are dispersed."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_DISPERSION, GAME_MAX_DISPERSION, GAME_DEFAULT_DISPERSION)
 
   GEN_INT("gold", game.info.gold,
           SSET_GAME_INIT, SSET_ECONOMICS, SSET_VITAL,
           ALLOW_NONE, ALLOW_BASIC,
-          N_("Starting gold per player"), 
+          N_("Starting gold per player"),
           N_("At the beginning of the game, each player is given this "
-             "much gold."), NULL, NULL, NULL,
+             "much gold."), nullptr, nullptr, nullptr,
           GAME_MIN_GOLD, GAME_MAX_GOLD, GAME_DEFAULT_GOLD)
 
   GEN_INT("infrapoints", game.info.infrapoints,
@@ -2051,20 +2074,20 @@ static struct setting settings[] = {
           ALLOW_NONE, ALLOW_BASIC,
           N_("Starting infrapoints per player"),
           N_("At the beginning of the game, each player is given this "
-             "many infrapoints."), NULL, NULL, NULL,
+             "many infrapoints."), nullptr, nullptr, nullptr,
           GAME_MIN_INFRA, GAME_MAX_INFRA, GAME_DEFAULT_INFRA)
 
   GEN_INT("techlevel", game.info.tech,
           SSET_GAME_INIT, SSET_SCIENCE, SSET_VITAL,
           ALLOW_NONE, ALLOW_BASIC,
-          N_("Number of initial techs per player"), 
+          N_("Number of initial techs per player"),
           /* TRANS: The string between single quotes is a setting name and
            * should not be translated. */
           N_("At the beginning of the game, each player is given this "
              "many technologies. The technologies chosen are random for "
              "each player. Depending on the value of tech_cost_style in "
              "the ruleset, a big value for 'techlevel' can make the next "
-             "techs really expensive."), NULL, NULL, NULL,
+             "techs really expensive."), nullptr, nullptr, nullptr,
           GAME_MIN_TECHLEVEL, GAME_MAX_TECHLEVEL, GAME_DEFAULT_TECHLEVEL)
 
   GEN_INT("sciencebox", game.info.sciencebox,
@@ -2075,7 +2098,7 @@ static struct setting settings[] = {
              "technology. All tech costs are multiplied by this amount "
              "(as a percentage). The base tech costs are determined by "
              "the ruleset or other game settings."),
-          NULL, NULL, NULL, GAME_MIN_SCIENCEBOX, GAME_MAX_SCIENCEBOX,
+          nullptr, nullptr, nullptr, GAME_MIN_SCIENCEBOX, GAME_MAX_SCIENCEBOX,
           GAME_DEFAULT_SCIENCEBOX)
 
   GEN_BOOL("multiresearch", game.server.multiresearch,
@@ -2084,7 +2107,7 @@ static struct setting settings[] = {
           N_("Allows switching to any technology without wasting old "
              "research. Bulbs are never transferred to new technology. "
              "Techpenalty options are ineffective after enabling that "
-             "option."), NULL, NULL,
+             "option."), nullptr, nullptr,
           GAME_DEFAULT_MULTIRESEARCH)
 
   GEN_INT("techpenalty", game.server.techpenalty,
@@ -2093,7 +2116,7 @@ static struct setting settings[] = {
           N_("If you change your current research technology, and you have "
              "positive research points, you lose this percentage of those "
              "research points. This does not apply when you have just gained "
-             "a technology this turn."), NULL, NULL, NULL,
+             "a technology this turn."), nullptr, nullptr, nullptr,
           GAME_MIN_TECHPENALTY, GAME_MAX_TECHPENALTY,
           GAME_DEFAULT_TECHPENALTY)
 
@@ -2102,8 +2125,8 @@ static struct setting settings[] = {
           N_("Chance to lose a technology while receiving it"),
           N_("The chance that learning a technology by treaty or theft "
              "will fail."),
-          NULL, NULL, NULL, GAME_MIN_TECHLOST_RECV, GAME_MAX_TECHLOST_RECV,
-          GAME_DEFAULT_TECHLOST_RECV)
+          nullptr, nullptr, nullptr, GAME_MIN_TECHLOST_RECV,
+          GAME_MAX_TECHLOST_RECV, GAME_DEFAULT_TECHLOST_RECV)
 
   GEN_INT("techlost_donor", game.server.techlost_donor,
           SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2111,8 +2134,8 @@ static struct setting settings[] = {
           N_("The chance that your civilization will lose a technology if "
              "you teach it to someone else by treaty, or if it is stolen "
              "from you."),
-          NULL, NULL, NULL, GAME_MIN_TECHLOST_DONOR, GAME_MAX_TECHLOST_DONOR,
-          GAME_DEFAULT_TECHLOST_DONOR)
+          nullptr, nullptr, nullptr, GAME_MIN_TECHLOST_DONOR,
+          GAME_MAX_TECHLOST_DONOR, GAME_DEFAULT_TECHLOST_DONOR)
 
   GEN_INT("techleak", game.info.tech_leak_pct,
           SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2122,7 +2145,7 @@ static struct setting settings[] = {
              "percentage of tech's bulb cost gets leaked each turn. "
              "This setting has no effect if the ruleset has disabled "
              "tech leakage."),
-          NULL, NULL, NULL, GAME_MIN_TECHLEAK, GAME_MAX_TECHLEAK,
+          nullptr, nullptr, nullptr, GAME_MIN_TECHLEAK, GAME_MAX_TECHLEAK,
           GAME_DEFAULT_TECHLEAK)
 
   GEN_BOOL("team_pooled_research", game.info.team_pooled_research,
@@ -2131,7 +2154,7 @@ static struct setting settings[] = {
            N_("If this setting is turned on, then the team mates will share "
               "the science research. Else, every player of the team will "
               "have to make its own."),
-           NULL, NULL, GAME_DEFAULT_TEAM_POOLED_RESEARCH)
+           nullptr, nullptr, GAME_DEFAULT_TEAM_POOLED_RESEARCH)
 
   GEN_INT("diplbulbcost", game.server.diplbulbcost,
           SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2140,8 +2163,9 @@ static struct setting settings[] = {
              "lose research points equal to this percentage of the cost to "
              "research a new technology. If this is non-zero, you can end up "
              "with negative research points."),
-          NULL, NULL, NULL,
-          GAME_MIN_DIPLBULBCOST, GAME_MAX_DIPLBULBCOST, GAME_DEFAULT_DIPLBULBCOST)
+          nullptr, nullptr, nullptr,
+          GAME_MIN_DIPLBULBCOST, GAME_MAX_DIPLBULBCOST,
+          GAME_DEFAULT_DIPLBULBCOST)
 
   GEN_INT("diplgoldcost", game.server.diplgoldcost,
           SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2149,8 +2173,9 @@ static struct setting settings[] = {
           N_("When transferring gold in diplomatic treaties, this percentage "
              "of the agreed sum is lost to both parties; it is deducted from "
              "the donor but not received by the recipient."),
-          NULL, NULL, NULL,
-          GAME_MIN_DIPLGOLDCOST, GAME_MAX_DIPLGOLDCOST, GAME_DEFAULT_DIPLGOLDCOST)
+          nullptr, nullptr, nullptr,
+          GAME_MIN_DIPLGOLDCOST, GAME_MAX_DIPLGOLDCOST,
+          GAME_DEFAULT_DIPLGOLDCOST)
 
   GEN_INT("incite_gold_loss_chance", game.server.incite_gold_loss_chance,
           SSET_RULES, SSET_SCIENCE, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2158,7 +2183,7 @@ static struct setting settings[] = {
           N_("When unit trying to incite revolt is eliminated, half of the gold "
              "(or quarter, if unit was caught), prepared to bribe citizens, "
              "can be lost or captured by enemy."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_INCITE_GOLD_LOSS_CHANCE, GAME_MAX_INCITE_GOLD_LOSS_CHANCE,
           GAME_DEFAULT_INCITE_GOLD_LOSS_CHANCE)
 
@@ -2169,7 +2194,7 @@ static struct setting settings[] = {
              "gold, there is chance that this gold would be captured by "
              "city defender. Transfer tax would be applied, though. "
              "This setting is irrelevant, if incite_gold_loss_chance is zero."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_INCITE_GOLD_CAPT_CHANCE, GAME_MAX_INCITE_GOLD_CAPT_CHANCE,
           GAME_DEFAULT_INCITE_GOLD_CAPT_CHANCE)
 
@@ -2180,7 +2205,7 @@ static struct setting settings[] = {
              "lose research points equal to this percentage of the cost to "
              "research a new technology. If this is non-zero, you can end up "
              "with negative research points."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_CONQUERCOST, GAME_MAX_CONQUERCOST,
           GAME_DEFAULT_CONQUERCOST)
 
@@ -2195,7 +2220,7 @@ static struct setting settings[] = {
              "equal to this percentage of the cost to research a new "
              "technology. If this is non-zero, you can end up "
              "with negative research points."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_FREECOST, GAME_MAX_FREECOST, GAME_DEFAULT_FREECOST)
 
   GEN_INT("techlossforgiveness", game.info.techloss_forgiveness,
@@ -2206,7 +2231,7 @@ static struct setting settings[] = {
              "research, you forget a technology you already knew.\n"
              "The special value -1 prevents loss of technology regardless of "
              "research points."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_TECHLOSSFG, GAME_MAX_TECHLOSSFG,
           GAME_DEFAULT_TECHLOSSFG)
 
@@ -2219,7 +2244,7 @@ static struct setting settings[] = {
             "sufficient to make it positive).\n"
             "The special value -1 means that your research balance is always "
             "restored to zero, regardless of your previous shortfall."),
-         NULL, NULL, NULL,
+         nullptr, nullptr, nullptr,
          GAME_MIN_TECHLOSSREST, GAME_MAX_TECHLOSSREST,
          GAME_DEFAULT_TECHLOSSREST)
 
@@ -2230,7 +2255,7 @@ static struct setting settings[] = {
           N_("This is the base amount of food required to grow a city. "
              "This value is multiplied by another factor that comes from "
              "the ruleset and is dependent on the size of the city."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_FOODBOX, GAME_MAX_FOODBOX, GAME_DEFAULT_FOODBOX)
 
   GEN_INT("aqueductloss", game.server.aqueductloss,
@@ -2241,8 +2266,8 @@ static struct setting settings[] = {
              "this is the base percentage of its foodbox that is lost "
              "each turn; the penalty may be reduced by buildings or other "
              "circumstances, depending on the ruleset."),
-          NULL, NULL, NULL,
-          GAME_MIN_AQUEDUCTLOSS, GAME_MAX_AQUEDUCTLOSS, 
+          nullptr, nullptr, nullptr,
+          GAME_MIN_AQUEDUCTLOSS, GAME_MAX_AQUEDUCTLOSS,
           GAME_DEFAULT_AQUEDUCTLOSS)
 
   GEN_INT("shieldbox", game.info.shieldbox,
@@ -2252,13 +2277,13 @@ static struct setting settings[] = {
           N_("This affects how quickly units and buildings can be "
              "produced.  The base costs are multiplied by this value (as "
              "a percentage)."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_SHIELDBOX, GAME_MAX_SHIELDBOX, GAME_DEFAULT_SHIELDBOX)
 
   /* Notradesize and fulltradesize used to have callbacks to prevent them
-   * from being set illegally (notradesize > fulltradesize).  However this
+   * from being set illegally (notradesize > fulltradesize). However this
    * provided a problem when setting them both through the client's settings
-   * dialog, since they cannot both be set atomically.  So the callbacks were
+   * dialog, since they cannot both be set atomically. So the callbacks were
    * removed and instead the game now knows how to deal with invalid
    * settings. */
   GEN_INT("fulltradesize", game.info.fulltradesize,
@@ -2270,8 +2295,8 @@ static struct setting settings[] = {
              "The penalty is 100% (no trade at all) for sizes up to "
              "'notradesize', and decreases gradually to 0% (no penalty "
              "except the normal corruption) for size='fulltradesize'. "
-             "See also 'notradesize'."), NULL, NULL, NULL,
-          GAME_MIN_FULLTRADESIZE, GAME_MAX_FULLTRADESIZE, 
+             "See also 'notradesize'."), nullptr, nullptr, nullptr,
+          GAME_MIN_FULLTRADESIZE, GAME_MAX_FULLTRADESIZE,
           GAME_DEFAULT_FULLTRADESIZE)
 
   GEN_INT("notradesize", game.info.notradesize,
@@ -2283,7 +2308,7 @@ static struct setting settings[] = {
              "is larger than this amount. The produced trade increases "
              "gradually for cities larger than 'notradesize' and smaller "
              "than 'fulltradesize'. See also 'fulltradesize'."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_NOTRADESIZE, GAME_MAX_NOTRADESIZE,
           GAME_DEFAULT_NOTRADESIZE)
 
@@ -2297,7 +2322,7 @@ static struct setting settings[] = {
              "determines how big percentage of the bonus calculation is "
              "relative to world size, and how much only absolute distance "
              "matters."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_TRADEWORLDRELPCT, GAME_MAX_TRADEWORLDRELPCT,
           GAME_DEFAULT_TRADEWORLDRELPCT)
 
@@ -2311,7 +2336,7 @@ static struct setting settings[] = {
              "at least two clear tiles in any direction between all existing "
              "cities and the new city site. A value of 1 removes any such "
              "restriction on city placement."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_CITYMINDIST, GAME_MAX_CITYMINDIST,
           GAME_DEFAULT_CITYMINDIST)
 
@@ -2319,21 +2344,21 @@ static struct setting settings[] = {
            SSET_RULES, SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
            N_("Technology trading"),
            N_("If turned off, trading technologies in the diplomacy dialog "
-              "is not allowed."), NULL, NULL,
+              "is not allowed."), nullptr, nullptr,
            GAME_DEFAULT_TRADING_TECH)
 
   GEN_BOOL("trading_gold", game.info.trading_gold,
            SSET_RULES, SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
            N_("Gold trading"),
            N_("If turned off, trading gold in the diplomacy dialog "
-              "is not allowed."), NULL, NULL,
+              "is not allowed."), nullptr, nullptr,
            GAME_DEFAULT_TRADING_GOLD)
 
   GEN_BOOL("trading_city", game.info.trading_city,
            SSET_RULES, SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
            N_("City trading"),
            N_("If turned off, trading cities in the diplomacy dialog "
-              "is not allowed."), NULL, NULL,
+              "is not allowed."), nullptr, nullptr,
            GAME_DEFAULT_TRADING_CITY)
 
   GEN_ENUM("caravan_bonus_style", game.info.caravan_bonus_style,
@@ -2344,7 +2369,7 @@ static struct setting settings[] = {
               "of source and destination with multipliers for overseas and "
               "international destinations. LOGARITHMIC bonuses are "
               "proportional to log^2(distance + trade)."),
-           NULL, NULL, NULL, caravanbonusstyle_name,
+           nullptr, nullptr, nullptr, caravanbonusstyle_name,
            GAME_DEFAULT_CARAVAN_BONUS_STYLE)
 
   GEN_ENUM("trade_revenue_style", game.info.trade_revenue_style,
@@ -2356,8 +2381,8 @@ static struct setting settings[] = {
              "and international routes. "
              "SIMPLE revenues are proportional to the average trade of the "
              "two cities."),
-	  NULL, NULL, NULL, traderevenuestyle_name,
-          GAME_DEFAULT_TRADE_REVENUE_STYLE)
+           nullptr, nullptr, nullptr, traderevenuestyle_name,
+           GAME_DEFAULT_TRADE_REVENUE_STYLE)
 
     GEN_INT("trademindist", game.info.trademindist,
           SSET_RULES, SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2366,7 +2391,7 @@ static struct setting settings[] = {
              "a trade route, they must be at least this far apart on the "
              "map. For square grids, the distance is calculated as "
              "\"Manhattan distance\", that is, the sum of the displacements "
-             "along the x and y directions."), NULL, NULL, NULL,
+             "along the x and y directions."), nullptr, nullptr, nullptr,
           GAME_MIN_TRADEMINDIST, GAME_MAX_TRADEMINDIST,
           GAME_DEFAULT_TRADEMINDIST)
 
@@ -2377,7 +2402,7 @@ static struct setting settings[] = {
           N_("Sets the number of turns between rapture growth of a city. "
              "If set to n a city will grow after celebrating for n+1 "
              "turns."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_RAPTUREDELAY, GAME_MAX_RAPTUREDELAY,
           GAME_DEFAULT_RAPTUREDELAY)
 
@@ -2389,7 +2414,7 @@ static struct setting settings[] = {
              "if any are defined by the ruleset. The relative frequency "
              "of disaster types is set by the ruleset. Zero prevents "
              "any random disasters from occurring."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_DISASTERS, GAME_MAX_DISASTERS,
           GAME_DEFAULT_DISASTERS)
 
@@ -2397,13 +2422,14 @@ static struct setting settings[] = {
            SSET_RULES, SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
            N_("AI trait distribution method"),
            N_("How trait values are given to AI players."),
-           NULL, NULL, NULL, trait_dist_name, GAME_DEFAULT_TRAIT_DIST_MODE)
+           nullptr, nullptr, nullptr, trait_dist_name,
+           GAME_DEFAULT_TRAIT_DIST_MODE)
 
   GEN_INT("razechance", game.server.razechance,
           SSET_RULES, SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
           N_("Chance for conquered building destruction"),
           N_("When a player conquers a city, each city improvement has this "
-             "percentage chance to be destroyed."), NULL, NULL, NULL,
+             "percentage chance to be destroyed."), nullptr, nullptr, nullptr,
           GAME_MIN_RAZECHANCE, GAME_MAX_RAZECHANCE, GAME_DEFAULT_RAZECHANCE)
 
   GEN_INT("occupychance", game.server.occupychance,
@@ -2415,7 +2441,7 @@ static struct setting settings[] = {
              "the combat (and no enemy units remain in the tile). If "
              "set to a value between 0 and 100, this will be used as "
              "the percent chance of \"occupying\" territory."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_OCCUPYCHANCE, GAME_MAX_OCCUPYCHANCE,
           GAME_DEFAULT_OCCUPYCHANCE)
 
@@ -2424,7 +2450,7 @@ static struct setting settings[] = {
            N_("Turn on/off server-side autoattack"),
            N_("If set to on, units with moves left will automatically "
               "consider attacking enemy units that move adjacent to them."),
-           NULL, NULL, GAME_DEFAULT_AUTOATTACK)
+           nullptr, nullptr, GAME_DEFAULT_AUTOATTACK)
 
   GEN_BOOL("killstack", game.info.killstack,
            SSET_RULES_SCENARIO, SSET_MILITARY, SSET_RARE,
@@ -2434,7 +2460,7 @@ static struct setting settings[] = {
               "and is not inside a city or suitable base, all units in the same "
               "tile are destroyed along with the defender. If this is disabled, "
               "only the defender unit is destroyed."),
-           NULL, NULL, GAME_DEFAULT_KILLSTACK)
+           nullptr, nullptr, GAME_DEFAULT_KILLSTACK)
 
   GEN_BOOL("killcitizen", game.info.killcitizen,
            SSET_RULES, SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2443,7 +2469,7 @@ static struct setting settings[] = {
               "after a successful attack by an enemy unit. If this is "
               "disabled, population is never reduced. Even when this is "
               "enabled, only some units may kill citizens."),
-           NULL, NULL, GAME_DEFAULT_KILLCITIZEN)
+           nullptr, nullptr, GAME_DEFAULT_KILLCITIZEN)
 
   GEN_INT("killunhomed", game.server.killunhomed,
           SSET_RULES, SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2453,7 +2479,7 @@ static struct setting settings[] = {
              "given by 'killunhomed' percent of the hitpoints of the unit "
              "type. At least one hitpoint is lost every turn until the "
              "death of the unit."),
-          NULL, NULL, NULL, GAME_MIN_KILLUNHOMED, GAME_MAX_KILLUNHOMED,
+          nullptr, nullptr, nullptr, GAME_MIN_KILLUNHOMED, GAME_MAX_KILLUNHOMED,
           GAME_DEFAULT_KILLUNHOMED)
 
   GEN_ENUM("borders", game.info.borders,
@@ -2466,7 +2492,7 @@ static struct setting settings[] = {
               "SEE_INSIDE and EXPAND makes everything inside a player's "
               "borders visible at once. ENABLED will, in some rulesets, "
               "grant the same visibility if certain conditions are met."),
-           NULL, NULL, NULL, borders_name, GAME_DEFAULT_BORDERS)
+           nullptr, nullptr, nullptr, borders_name, GAME_DEFAULT_BORDERS)
 
   GEN_ENUM("happyborders", game.info.happyborders,
            SSET_RULES, SSET_MILITARY, SSET_SITUATIONAL,
@@ -2474,7 +2500,7 @@ static struct setting settings[] = {
            N_("Units inside borders cause no unhappiness"),
            N_("If this is set, units will not cause unhappiness when "
               "inside your borders, or even allies borders, depending "
-              "on value."), NULL, NULL, NULL,
+              "on value."), nullptr, nullptr, nullptr,
            happyborders_name, GAME_DEFAULT_HAPPYBORDERS)
 
   GEN_ENUM("diplomacy", game.info.diplomacy,
@@ -2483,7 +2509,7 @@ static struct setting settings[] = {
            N_("Ability to do diplomacy with other players"),
            N_("This setting controls the ability to do diplomacy with "
               "other players."),
-           NULL, NULL, NULL, diplomacy_name, GAME_DEFAULT_DIPLOMACY)
+           nullptr, nullptr, nullptr, diplomacy_name, GAME_DEFAULT_DIPLOMACY)
 
   GEN_ENUM("citynames", game.server.allowed_city_names,
            SSET_RULES, SSET_SOCIOLOGY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2501,7 +2527,8 @@ static struct setting settings[] = {
               "\"Globally unique\", but a player isn't allowed to use a "
               "default city name of another nation unless it is a default "
               "for their nation also."),
-           NULL, NULL, NULL, citynames_name, GAME_DEFAULT_ALLOWED_CITY_NAMES)
+           nullptr, nullptr, nullptr, citynames_name,
+           GAME_DEFAULT_ALLOWED_CITY_NAMES)
 
   GEN_ENUM("plrcolormode", game.server.plrcolormode,
            SSET_RULES, SSET_INTERNAL, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2533,14 +2560,14 @@ static struct setting settings[] = {
               "get a random color from the list in the ruleset.\n"
               "Regardless of this setting, individual player colors can be "
               "changed after the game starts with the 'playercolor' command."),
-           NULL, plrcol_validate, plrcol_action, plrcol_name,
+           nullptr, plrcol_validate, plrcol_action, plrcol_name,
            GAME_DEFAULT_PLRCOLORMODE)
 
   /* Flexible rules: these can be changed after the game has started.
    *
    * The distinction between "rules" and "flexible rules" is not always
    * clearcut, and some existing cases may be largely historical or
-   * accidental.  However some generalizations can be made:
+   * accidental. However some generalizations can be made:
    *
    *   -- Low-level game mechanics should not be flexible (eg, rulesets).
    *   -- Options which would affect the game "state" (city production etc)
@@ -2557,15 +2584,16 @@ static struct setting settings[] = {
             * should not be translated. */
            N_("This setting controls how frequently the barbarians appear "
               "in the game. See also the 'onsetbarbs' setting."),
-           NULL, NULL, NULL, barbarians_name, GAME_DEFAULT_BARBARIANRATE)
+           nullptr, nullptr, nullptr, barbarians_name,
+           GAME_DEFAULT_BARBARIANRATE)
 
   GEN_INT("onsetbarbs", game.server.onsetbarbarian,
           SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_VITAL,
           ALLOW_NONE, ALLOW_BASIC,
           N_("Barbarian onset turn"),
           N_("Barbarians will not appear before this turn."),
-          NULL, NULL, NULL,
-          GAME_MIN_ONSETBARBARIAN, GAME_MAX_ONSETBARBARIAN, 
+          nullptr, nullptr, nullptr,
+          GAME_MIN_ONSETBARBARIAN, GAME_MAX_ONSETBARBARIAN,
           GAME_DEFAULT_ONSETBARBARIAN)
 
   GEN_ENUM("revolentype", game.info.revolentype,
@@ -2577,7 +2605,8 @@ static struct setting settings[] = {
               "many times any player has changed to this type of government "
               "before, so it becomes easier to establish a new system of "
               "government if it has been done before."),
-           NULL, NULL, NULL, revolentype_name, GAME_DEFAULT_REVOLENTYPE)
+           nullptr, nullptr, nullptr, revolentype_name,
+           GAME_DEFAULT_REVOLENTYPE)
 
   GEN_INT("revolen", game.server.revolution_length,
           SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE,
@@ -2586,8 +2615,8 @@ static struct setting settings[] = {
           N_("When changing governments, a period of anarchy will occur. "
              "Value of this setting, used the way 'revolentype' setting "
              "dictates, defines the length of the anarchy."),
-          NULL, NULL, NULL,
-          GAME_MIN_REVOLUTION_LENGTH, GAME_MAX_REVOLUTION_LENGTH, 
+          nullptr, nullptr, nullptr,
+          GAME_MIN_REVOLUTION_LENGTH, GAME_MAX_REVOLUTION_LENGTH,
           GAME_DEFAULT_REVOLUTION_LENGTH)
 
   GEN_BOOL("fogofwar", game.info.fogofwar,
@@ -2597,7 +2626,7 @@ static struct setting settings[] = {
               "the vision range of your own units and cities will be "
               "revealed to you. You will not see new cities or terrain "
               "changes in tiles not observed."),
-           NULL, NULL, GAME_DEFAULT_FOGOFWAR)
+           nullptr, nullptr, GAME_DEFAULT_FOGOFWAR)
 
   GEN_BOOL("foggedborders", game.server.foggedborders,
            SSET_RULES, SSET_MILITARY, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -2607,7 +2636,7 @@ static struct setting settings[] = {
               "direct sight of the affected tiles. Otherwise, players "
               "can see any or all changes to borders as long as they "
               "have previously seen the tiles."),
-           NULL, NULL, GAME_DEFAULT_FOGGEDBORDERS)
+           nullptr, nullptr, GAME_DEFAULT_FOGGEDBORDERS)
 
   GEN_BITWISE("airliftingstyle", game.info.airlifting_style,
               SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_SITUATIONAL,
@@ -2630,7 +2659,8 @@ static struct setting settings[] = {
                  "(DEST_UNLIMITED): airlifting to a city doesn't "
                  "reduce the airlifted counter. It depends on the ruleset "
                  "whether this is possible even with zero airlift capacity."),
-              NULL, NULL, airliftingstyle_name, GAME_DEFAULT_AIRLIFTINGSTYLE)
+              nullptr, nullptr, airliftingstyle_name,
+              GAME_DEFAULT_AIRLIFTINGSTYLE)
 
   GEN_INT("diplchance", game.server.diplchance,
           SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_SITUATIONAL,
@@ -2643,7 +2673,7 @@ static struct setting settings[] = {
              "Unit Bribing, and Unit Sabotaging never do. "
              "Non-aggressive missions typically have no base chance "
              "at all, but always success."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_DIPLCHANCE, GAME_MAX_DIPLCHANCE, GAME_DEFAULT_DIPLCHANCE)
 
   GEN_BITWISE("victories", game.info.victory_conditions,
@@ -2652,8 +2682,8 @@ static struct setting settings[] = {
               N_("What kinds of victories are possible"),
               /* TRANS: The strings between double quotes are also translated
                * separately (they must match!). The strings between single
-               * quotes are setting names and shouldn't be translated. The
-               * strings between parentheses and in uppercase must stay as
+               * quotes are setting names and shouldn't be translated.
+               * The strings between parentheses and in uppercase must stay as
                * untranslated. */
               N_("This setting controls how game can be won. One can always "
                  "win by conquering entire planet, but other victory conditions "
@@ -2666,21 +2696,23 @@ static struct setting settings[] = {
                  "domination criteria.\n"
                  "- \"World Peace\" (WORLDPEACE): There's no wars in the world for "
                  "the specified amount of turns.\n"),
-              NULL, NULL, victory_conditions_name, GAME_DEFAULT_VICTORY_CONDITIONS)
+              nullptr, nullptr, victory_conditions_name,
+              GAME_DEFAULT_VICTORY_CONDITIONS)
 
   GEN_BOOL("endspaceship", game.server.endspaceship, SSET_RULES_FLEXIBLE,
            SSET_SCIENCE, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
            N_("Should the game end if the spaceship arrives?"),
            N_("If this option is turned on, the game will end with the "
               "arrival of a spaceship at Alpha Centauri."),
-           NULL, NULL, GAME_DEFAULT_END_SPACESHIP)
+           nullptr, nullptr, GAME_DEFAULT_END_SPACESHIP)
 
   GEN_INT("spaceship_travel_pct", game.server.spaceship_travel_pct,
            SSET_RULES_FLEXIBLE, SSET_SCIENCE, SSET_VITAL, ALLOW_NONE,
            ALLOW_BASIC,
            N_("Percentage to multiply spaceship travel time by"),
            N_("This percentage is multiplied onto the time it will take for "
-              "a spaceship to arrive at Alpha Centauri."), NULL, NULL, NULL,
+              "a spaceship to arrive at Alpha Centauri."),
+          nullptr, nullptr, nullptr,
           GAME_MIN_SPACESHIP_TRAVEL_PCT, GAME_MAX_SPACESHIP_TRAVEL_PCT,
           GAME_DEFAULT_SPACESHIP_TRAVEL_PCT)
 
@@ -2691,7 +2723,7 @@ static struct setting settings[] = {
           N_("A civil war is triggered when a player has at least this "
              "many cities and the player's capital is captured. If "
              "this option is set to the maximum value, civil wars are "
-             "turned off altogether."), NULL, NULL, NULL,
+             "turned off altogether."), nullptr, nullptr, nullptr,
           GAME_MIN_CIVILWARSIZE, GAME_MAX_CIVILWARSIZE,
           GAME_DEFAULT_CIVILWARSIZE)
 
@@ -2700,7 +2732,7 @@ static struct setting settings[] = {
            ALLOW_NONE, ALLOW_BASIC,
            N_("Restrict the use of the infrastructure for enemy units"),
            N_("If this option is enabled, the use of roads and rails "
-              "will be restricted for enemy units."), NULL, NULL,
+              "will be restricted for enemy units."), nullptr, nullptr,
            GAME_DEFAULT_RESTRICTINFRA)
 
   GEN_BOOL("unreachableprotects", game.info.unreachable_protects,
@@ -2713,7 +2745,7 @@ static struct setting settings[] = {
               "tiles with an unreachable unit in them cannot be attacked. "
               "Some units in some rulesets may override this, never "
               "protecting reachable units on their tile."),
-           NULL, NULL, GAME_DEFAULT_UNRPROTECTS)
+           nullptr, nullptr, GAME_DEFAULT_UNRPROTECTS)
 
   GEN_INT("contactturns", game.server.contactturns,
           SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_RARE,
@@ -2723,7 +2755,7 @@ static struct setting settings[] = {
              "after their units have last met, even when they do not have "
              "an embassy. If set to zero, then players cannot meet unless "
              "they have an embassy."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_CONTACTTURNS, GAME_MAX_CONTACTTURNS,
           GAME_DEFAULT_CONTACTTURNS)
 
@@ -2737,7 +2769,7 @@ static struct setting settings[] = {
               "requirement for building a palace will be ignored. (In "
               "some rulesets, buildings other than the palace are affected "
               "by this setting.)"),
-           NULL, NULL, GAME_DEFAULT_SAVEPALACE)
+           nullptr, nullptr, GAME_DEFAULT_SAVEPALACE)
 
   GEN_BOOL("homecaughtunits", game.server.homecaughtunits,
            SSET_RULES_FLEXIBLE, SSET_MILITARY, SSET_RARE,
@@ -2747,7 +2779,7 @@ static struct setting settings[] = {
             * should not be translated. */
            N_("If unset, caught units will have no homecity and will be "
               "subject to the 'killunhomed' option."),
-           NULL, NULL, GAME_DEFAULT_HOMECAUGHTUNITS)
+           nullptr, nullptr, GAME_DEFAULT_HOMECAUGHTUNITS)
 
   GEN_BOOL("naturalcitynames", game.server.natural_city_names,
            SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE,
@@ -2755,7 +2787,7 @@ static struct setting settings[] = {
            N_("Whether to use natural city names"),
            N_("If enabled, the default city names will be determined based "
               "on the surrounding terrain."),
-           NULL, NULL, GAME_DEFAULT_NATURALCITYNAMES)
+           nullptr, nullptr, GAME_DEFAULT_NATURALCITYNAMES)
 
   GEN_BOOL("migration", game.server.migration,
            SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE,
@@ -2777,7 +2809,7 @@ static struct setting settings[] = {
               "  'mgr_distance'     - How far citizens will migrate.\n"
               "  'mgr_worldchance'  - Chance for inter-nation migration.\n"
               "  'mgr_nationchance' - Chance for intra-nation migration."),
-           NULL, NULL, GAME_DEFAULT_MIGRATION)
+           nullptr, nullptr, GAME_DEFAULT_MIGRATION)
 
   GEN_INT("mgr_turninterval", game.server.mgr_turninterval,
           SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE,
@@ -2792,7 +2824,7 @@ static struct setting settings[] = {
              "current city. Migration will never occur the same turn "
              "that a city is built. This setting has no effect unless "
              "migration is enabled by the 'migration' setting."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_MGR_TURNINTERVAL, GAME_MAX_MGR_TURNINTERVAL,
           GAME_DEFAULT_MGR_TURNINTERVAL)
 
@@ -2804,7 +2836,7 @@ static struct setting settings[] = {
            N_("If this setting is enabled, citizens will not migrate to "
               "cities which would not have enough food to support them. "
               "This setting has no effect unless migration is enabled by "
-              "the 'migration' setting."), NULL, NULL,
+              "the 'migration' setting."), nullptr, nullptr,
            GAME_DEFAULT_MGR_FOODNEEDED)
 
   GEN_INT("mgr_distance", game.server.mgr_distance,
@@ -2822,8 +2854,8 @@ static struct setting settings[] = {
              "destination city's working radius.) This setting has no "
              "effect unless migration is enabled by the 'migration' "
              "setting."),
-          NULL, NULL, NULL, GAME_MIN_MGR_DISTANCE, GAME_MAX_MGR_DISTANCE,
-          GAME_DEFAULT_MGR_DISTANCE)
+          nullptr, nullptr, nullptr, GAME_MIN_MGR_DISTANCE,
+          GAME_MAX_MGR_DISTANCE, GAME_DEFAULT_MGR_DISTANCE)
 
   GEN_INT("mgr_nationchance", game.server.mgr_nationchance,
           SSET_RULES_FLEXIBLE, SSET_SOCIOLOGY, SSET_RARE,
@@ -2836,7 +2868,7 @@ static struct setting settings[] = {
              "migration will always occur if the citizens find a suitable "
              "destination. This setting has no effect unless migration "
              "is activated by the 'migration' setting."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_MGR_NATIONCHANCE, GAME_MAX_MGR_NATIONCHANCE,
           GAME_DEFAULT_MGR_NATIONCHANCE)
 
@@ -2851,7 +2883,7 @@ static struct setting settings[] = {
              "that citizens will always migrate if they find a suitable "
              "destination. This setting has no effect if migration is "
              "not enabled by the 'migration' setting."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_MGR_WORLDCHANCE, GAME_MAX_MGR_WORLDCHANCE,
           GAME_DEFAULT_MGR_WORLDCHANCE)
 
@@ -2898,7 +2930,7 @@ static struct setting settings[] = {
                 "     3 = Controller allowed, no observers allowed, "
                 "can't displace connections;\n"
                 "     4 = No controller allowed, observers allowed"),
-             allowtake_callback, NULL, GAME_DEFAULT_ALLOW_TAKE)
+             allowtake_callback, nullptr, GAME_DEFAULT_ALLOW_TAKE)
 
   GEN_BOOL("autotoggle", game.server.auto_ai_toggle,
            SSET_META, SSET_NETWORK, SSET_SITUATIONAL,
@@ -2906,13 +2938,13 @@ static struct setting settings[] = {
            N_("Whether AI-status toggles with connection"),
            N_("If enabled, AI status is turned off when a player "
               "connects, and on when a player disconnects."),
-           NULL, autotoggle_action, GAME_DEFAULT_AUTO_AI_TOGGLE)
+           nullptr, autotoggle_action, GAME_DEFAULT_AUTO_AI_TOGGLE)
 
   GEN_INT("endturn", game.server.end_turn,
           SSET_META, SSET_SOCIOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
           N_("Turn the game ends"),
           N_("The game will end at the end of the given turn."),
-          NULL, endturn_callback, NULL,
+          nullptr, endturn_callback, nullptr,
           GAME_MIN_END_TURN, GAME_MAX_END_TURN, GAME_DEFAULT_END_TURN)
 
   GEN_BITWISE("revealmap", game.server.revealmap, SSET_GAME_INIT,
@@ -2920,8 +2952,8 @@ static struct setting settings[] = {
               N_("Reveal the map"),
               /* TRANS: The strings between double quotes are also translated
                * separately (they must match!). The strings between single
-               * quotes are setting names and shouldn't be translated. The
-               * strings between parentheses and in uppercase must not be
+               * quotes are setting names and shouldn't be translated.
+               * The strings between parentheses and in uppercase must not be
                * translated. */
               N_("If \"Reveal map at game start\" (START) is set, the "
                  "initial state of the entire map will be known to all "
@@ -2930,7 +2962,7 @@ static struct setting settings[] = {
                  "If \"Unfog map for dead players\" (DEAD) is set, dead "
                  "players can see the entire map, if they are alone in "
                  "their team."),
-             NULL, NULL, revealmap_name, GAME_DEFAULT_REVEALMAP)
+             nullptr, nullptr, revealmap_name, GAME_DEFAULT_REVEALMAP)
 
   GEN_INT("timeout", game.info.timeout,
           SSET_META, SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
@@ -2948,7 +2980,7 @@ static struct setting settings[] = {
              "command \"timeoutincrease\" to have a dynamic timer. "
              "The first turn is treated as a special case and is controlled "
              "by the 'first_timeout' setting."),
-          NULL, timeout_callback, timeout_action,
+          nullptr, timeout_callback, timeout_action,
           GAME_MIN_TIMEOUT, GAME_MAX_TIMEOUT, GAME_DEFAULT_TIMEOUT)
 
   GEN_INT("first_timeout", game.info.first_timeout,
@@ -2960,7 +2992,7 @@ static struct setting settings[] = {
              "If set to 0, T1 will not have a timeout.\n"
              "If set to -1, the special treatment of T1 will be disabled.\n"
              "See also 'timeout'."),
-          NULL, first_timeout_callback, first_timeout_action,
+          nullptr, first_timeout_callback, first_timeout_action,
           GAME_MIN_FIRST_TIMEOUT, GAME_MAX_FIRST_TIMEOUT,
           GAME_DEFAULT_FIRST_TIMEOUT)
 
@@ -2969,7 +3001,7 @@ static struct setting settings[] = {
           N_("Timeout at least n seconds when enemy moved"),
           N_("Any time a unit moves while in sight of an enemy player, "
              "the remaining timeout is increased to this value."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           0, GAME_MAX_TIMEOUT, GAME_DEFAULT_TIMEOUTADDEMOVE)
 
   GEN_INT("unitwaittime", game.server.unitwaittime,
@@ -2985,7 +3017,7 @@ static struct setting settings[] = {
              "before the turn change, it will not be able to move or act "
              "in the next turn for at least 15 seconds. This value is "
              "limited to a maximum value of 2/3 'timeout'."),
-          NULL, unitwaittime_callback, NULL, GAME_MIN_UNITWAITTIME,
+          nullptr, unitwaittime_callback, nullptr, GAME_MIN_UNITWAITTIME,
           GAME_MAX_UNITWAITTIME, GAME_DEFAULT_UNITWAITTIME)
 
   /* This setting points to the "stored" value; changing it won't have
@@ -2998,7 +3030,8 @@ static struct setting settings[] = {
            N_("This setting controls whether players may make "
               "moves at the same time during a turn. Change "
               "in setting takes effect next turn."),
-           phasemode_help, NULL, NULL, phasemode_name, GAME_DEFAULT_PHASE_MODE)
+           phasemode_help, nullptr, nullptr, phasemode_name,
+           GAME_DEFAULT_PHASE_MODE)
 
   GEN_INT("nettimeout", game.server.tcptimeout,
           SSET_META, SSET_NETWORK, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
@@ -3007,7 +3040,7 @@ static struct setting settings[] = {
              "this value, then the connection is closed. Zero "
              "means there is no timeout (although connections will be "
              "automatically disconnected eventually)."),
-          NULL, NULL, NULL,
+          nullptr, nullptr, nullptr,
           GAME_MIN_TCPTIMEOUT, GAME_MAX_TCPTIMEOUT, GAME_DEFAULT_TCPTIMEOUT)
 
   GEN_INT("netwait", game.server.netwait,
@@ -3016,14 +3049,14 @@ static struct setting settings[] = {
           N_("The server will wait for up to the value of this "
              "parameter in seconds, for all client connection network "
              "buffers to unblock. Zero means the server will not "
-             "wait at all."), NULL, NULL, NULL,
+             "wait at all."), nullptr, nullptr, nullptr,
           GAME_MIN_NETWAIT, GAME_MAX_NETWAIT, GAME_DEFAULT_NETWAIT)
 
   GEN_INT("pingtime", game.server.pingtime,
           SSET_META, SSET_NETWORK, SSET_RARE, ALLOW_NONE, ALLOW_BASIC,
           N_("Seconds between PINGs"),
           N_("The server will poll the clients with a PING request "
-             "each time this period elapses."), NULL, NULL, NULL,
+             "each time this period elapses."), nullptr, nullptr, nullptr,
           GAME_MIN_PINGTIME, GAME_MAX_PINGTIME, GAME_DEFAULT_PINGTIME)
 
   GEN_INT("pingtimeout", game.server.pingtimeout,
@@ -3031,7 +3064,7 @@ static struct setting settings[] = {
           ALLOW_NONE, ALLOW_BASIC,
           N_("Time to cut a client"),
           N_("If a client doesn't reply to a PING in this time the "
-             "client is disconnected."), NULL, NULL, NULL,
+             "client is disconnected."), nullptr, nullptr, nullptr,
           GAME_MIN_PINGTIMEOUT, GAME_MAX_PINGTIMEOUT, GAME_DEFAULT_PINGTIMEOUT)
 
   GEN_BOOL("iphide", game.server.ip_hide,
@@ -3041,7 +3074,7 @@ static struct setting settings[] = {
            N_("Don't tell client IP address to other clients. Server operator "
               "can still see it. Also, changing this setting cannot do anything "
               "to the information already sent before."),
-           NULL, NULL, GAME_DEFAULT_IPHIDE)
+           nullptr, nullptr, GAME_DEFAULT_IPHIDE)
 
   GEN_BOOL("turnblock", game.server.turnblock,
            SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
@@ -3050,7 +3083,7 @@ static struct setting settings[] = {
            N_("If this is turned on, the game turn is not advanced "
               "until all players have finished their turn, including "
               "disconnected players."),
-           NULL, NULL, GAME_DEFAULT_TURNBLOCK)
+           nullptr, nullptr, GAME_DEFAULT_TURNBLOCK)
 
   GEN_BOOL("fixedlength", game.server.fixedlength,
            SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
@@ -3061,7 +3094,7 @@ static struct setting settings[] = {
            N_("If this is turned on the game turn will not advance "
               "until the timeout has expired, even after all players "
               "have clicked on \"Turn Done\"."),
-           NULL, NULL, FALSE)
+           nullptr, nullptr, FALSE)
 
   GEN_INT("top_cities", game.info.top_cities_count,
           SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
@@ -3069,7 +3102,7 @@ static struct setting settings[] = {
           N_("Number of cities in Top Cities report"),
           N_("How many cities should the Top Cities report contain? "
              "If this is zero, Top Cities report is not available "
-             "at all."), NULL, NULL, NULL,
+             "at all."), nullptr, nullptr, nullptr,
           GAME_MIN_TOP_CITIES_COUNT, GAME_MAX_TOP_CITIES_COUNT,
           GAME_DEFAULT_TOP_CITIES_COUNT)
 
@@ -3100,7 +3133,7 @@ static struct setting settings[] = {
                 "    b = display \"best nation\" column\n"
                 "The order of characters is not significant, but "
                 "their capitalization is."),
-             demography_callback, NULL, GAME_DEFAULT_DEMOGRAPHY)
+             demography_callback, nullptr, GAME_DEFAULT_DEMOGRAPHY)
 
   GEN_INT("saveturns", game.server.save_nturns,
           SSET_META, SSET_INTERNAL, SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
@@ -3110,7 +3143,7 @@ static struct setting settings[] = {
            * quotes is a setting name and shouldn't be translated. */
           N_("How many turns elapse between automatic game saves. This "
              "setting only has an effect when the 'autosaves' setting "
-             "includes \"New turn\"."), NULL, NULL, NULL,
+             "includes \"New turn\"."), nullptr, nullptr, nullptr,
           GAME_MIN_SAVETURNS, GAME_MAX_SAVETURNS, GAME_DEFAULT_SAVETURNS)
 
   GEN_INT("savefrequency", game.server.save_frequency,
@@ -3123,8 +3156,10 @@ static struct setting settings[] = {
              "Unlike other save types, this save is only meant as backup "
              "for computer memory, and it always uses the same name, older "
              "saves are not kept. This setting only has an effect when the "
-             "'autosaves' setting includes \"Timer\"."), NULL, NULL, NULL,
-          GAME_MIN_SAVEFREQUENCY, GAME_MAX_SAVEFREQUENCY, GAME_DEFAULT_SAVEFREQUENCY)
+             "'autosaves' setting includes \"Timer\"."),
+          nullptr, nullptr, nullptr,
+          GAME_MIN_SAVEFREQUENCY, GAME_MAX_SAVEFREQUENCY,
+          GAME_DEFAULT_SAVEFREQUENCY)
 
   GEN_BITWISE("autosaves", game.server.autosaves,
               SSET_META, SSET_INTERNAL, SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
@@ -3143,7 +3178,8 @@ static struct setting settings[] = {
                  "- \"Server interrupted\" (INTERRUPT): Save when server "
                  "quits due to interrupt.\n"
                  "- \"Timer\" (TIMER): Save every 'savefrequency' minutes."),
-              autosaves_callback, NULL, autosaves_name, GAME_DEFAULT_AUTOSAVES)
+              autosaves_callback, nullptr, autosaves_name,
+              GAME_DEFAULT_AUTOSAVES)
 
   GEN_BOOL("threaded_save", game.server.threaded_save,
            SSET_META, SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
@@ -3154,7 +3190,7 @@ static struct setting settings[] = {
               "file containing the game situation takes place in "
               "the background while game otherwise continues. This way "
               "users are not required to wait for the save to finish."),
-           NULL, NULL, GAME_DEFAULT_THREADED_SAVE)
+           nullptr, nullptr, GAME_DEFAULT_THREADED_SAVE)
 
   GEN_INT("compress", game.server.save_compress_level,
           SSET_META, SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
@@ -3163,20 +3199,22 @@ static struct setting settings[] = {
           N_("If non-zero, saved games will be compressed depending on the "
              "'compresstype' setting. Larger values will give better "
              "compression but take longer."),
-          NULL, NULL, NULL,
-          GAME_MIN_COMPRESS_LEVEL, GAME_MAX_COMPRESS_LEVEL, GAME_DEFAULT_COMPRESS_LEVEL)
+          nullptr, nullptr, nullptr,
+          GAME_MIN_COMPRESS_LEVEL, GAME_MAX_COMPRESS_LEVEL,
+          GAME_DEFAULT_COMPRESS_LEVEL)
 
   GEN_ENUM("compresstype", game.server.save_compress_type,
            SSET_META, SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
            N_("Savegame compression algorithm"),
            N_("Compression library to use for savegames."),
-           NULL, NULL, NULL, compresstype_name, GAME_DEFAULT_COMPRESS_TYPE)
+           nullptr, nullptr, nullptr, compresstype_name,
+           GAME_DEFAULT_COMPRESS_TYPE)
 
   GEN_STRING("savename", game.server.save_name,
              SSET_META, SSET_INTERNAL, SSET_VITAL, ALLOW_HACK, ALLOW_HACK,
              N_("Definition of the save file name"),
-             /* TRANS: %R, %S, %T and %Y must not be translated. The
-              * strings (examples and setting names) between single quotes
+             /* TRANS: %R, %S, %T and %Y must not be translated.
+              * The strings (examples and setting names) between single quotes
               * neither. The strings between <> should be translated.
               * xgettext:no-c-format */
              N_("Within the string the following custom formats are "
@@ -3193,7 +3231,7 @@ static struct setting settings[] = {
                 "savegames will overwrite old ones. If none of the formats "
                 "is used '-T%04T-Y%05Y-%R' is appended to the value of "
                 "'savename'."),
-             savename_validate, NULL, GAME_DEFAULT_SAVE_NAME)
+             savename_validate, nullptr, GAME_DEFAULT_SAVE_NAME)
 
   GEN_BOOL("scorelog", game.server.scorelog,
            SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
@@ -3208,14 +3246,14 @@ static struct setting settings[] = {
            N_("If this is turned on, player statistics are appended to "
               "the file defined by the option 'scorefile' every turn. "
               "These statistics can be used to create power graphs after "
-              "the game."), NULL, scorelog_action, GAME_DEFAULT_SCORELOG)
+              "the game."), nullptr, scorelog_action, GAME_DEFAULT_SCORELOG)
 
   GEN_ENUM("scoreloglevel", game.server.scoreloglevel,
            SSET_META, SSET_INTERNAL, SSET_SITUATIONAL,
            ALLOW_HACK, ALLOW_HACK,
            N_("Scorelog level"),
            N_("Whether scores are logged for all players including AIs, "
-              "or only for human players."), NULL, NULL, NULL,
+              "or only for human players."), nullptr, nullptr, nullptr,
            scoreloglevel_name, GAME_DEFAULT_SCORELOGLEVEL)
 
 #ifndef FREECIV_WEB
@@ -3226,7 +3264,7 @@ static struct setting settings[] = {
              /* TRANS: Don't translate the string in single quotes. */
              N_("The default name for the score log file is "
               "'freeciv-score.log'."),
-             scorefile_validate, NULL, GAME_DEFAULT_SCOREFILE)
+             scorefile_validate, nullptr, GAME_DEFAULT_SCOREFILE)
 #endif /* !FREECIV_WEB */
 
   GEN_INT("maxconnectionsperhost", game.server.maxconnectionsperhost,
@@ -3237,7 +3275,8 @@ static struct setting settings[] = {
              "the total number of connections from the very same host "
              "equals or exceeds this value. A value of 0 means that "
              "there is no limit, at least up to the maximum number of "
-             "connections supported by the server."), NULL, NULL, NULL,
+             "connections supported by the server."),
+          nullptr, nullptr, nullptr,
           GAME_MIN_MAXCONNECTIONSPERHOST, GAME_MAX_MAXCONNECTIONSPERHOST,
           GAME_DEFAULT_MAXCONNECTIONSPERHOST)
 
@@ -3245,18 +3284,19 @@ static struct setting settings[] = {
           SSET_RULES_FLEXIBLE, SSET_NETWORK, SSET_RARE,
           ALLOW_HACK, ALLOW_HACK,
           N_("Time before a kicked user can reconnect"),
-          /* TRANS: the string in double quotes is a server command name and
+          /* TRANS: The string in double quotes is a server command name and
            * should not be translated */
           N_("Gives the time in seconds before a user kicked using the "
              "\"kick\" command may reconnect. Changing this setting will "
-             "affect users kicked in the past."), NULL, NULL, NULL,
+             "affect users kicked in the past."),
+          nullptr, nullptr, nullptr,
           GAME_MIN_KICK_TIME, GAME_MAX_KICK_TIME, GAME_DEFAULT_KICK_TIME)
 
   GEN_INT("luatimeout", game.lua_timeout,
           SSET_RULES_FLEXIBLE, SSET_INTERNAL, SSET_RARE, ALLOW_HACK, ALLOW_HACK,
           N_("Lua timeout"),
           N_("Time in seconds that a single lua script can run before it gets "
-             "forcibly terminated."), NULL, NULL, NULL,
+             "forcibly terminated."), nullptr, nullptr, nullptr,
           GAME_MIN_LUA_TIMEOUT, GAME_MAX_LUA_TIMEOUT, GAME_DEFAULT_LUA_TIMEOUT)
 
   GEN_STRING_NRS("metamessage", game.server.meta_info.user_message,
@@ -3267,14 +3307,14 @@ static struct setting settings[] = {
                     "automatically generated message. "
                     "Set to empty (\"\", not \"empty\") to always use an "
                     "automatically generated meta server message."),
-                 NULL, metamessage_action, GAME_DEFAULT_USER_META_MESSAGE)
+                 nullptr, metamessage_action, GAME_DEFAULT_USER_META_MESSAGE)
 
   GEN_ENUM("ailevel", game.info.skill_level,
            SSET_META, SSET_INTERNAL, SSET_VITAL, ALLOW_NONE, ALLOW_CTRL,
            N_("Level of new AIs"),
            N_("Difficulty level of any AI players to be created now on. "
               "Changing value of this setting does not affect "
-              "existing players."), NULL, NULL, NULL,
+              "existing players."), nullptr, nullptr, nullptr,
            ailevel_name, GAME_DEFAULT_SKILL_LEVEL)
 
   GEN_STRING_NRS("aitype", game.server.default_ai_type_name,
@@ -3300,7 +3340,7 @@ static const int SETTINGS_NUM = ARRAY_SIZE(settings);
 ****************************************************************************/
 struct setting *setting_by_number(int id)
 {
-  return (0 <= id && id < SETTINGS_NUM ? settings + id : NULL);
+  return (0 <= id && id < SETTINGS_NUM ? settings + id : nullptr);
 }
 
 /************************************************************************//**
@@ -3308,14 +3348,15 @@ struct setting *setting_by_number(int id)
 ****************************************************************************/
 struct setting *setting_by_name(const char *name)
 {
-  fc_assert_ret_val(name, NULL);
+  fc_assert_ret_val(name, nullptr);
 
   settings_iterate(SSET_ALL, pset) {
     if (0 == strcmp(name, pset->name)) {
       return pset;
     }
   } settings_iterate_end;
-  return NULL;
+
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -3323,7 +3364,8 @@ struct setting *setting_by_name(const char *name)
 ****************************************************************************/
 int setting_number(const struct setting *pset)
 {
-  fc_assert_ret_val(pset != NULL, -1);
+  fc_assert_ret_val(pset != nullptr, -1);
+
   return pset - settings;
 }
 
@@ -3349,7 +3391,7 @@ const char *setting_short_help(const struct setting *pset)
 ****************************************************************************/
 const char *setting_extra_help(const struct setting *pset, bool constant)
 {
-  if (!constant && pset->help_func != NULL) {
+  if (!constant && pset->help_func != nullptr) {
     return pset->help_func(pset);
   }
 
@@ -3644,7 +3686,7 @@ static bool setting_bool_validate_base(const struct setting *pset,
 
   return (setting_match_prefix(pset->boolean.name, buf, pint_val,
                                reject_msg, reject_msg_len)
-          && (NULL == pset->boolean.validate
+          && (pset->boolean.validate == nullptr
               || pset->boolean.validate(0 != *pint_val, caller, reject_msg,
                                         reject_msg_len)));
 }
@@ -3704,7 +3746,7 @@ static const char *setting_bool_secfile_str(secfile_data_t data, int val)
   const struct sset_val_name *name =
       ((const struct setting *) data)->boolean.name(val);
 
-  return (NULL != name ? name->support : NULL);
+  return (name != nullptr ? name->support : nullptr);
 }
 
 /************************************************************************//**
@@ -3861,7 +3903,7 @@ char *setting_str_get(struct setting *pset)
   fc_assert(setting_type(pset) == SST_STRING);
 
   return pset->string.value;
-}             
+}
 
 /************************************************************************//**
   Convert the integer to the long support string representation of an
@@ -3874,30 +3916,31 @@ const char *setting_enum_secfile_str(secfile_data_t data, int val)
 
   name = info->set->enumerator.name(val);
 
-  if (info->compat && name != NULL) {
+  if (info->compat && name != nullptr) {
     const char *ret = setcompat_current_val_from_previous(info->set,
                                                           name->support);
 
-    if (ret != NULL) {
+    if (ret != nullptr) {
       return ret;
     }
   }
 
-  return (NULL != name ? name->support : NULL);
+  return (name != nullptr ? name->support : nullptr);
 }
 
 /************************************************************************//**
   Convert the integer to the string representation of an enumerator.
-  Return NULL if 'val' is not a valid enumerator.
+  Return nullptr if 'val' is not a valid enumerator.
 ****************************************************************************/
 const char *setting_enum_val(const struct setting *pset, int val, bool pretty)
 {
   const struct sset_val_name *name;
 
-  fc_assert_ret_val(SST_ENUM == pset->stype, NULL);
+  fc_assert_ret_val(SST_ENUM == pset->stype, nullptr);
+
   name = pset->enumerator.name(val);
-  if (NULL == name) {
-    return NULL;
+  if (name == nullptr) {
+    return nullptr;
   } else if (pretty) {
     return _(name->pretty);
   } else {
@@ -3950,13 +3993,13 @@ static bool setting_enum_validate_base(const struct setting *pset,
 
   return (setting_match_prefix(pset->enumerator.name, buf, pint_val,
                                reject_msg, reject_msg_len)
-          && (NULL == pset->enumerator.validate
+          && (pset->enumerator.validate == nullptr
               || pset->enumerator.validate(*pint_val, caller, reject_msg,
                                            reject_msg_len)));
 }
 
 /************************************************************************//**
-  Helper function to write value to enumerator setting 
+  Helper function to write value to enumerator setting
 ****************************************************************************/
 static bool set_enum_value(struct setting *pset, int val)
 {
@@ -3990,7 +4033,7 @@ static bool set_enum_value(struct setting *pset, int val)
 }
 
 /************************************************************************//**
-  Helper function to read value from enumerator setting 
+  Helper function to read value from enumerator setting
 ****************************************************************************/
 int read_enum_value(const struct setting *pset)
 {
@@ -4067,7 +4110,7 @@ const char *setting_bitwise_secfile_str(secfile_data_t data, int bit)
   struct sf_cb_data *info = (struct sf_cb_data *)data;
   const struct sset_val_name *name = info->set->bitwise.name(bit);
 
-  if (info->compat && name == NULL) {
+  if (info->compat && name == nullptr) {
     if (!fc_strcasecmp("topology", setting_name(info->set))) {
       if ((1 << bit) == TF_OLD_WRAPX) {
         return "WrapX";
@@ -4078,22 +4121,23 @@ const char *setting_bitwise_secfile_str(secfile_data_t data, int bit)
     }
   }
 
-  return (NULL != name ? name->support : NULL);
+  return (name != nullptr ? name->support : nullptr);
 }
 
 /************************************************************************//**
   Convert the bit number to its string representation.
-  Return NULL if 'bit' is not a valid bit.
+  Return nullptr if 'bit' is not a valid bit.
 ****************************************************************************/
 const char *setting_bitwise_bit(const struct setting *pset,
                                 int bit, bool pretty)
 {
   const struct sset_val_name *name;
 
-  fc_assert_ret_val(SST_BITWISE == pset->stype, NULL);
+  fc_assert_ret_val(SST_BITWISE == pset->stype, nullptr);
+
   name = pset->bitwise.name(bit);
-  if (NULL == name) {
-    return NULL;
+  if (name == nullptr) {
+    return nullptr;
   } else if (pretty) {
     return _(name->pretty);
   } else {
@@ -4191,7 +4235,7 @@ static bool setting_bitwise_validate_base(const struct setting *pset,
   /* Value names are separated by '|'. */
   do {
     p = strchr(val, '|');
-    if (NULL != p) {
+    if (p != nullptr) {
       p++;
       fc_strlcpy(buf, val, MIN(p - val, sizeof(buf)));
     } else {
@@ -4199,7 +4243,7 @@ static bool setting_bitwise_validate_base(const struct setting *pset,
       sz_strlcpy(buf, val);
     }
     remove_leading_trailing_spaces(buf);
-    if (NULL == p && '\0' == buf[0] && 0 == *pint_val) {
+    if (p == nullptr && '\0' == buf[0] && 0 == *pint_val) {
       /* Empty string = value 0. */
       break;
     } else if (!setting_match_prefix(pset->bitwise.name, buf, &bit,
@@ -4208,9 +4252,9 @@ static bool setting_bitwise_validate_base(const struct setting *pset,
     }
     *pint_val |= 1 << bit;
     val = p;
-  } while (NULL != p);
+  } while (p != nullptr);
 
-  return (NULL == pset->bitwise.validate
+  return (pset->bitwise.validate == nullptr
           || pset->bitwise.validate(*pint_val, caller,
                                     reject_msg, reject_msg_len));
 }
@@ -4267,9 +4311,9 @@ int setting_bitwise_get(struct setting *pset)
 const char *setting_value_name(const struct setting *pset, bool pretty,
                                char *buf, size_t buf_len)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
-  fc_assert_ret_val(NULL != buf, NULL);
-  fc_assert_ret_val(0 < buf_len, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
+  fc_assert_ret_val(buf != nullptr, nullptr);
+  fc_assert_ret_val(0 < buf_len, nullptr);
 
   switch (pset->stype) {
   case SST_BOOL:
@@ -4294,7 +4338,7 @@ const char *setting_value_name(const struct setting *pset, bool pretty,
 
   log_error("%s(): Setting \"%s\" (nb %d) not handled in switch statement.",
             __FUNCTION__, setting_name(pset), setting_number(pset));
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -4303,9 +4347,9 @@ const char *setting_value_name(const struct setting *pset, bool pretty,
 const char *setting_default_name(const struct setting *pset, bool pretty,
                                  char *buf, size_t buf_len)
 {
-  fc_assert_ret_val(NULL != pset, NULL);
-  fc_assert_ret_val(NULL != buf, NULL);
-  fc_assert_ret_val(0 < buf_len, NULL);
+  fc_assert_ret_val(pset != nullptr, nullptr);
+  fc_assert_ret_val(buf != nullptr, nullptr);
+  fc_assert_ret_val(0 < buf_len, nullptr);
 
   switch (pset->stype) {
   case SST_BOOL:
@@ -4330,7 +4374,7 @@ const char *setting_default_name(const struct setting *pset, bool pretty,
 
   log_error("%s(): Setting \"%s\" (nb %d) not handled in switch statement.",
             __FUNCTION__, setting_name(pset), setting_number(pset));
-  return NULL;
+  return nullptr;
 }
 
 /************************************************************************//**
@@ -4368,7 +4412,7 @@ void setting_set_to_default(struct setting *pset)
 ****************************************************************************/
 void setting_action(const struct setting *pset)
 {
-  if (pset->action != NULL) {
+  if (pset->action != nullptr) {
     pset->action(pset);
   }
 }
@@ -4391,12 +4435,13 @@ bool settings_ruleset(struct section_file *file, const char *section,
   } settings_iterate_end;
 
   /* Settings */
-  if (NULL == secfile_section_by_name(file, section)) {
+  if (secfile_section_by_name(file, section) == nullptr) {
     /* No settings in ruleset file */
     log_verbose("no [%s] section for game settings in %s", section,
                 secfile_name(file));
   } else {
-    for (j = 0; (name = secfile_lookup_str_default(file, NULL, "%s.set%d.name",
+    for (j = 0; (name = secfile_lookup_str_default(file, nullptr,
+                                                   "%s.set%d.name",
                                                    section, j)); j++) {
       char path[256];
 
@@ -4413,7 +4458,7 @@ bool settings_ruleset(struct section_file *file, const char *section,
     }
   }
 
-  /* Execute all setting actions to consider actions due to the 
+  /* Execute all setting actions to consider actions due to the
    * default values. */
   if (act) {
     settings_iterate(SSET_ALL, pset) {
@@ -4425,8 +4470,8 @@ bool settings_ruleset(struct section_file *file, const char *section,
 
   autolock_settings();
 
-  /* send game settings */
-  send_server_settings(NULL);
+  /* Send game settings */
+  send_server_settings(nullptr);
 
   return TRUE;
 }
@@ -4446,7 +4491,7 @@ static bool setting_ruleset_one(struct section_file *file,
                                 const char *name, const char *path,
                                 bool compat)
 {
-  struct setting *pset = NULL;
+  struct setting *pset = nullptr;
   char reject_msg[256], buf[256];
   bool lock;
   struct sf_cb_data info = { pset, compat };
@@ -4458,7 +4503,7 @@ static bool setting_ruleset_one(struct section_file *file,
     }
   } settings_iterate_end;
 
-  if (pset == NULL || !pset->ruleset_settable) {
+  if (pset == nullptr || !pset->ruleset_settable) {
     /* No setting found or it's not settable by ruleset */
     return FALSE;
   }
@@ -4485,8 +4530,8 @@ static bool setting_ruleset_one(struct section_file *file,
         break;
       }
       if (val != *pset->boolean.pvalue) {
-        if (NULL == pset->boolean.validate
-            || pset->boolean.validate(val, NULL, reject_msg,
+        if (pset->boolean.validate == nullptr
+            || pset->boolean.validate(val, nullptr, reject_msg,
                                       sizeof(reject_msg))) {
           *pset->boolean.pvalue = val;
           log_normal(_("Ruleset: '%s' has been set to %s."),
@@ -4507,7 +4552,7 @@ static bool setting_ruleset_one(struct section_file *file,
           log_error("Can't read value for setting '%s': %s", name,
                     secfile_error());
       } else if (val != *pset->integer.pvalue) {
-        if (setting_int_set(pset, val, NULL, reject_msg,
+        if (setting_int_set(pset, val, nullptr, reject_msg,
                             sizeof(reject_msg))) {
           log_normal(_("Ruleset: '%s' has been set to %s."),
                      setting_name(pset),
@@ -4523,11 +4568,11 @@ static bool setting_ruleset_one(struct section_file *file,
     {
       const char *val = secfile_lookup_str(file, "%s.value", path);
 
-      if (NULL == val) {
+      if (val == nullptr) {
         log_error("Can't read value for setting '%s': %s", name,
                   secfile_error());
       } else if (0 != strcmp(val, pset->string.value)) {
-        if (setting_str_set(pset, val, NULL, reject_msg,
+        if (setting_str_set(pset, val, nullptr, reject_msg,
                             sizeof(reject_msg))) {
           log_normal(_("Ruleset: '%s' has been set to %s."),
                      setting_name(pset),
@@ -4549,8 +4594,8 @@ static bool setting_ruleset_one(struct section_file *file,
         log_error("Can't read value for setting '%s': %s",
                   name, secfile_error());
       } else if (val != read_enum_value(pset)) {
-        if (NULL == pset->enumerator.validate
-            || pset->enumerator.validate(val, NULL, reject_msg,
+        if (pset->enumerator.validate == nullptr
+            || pset->enumerator.validate(val, nullptr, reject_msg,
                                          sizeof(reject_msg))) {
           set_enum_value(pset, val);
           log_normal(_("Ruleset: '%s' has been set to %s."),
@@ -4573,8 +4618,8 @@ static bool setting_ruleset_one(struct section_file *file,
         log_error("Can't read value for setting '%s': %s",
                   name, secfile_error());
       } else if (val != *pset->bitwise.pvalue) {
-        if (NULL == pset->bitwise.validate
-            || pset->bitwise.validate((unsigned) val, NULL,
+        if (pset->bitwise.validate == nullptr
+            || pset->bitwise.validate((unsigned) val, nullptr,
                                       reject_msg, sizeof(reject_msg))) {
           *pset->bitwise.pvalue = val;
           log_normal(_("Ruleset: '%s' has been set to %s."),
@@ -4595,7 +4640,7 @@ static bool setting_ruleset_one(struct section_file *file,
     setting_ruleset_setdef(pset);
   }
 
-  /* set lock */
+  /* Set lock */
   lock = secfile_lookup_bool_default(file, FALSE, "%s.lock", path);
 
   if (lock) {
@@ -4752,7 +4797,7 @@ static void setting_game_restore(struct setting *pset)
   char reject_msg[256] = "", buf[256];
   bool res = FALSE;
 
-  if (!setting_is_changeable(pset, NULL, reject_msg, sizeof(reject_msg))) {
+  if (!setting_is_changeable(pset, nullptr, reject_msg, sizeof(reject_msg))) {
     log_debug("Can't restore '%s': %s", setting_name(pset),
               reject_msg);
     return;
@@ -4765,33 +4810,33 @@ static void setting_game_restore(struct setting *pset)
 
   switch (setting_type(pset)) {
   case SST_BOOL:
-    res = (NULL != setting_bool_to_str(pset, pset->boolean.game_value,
-                                       FALSE, buf, sizeof(buf))
-           && setting_bool_set(pset, buf, NULL, reject_msg,
+    res = (setting_bool_to_str(pset, pset->boolean.game_value,
+                               FALSE, buf, sizeof(buf)) != nullptr
+           && setting_bool_set(pset, buf, nullptr, reject_msg,
                                sizeof(reject_msg)));
     break;
 
   case SST_INT:
-    res = setting_int_set(pset, pset->integer.game_value, NULL, reject_msg,
+    res = setting_int_set(pset, pset->integer.game_value, nullptr, reject_msg,
                           sizeof(reject_msg));
     break;
 
   case SST_STRING:
-    res = setting_str_set(pset, pset->string.game_value, NULL, reject_msg,
+    res = setting_str_set(pset, pset->string.game_value, nullptr, reject_msg,
                           sizeof(reject_msg));
     break;
 
   case SST_ENUM:
-    res = (NULL != setting_enum_to_str(pset, pset->enumerator.game_value,
-                                       FALSE, buf, sizeof(buf))
-           && setting_enum_set(pset, buf, NULL, reject_msg,
+    res = (setting_enum_to_str(pset, pset->enumerator.game_value,
+                               FALSE, buf, sizeof(buf)) != nullptr
+           && setting_enum_set(pset, buf, nullptr, reject_msg,
                                sizeof(reject_msg)));
     break;
 
   case SST_BITWISE:
-    res = (NULL != setting_bitwise_to_str(pset, pset->bitwise.game_value,
-                                          FALSE, buf, sizeof(buf))
-           && setting_bitwise_set(pset, buf, NULL, reject_msg,
+    res = (setting_bitwise_to_str(pset, pset->bitwise.game_value,
+                                  FALSE, buf, sizeof(buf)) != nullptr
+           && setting_bitwise_set(pset, buf, nullptr, reject_msg,
                                   sizeof(reject_msg)));
     break;
 
@@ -4955,10 +5000,10 @@ void settings_game_load(struct section_file *file, const char *section)
             pset->setdef = SETDEF_CHANGED;
 
             if (val != *pset->boolean.pvalue) {
-              if (setting_is_changeable(pset, NULL, reject_msg,
+              if (setting_is_changeable(pset, nullptr, reject_msg,
                                         sizeof(reject_msg))
-                  && (NULL == pset->boolean.validate
-                      || pset->boolean.validate(val, NULL, reject_msg,
+                  && (pset->boolean.validate == nullptr
+                      || pset->boolean.validate(val, nullptr, reject_msg,
                                                 sizeof(reject_msg)))) {
                 *pset->boolean.pvalue = val;
                 log_normal(_("Savegame: '%s' has been set to %s."),
@@ -4987,10 +5032,10 @@ void settings_game_load(struct section_file *file, const char *section)
             pset->setdef = SETDEF_CHANGED;
 
             if (val != *pset->integer.pvalue) {
-              if (setting_is_changeable(pset, NULL, reject_msg,
+              if (setting_is_changeable(pset, nullptr, reject_msg,
                                         sizeof(reject_msg))
-                  && (NULL == pset->integer.validate
-                      || pset->integer.validate(val, NULL, reject_msg,
+                  && (pset->integer.validate == nullptr
+                      || pset->integer.validate(val, nullptr, reject_msg,
                                                 sizeof(reject_msg)))) {
                 *pset->integer.pvalue = val;
                 log_normal(_("Savegame: '%s' has been set to %s."),
@@ -5013,14 +5058,14 @@ void settings_game_load(struct section_file *file, const char *section)
           const char *val = secfile_lookup_str(file, "%s.set%d.value",
                                                section, i);
 
-          if (NULL == val) {
+          if (val == nullptr) {
             log_verbose("Option '%s' not defined in the savegame: %s", name,
                         secfile_error());
           } else {
             pset->setdef = SETDEF_CHANGED;
 
             if (0 != strcmp(val, pset->string.value)) {
-              if (setting_str_set(pset, val, NULL, reject_msg,
+              if (setting_str_set(pset, val, nullptr, reject_msg,
                                   sizeof(reject_msg))) {
                 log_normal(_("Savegame: '%s' has been set to %s."),
                            setting_name(pset),
@@ -5050,10 +5095,10 @@ void settings_game_load(struct section_file *file, const char *section)
             pset->setdef = SETDEF_CHANGED;
 
             if (val != read_enum_value(pset)) {
-              if (setting_is_changeable(pset, NULL, reject_msg,
+              if (setting_is_changeable(pset, nullptr, reject_msg,
                                         sizeof(reject_msg))
-                  && (NULL == pset->enumerator.validate
-                      || pset->enumerator.validate(val, NULL, reject_msg,
+                  && (pset->enumerator.validate == nullptr
+                      || pset->enumerator.validate(val, nullptr, reject_msg,
                                                    sizeof(reject_msg)))) {
                 set_enum_value(pset, val);
                 log_normal(_("Savegame: '%s' has been set to %s."),
@@ -5084,10 +5129,10 @@ void settings_game_load(struct section_file *file, const char *section)
             pset->setdef = SETDEF_CHANGED;
 
             if (val != *pset->bitwise.pvalue) {
-              if (setting_is_changeable(pset, NULL, reject_msg,
+              if (setting_is_changeable(pset, nullptr, reject_msg,
                                         sizeof(reject_msg))
-                  && (NULL == pset->bitwise.validate
-                      || pset->bitwise.validate(val, NULL, reject_msg,
+                  && (pset->bitwise.validate == nullptr
+                      || pset->bitwise.validate(val, nullptr, reject_msg,
                                                 sizeof(reject_msg)))) {
                 *pset->bitwise.pvalue = val;
                 log_normal(_("Savegame: '%s' has been set to %s."),
@@ -5232,7 +5277,7 @@ void settings_init(bool act)
 void settings_reset(void)
 {
   settings_iterate(SSET_ALL, pset) {
-    if (setting_is_changeable(pset, NULL, NULL, 0)) {
+    if (setting_is_changeable(pset, nullptr, nullptr, 0)) {
       setting_set_to_default(pset);
       setting_action(pset);
     }
@@ -5282,7 +5327,7 @@ void send_server_setting(struct conn_list *dest, const struct setting *pset)
   memset(&packet, 0, sizeof(packet));                                       \
   packet.id = setting_number(pset);                                         \
   packet.is_visible = setting_is_visible(pset, pconn);                      \
-  packet.is_changeable = setting_is_changeable(pset, pconn, NULL, 0);       \
+  packet.is_changeable = setting_is_changeable(pset, pconn, nullptr, 0);    \
   packet.initial_setting = game.info.is_new_game;                           \
   packet.setdef = setting_get_setdef(pset);
 
@@ -5508,7 +5553,7 @@ static void settings_list_init(void)
       break;
     case SSET_CHANGED:
     case SSET_LOCKED:
-      /* This is done in settings_list_update. */
+      /* This is done in settings_list_update(). */
       break;
     case OLEVELS_NUM:
       /* No setting should be in this level. */
@@ -5574,9 +5619,9 @@ int settings_list_cmp(const struct setting *const *ppset1,
 ****************************************************************************/
 struct setting_list *settings_list_get(enum sset_level level)
 {
-  fc_assert_ret_val(setting_sorted.init, NULL);
-  fc_assert_ret_val(setting_sorted.level[level] != NULL, NULL);
-  fc_assert_ret_val(sset_level_is_valid(level), NULL);
+  fc_assert_ret_val(setting_sorted.init, nullptr);
+  fc_assert_ret_val(setting_sorted.level[level] != nullptr, nullptr);
+  fc_assert_ret_val(sset_level_is_valid(level), nullptr);
 
   return setting_sorted.level[level];
 }
diff --git a/server/settings.h b/server/settings.h
index e3fc577b6d..57784deb61 100644
--- a/server/settings.h
+++ b/server/settings.h
@@ -49,7 +49,7 @@ struct sset_val_name {
 #define SPECENUM_VALUE5NAME N_("Internal")
 #define SPECENUM_VALUE6     SSET_NETWORK
 #define SPECENUM_VALUE6NAME N_("Networking")
-/* keep this last */
+/* Keep this last */
 #define SPECENUM_COUNT      SSET_NUM_CATEGORIES
 #include "specenum_gen.h"
 
@@ -69,7 +69,7 @@ struct sset_val_name {
 #define SPECENUM_VALUE5NAME N_("Changed")
 #define SPECENUM_VALUE6     SSET_LOCKED
 #define SPECENUM_VALUE6NAME N_("Locked")
-/* keep this last */
+/* Keep this last */
 #define SPECENUM_COUNT      OLEVELS_NUM
 #include "specenum_gen.h"
 
@@ -173,7 +173,7 @@ void setting_admin_lock_set(struct setting *pset);
 void setting_ruleset_lock_clear(struct setting *pset);
 void setting_admin_lock_clear(struct setting *pset);
 
-/* get 'struct setting_list' and related functions: */
+/* Get 'struct setting_list' and related functions: */
 #define SPECLIST_TAG setting
 #define SPECLIST_TYPE struct setting
 #include "speclist.h"
@@ -188,7 +188,7 @@ void setting_admin_lock_clear(struct setting *pset);
 #define settings_iterate(_level, _pset)                                      \
 {                                                                            \
   struct setting_list *_setting_list = settings_list_get(_level);            \
-  if (_setting_list != NULL) {                                               \
+  if (_setting_list != nullptr) {                                            \
     setting_list_iterate(_setting_list, _pset) {
 
 #define settings_iterate_end                                                 \
@@ -227,4 +227,4 @@ enum setting_default_level setting_get_setdef(const struct setting *pset);
 }
 #endif /* __cplusplus */
 
-#endif				/* FC__SETTINGS_H */
+#endif /* FC__SETTINGS_H */
-- 
2.47.2

