From 845c3626a50d638d6b6f8acd082b89d3df0d59f5 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Thu, 18 Jun 2026 02:43:48 +0300
Subject: [PATCH 37/37] common/: Replace NULL with nullptr

See RM #2055

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/borders.c      |  2 +-
 common/fc_interface.c |  2 +-
 common/oblig_reqs.c   |  3 ++-
 common/spaceship.c    | 42 +++++++++++++++++++++---------------------
 4 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/common/borders.c b/common/borders.c
index aefedd5490..4d9de73c2a 100644
--- a/common/borders.c
+++ b/common/borders.c
@@ -119,7 +119,7 @@ bool is_border_source(struct tile *ptile)
     return TRUE;
   }
 
-  if (extra_owner(ptile) != NULL) {
+  if (extra_owner(ptile) != nullptr) {
     struct extra_type_list *terr_claimers = extra_type_list_of_terr_claimers();
 
     extra_type_list_iterate(terr_claimers, pextra) {
diff --git a/common/fc_interface.c b/common/fc_interface.c
index 722672d5d2..282236b862 100644
--- a/common/fc_interface.c
+++ b/common/fc_interface.c
@@ -35,7 +35,7 @@
 struct functions fc_functions;
 
 /* The functions are accessed via this pointer. */
-const struct functions *fc_funcs = NULL;
+const struct functions *fc_funcs = nullptr;
 /* After this is set to TRUE (in interface_init()), the functions are
    available via fc_funcs. */
 bool fc_funcs_defined = FALSE;
diff --git a/common/oblig_reqs.c b/common/oblig_reqs.c
index 16f5802eeb..59366df898 100644
--- a/common/oblig_reqs.c
+++ b/common/oblig_reqs.c
@@ -51,7 +51,8 @@ static struct ae_contra_or *req_contradiction_or(int alternatives, ...)
   int i;
   va_list args;
 
-  fc_assert_ret_val(alternatives > 0, NULL);
+  fc_assert_ret_val(alternatives > 0, nullptr);
+
   out = fc_malloc(sizeof(*out));
   out->users = 0;
   out->alternatives = alternatives;
diff --git a/common/spaceship.c b/common/spaceship.c
index f3d33ebfb2..f9eaebe3db 100644
--- a/common/spaceship.c
+++ b/common/spaceship.c
@@ -21,7 +21,7 @@
 #include "spaceship.h"
 
 const struct sship_part_info structurals_info[NUM_SS_STRUCTURALS] = {
-  {19, 13, -1},		/* -1 means none required */
+  {19, 13, -1},         /* -1 means none required */
   {19, 15,  0},
   {19, 11,  0},
   {19, 17,  1},
@@ -131,10 +131,10 @@ bool next_spaceship_component(struct player *pplayer,
                               struct player_spaceship *ship,
                               struct spaceship_component *fill)
 {
-  fc_assert_ret_val(fill != NULL, FALSE);
+  fc_assert_ret_val(fill != nullptr, FALSE);
 
   if (ship->modules > (ship->habitation + ship->life_support
-		       + ship->solar_panels)) {
+                       + ship->solar_panels)) {
     /* "nice" governments prefer to keep success 100%;
      * others build habitation first (for score?)  (Thanks Massimo.)
      */
@@ -202,33 +202,33 @@ bool next_spaceship_component(struct player *pplayer,
       req = modules_info[2].required;
     } else {
       for (i = 0; i < NUM_SS_COMPONENTS; i++) {
-	if ((i % 2 == 0 && ship->fuel > (i/2))
-	    || (i % 2 == 1 && ship->propulsion > (i/2))) {
-	  if (!BV_ISSET(ship->structure, components_info[i].required)) {
-	    req = components_info[i].required;
-	    break;
-	  }
-	}
+        if ((i % 2 == 0 && ship->fuel > (i/2))
+            || (i % 2 == 1 && ship->propulsion > (i/2))) {
+          if (!BV_ISSET(ship->structure, components_info[i].required)) {
+            req = components_info[i].required;
+            break;
+          }
+        }
       }
     }
     if (req == -1) {
       for (i = 0; i < NUM_SS_MODULES; i++) {
-	if ((i % 3 == 0 && ship->habitation > (i/3))
-	    || (i % 3 == 1 && ship->life_support > (i/3))
-	    || (i % 3 == 2 && ship->solar_panels > (i/3))) {
-	  if (!BV_ISSET(ship->structure, modules_info[i].required)) {
-	    req = modules_info[i].required;
-	    break;
-	  }
-	}
+        if ((i % 3 == 0 && ship->habitation > (i/3))
+            || (i % 3 == 1 && ship->life_support > (i/3))
+            || (i % 3 == 2 && ship->solar_panels > (i/3))) {
+          if (!BV_ISSET(ship->structure, modules_info[i].required)) {
+            req = modules_info[i].required;
+            break;
+          }
+        }
       }
     }
     if (req == -1) {
       for (i = 0; i < NUM_SS_STRUCTURALS; i++) {
         if (!BV_ISSET(ship->structure, i)) {
-	  req = i;
-	  break;
-	}
+          req = i;
+          break;
+        }
       }
     }
     /* sanity: */
-- 
2.53.0

