From 2d09112f91eccfc900de483e24fe4bb88e11c880 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Thu, 14 Aug 2025 17:38:32 +0300
Subject: [PATCH 40/40] server: Rermove trailing spaces

See RM #1556

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/animals.c     |  2 +-
 server/auth.c        |  2 +-
 server/barbarian.c   |  2 +-
 server/cityhand.c    |  4 ++--
 server/commands.c    |  4 ++--
 server/console.c     |  2 +-
 server/diplhand.c    | 10 +++++-----
 server/diplomats.c   |  4 ++--
 server/edithand.c    |  8 ++++----
 server/gamehand.c    |  8 ++++----
 server/infrapts.c    |  2 +-
 server/maphand.c     |  8 ++++----
 server/notify.c      |  4 ++--
 server/sanitycheck.c |  6 +++---
 server/sernet.c      | 10 +++++-----
 server/spacerace.c   | 10 +++++-----
 server/techtools.c   |  6 +++---
 17 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/server/animals.c b/server/animals.c
index f94026e3bf..9ce7f6528f 100644
--- a/server/animals.c
+++ b/server/animals.c
@@ -1,5 +1,5 @@
 /***********************************************************************
- Freeciv - Copyright (C) 1996 - 2004 The Freeciv Project Team 
+ Freeciv - Copyright (C) 1996 - 2004 The Freeciv Project Team
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
diff --git a/server/auth.c b/server/auth.c
index 5bf666d013..00cc42ab9f 100644
--- a/server/auth.c
+++ b/server/auth.c
@@ -313,7 +313,7 @@ static bool is_good_password(const char *password, char *msg)
   fc_snprintf(msg, MAX_LEN_MSG,
               _("The password must have at least %d capital letters, %d "
                 "numbers, and be at minimum %d [printable] characters long. "
-                "Try again."), 
+                "Try again."),
               MIN_PASSWORD_CAPS, MIN_PASSWORD_NUMS, MIN_PASSWORD_LEN);
 
   for (i = 0; i < strlen(password); i++) {
diff --git a/server/barbarian.c b/server/barbarian.c
index b6181e2eb7..c341f3d257 100644
--- a/server/barbarian.c
+++ b/server/barbarian.c
@@ -361,7 +361,7 @@ bool unleash_barbarians(struct tile *ptile)
                                     TRUE, FALSE, FALSE)) {
             /* Move */
             (void) unit_move_pay(punit2, dir_tiles[rdir]);
-            log_debug("Moved barbarian unit from (%d, %d) to (%d, %d)", 
+            log_debug("Moved barbarian unit from (%d, %d) to (%d, %d)",
                       TILE_XY(ptile), TILE_XY(dir_tiles[rdir]));
             dest_found = TRUE;
           }
diff --git a/server/cityhand.c b/server/cityhand.c
index 5457b0d39d..3e07b6e26b 100644
--- a/server/cityhand.c
+++ b/server/cityhand.c
@@ -298,7 +298,7 @@ void really_handle_city_buy(struct player *pplayer, struct city *pcity)
   /* This function corresponds to city_can_buy() in the client. */
 
   fc_assert_ret(pcity && player_owns_city(pplayer, pcity));
