From 7de28662f412586e7fb548f759f50954f577d8f5 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 25 Aug 2026 22:33:18 +0300
Subject: [PATCH 61/61] srv_*.[ch]: Replace NULL with nullptr

See RM #2168

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/srv_entrypoint.c |  8 ++++----
 server/srv_log.c        | 10 +++++-----
 server/srv_main.h       |  4 ++--
 server/srv_signal.c     | 12 ++++++------
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/server/srv_entrypoint.c b/server/srv_entrypoint.c
index f944b0af5a..c9fb9c911e 100644
--- a/server/srv_entrypoint.c
+++ b/server/srv_entrypoint.c
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
   int inx;
   bool showhelp = FALSE;
   bool showvers = FALSE;
-  char *option = NULL;
+  char *option = nullptr;
 
   executable_init();
   setup_interrupt_handlers();
@@ -215,7 +215,7 @@ int main(int argc, char *argv[])
   con_write(C_VERSION, _("This is the server for %s"), freeciv_name_version());
   /* TRANS: No full stop after the URL, could cause confusion. */
   con_write(C_COMMENT, _("You can learn a lot about Freeciv at %s"),
-	    HOMEPAGE_URL);
+            HOMEPAGE_URL);
 
   if (showhelp) {
     struct cmdhelp *help = cmdhelp_new(argv[0]);
@@ -305,7 +305,7 @@ int main(int argc, char *argv[])
                 /* TRANS: "saves" is exactly what user must type, do not translate. */
                 _("saves DIR"),
                 _("Save games to directory DIR"));
-    cmdhelp_add(help, NULL,
+    cmdhelp_add(help, nullptr,
                 /* TRANS: "scenarios" is exactly what user must type, do not translate. */
                 _("scenarios DIR"),
                 _("Save scenarios to directory DIR"));
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
                 /* TRANS: "Ranklog" is exactly what user must type, do not translate. */
                 _("Ranklog FILE"),
                 _("Use FILE as ranking logfile"));
-    cmdhelp_add(help, NULL,
+    cmdhelp_add(help, nullptr,
                 /* TRANS: "ruleset" is exactly what user must type, do not translate. */
                 _("ruleset RULESET"),
                 _("Load ruleset RULESET"));
diff --git a/server/srv_log.c b/server/srv_log.c
index 8736e93acd..663c018bc8 100644
--- a/server/srv_log.c
+++ b/server/srv_log.c
@@ -73,7 +73,7 @@ void real_city_log(const char *file, const char *function, int line,
 
   cat_snprintf(buffer, sizeof(buffer), "%s", buffer2);
   if (notify) {
-    notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buffer);
+    notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buffer);
   }
   do_log(file, function, line, FALSE, level, "%s", buffer);
 }
@@ -117,7 +117,7 @@ void real_unit_log(const char *file, const char *function, int line,
 
   cat_snprintf(buffer, sizeof(buffer), "%s", buffer2);
   if (notify) {
-    notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buffer);
+    notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buffer);
   }
   do_log(file, function, line, FALSE, level, "%s", buffer);
 }
@@ -165,7 +165,7 @@ void timing_results_real(void)
               timer_read_seconds(aitimer[which][0]),                        \
               timer_read_seconds(aitimer[which][1]));                       \
   log_test("%s", buf);                                                      \
-  notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buf);
+  notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
 
   log_test("  --- AI timing results ---");
 
@@ -175,11 +175,11 @@ void timing_results_real(void)
   fc_snprintf(buf, sizeof(buf), "  %s: %g sec turn, %g sec game", text, \
               timer_read_seconds(aitimer[which][0]),                    \
               timer_read_seconds(aitimer[which][1]));                   \
-  notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log, "%s", buf);
+  notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log, "%s", buf);
 
 #endif /* LOG_TIMERS */
 
-  notify_conn(NULL, NULL, E_AI_DEBUG, ftc_log,
+  notify_conn(nullptr, nullptr, E_AI_DEBUG, ftc_log,
               "  --- AI timing results ---");
   AILOG_OUT("Total AI time", AIT_ALL);
   AILOG_OUT("Movemap", AIT_MOVEMAP);
diff --git a/server/srv_main.h b/server/srv_main.h
index 8b006eff48..9717957e3a 100644
--- a/server/srv_main.h
+++ b/server/srv_main.h
@@ -30,11 +30,11 @@ struct server_arguments {
   bool metaconnection_persistent;
   char identity_name[256];
   unsigned short int metaserver_port;
-  /* Address this server is to listen on (NULL => INADDR_ANY) */
+  /* Address this server is to listen on (nullptr => INADDR_ANY) */
   char *bind_addr;
   /* This server's listen port */
   int port;
-  /* Address to bind when connecting to the metaserver (NULL => bind_addr) */
+  /* Address to bind when connecting to the metaserver (nullptr => bind_addr) */
   char *bind_meta_addr;
   /* The log level */
   enum log_level loglevel;
diff --git a/server/srv_signal.c b/server/srv_signal.c
index 9328d68654..67f1761bb6 100644
--- a/server/srv_signal.c
+++ b/server/srv_signal.c
@@ -50,7 +50,7 @@ if (S_S_RUNNING == server_state()) {    \
 }                                       \
 exit(EXIT_SUCCESS);
 
-static struct timer *signal_timer = NULL;
+static struct timer *signal_timer = nullptr;
 
 /**********************************************************************//**
   This function is called when a SIGINT (ctrl-c) is received. It will exit
@@ -60,20 +60,20 @@ static void signal_handler(int sig)
 {
   switch (sig) {
   case SIGINT:
-    if (signal_timer != NULL && timer_read_seconds(signal_timer) <= 1.0) {
+    if (signal_timer != nullptr && timer_read_seconds(signal_timer) <= 1.0) {
       save_and_exit(SIGINT);
     } else {
       if (game.info.timeout == -1) {
         log_normal(_("Setting timeout to 0. Autogame will stop."));
         game.info.timeout = 0;
       }
-      if (signal_timer == NULL) {
+      if (signal_timer == nullptr) {
         log_normal(_("You must interrupt Freeciv twice "
                      "within one second to make it exit."));
       }
     }
     signal_timer = timer_renew(signal_timer, TIMER_USER, TIMER_ACTIVE,
-                               signal_timer != NULL ? NULL : "ctrlc");
+                               signal_timer != nullptr ? nullptr : "ctrlc");
     timer_start(signal_timer);
     break;
 
@@ -148,8 +148,8 @@ void setup_interrupt_handlers(void)
 **************************************************************************/
 void signal_timer_free(void)
 {
-  if (signal_timer != NULL) {
+  if (signal_timer != nullptr) {
     timer_destroy(signal_timer);
-    signal_timer = NULL;
+    signal_timer = nullptr;
   }
 }
-- 
2.53.0

