From 7a125a27b738f71af8ae993f308a6e59b8911f9e Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 29 Nov 2026 01:54:24 +0200
Subject: [PATCH 61/61] daidomestic.c: Replace NULL with nullptr

See RM #2510

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 ai/default/daidomestic.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/ai/default/daidomestic.c b/ai/default/daidomestic.c
index 760ee117f1..a0fbd5f142 100644
--- a/ai/default/daidomestic.c
+++ b/ai/default/daidomestic.c
@@ -89,7 +89,7 @@ static void dai_choose_help_wonder(struct ai_type *ait,
   }
 
   if (pcity == wonder_city
-      || wonder_city == NULL
+      || wonder_city == nullptr
       || city_data->distance_to_wonder_city <= 0
       || !city_production_gets_caravan_shields(&wonder_city->production)
       /* TODO: Should helping to build a unit be considered when legal? */
@@ -151,7 +151,7 @@ static void dai_choose_help_wonder(struct ai_type *ait,
       unit_type = dai_wants_role_unit(ait, pplayer, pcity,
                                       action_id_get_role(ACTION_HELP_WONDER),
                                       want);
-      if (unit_type != NULL) {
+      if (unit_type != nullptr) {
         choice->want = want;
         choice->type = CT_CIVILIAN;
         choice->value.utype = unit_type;
@@ -294,14 +294,14 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
 
     players_iterate(aplayer) {
       if (aplayer == pplayer || !aplayer->is_alive) {
-	continue;
+        continue;
       }
       if (pplayers_allied(pplayer, aplayer)) {
         city_list_iterate(aplayer->cities, acity) {
           if (can_cities_trade(pcity, acity)) {
             if (tile_continent(acity->tile) != continent) {
               if (!(can_move_ic || has_boats)) {
-                /* FIXME: get by roads/rivers? */
+                /* FIXME: Get by roads/rivers? */
                 continue;
               }
               dest_city_found = TRUE;
@@ -369,7 +369,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
    * correct action. */
   trade_action = utype_can_do_action(unit_type, ACTION_TRADE_ROUTE) ?
         ACTION_TRADE_ROUTE : ACTION_MARKETPLACE;
-  bonus = get_target_bonus_effects(NULL,
+  bonus = get_target_bonus_effects(nullptr,
                                    &(const struct req_context) {
                                      .player = pplayer,
                                      .city = pcity,
@@ -378,7 +378,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
                                      .action =
                                        action_by_number(trade_action),
                                    },
-                                   NULL,
+                                   nullptr,
                                    EFT_TRADE_REVENUE_BONUS);
 
   /* Be mercy full to players with small amounts. Round up. */
@@ -443,7 +443,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
     want += trader_trait / 4;
   }
 
-  want -= utype_build_shield_cost(pcity, NULL, unit_type) * SHIELD_WEIGHTING / 150;
+  want -= utype_build_shield_cost(pcity, nullptr, unit_type) * SHIELD_WEIGHTING / 150;
 
   /* Don't pile too many of them */
   if (unassigned_caravans * 10 > want && want > 0.0) {
@@ -453,7 +453,8 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
   }
 
   CITY_LOG(LOG_DEBUG, pcity,
-           "want for trade route unit is " ADV_WANT_PRINTF " (expected initial income %d)",
+           "want for trade route unit is " ADV_WANT_PRINTF
+           " (expected initial income %d)",
            want,
            income);
 
@@ -464,7 +465,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
                                     action_id_get_role(ACTION_TRADE_ROUTE),
                                     want);
 
-    if (unit_type == NULL) {
+    if (unit_type == nullptr) {
       unit_type = dai_wants_role_unit(ait, pplayer, pcity,
                                       action_id_get_role(ACTION_MARKETPLACE),
                                       want);
@@ -472,7 +473,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity,
 
     /* We don't want to build caravan that wouldn't be able to reach the
      * destination by any means. It would be useless. */
-    if (unit_type != NULL && (!need_boat || has_boats)) {
+    if (unit_type != nullptr && (!need_boat || has_boats)) {
       choice->want = want;
       choice->type = CT_CIVILIAN;
       choice->value.utype = unit_type;
@@ -493,7 +494,7 @@ struct adv_choice *domestic_advisor_choose_build(struct ai_type *ait,
                                                  struct player *pplayer,
                                                  struct city *pcity)
 {
-  struct adv_data *adv = adv_data_get(pplayer, NULL);
+  struct adv_data *adv = adv_data_get(pplayer, nullptr);
   /* Unit type with certain role */
   struct unit_type *worker_type;
   struct unit_type *founder_type;
@@ -511,14 +512,14 @@ struct adv_choice *domestic_advisor_choose_build(struct ai_type *ait,
   worker_want = city_data->worker_want * pplayer->ai_common.expand / 100;
 
   if (adv->wonder_city == pcity->id) {
-    if (worker_type == NULL || worker_type->pop_cost > 0) {
+    if (worker_type == nullptr || worker_type->pop_cost > 0) {
       worker_want /= 5;
     } else {
       worker_want /= 2;
     }
   }
 
-  if (worker_type != NULL
+  if (worker_type != nullptr
       && pcity->surplus[O_FOOD] > utype_upkeep_cost(worker_type, nullptr,
                                                     pplayer, O_FOOD)) {
     if (worker_want > 0) {
@@ -531,7 +532,7 @@ struct adv_choice *domestic_advisor_choose_build(struct ai_type *ait,
     }
     /* Terrain improvers don't use boats (yet) */
 
-  } else if (worker_type == NULL && worker_want > 0) {
+  } else if (worker_type == nullptr && worker_want > 0) {
     /* Can't build workers. Lets stimulate science */
     dai_wants_role_unit(ait, pplayer, pcity, UTYF_WORKERS, worker_want);
   }
@@ -546,7 +547,7 @@ struct adv_choice *domestic_advisor_choose_build(struct ai_type *ait,
     founder_want = city_data->founder_want;
 
     if (adv->wonder_city == pcity->id) {
-      if (founder_type == NULL || founder_type->pop_cost > 0) {
+      if (founder_type == nullptr || founder_type->pop_cost > 0) {
         founder_want /= 5;
       } else {
         founder_want /= 2;
@@ -580,7 +581,7 @@ struct adv_choice *domestic_advisor_choose_build(struct ai_type *ait,
         /* We need boats to colonize! */
         /* We might need boats even if there are boats free,
          * if they are blockaded or in inland seas. */
-        struct ai_plr *ai = dai_plr_data_get(ait, pplayer, NULL);
+        struct ai_plr *ai = dai_plr_data_get(ait, pplayer, nullptr);
 
         CITY_LOG(LOG_DEBUG, pcity,
                  "desires founders with passion " ADV_WANT_PRINTF
@@ -660,7 +661,7 @@ void dai_wonder_city_distance(struct ai_type *ait, struct player *pplayer,
     def_ai_city_data(acity, ait)->distance_to_wonder_city = 0;
   } city_list_iterate_end;
 
-  if (wonder_city == NULL) {
+  if (wonder_city == nullptr) {
     return;
   }
 
-- 
2.53.0

