From 45568018304b6681150a0479caee890f35810c4f Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 10 Oct 2026 07:22:56 +0300
Subject: [PATCH 77/77] client/*_common.c: Replace NULL with nullptr

See RM #2349

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/chatline_common.c   |  8 ++--
 client/citydlg_common.c    | 48 +++++++++++-----------
 client/colors_common.c     | 29 ++++++-------
 client/connectdlg_common.c | 38 ++++++++---------
 client/luaconsole_common.c |  8 ++--
 client/mapctrl_common.c    | 38 ++++++++---------
 client/messagewin_common.c | 18 ++++----
 client/overview_common.c   | 56 ++++++++++++-------------
 client/plrdlg_common.c     | 84 +++++++++++++++++++-------------------
 client/repodlgs_common.c   |  6 +--
 client/themes_common.c     | 19 +++++----
 client/unitselect_common.c | 16 ++++----
 12 files changed, 185 insertions(+), 183 deletions(-)

diff --git a/client/chatline_common.c b/client/chatline_common.c
index 5008175b88..7d0e8b2589 100644
--- a/client/chatline_common.c
+++ b/client/chatline_common.c
@@ -121,8 +121,8 @@ void output_window_append(const struct ft_color color,
       text_tag_list_prepend(tags, ptag);
     } else {
       log_error("Failed to create a color text tag (fg = %s, bg = %s).",
-                (NULL != color.foreground ? color.foreground : "NULL"),
-                (NULL != color.background ? color.background : "NULL"));
+                (color.foreground != nullptr ? color.foreground : "nullptr"),
+                (color.background != nullptr ? color.background : "nullptr"));
     }
   }
 
@@ -133,7 +133,7 @@ void output_window_append(const struct ft_color color,
 }
 
 /**********************************************************************//**
-  Add a line of text to the output ("chatline") window.  The text is
+  Add a line of text to the output ("chatline") window. The text is
   constructed in printf style.
 **************************************************************************/
 void output_window_vprintf(const struct ft_color color,
@@ -147,7 +147,7 @@ void output_window_vprintf(const struct ft_color color,
 
 
 /**********************************************************************//**
-  Add a line of text to the output ("chatline") window.  The text is
+  Add a line of text to the output ("chatline") window. The text is
   constructed in printf style.
 **************************************************************************/
 void output_window_printf(const struct ft_color color,
diff --git a/client/citydlg_common.c b/client/citydlg_common.c
index 27a385497d..0e2f87180f 100644
--- a/client/citydlg_common.c
+++ b/client/citydlg_common.c
@@ -189,7 +189,7 @@ void city_dialog_redraw_map(struct city *pcity,
 {
   struct tileset *tmp;
 
-  tmp = NULL;
+  tmp = nullptr;
   if (unscaled_tileset) {
     tmp = tileset;
     tileset = unscaled_tileset;
@@ -204,15 +204,15 @@ void city_dialog_redraw_map(struct city *pcity,
   mapview_layer_iterate(layer) {
     citydlg_iterate(pcity, ptile, pedge, pcorner, canvas_x, canvas_y) {
       struct unit *punit
-        = ptile ? get_drawable_unit(tileset, ptile, pcity) : NULL;
-      struct city *pcity_draw = ptile ? tile_city(ptile) : NULL;
+        = ptile ? get_drawable_unit(tileset, ptile, pcity) : nullptr;
+      struct city *pcity_draw = ptile ? tile_city(ptile) : nullptr;
 
       put_one_element(pcanvas, 1.0, layer, ptile, pedge, pcorner,
-                      punit, pcity_draw, canvas_x, canvas_y, pcity, NULL);
+                      punit, pcity_draw, canvas_x, canvas_y, pcity, nullptr);
     } citydlg_iterate_end;
   } mapview_layer_iterate_end;
 
-  if (tmp != NULL) {
+  if (tmp != nullptr) {
     tileset = tmp;
   }
 }
@@ -254,7 +254,7 @@ char *city_production_cost_str(const struct city *pcity)
 /**********************************************************************//**
   Find the city dialog city production text for the given city, and
   place it into the buffer. This will check the
-  concise_city_production option. pcity may be NULL; in this case a
+  concise_city_production option. pcity may be nullptr; in this case a
   filler string is returned.
 **************************************************************************/
 void get_city_dialog_production(struct city *pcity,
@@ -263,7 +263,7 @@ void get_city_dialog_production(struct city *pcity,
   char time_str[50], *cost_str;
   int turns, stock;
 
-  if (pcity == NULL) {
+  if (pcity == nullptr) {
     /*
      * Some GUIs use this to build a "filler string" so that they can
      * properly size the widget to hold the string. This has some
@@ -373,7 +373,7 @@ void get_city_dialog_production_full(char *buffer, size_t buffer_len,
 /**********************************************************************//**
   Pretty sprints the info about a production in 4 columns (name, info,
   cost, turns to build). The columns must each have a size of
-  column_size bytes. City may be NULL.
+  column_size bytes. City may be nullptr.
 **************************************************************************/
 void get_city_dialog_production_row(char *buf[], size_t column_size,
                                     struct universal *target,
@@ -408,7 +408,7 @@ void get_city_dialog_production_row(char *buf[], size_t column_size,
       if (pcity && is_improvement_redundant(pcity, pimprove)) {
         fc_snprintf(buf[1], column_size, "%d*", upkeep);
       } else {
-        const char *state = NULL;
+        const char *state = nullptr;
 
         if (is_great_wonder(pimprove)) {
           if (improvement_obsolete(pplayer, pimprove, pcity)) {
@@ -436,12 +436,12 @@ void get_city_dialog_production_row(char *buf[], size_t column_size,
         }
       }
 
-      if (pcity != NULL) {
+      if (pcity != nullptr) {
         fc_snprintf(buf[2], column_size, "%d",
                     impr_build_shield_cost(pcity, pimprove));
       } else {
         fc_snprintf(buf[2], column_size, "%d",
-                    impr_estimate_build_shield_cost(pplayer, NULL, pimprove));
+                    impr_estimate_build_shield_cost(pplayer, nullptr, pimprove));
       }
     }
     break;
@@ -514,7 +514,7 @@ static struct city_sum *city_sum_new(const char *format)
 
   sum->format = format;
   sum->n = 0;
-  sum->sums = NULL;
+  sum->sums = nullptr;
 
   return sum;
 }
@@ -535,11 +535,11 @@ static void city_sum_add_real(struct city_sum *sum, double value,
 
   /* Likely to lead to quadratic behavior, but who cares: */
   for (i = 0; i < sum->n; i++) {
-    fc_assert(sum->sums != NULL);
+    fc_assert(sum->sums != nullptr);
     if ((strcmp(sum->sums[i].posdesc, posdesc) == 0)
         && (strcmp(sum->sums[i].negdesc, negdesc) == 0)
         && ((sum->sums[i].auxfmt == auxfmt)
-            || (auxfmt != NULL && !strcmp(sum->sums[i].auxfmt, auxfmt)))
+            || (auxfmt != nullptr && !strcmp(sum->sums[i].auxfmt, auxfmt)))
         && sum->sums[i].suppress_if_zero == suppress_if_zero) {
       /* Looks like we already have an entry like this. Accumulate values. */
       sum->sums[i].value += value;
@@ -626,7 +626,7 @@ static void
   va_end(args);
 
   /* Descriptions will be freed individually, so need to fc_strdup() */
-  city_sum_add_real(sum, value, FALSE, NULL, 0, desc, fc_strdup(desc));
+  city_sum_add_real(sum, value, FALSE, nullptr, 0, desc, fc_strdup(desc));
 }
 
 /**********************************************************************//**
@@ -653,7 +653,7 @@ static void
   va_end(args);
 
   /* Descriptions will be freed individually, so need to fc_strdup() */
-  city_sum_add_real(sum, value, TRUE, NULL, 0, desc, fc_strdup(desc));
+  city_sum_add_real(sum, value, TRUE, nullptr, 0, desc, fc_strdup(desc));
 }
 
 /**********************************************************************//**
@@ -850,7 +850,7 @@ void get_city_dialog_output_text(const struct city *pcity,
         if (eft[priority] == EFT_OUTPUT_BONUS_ABSOLUTE) {
           new_total = bonus * base / 100 + delta;
           city_sum_add_full(sum, new_total - city_sum_total(sum), TRUE,
-                            NULL, 0,
+                            nullptr, 0,
                             Q_("?city_surplus:Bonus from %s"),
                             Q_("?city_surplus:Loss from %s"), buf2);
         } else {
@@ -953,7 +953,7 @@ void get_city_dialog_illness_text(const struct city *pcity,
 
   plist = effect_list_new();
 
-  (void) get_city_bonus_effects(plist, pcity, NULL, EFT_HEALTH_PCT);
+  (void) get_city_bonus_effects(plist, pcity, nullptr, EFT_HEALTH_PCT);
 
   effect_list_iterate(plist, peffect) {
     char buf2[512];
@@ -1031,13 +1031,13 @@ void get_city_dialog_culture_text(const struct city *pcity,
 
   buf[0] = '\0';
 
-  /* XXX: no way to check whether client's idea of gain/turn is accurate */
+  /* XXX: No way to check whether client's idea of gain/turn is accurate */
   city_sum_add(sum, pcity->history, Q_("?city_culture:History (%+d/turn)"),
                city_history_gain(pcity));
 
   plist = effect_list_new();
 
-  (void) get_city_bonus_effects(plist, pcity, NULL, EFT_PERFORMANCE);
+  (void) get_city_bonus_effects(plist, pcity, nullptr, EFT_PERFORMANCE);
 
   effect_list_iterate(plist, peffect) {
     char buf2[512];
@@ -1300,7 +1300,7 @@ void city_rotate_specialist(struct city *pcity, int citizen_index)
 void activate_all_units(struct tile *ptile)
 {
   struct unit_list *punit_list = ptile->units;
-  struct unit *pmyunit = NULL;
+  struct unit *pmyunit = nullptr;
 
   unit_list_iterate(punit_list, punit) {
     if (unit_owner(punit) == client.conn.playing) {
@@ -1561,7 +1561,7 @@ bool city_can_buy(const struct city *pcity)
    * doesn't allow for error messages. It doesn't check the cost of
    * buying; that's handled separately (and with an error message). */
   return (can_client_issue_orders()
-          && NULL != pcity
+          && pcity != nullptr
           && city_owner(pcity) == client.conn.playing
           && pcity->turn_founded != game.info.turn
           && !pcity->did_buy
@@ -1615,11 +1615,11 @@ int city_toggle_worker(struct city *pcity, int city_x, int city_y)
   fc_assert(is_valid_city_coords(city_radius_sq, city_x, city_y));
   ptile = city_map_to_tile(&(wld.map), city_tile(pcity), city_radius_sq,
                            city_x, city_y);
-  if (NULL == ptile) {
+  if (ptile == nullptr) {
     return 0;
   }
 
-  if (NULL != tile_worked(ptile) && tile_worked(ptile) == pcity) {
+  if (tile_worked(ptile) != nullptr && tile_worked(ptile) == pcity) {
     return dsend_packet_city_make_specialist(&client.conn,
                                              pcity->id, ptile->index);
   } else if (city_can_work_tile(pcity, ptile)) {
diff --git a/client/colors_common.c b/client/colors_common.c
index a79845ce9e..1badaa3337 100644
--- a/client/colors_common.c
+++ b/client/colors_common.c
@@ -38,7 +38,7 @@ struct color_system {
 /************************************************************************//**
   Called when the client first starts to allocate the default colors.
 
-  Currently this must be called in ui_main, generally after UI
+  Currently this must be called in ui_main(), generally after UI
   initialization.
 ****************************************************************************/
 struct color_system *color_system_read(struct section_file *file)
@@ -50,7 +50,7 @@ struct color_system *color_system_read(struct section_file *file)
 
   for (stdcolor = color_std_begin(); stdcolor != color_std_end();
        stdcolor = color_std_next(stdcolor)) {
-    struct rgbcolor *prgbcolor = NULL;
+    struct rgbcolor *prgbcolor = nullptr;
 
     if (rgbcolor_load(file, &prgbcolor, "colors.%s0",
                       color_std_name(stdcolor))) {
@@ -86,11 +86,12 @@ void color_system_free(struct color_system *colors)
 ****************************************************************************/
 struct color *ensure_color(struct rgbcolor *rgb)
 {
-  fc_assert_ret_val(rgb != NULL, NULL);
+  fc_assert_ret_val(rgb != nullptr, nullptr);
 
   if (!rgb->color) {
     rgb->color = color_alloc(rgb->r, rgb->g, rgb->b);
   }
+
   return rgb->color;
 }
 
@@ -101,7 +102,7 @@ struct color *get_color(const struct tileset *t, enum color_std stdcolor)
 {
   struct color_system *colors = get_color_system(t);
 
-  fc_assert_ret_val(colors != NULL, NULL);
+  fc_assert_ret_val(colors != nullptr, nullptr);
 
   return ensure_color(*(colors->stdcolors + stdcolor));
 }
@@ -112,9 +113,9 @@ struct color *get_color(const struct tileset *t, enum color_std stdcolor)
 ****************************************************************************/
 bool player_has_color(const struct player *pplayer)
 {
-  fc_assert_ret_val(pplayer != NULL, FALSE);
+  fc_assert_ret_val(pplayer != nullptr, FALSE);
 
-  return pplayer->rgb != NULL;
+  return pplayer->rgb != nullptr;
 }
 
 /************************************************************************//**
@@ -125,8 +126,8 @@ bool player_has_color(const struct player *pplayer)
 struct color *get_player_color(const struct tileset *t,
                                const struct player *pplayer)
 {
-  fc_assert_ret_val(pplayer != NULL, NULL);
-  fc_assert_ret_val(pplayer->rgb != NULL, NULL);
+  fc_assert_ret_val(pplayer != nullptr, nullptr);
+  fc_assert_ret_val(pplayer->rgb != nullptr, nullptr);
 
   return ensure_color(pplayer->rgb);
 }
@@ -137,8 +138,8 @@ struct color *get_player_color(const struct tileset *t,
 struct color *get_terrain_color(const struct tileset *t,
                                 const struct terrain *pterrain)
 {
-  fc_assert_ret_val(pterrain != NULL, NULL);
-  fc_assert_ret_val(pterrain->rgb != NULL, NULL);
+  fc_assert_ret_val(pterrain != nullptr, nullptr);
+  fc_assert_ret_val(pterrain->rgb != nullptr, nullptr);
 
   return ensure_color(pterrain->rgb);
 }
@@ -152,16 +153,16 @@ struct color *color_best_contrast(struct color *subject,
 {
   int sbright = color_brightness_score(subject), bestdiff = 0;
   int i;
-  struct color *best = NULL;
+  struct color *best = nullptr;
 
-  fc_assert_ret_val(candidates != NULL, NULL);
-  fc_assert_ret_val(ncandidates > 0, NULL);
+  fc_assert_ret_val(candidates != nullptr, nullptr);
+  fc_assert_ret_val(ncandidates > 0, nullptr);
 
   for (i = 0; i < ncandidates; i++) {
     int cbright = color_brightness_score(candidates[i]);
     int diff = ABS(sbright - cbright);
 
-    if (best == NULL || diff > bestdiff) {
+    if (best == nullptr || diff > bestdiff) {
       best = candidates[i];
       bestdiff = diff;
     }
diff --git a/client/connectdlg_common.c b/client/connectdlg_common.c
index e79e004087..0db28ca2f9 100644
--- a/client/connectdlg_common.c
+++ b/client/connectdlg_common.c
@@ -156,9 +156,9 @@ void client_kill_server(bool force)
   if (server_quitting && server_pid > 0) {
     /* Already asked to /quit.
      * If it didn't do that, kill it. */
-    if (waitpid(server_pid, NULL, WUNTRACED) <= 0) {
+    if (waitpid(server_pid, nullptr, WUNTRACED) <= 0) {
       kill(server_pid, SIGTERM);
-      waitpid(server_pid, NULL, WUNTRACED);
+      waitpid(server_pid, nullptr, WUNTRACED);
     }
     server_pid = -1;
     server_quitting = FALSE;
@@ -200,7 +200,7 @@ void client_kill_server(bool force)
        * the server. */
 #ifdef HAVE_USABLE_FORK
       kill(server_pid, SIGTERM);
-      waitpid(server_pid, NULL, WUNTRACED);
+      waitpid(server_pid, nullptr, WUNTRACED);
       server_pid = -1;
 #elif FREECIV_MSWINDOWS
       TerminateProcess(server_process, 0);
@@ -286,7 +286,7 @@ bool client_start_server(void)
   }
 
   storage = freeciv_storage_dir();
-  if (storage == NULL) {
+  if (storage == nullptr) {
     output_window_append(ftc_client, _("Cannot find freeciv storage directory"));
     output_window_append(ftc_client,
                          _("You'll have to start server manually. Sorry..."));
@@ -348,11 +348,11 @@ bool client_start_server(void)
     if (are_deprecation_warnings_enabled()) {
       argv[argc++] = "--warnings";
     }
-    if (ruleset != NULL) {
+    if (ruleset != nullptr) {
       argv[argc++] = "--ruleset";
       argv[argc++] = ruleset;
     }
-    argv[argc] = NULL;
+    argv[argc] = nullptr;
     fc_assert(argc <= max_nargs);
 
     {
@@ -448,8 +448,8 @@ bool client_start_server(void)
   if (logfile) {
     loghandle = CreateFile(logfile, GENERIC_WRITE,
                            FILE_SHARE_READ | FILE_SHARE_WRITE,
-                           NULL,
-                           OPEN_ALWAYS, 0, NULL);
+                           nullptr,
+                           OPEN_ALWAYS, 0, nullptr);
   }
 
   ZeroMemory(&si, sizeof(si));
@@ -503,7 +503,7 @@ bool client_start_server(void)
   } else {
     depr = "";
   }
-  if (ruleset != NULL) {
+  if (ruleset != nullptr) {
     fc_snprintf(rsparam, sizeof(rsparam), " --ruleset %s", ruleset);
   } else {
     rsparam[0] = '\0';
@@ -538,22 +538,22 @@ bool client_start_server(void)
 
   if (
 #ifdef FREECIV_DEBUG
-      !CreateProcess(NULL, cmdline1, NULL, NULL, TRUE,
+      !CreateProcess(nullptr, cmdline1, nullptr, nullptr, TRUE,
                      DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
-                     NULL, NULL, &si, &pi)
+                     nullptr, nullptr, &si, &pi)
 #ifndef FREECIV_WEB
-      && !CreateProcess(NULL, cmdline2, NULL, NULL, TRUE,
+      && !CreateProcess(nullptr, cmdline2, nullptr, nullptr, TRUE,
                         DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
-                        NULL, NULL, &si, &pi)
+                        nullptr, nullptr, &si, &pi)
 #endif /* FREECIV_WEB */
       &&
 #endif /* FREECIV_DEBUG */
-      !CreateProcess(NULL, cmdline3, NULL, NULL, TRUE,
+      !CreateProcess(nullptr, cmdline3, nullptr, nullptr, TRUE,
                      DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
-                     NULL, NULL, &si, &pi)
-      && !CreateProcess(NULL, cmdline4, NULL, NULL, TRUE,
+                     nullptr, nullptr, &si, &pi)
+      && !CreateProcess(nullptr, cmdline4, nullptr, nullptr, TRUE,
                         DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
-                        NULL, NULL, &si, &pi)) {
+                        nullptr, nullptr, &si, &pi)) {
     log_error("Failed to start server process.");
 #ifdef FREECIV_DEBUG
     log_verbose("Tried with commandline: '%s'", cmdline1);
@@ -580,7 +580,7 @@ bool client_start_server(void)
     fc_usleep(WAIT_BETWEEN_TRIES);
 #ifdef HAVE_USABLE_FORK
 #ifndef FREECIV_MSWINDOWS
-    if (waitpid(server_pid, NULL, WNOHANG) != 0) {
+    if (waitpid(server_pid, nullptr, WNOHANG) != 0) {
       break;
     }
 #endif /* FREECIV_MSWINDOWS */
@@ -683,7 +683,7 @@ void send_client_wants_hack(const char *filename)
     struct section_file *file;
     const char *sdir = freeciv_storage_dir();
 
-    if (sdir == NULL) {
+    if (sdir == nullptr) {
       return;
     }
 
diff --git a/client/luaconsole_common.c b/client/luaconsole_common.c
index c5d6f7b24a..068e909a5c 100644
--- a/client/luaconsole_common.c
+++ b/client/luaconsole_common.c
@@ -57,8 +57,8 @@ void luaconsole_append(const struct ft_color color,
       text_tag_list_prepend(tags, ptag);
     } else {
       log_error("Failed to create a color text tag (fg = %s, bg = %s).",
-                (NULL != color.foreground ? color.foreground : "NULL"),
-                (NULL != color.background ? color.background : "NULL"));
+                (color.foreground != nullptr ? color.foreground : "nullptr"),
+                (color.background != nullptr ? color.background : "nullptr"));
     }
   }
 
@@ -67,7 +67,7 @@ void luaconsole_append(const struct ft_color color,
 }
 
 /*************************************************************************//**
-  Add a line of text to the output ("chatline") window.  The text is
+  Add a line of text to the output ("chatline") window. The text is
   constructed in printf style.
 *****************************************************************************/
 void luaconsole_vprintf(const struct ft_color color,
@@ -81,7 +81,7 @@ void luaconsole_vprintf(const struct ft_color color,
 
 
 /*************************************************************************//**
-  Add a line of text to the output ("chatline") window.  The text is
+  Add a line of text to the output ("chatline") window. The text is
   constructed in printf style.
 *****************************************************************************/
 void luaconsole_printf(const struct ft_color color,
diff --git a/client/mapctrl_common.c b/client/mapctrl_common.c
index 39648594d9..cbda2be551 100644
--- a/client/mapctrl_common.c
+++ b/client/mapctrl_common.c
@@ -15,7 +15,7 @@
 #include <fc_config.h>
 #endif
 
-#include <stdlib.h>		/* qsort */
+#include <stdlib.h>             /* qsort */
 
 /* utility */
 #include "fcintl.h"
@@ -62,7 +62,7 @@ bool tiles_hilited_cities = FALSE;
 /* The mapcanvas clipboard */
 struct universal clipboard =
 { .kind = VUT_NONE,
-  .value = {.building = NULL}
+  .value = {.building = nullptr}
 };
 
 /* Goto with drag and drop. */
@@ -71,7 +71,7 @@ bool keyboardless_goto_active = FALSE;
 struct tile *keyboardless_goto_start_tile;
 
 /* Update the workers for a city on the map, when the update is received */
-struct city *city_workers_display = NULL;
+struct city *city_workers_display = nullptr;
 
 /*************************************************************************/
 
@@ -140,12 +140,12 @@ static void define_tiles_within_rectangle(bool append)
       /*  For diamond shaped tiles, every other row is indented.
        */
       if ((yy % 2 ^ xx % 2) != 0) {
-	continue;
+        continue;
       }
 
       ptile = canvas_pos_to_tile(x, y, map_zoom);
       if (!ptile) {
-	continue;
+        continue;
       }
 
       /*  "Half-tile" indentation must match, or we'll process
@@ -154,13 +154,13 @@ static void define_tiles_within_rectangle(bool append)
       tile_to_canvas_pos(&x2, &y2, map_zoom, ptile);
 
       if ((yy % 2) != 0 && ((rec_corner_x % W) ^ abs((int)x2 % W)) != 0) {
-	continue;
+        continue;
       }
 
       /*  Tile passed all tests; process it.
        */
       pcity = tile_city(ptile);
-      if (pcity != NULL && city_owner(pcity) == client_player()) {
+      if (pcity != nullptr && city_owner(pcity) == client_player()) {
         mapdeco_set_highlight(ptile, TRUE);
         found_any_cities = tiles_hilited_cities = TRUE;
       }
@@ -202,7 +202,7 @@ void update_selection_rectangle(float canvas_x, float canvas_y)
 {
   const int W = tileset_tile_width(tileset),  half_W = W / 2;
   const int H = tileset_tile_height(tileset), half_H = H / 2;
-  static struct tile *rec_tile = NULL;
+  static struct tile *rec_tile = nullptr;
   int diff_x, diff_y;
   struct tile *center_tile;
   struct tile *ptile;
@@ -343,7 +343,7 @@ void toggle_tile_hilite(struct tile *ptile)
       toggle_city_hilite(pcity, FALSE); /* cityrep.c */
     }
   }
-  else if (NULL != pcity && city_owner(pcity) == client.conn.playing) {
+  else if (pcity != nullptr && city_owner(pcity) == client.conn.playing) {
     mapdeco_set_highlight(ptile, TRUE);
     tiles_hilited_cities = TRUE;
     toggle_city_hilite(pcity, TRUE);
@@ -427,13 +427,13 @@ void clipboard_paste_production(struct city *pcity)
   if (!can_client_issue_orders()) {
     return;
   }
-  if (NULL == clipboard.value.building) {
+  if (clipboard.value.building == nullptr) {
     create_event(city_tile(pcity), E_BAD_COMMAND, ftc_client,
                  _("Clipboard is empty."));
     return;
   }
   if (!tiles_hilited_cities) {
-    if (NULL != pcity && city_owner(pcity) == client.conn.playing) {
+    if (pcity != nullptr && city_owner(pcity) == client.conn.playing) {
       clipboard_send_production_packet(pcity);
     }
     return;
@@ -498,7 +498,7 @@ void release_goto_button(int canvas_x, int canvas_y)
   }
   keyboardless_goto_active = FALSE;
   keyboardless_goto_button_down = FALSE;
-  keyboardless_goto_start_tile = NULL;
+  keyboardless_goto_start_tile = nullptr;
 }
 
 /**********************************************************************//**
@@ -534,7 +534,7 @@ bool can_end_turn(void)
   struct option *opt;
 
   opt = optset_option_by_name(server_optset, "fixedlength");
-  if (opt != NULL && option_bool_get(opt)) {
+  if (opt != nullptr && option_bool_get(opt)) {
     return FALSE;
   }
 
@@ -599,28 +599,28 @@ void adjust_workers_button_pressed(int canvas_x, int canvas_y)
 {
   struct tile *ptile = canvas_pos_to_tile(canvas_x, canvas_y, mouse_zoom);
 
-  if (NULL != ptile && can_client_issue_orders()) {
+  if (ptile != nullptr && can_client_issue_orders()) {
     struct city *pcity = find_city_near_tile(ptile);
 
-    if (pcity && !cma_is_city_under_agent(pcity, NULL)) {
+    if (pcity && !cma_is_city_under_agent(pcity, nullptr)) {
 #ifndef FREECIV_NDEBUG
       int city_x, city_y;
 #endif
 
       fc_assert_ret(city_base_to_city_map(&city_x, &city_y, pcity, ptile));
 
-      if (NULL != tile_worked(ptile) && tile_worked(ptile) == pcity) {
+      if (tile_worked(ptile) != nullptr && tile_worked(ptile) == pcity) {
         dsend_packet_city_make_specialist(&client.conn,
                                           pcity->id, ptile->index);
       } else if (city_can_work_tile(pcity, ptile)) {
         dsend_packet_city_make_worker(&client.conn,
                                       pcity->id, ptile->index);
       } else {
-	return;
+        return;
       }
 
       /* When the city info packet is received, update the workers on the
-       * map.  This is a bad hack used to selectively update the mapview
+       * map. This is a bad hack used to selectively update the mapview
        * when we receive the corresponding city packet. */
       city_workers_display = pcity;
     }
@@ -628,7 +628,7 @@ void adjust_workers_button_pressed(int canvas_x, int canvas_y)
 }
 
 /**********************************************************************//**
-  Recenter the map on the canvas location, on user request.  Usually this
+  Recenter the map on the canvas location, on user request. Usually this
   is done with a right-click.
 **************************************************************************/
 void recenter_button_pressed(int canvas_x, int canvas_y)
diff --git a/client/messagewin_common.c b/client/messagewin_common.c
index 1b940a5be7..651d37b004 100644
--- a/client/messagewin_common.c
+++ b/client/messagewin_common.c
@@ -37,7 +37,7 @@
 
 #include "messagewin_common.h"
 
-static struct message **messages = NULL;
+static struct message **messages = nullptr;
 static int messages_total = 0;
 static int messages_alloc = 0;
 
@@ -51,7 +51,7 @@ static void meswin_dialog_update(void)
   }
 
   if (meswin_dialog_is_open()) {
-    update_queue_add(real_meswin_dialog_update, NULL);
+    update_queue_add(real_meswin_dialog_update, nullptr);
   } else if (0 < messages_total
              && (!client_has_player()
                  || is_human(client.conn.playing))) {
@@ -80,13 +80,13 @@ void meswin_clear_older(int turn, int phase)
 
     text_tag_list_destroy(messages[i]->tags);
     free(messages[i]);
-    messages[i] = NULL;
+    messages[i] = nullptr;
   }
 
   if (i != 0) {
     for (; i < messages_total; i++, j++) {
       messages[j] = messages[i];
-      messages[i] = NULL;
+      messages[i] = nullptr;
     }
     messages_total = j;
   }
@@ -124,7 +124,7 @@ void meswin_add(const char *message, const struct text_tag_list *tags,
   msg->event = event;
   msg->descr = s;
   msg->tags = text_tag_list_copy(tags);
-  msg->location_ok = (ptile != NULL);
+  msg->location_ok = (ptile != nullptr);
   msg->visited = FALSE;
   msg->turn = turn;
   msg->phase = phase;
@@ -149,7 +149,7 @@ void meswin_add(const char *message, const struct text_tag_list *tags,
 }
 
 /************************************************************************//**
-  Returns the pointer to a message.  Returns NULL on error.
+  Returns the pointer to a message. Returns nullptr on error.
 ****************************************************************************/
 const struct message *meswin_get_message(int message_index)
 {
@@ -157,7 +157,7 @@ const struct message *meswin_get_message(int message_index)
     return messages[message_index];
   } else {
     /* Can happen in turn change... */
-    return NULL;
+    return nullptr;
   }
 }
 
@@ -195,8 +195,8 @@ void meswin_popup_city(int message_index)
     }
 
     if (pcity && can_player_see_units_in_city(client.conn.playing, pcity)) {
-      /* If the event was the city being destroyed, pcity will be NULL
-       * and we'd better not try to pop it up.  It's also possible that
+      /* If the event was the city being destroyed, pcity will be nullptr
+       * and we'd better not try to pop it up. It's also possible that
        * events will happen on enemy cities; we generally don't want to pop
        * those dialogs up either (although it's hard to be certain).
        *
diff --git a/client/overview_common.c b/client/overview_common.c
index 2932154177..7761551259 100644
--- a/client/overview_common.c
+++ b/client/overview_common.c
@@ -33,12 +33,12 @@
 int OVERVIEW_TILE_SIZE = 2;
 #if 0
 struct overview overview = {
-  /* These are the default values.  All others are zeroed automatically. */
+  /* These are the default values. All others are zeroed automatically. */
   .fog = TRUE,
   .layers = {[OLAYER_BACKGROUND] = TRUE,
-	     [OLAYER_UNITS] = TRUE,
-	     [OLAYER_CITIES] = TRUE,
-	     [OLAYER_BORDERS_ON_OCEAN] = TRUE}
+             [OLAYER_UNITS] = TRUE,
+             [OLAYER_CITIES] = TRUE,
+             [OLAYER_BORDERS_ON_OCEAN] = TRUE}
 };
 #endif
 
@@ -49,20 +49,20 @@ struct overview overview = {
 static bool overview_dirty = FALSE;
 
 /************************************************************************//**
-  Translate from gui to natural coordinate systems.  This provides natural
+  Translate from gui to natural coordinate systems. This provides natural
   coordinates as a floating-point value so there is no loss of information
   in the resulting values.
 ****************************************************************************/
 static void gui_to_natural_pos(const struct tileset *t,
-			       double *ntl_x, double *ntl_y,
-			       int gui_x, int gui_y)
+                               double *ntl_x, double *ntl_y,
+                               int gui_x, int gui_y)
 {
   const double gui_xd = gui_x, gui_yd = gui_y;
   const double W = tileset_tile_width(t) * map_zoom;
   const double H = tileset_tile_height(t) * map_zoom;
   double map_x, map_y;
 
-  /* First convert to map positions.  This ignores hex conversions; we're
+  /* First convert to map positions. This ignores hex conversions; we're
    * not looking for an exact tile. */
   if (tileset_is_isometric(t)) {
     /* Includes hex cases. */
@@ -121,14 +121,14 @@ static struct color *overview_tile_color(struct tile *ptile)
     struct city *pcity = tile_city(ptile);
 
     if (pcity) {
-      if (NULL == client.conn.playing
+      if (client.conn.playing == nullptr
           || city_owner(pcity) == client.conn.playing) {
-	return get_color(tileset, COLOR_OVERVIEW_MY_CITY);
+        return get_color(tileset, COLOR_OVERVIEW_MY_CITY);
       } else if (pplayers_allied(city_owner(pcity), client.conn.playing)) {
-	/* Includes teams. */
-	return get_color(tileset, COLOR_OVERVIEW_ALLIED_CITY);
+        /* Includes teams. */
+        return get_color(tileset, COLOR_OVERVIEW_ALLIED_CITY);
       } else {
-	return get_color(tileset, COLOR_OVERVIEW_ENEMY_CITY);
+        return get_color(tileset, COLOR_OVERVIEW_ENEMY_CITY);
       }
     }
   }
@@ -136,14 +136,14 @@ static struct color *overview_tile_color(struct tile *ptile)
     struct unit *punit = find_visible_unit(ptile);
 
     if (punit) {
-      if (NULL == client.conn.playing
+      if (client.conn.playing == nullptr
           || unit_owner(punit) == client.conn.playing) {
-	return get_color(tileset, COLOR_OVERVIEW_MY_UNIT);
+        return get_color(tileset, COLOR_OVERVIEW_MY_UNIT);
       } else if (pplayers_allied(unit_owner(punit), client.conn.playing)) {
-	/* Includes teams. */
-	return get_color(tileset, COLOR_OVERVIEW_ALLIED_UNIT);
+        /* Includes teams. */
+        return get_color(tileset, COLOR_OVERVIEW_ALLIED_UNIT);
       } else {
-	return get_color(tileset, COLOR_OVERVIEW_ENEMY_UNIT);
+        return get_color(tileset, COLOR_OVERVIEW_ENEMY_UNIT);
       }
     }
   }
@@ -221,14 +221,14 @@ static void redraw_overview(void)
   }
 
   gui_to_overview_pos(tileset, &x[0], &y[0],
-		      mapview.gui_x0, mapview.gui_y0);
+                      mapview.gui_x0, mapview.gui_y0);
   gui_to_overview_pos(tileset, &x[1], &y[1],
-		      mapview.gui_x0 + mapview.width, mapview.gui_y0);
+                      mapview.gui_x0 + mapview.width, mapview.gui_y0);
   gui_to_overview_pos(tileset, &x[2], &y[2],
-		      mapview.gui_x0 + mapview.width,
-		      mapview.gui_y0 + mapview.height);
+                      mapview.gui_x0 + mapview.width,
+                      mapview.gui_y0 + mapview.height);
   gui_to_overview_pos(tileset, &x[3], &y[3],
-		      mapview.gui_x0, mapview.gui_y0 + mapview.height);
+                      mapview.gui_x0, mapview.gui_y0 + mapview.height);
 
   for (i = 0; i < 4; i++) {
     int src_x = x[i];
@@ -314,7 +314,7 @@ void center_tile_overviewcanvas(void)
   redraw_overview();
 
   gui_to_overview_pos(tileset, &ox, &oy,
-		      mapview.gui_x0, mapview.gui_y0);
+                      mapview.gui_x0, mapview.gui_y0);
   update_overview_scroll_window_pos(ox, oy);
 }
 
@@ -327,7 +327,7 @@ void map_to_overview_pos(int *overview_x, int *overview_y,
   /* The map position may not be normal, for instance when the mapview
    * origin is not a normal position.
    *
-   * NOTE: this embeds the map wrapping in the overview code. */
+   * NOTE: This embeds the map wrapping in the overview code. */
   do_in_natural_pos(ntl_x, ntl_y, map_x, map_y) {
     int ovr_x = ntl_x - gui_options.overview.map_x0;
     int ovr_y = ntl_y - gui_options.overview.map_y0;
@@ -513,8 +513,8 @@ void overview_free(void)
   if (gui_options.overview.map) {
     canvas_free(gui_options.overview.map);
     canvas_free(gui_options.overview.window);
-    gui_options.overview.map = NULL;
-    gui_options.overview.window = NULL;
+    gui_options.overview.map = nullptr;
+    gui_options.overview.window = nullptr;
   }
 }
 
@@ -524,7 +524,7 @@ void overview_free(void)
 void overview_redraw_callback(struct option *option)
 {
   /* This is called once for each option changed so it is slower than
-   * necessary.  If this becomes a problem it could be switched to use a
+   * necessary. If this becomes a problem it could be switched to use a
    * queue system like the mapview drawing code does. */
   refresh_overview_canvas();
 }
diff --git a/client/plrdlg_common.c b/client/plrdlg_common.c
index ed46d79921..99f8fe2740 100644
--- a/client/plrdlg_common.c
+++ b/client/plrdlg_common.c
@@ -111,7 +111,7 @@ static const char *col_diplstate(const struct player *player)
   static char buf[100];
   const struct player_diplstate *pds;
 
-  if (NULL == client.conn.playing || player == client.conn.playing) {
+  if (client.conn.playing == nullptr || player == client.conn.playing) {
     return "-";
   } else {
     pds = player_diplstate_get(client.conn.playing, player);
@@ -134,7 +134,7 @@ static const char *col_diplstate(const struct player *player)
 ****************************************************************************/
 static int diplstate_value(const struct player *plr)
 {
-  /* these values are scaled so that adding/subtracting
+  /* These values are scaled so that adding/subtracting
      the number of turns left makes sense */
   static const int diplstate_cmp_lookup[DS_LAST] = {
     [DS_TEAM] = 1 << 16,
@@ -149,8 +149,8 @@ static int diplstate_value(const struct player *plr)
   const struct player_diplstate *pds;
   int ds_value;
 
-  if (NULL == client.conn.playing || plr == client.conn.playing) {
-    /* current global player is as close as players get
+  if (client.conn.playing == nullptr || plr == client.conn.playing) {
+    /* Current global player is as close as players get
        -> return value smaller than for DS_TEAM */
     return 0;
   }
@@ -179,7 +179,7 @@ static int cmp_diplstate(const struct player *player1,
 ****************************************************************************/
 static const char *col_love(const struct player *player)
 {
-  if (NULL == client.conn.playing || player == client.conn.playing
+  if (client.conn.playing == nullptr || player == client.conn.playing
       || is_human(player)) {
     return "-";
   } else {
@@ -195,7 +195,7 @@ static int cmp_love(const struct player *player1,
 {
   int love1, love2;
 
-  if (NULL == client.conn.playing) {
+  if (client.conn.playing == nullptr) {
     return player_number(player1) - player_number(player2);
   }
 
@@ -241,7 +241,7 @@ const char *plrdlg_col_state(const struct player *plr)
     }
 
     opt = optset_option_by_name(server_optset, "turnblock");
-    if (opt != NULL) {
+    if (opt != nullptr) {
       consider_tb = option_bool_get(opt);
     }
 
@@ -345,10 +345,10 @@ static const char *get_culture_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)))) {
     fc_snprintf(buf, sizeof(buf), "%d", them->client.culture);
   } else {
@@ -385,10 +385,10 @@ static const char *get_gold_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)
                      || player_diplstate_get(me, them)->contact_turns_left > 0))) {
     fc_snprintf(buf, sizeof(buf), "%d", them->economic.gold);
@@ -426,10 +426,10 @@ static const char *get_tax_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)))) {
     fc_snprintf(buf, sizeof(buf), "%d %%", them->economic.tax);
   } else {
@@ -466,10 +466,10 @@ static const char *get_science_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)))) {
     fc_snprintf(buf, sizeof(buf), "%d %%", them->economic.science);
   } else {
@@ -506,10 +506,10 @@ static const char *get_luxury_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)))) {
     fc_snprintf(buf, sizeof(buf), "%d %%", them->economic.luxury);
   } else {
@@ -536,10 +536,10 @@ static const char *get_researching_info(const struct player *them)
   const struct player *me = client_player();
   bool gobs = client_is_global_observer();
 
-  if (them == NULL || !them->is_alive) {
+  if (them == nullptr || !them->is_alive) {
     fc_snprintf(buf, sizeof(buf), "-");
   } else if (gobs
-             || (me != NULL
+             || (me != nullptr
                  && (me == them || team_has_embassy(me->team, them)))) {
     struct research *research = research_get(them);
 
@@ -564,30 +564,30 @@ static const char *col_research(const struct player *pplayer)
   ...
 ****************************************************************************/
 struct player_dlg_column player_dlg_columns[] = {
-  {TRUE, COL_TEXT, N_("?Player:Name"), col_name, NULL, cmp_name, "name"},
-  {FALSE, COL_TEXT, N_("Username"), col_username, NULL, NULL, "username"},
-  {TRUE, COL_FLAG, N_("Flag"), NULL, NULL, NULL,  "flag"},
-  {TRUE, COL_TEXT, N_("Nation"), col_nation, NULL, NULL,  "nation"},
-  {TRUE, COL_COLOR, N_("Border"), NULL, NULL, NULL,  "border"},
-  {TRUE, COL_RIGHT_TEXT, N_("Score"), get_score_text, NULL, cmp_score, "score"},
-  {TRUE, COL_TEXT, N_("Team"), col_team, NULL, NULL,  "team"},
-  {TRUE, COL_BOOLEAN, N_("AI"), NULL, col_ai, NULL,  "ai"},
-  {TRUE, COL_TEXT, N_("Attitude"), col_love, NULL, cmp_love,  "attitude"},
-  {TRUE, COL_TEXT, N_("Embassy"), col_embassy, NULL, NULL,  "embassy"},
-  {TRUE, COL_TEXT, N_("Dipl.State"), col_diplstate, NULL, cmp_diplstate,
+  {TRUE, COL_TEXT, N_("?Player:Name"), col_name, nullptr, cmp_name, "name"},
+  {FALSE, COL_TEXT, N_("Username"), col_username, nullptr, nullptr, "username"},
+  {TRUE, COL_FLAG, N_("Flag"), nullptr, nullptr, nullptr, "flag"},
+  {TRUE, COL_TEXT, N_("Nation"), col_nation, nullptr, nullptr, "nation"},
+  {TRUE, COL_COLOR, N_("Border"), nullptr, nullptr, nullptr, "border"},
+  {TRUE, COL_RIGHT_TEXT, N_("Score"), get_score_text, nullptr, cmp_score, "score"},
+  {TRUE, COL_TEXT, N_("Team"), col_team, nullptr, nullptr, "team"},
+  {TRUE, COL_BOOLEAN, N_("AI"), nullptr, col_ai, nullptr, "ai"},
+  {TRUE, COL_TEXT, N_("Attitude"), col_love, nullptr, cmp_love, "attitude"},
+  {TRUE, COL_TEXT, N_("Embassy"), col_embassy, nullptr, nullptr, "embassy"},
+  {TRUE, COL_TEXT, N_("Dipl.State"), col_diplstate, nullptr, cmp_diplstate,
     "diplstate"},
-  {TRUE, COL_TEXT, N_("Vision"), col_vision, NULL, NULL,  "vision"},
-  {TRUE, COL_TEXT, N_("State"), plrdlg_col_state, NULL, NULL,  "state"},
-  {FALSE, COL_TEXT, N_("?Player_dlg:Host"), col_host, NULL, NULL,  "host"},
-  {FALSE, COL_RIGHT_TEXT, N_("?Player_dlg:Idle"), col_idle, NULL, NULL,  "idle"},
-  {FALSE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, NULL, NULL,  "ping"},
-  {TRUE, COL_TEXT, N_("Government"), col_government, NULL, NULL,  "government"},
-  {TRUE, COL_RIGHT_TEXT, N_("Culture"), col_culture, NULL, cmp_culture, "culture"},
-  {TRUE, COL_RIGHT_TEXT, N_("Gold"), col_gold, NULL, cmp_gold, "gold"},
-  {TRUE, COL_RIGHT_TEXT, N_("Tax"), col_tax, NULL, cmp_tax, "tax"},
-  {TRUE, COL_RIGHT_TEXT, N_("Science"), col_science, NULL, cmp_science, "science"},
-  {TRUE, COL_RIGHT_TEXT, N_("Luxury"), col_luxury, NULL, cmp_luxury, "luxury"},
-  {TRUE, COL_TEXT, N_("Research"), col_research, NULL, NULL, "research"}
+  {TRUE, COL_TEXT, N_("Vision"), col_vision, nullptr, nullptr, "vision"},
+  {TRUE, COL_TEXT, N_("State"), plrdlg_col_state, nullptr, nullptr, "state"},
+  {FALSE, COL_TEXT, N_("?Player_dlg:Host"), col_host, nullptr, nullptr, "host"},
+  {FALSE, COL_RIGHT_TEXT, N_("?Player_dlg:Idle"), col_idle, nullptr, nullptr, "idle"},
+  {FALSE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, nullptr, nullptr, "ping"},
+  {TRUE, COL_TEXT, N_("Government"), col_government, nullptr, nullptr, "government"},
+  {TRUE, COL_RIGHT_TEXT, N_("Culture"), col_culture, nullptr, cmp_culture, "culture"},
+  {TRUE, COL_RIGHT_TEXT, N_("Gold"), col_gold, nullptr, cmp_gold, "gold"},
+  {TRUE, COL_RIGHT_TEXT, N_("Tax"), col_tax, nullptr, cmp_tax, "tax"},
+  {TRUE, COL_RIGHT_TEXT, N_("Science"), col_science, nullptr, cmp_science, "science"},
+  {TRUE, COL_RIGHT_TEXT, N_("Luxury"), col_luxury, nullptr, cmp_luxury, "luxury"},
+  {TRUE, COL_TEXT, N_("Research"), col_research, nullptr, nullptr, "research"}
 };
 
 const int num_player_dlg_columns = ARRAY_SIZE(player_dlg_columns);
diff --git a/client/repodlgs_common.c b/client/repodlgs_common.c
index 4efeb9e4ed..6516ae9968 100644
--- a/client/repodlgs_common.c
+++ b/client/repodlgs_common.c
@@ -51,7 +51,7 @@ void get_economy_report_data(struct improvement_entry *entries,
   *total_cost = 0;
   *total_income = 0;
 
-  if (NULL == client.conn.playing) {
+  if (client.conn.playing == nullptr) {
     return;
   }
 
@@ -110,7 +110,7 @@ void get_economy_report_units_data(struct unit_entry *entries,
   *num_entries_used = 0;
   *total_cost = 0;
 
-  if (NULL == client.conn.playing) {
+  if (client.conn.playing == nullptr) {
     return;
   }
 
@@ -127,7 +127,7 @@ void get_economy_report_units_data(struct unit_entry *entries,
 
     city_list_iterate(client.conn.playing->cities, pcity) {
       unit_list_iterate(pcity->units_supported, punit) {
-	if (unit_type_get(punit) == unittype) {
+        if (unit_type_get(punit) == unittype) {
           count++;
           partial_cost += punit->upkeep[O_GOLD];
         }
diff --git a/client/themes_common.c b/client/themes_common.c
index a1592796a0..3ab6021005 100644
--- a/client/themes_common.c
+++ b/client/themes_common.c
@@ -67,18 +67,18 @@ void init_themes(void)
   int i;
 
   /* Get GUI-specific theme directories */
-  char **gui_directories =
-      get_gui_specific_themes_directories(&num_directories);
+  char **gui_directories
+    = get_gui_specific_themes_directories(&num_directories);
 
-  directories =
-      fc_malloc(sizeof(struct theme_directory) * num_directories);
+  directories
+    = fc_malloc(sizeof(struct theme_directory) * num_directories);
 
   for (i = 0; i < num_directories; i++) {
     directories[i].path = gui_directories[i];
 
     /* Get usable themes in this directory */
-    directories[i].themes =
-	get_usable_themes_in_directory(directories[i].path,
+    directories[i].themes
+      = get_usable_themes_in_directory(directories[i].path,
                                        &(directories[i].num_themes));
   }
   free(gui_directories);
@@ -89,9 +89,9 @@ void init_themes(void)
 ****************************************************************************/
 const struct strvec *get_themes_list(const struct option *poption)
 {
-  static struct strvec *themes_list = NULL;
+  static struct strvec *themes_list = nullptr;
 
-  if (NULL == themes_list) {
+  if (themes_list == nullptr) {
     int i, j, k;
 
     themes_list = strvec_new();
@@ -139,6 +139,7 @@ void theme_reread_callback(struct option *poption)
 {
   const char *theme_name = option_str_get(poption);
 
-  fc_assert_ret(NULL != theme_name && theme_name[0] != '\0');
+  fc_assert_ret(theme_name != nullptr && theme_name[0] != '\0');
+
   load_theme(theme_name);
 }
diff --git a/client/unitselect_common.c b/client/unitselect_common.c
index b6511d29e1..b73b5d6381 100644
--- a/client/unitselect_common.c
+++ b/client/unitselect_common.c
@@ -52,7 +52,7 @@ static struct usdata *usdata_new(void)
 
   struct usdata *data = fc_calloc(1, sizeof(*data));
 
-  data->utype = NULL;
+  data->utype = nullptr;
 
   for (loc = unit_select_location_mode_begin();
        loc != unit_select_location_mode_end();
@@ -71,7 +71,7 @@ static struct usdata *usdata_new(void)
 *****************************************************************************/
 static void usdata_destroy(struct usdata *data)
 {
-  if (data != NULL) {
+  if (data != nullptr) {
     enum unit_select_location_mode loc;
     enum unit_activity act;
 
@@ -79,7 +79,7 @@ static void usdata_destroy(struct usdata *data)
          loc != unit_select_location_mode_end();
          loc = unit_select_location_mode_next(loc)) {
       for (act = 0; act < ACTIVITY_LAST; act++) {
-        if (data->units[loc][act] != NULL) {
+        if (data->units[loc][act] != nullptr) {
           unit_list_destroy(data->units[loc][act]);
         }
       }
@@ -186,7 +186,7 @@ static void usdlg_data_add_unit(struct usdata_hash *ushash,
 static bool usdlg_check_unit_activity(const struct unit *punit,
                                       enum unit_activity act)
 {
-  fc_assert_ret_val(punit != NULL, FALSE);
+  fc_assert_ret_val(punit != nullptr, FALSE);
 
   return (punit->activity == act);
 }
@@ -200,11 +200,11 @@ static bool usdlg_check_unit_location(const struct unit *punit,
 {
   struct tile *utile;
 
-  fc_assert_ret_val(punit != NULL, FALSE);
+  fc_assert_ret_val(punit != nullptr, FALSE);
 
   utile = unit_tile(punit);
 
-  fc_assert_ret_val(utile != NULL, FALSE);
+  fc_assert_ret_val(utile != nullptr, FALSE);
 
   switch (loc) {
   case SELLOC_UNITS:
@@ -228,13 +228,13 @@ static bool usdlg_check_unit_location(const struct unit *punit,
     break;
   case SELLOC_LAND:
     if (utype_move_type(unit_type_get(punit)) == UMT_LAND
-        && (!is_ocean(tile_terrain(utile)) || tile_city(utile) != NULL)) {
+        && (!is_ocean(tile_terrain(utile)) || tile_city(utile) != nullptr)) {
       return TRUE;
     }
     break;
   case SELLOC_SEA:
     if (utype_move_type(unit_type_get(punit)) == UMT_SEA
-        && (is_ocean(tile_terrain(utile)) || tile_city(utile) != NULL)) {
+        && (is_ocean(tile_terrain(utile)) || tile_city(utile) != nullptr)) {
       return TRUE;
     }
     break;
-- 
2.53.0