- 
+
   if (pcity->turn_founded == game.info.turn) {
     notify_player(pplayer, pcity->tile, E_BAD_COMMAND, ftc_server,
                   _("Cannot buy in city created this turn."));
@@ -330,7 +330,7 @@ void really_handle_city_buy(struct player *pplayer, struct city *pcity)
     return; /* sanity */
   }
   if (cost > pplayer->economic.gold) {
-    /* In case something changed while player tried to buy, or player 
+    /* In case something changed while player tried to buy, or player
      * tried to cheat! */
     /* Split into two to allow localization of two pluralisations. */
     char buf[MAX_LEN_MSG];
diff --git a/server/commands.c b/server/commands.c
index a0b270494c..eddf294b3a 100644
--- a/server/commands.c
+++ b/server/commands.c
@@ -439,9 +439,9 @@ static struct command commands[] = {
    NULL, NULL,
    CMD_ECHO_ADMINS, VCF_NONE, 50
   },
-  {"timeoutincrease", ALLOW_CTRL, 
+  {"timeoutincrease", ALLOW_CTRL,
    /* TRANS: translate text between <> only */
-   N_("timeoutincrease <turn> <turninc> <value> <valuemult>"), 
+   N_("timeoutincrease <turn> <turninc> <value> <valuemult>"),
    N_("See \"/help timeoutincrease\"."),
    N_("Every <turn> turns, add <value> to timeout timer, then add <turninc> "
       "to <turn> and multiply <value> by <valuemult>. Use this command in "
diff --git a/server/console.c b/server/console.c
index 0586154b7c..e55a169d57 100644
--- a/server/console.c
+++ b/server/console.c
@@ -179,7 +179,7 @@ static int con_dump(enum rfc_status rfc_status, const char *message, ...)
 {
   static char buf[MAX_LEN_CONSOLE_LINE];
   va_list args;
-  
+
   va_start(args, message);
   fc_vsnprintf(buf, sizeof(buf), message, args);
   va_end(args);
diff --git a/server/diplhand.c b/server/diplhand.c
index 352c97cb88..f6999a8253 100644
--- a/server/diplhand.c
+++ b/server/diplhand.c
@@ -57,7 +57,7 @@
 #define TURNS_LEFT 16
 
 /**********************************************************************//**
-  Calls treaty_evaluate function if such is set for AI player.    
+  Calls treaty_evaluate function if such is set for AI player.
 **************************************************************************/
 static void call_treaty_evaluate(struct player *pplayer, struct player *aplayer,
                                  struct treaty *ptreaty)
@@ -732,7 +732,7 @@ void handle_diplomacy_remove_clause_req(struct player *pplayer,
   if (pgiver != pplayer && pgiver != pother) {
     return;
   }
-  
+
   ptreaty = find_treaty(pplayer, pother);
 
   if (ptreaty && remove_clause(ptreaty, pgiver, type, value)) {
@@ -811,14 +811,14 @@ static void really_diplomacy_cancel_meeting(struct player *pplayer,
 					   player_number(pplayer),
 					   player_number(pplayer));
     notify_player(pother, NULL, E_DIPLOMACY, ftc_server,
-                  _("%s canceled the meeting!"), 
+                  _("%s canceled the meeting!"),
                   player_name(pplayer));
     /* Need to send to pplayer too, for multi-connects: */
     dlsend_packet_diplomacy_cancel_meeting(pplayer->connections,
 					   player_number(pother),
 					   player_number(pplayer));
     notify_player(pplayer, NULL, E_DIPLOMACY, ftc_server,
-                  _("Meeting with %s canceled."), 
+                  _("Meeting with %s canceled."),
                   player_name(pother));
     treaty_remove(ptreaty);
   }
@@ -897,7 +897,7 @@ void send_diplomatic_meetings(struct connection *dest)
       dsend_packet_diplomacy_init_meeting(dest, player_number(other),
                                           player_number(pplayer));
       clause_list_iterate(ptreaty->clauses, pclause) {
-        dsend_packet_diplomacy_create_clause(dest, 
+        dsend_packet_diplomacy_create_clause(dest,
                                              player_number(other),
                                              player_number(pclause->from),
                                              pclause->type,
diff --git a/server/diplomats.c b/server/diplomats.c
index e7e759d9e1..a2a0af496e 100644
--- a/server/diplomats.c
+++ b/server/diplomats.c
@@ -631,7 +631,7 @@ bool spy_sabotage_unit(struct player *pplayer, struct unit *pdiplomat,
 
 /************************************************************************//**
   Bribe an enemy unit.
-  
+
   - Can't bribe a unit if:
     - Player doesn't have enough gold.
   - Otherwise, the unit will be bribed.
@@ -2376,7 +2376,7 @@ void diplomat_escape(struct player *pplayer, struct unit *pdiplomat,
 /************************************************************************//**
   This determines if a diplomat/spy survives and escapes.
 
-  Spies have a game.server.diplchance specified chance of survival (better 
+  Spies have a game.server.diplchance specified chance of survival (better
   if veteran):
     - Diplomats always die.
     - Escapes to home city.
diff --git a/server/edithand.c b/server/edithand.c
index eaa6dd8a12..82909f83ce 100644
--- a/server/edithand.c
+++ b/server/edithand.c
@@ -710,7 +710,7 @@ void handle_edit_city_create(struct connection *pc, int owner, int tile,
     notify_conn(pc->self, ptile, E_BAD_COMMAND, ftc_editor,
                 /* TRANS: ..." at <tile-coordinates> because"... */
                 _("Cannot create a city at %s because the "
-                  "given owner's player id %d is invalid"), 
+                  "given owner's player id %d is invalid"),
                 tile_link(ptile), owner);
     return;
 
@@ -844,7 +844,7 @@ void handle_edit_city(struct connection *pc,
       changed = TRUE;
     }
   } improvement_iterate_end;
- 
+
   /* Handle food stock change. */
   if (packet->food_stock != pcity->food_stock) {
     int max = city_granary_size(city_size_get(pcity));
@@ -885,7 +885,7 @@ void handle_edit_city(struct connection *pc,
     city_refresh_queue_processing();
 
     /* FIXME: city_refresh_queue_processing only sends to city owner? */
-    send_city_info(NULL, pcity);  
+    send_city_info(NULL, pcity);
 
     conn_list_do_unbuffer(game.est_connections);
   }
@@ -1010,7 +1010,7 @@ void handle_edit_player_remove(struct connection *pc, int id)
 /************************************************************************//**
   Handle editing of any or all player properties.
 ****************************************************************************/
-void handle_edit_player(struct connection *pc, 
+void handle_edit_player(struct connection *pc,
                         const struct packet_edit_player *packet)
 {
   struct player *pplayer;
diff --git a/server/gamehand.c b/server/gamehand.c
index cdfd1447fb..afc3c46cf1 100644
--- a/server/gamehand.c
+++ b/server/gamehand.c
@@ -15,7 +15,7 @@
 #include <fc_config.h>
 #endif
 
-#include <stdio.h> /* for remove() */ 
+#include <stdio.h> /* for remove() */
 
 /* utility */
 #include "capability.h"
@@ -107,7 +107,7 @@ enum unit_role_id crole_to_role_id(char crole)
     return L_START_ATTACK_FAST;
   case 'A':
     return L_START_ATTACK_STRONG;
-  default: 
+  default:
     return 0;
   }
 }
@@ -190,7 +190,7 @@ static struct tile *place_starting_unit(struct tile *starttile,
                                              utype_has_flag(utype, UTYF_FLAGLESS)),
                     NULL);
 
-  /* For scenarios or dispersion, huts may coincide with player starts (in 
+  /* For scenarios or dispersion, huts may coincide with player starts (in
    * other cases, huts are avoided as start positions). Remove any such hut,
    * and make sure to tell the client, since we may have already sent this
    * tile (with the hut) earlier: */
@@ -903,7 +903,7 @@ void send_year_to_clients(void)
   Send game_info packet; some server options and various stuff...
   dest == NULL means game.est_connections
 
-  It may be sent at any time. It MUST be sent before any player info, 
+  It may be sent at any time. It MUST be sent before any player info,
   as it contains the number of players.  To avoid inconsistency, it
   SHOULD be sent after rulesets and any other server settings.
 ****************************************************************************/
diff --git a/server/infrapts.c b/server/infrapts.c
index 7df237d131..4360576450 100644
--- a/server/infrapts.c
+++ b/server/infrapts.c
@@ -1,5 +1,5 @@
 /***********************************************************************
- Freeciv - Copyright (C) 1996 - 2004 The Freeciv Project Team 
+ Freeciv - Copyright (C) 1996 - 2004 The Freeciv Project Team
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
diff --git a/server/maphand.c b/server/maphand.c
index 4acbc90e70..6fbc4e068e 100644
--- a/server/maphand.c
+++ b/server/maphand.c
@@ -433,7 +433,7 @@ void give_citymap_from_player_to_player(struct city *pcity,
 /**********************************************************************//**
   Send all tiles known to specified clients.
   If dest is NULL means game.est_connections.
-  
+
   Note for multiple connections this may change "sent" multiple times
   for single player.  This is ok, because "sent" data is just optimised
   calculations, so it will be correct before this, for each connection
@@ -1375,7 +1375,7 @@ struct vision_site *map_get_player_city(const struct tile *ptile,
   struct vision_site *psite = map_get_player_site(ptile, pplayer);
 
   fc_assert_ret_val(psite == NULL || psite->location == ptile, NULL);
- 
+
   return psite;
 }
 
@@ -1721,7 +1721,7 @@ void remove_shared_vision(struct player *pfrom, struct player *pto)
     buffer_shared_vision(pplayer);
     players_iterate(pplayer2) {
       if (!really_gives_vision(pplayer, pplayer2)
-          && BV_ISSET(save_vision[player_index(pplayer)], 
+          && BV_ISSET(save_vision[player_index(pplayer)],
                       player_index(pplayer2))) {
         log_debug("really removing shared vision from %s to %s",
                   player_name(pplayer), player_name(pplayer2));
@@ -1945,7 +1945,7 @@ bool need_to_reassign_continents(const struct terrain *oldter,
                                  const struct terrain *newter)
 {
   bool old_is_ocean, new_is_ocean;
-  
+
   if (!oldter || !newter) {
     return FALSE;
   }
diff --git a/server/notify.c b/server/notify.c
index 8df34ceebb..f1bcf7d0d8 100644
--- a/server/notify.c
+++ b/server/notify.c
@@ -292,7 +292,7 @@ void notify_player(const struct player *pplayer,
                    const struct tile *ptile,
                    enum event_type event,
                    const struct ft_color color,
-                   const char *format, ...) 
+                   const char *format, ...)
 {
   struct conn_list *dest = pplayer ? pplayer->connections : NULL;
   struct packet_chat_msg genmsg;
@@ -316,7 +316,7 @@ void notify_embassies(const struct player *pplayer,
                       const struct tile *ptile,
                       enum event_type event,
                       const struct ft_color color,
-                      const char *format, ...) 
+                      const char *format, ...)
 {
   struct packet_chat_msg genmsg;
   struct event_cache_players *players = NULL;
diff --git a/server/sanitycheck.c b/server/sanitycheck.c
index f8c9fd3afb..7551280582 100644
--- a/server/sanitycheck.c
+++ b/server/sanitycheck.c
@@ -103,7 +103,7 @@ static void check_specials(const char *file, const char *function, int line)
       }
     } extra_type_by_cause_iterate_end;
 
-    SANITY_TILE(ptile, terrain_index(pterrain) >= T_FIRST 
+    SANITY_TILE(ptile, terrain_index(pterrain) >= T_FIRST
                        && terrain_index(pterrain) < terrain_count());
   } whole_map_iterate_end;
 }
@@ -209,11 +209,11 @@ static void check_map(const char *file, const char *function, int line)
 
       /* Check diplomatic status of stacked units. */
       unit_list_iterate(ptile->units, punit2) {
-	SANITY_TILE(ptile, pplayers_allied(unit_owner(punit), 
+	SANITY_TILE(ptile, pplayers_allied(unit_owner(punit),
                                            unit_owner(punit2)));
       } unit_list_iterate_end;
       if (pcity) {
-	SANITY_TILE(ptile, pplayers_allied(unit_owner(punit), 
+	SANITY_TILE(ptile, pplayers_allied(unit_owner(punit),
                                            city_owner(pcity)));
       }
     } unit_list_iterate_end;
diff --git a/server/sernet.c b/server/sernet.c
index aeae4b2a61..600f854b4b 100644
--- a/server/sernet.c
+++ b/server/sernet.c
@@ -448,7 +448,7 @@ struct packet_to_handle {
 /*************************************************************************//**
   Simplify a loop by wrapping get_packet_from_connection.
 *****************************************************************************/
-static bool get_packet(struct connection *pconn, 
+static bool get_packet(struct connection *pconn,
                        struct packet_to_handle *ppacket)
 {
   ppacket->data = get_packet_from_connection(pconn, &ppacket->type);
@@ -496,7 +496,7 @@ static void incoming_client_packets(struct connection *pconn)
     connection_do_unbuffer(pconn);
 
 #if PROCESSING_TIME_STATISTICS
-    log_verbose("processed request %d in %gms", request_id, 
+    log_verbose("processed request %d in %gms", request_id,
                 timer_read_seconds(request_time) * 1000.0);
 #endif /* PROCESSING_TIME_STATISTICS */
 
@@ -1107,7 +1107,7 @@ int server_make_connection(int new_sock, const char *client_addr,
 
       conn_list_append(game.all_connections, pconn);
 
-      log_verbose("connection (%s) from %s (%s)", 
+      log_verbose("connection (%s) from %s (%s)",
                   pconn->username, pconn->addr, pconn->server.ipaddr);
       /* Give a ping timeout to send the PACKET_SERVER_JOIN_REQ, or close
        * the mute connection. This timer will be canceled into
@@ -1188,7 +1188,7 @@ int server_open_socket(void)
 
 #ifndef FREECIV_HAVE_WINSOCK
     /* SO_REUSEADDR considered harmful on Win, necessary otherwise */
-    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, 
+    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
                    (char *)&on, sizeof(on)) == -1) {
       log_error("setsockopt SO_REUSEADDR failed: %s",
                 fc_strerror(fc_get_errno()));
@@ -1610,7 +1610,7 @@ static void send_lanserver_response(void)
   }
 #endif /* FREECIV_HAVE_WINSOCK */
 
-  if (setsockopt(socksend, SOL_SOCKET, SO_BROADCAST, 
+  if (setsockopt(socksend, SOL_SOCKET, SO_BROADCAST,
                  (const char*)&setting, sizeof(setting))) {
     log_error("Lan response setsockopt failed: %s", fc_strerror(fc_get_errno()));
     return;
diff --git a/server/spacerace.c b/server/spacerace.c
index aa4b7a8dcf..fa1b22b9e9 100644
--- a/server/spacerace.c
+++ b/server/spacerace.c
@@ -56,7 +56,7 @@ void spaceship_calc_derived(struct player_spaceship *ship)
   fc_assert_ret(ship->structurals <= NUM_SS_STRUCTURALS);
   fc_assert_ret(ship->components <= NUM_SS_COMPONENTS);
   fc_assert_ret(ship->modules <= NUM_SS_MODULES);
-  
+
   ship->mass = 0;
   ship->support_rate = ship->energy_rate =
     ship->success_rate = ship->travel_time = 0.0;
@@ -136,7 +136,7 @@ void send_spaceship_info(struct player *src, struct conn_list *dest)
     if (!src || pplayer == src) {
       struct packet_spaceship_info info;
       struct player_spaceship *ship = &pplayer->spaceship;
-	  
+
       info.player_num = player_number(pplayer);
       info.sship_state = ship->state;
       info.structurals = ship->structurals;
@@ -155,7 +155,7 @@ void send_spaceship_info(struct player *src, struct conn_list *dest)
       info.success_rate = ship->success_rate;
       info.travel_time = ship->travel_time;
       info.structure = ship->structure;
-	  
+
       lsend_packet_spaceship_info(dest, &info);
     }
   } players_iterate_end;
@@ -216,7 +216,7 @@ bool do_spaceship_place(struct player *pplayer, enum action_requester from,
                         enum spaceship_place_type type, int num)
 {
   struct player_spaceship *ship = &pplayer->spaceship;
-  
+
   if (ship->state == SSHIP_NONE) {
     if (from == ACT_REQ_PLAYER) {
       notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
@@ -463,7 +463,7 @@ int rank_spaceship_arrival(struct player **result)
 
   shuffled_players_iterate(pplayer) {
     struct player_spaceship *ship = &pplayer->spaceship;
-    
+
     if (ship->state == SSHIP_LAUNCHED) {
       result[n++] = pplayer;
     }
diff --git a/server/techtools.c b/server/techtools.c
index c6a2c1a994..6faf6b69ce 100644
--- a/server/techtools.c
+++ b/server/techtools.c
@@ -381,7 +381,7 @@ void found_new_tech(struct research *presearch, Tech_type_id tech_found,
             && is_great_wonder(pimprove)
             && (pcity = city_from_great_wonder(pimprove))) {
           notify_player(city_owner(pcity), NULL, E_WONDER_OBSOLETE, ftc_server,
-                        _("Discovery of %s OBSOLETES %s in %s!"), 
+                        _("Discovery of %s OBSOLETES %s in %s!"),
                         research_advance_name_translation
                             (research_get(city_owner(pcity)), tech_found),
                         improvement_name_translation(pimprove),
@@ -1258,7 +1258,7 @@ Tech_type_id steal_a_tech(struct player *pplayer, struct player *victim,
         j++;
       }
     } advance_index_iterate_max_end;
-  
+
     if (j == 0)  {
       /* We've moved on to future tech */
       if (vresearch->future_tech > presearch->future_tech) {
@@ -1343,7 +1343,7 @@ void handle_player_research(struct player *pplayer, int tech)
   if (tech != A_FUTURE && !valid_advance_by_number(tech)) {
     return;
   }
-  
+
   if (tech != A_FUTURE
       && research_invention_state(research, tech) != TECH_PREREQS_KNOWN) {
     return;
-- 
2.50.1

