From 68884fc9f8c703044c5a3081e4fcaa3285fea019 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Mon, 19 May 2025 03:43:00 +0300
Subject: [PATCH 60/60] client/*.c: Remove trailing spaces

See RM #1413

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/audio.c           |  6 ++++--
 client/client_main.c     |  6 +++---
 client/climisc.c         |  4 ++--
 client/control.c         | 26 +++++++++++++-------------
 client/editor.c          |  8 ++++----
 client/global_worklist.c |  2 +-
 client/helpdata.c        | 20 ++++++++++----------
 client/packhand.c        | 16 ++++++++--------
 client/plrdlg_common.c   |  2 +-
 client/repodlgs_common.c |  2 +-
 client/servers.c         | 10 +++++-----
 client/themes_common.c   |  4 ++--
 12 files changed, 54 insertions(+), 52 deletions(-)

diff --git a/client/audio.c b/client/audio.c
index d3aa610fb9..fefbab277f 100644
--- a/client/audio.c
+++ b/client/audio.c
@@ -363,8 +363,10 @@ void audio_real_init(const char *const soundset_name,
   }
 
 #ifdef AUDIO_SDL
-  if (audio_select_plugin("sdl")) return; 
-#endif
+  if (audio_select_plugin("sdl")) {
+    return;
+  }
+#endif /* AUDIO_SDL */
   log_normal(_("No real audio subsystem managed to initialize!"));
   log_normal(_("Perhaps there is some misconfiguration or bad permissions."));
   log_normal(_("Proceeding with sound support disabled."));
diff --git a/client/client_main.c b/client/client_main.c
index 833573107d..c6a6bf98b1 100644
--- a/client/client_main.c
+++ b/client/client_main.c
@@ -80,7 +80,7 @@
 #include "climisc.h"
 #include "clinet.h"
 #include "connectdlg_common.h"  /* client_kill_server() */
-#include "control.h" 
+#include "control.h"
 #include "editor.h"
 #include "global_worklist.h"
 #include "gui_properties.h"
@@ -646,7 +646,7 @@ int client_main(int argc, char *argv[], bool postpone_tileset)
     sz_strlcpy(music_set_name, gui_options.default_music_set_name);
   }
   if (sound_plugin_name[0] == '\0') {
-    sz_strlcpy(sound_plugin_name, gui_options.default_sound_plugin_name); 
+    sz_strlcpy(sound_plugin_name, gui_options.default_sound_plugin_name);
   }
   if (server_host[0] == '\0') {
     sz_strlcpy(server_host, gui_options.default_server_host);
@@ -654,7 +654,7 @@ int client_main(int argc, char *argv[], bool postpone_tileset)
     sz_strlcpy(gui_options.default_server_host, server_host);
   }
   if (user_name[0] == '\0') {
-    sz_strlcpy(user_name, gui_options.default_user_name); 
+    sz_strlcpy(user_name, gui_options.default_user_name);
   }
   if (metaserver[0] == '\0') {
     if (0 == strcmp(gui_options.default_metaserver, DEFAULT_METASERVER_OPTION)) {
diff --git a/client/climisc.c b/client/climisc.c
index 8e1b0f967a..f593fbeab1 100644
--- a/client/climisc.c
+++ b/client/climisc.c
@@ -11,7 +11,7 @@
    GNU General Public License for more details.
 ***********************************************************************/
 
-/*********************************************************************** 
+/***********************************************************************
   This module contains various general - mostly highlevel - functions
   used throughout the client.
 ***********************************************************************/
@@ -1270,7 +1270,7 @@ void client_unit_init_act_prob_cache(struct unit *punit)
   This is only guesswork based on unit properties. One should not
   take UNIT_BG_FLYING seriously meaning that unit can fly - custom
   ruleset might have units with similar properties but explains these
-  properties by some other means than by flying. 
+  properties by some other means than by flying.
 **************************************************************************/
 enum unit_bg_color_type unit_color_type(const struct unit_type *punittype)
 {
diff --git a/client/control.c b/client/control.c
index b58f675905..39f4229fac 100644
--- a/client/control.c
+++ b/client/control.c
@@ -680,7 +680,7 @@ static struct unit *find_best_focus_candidate(bool accept_current)
   This function may be called from packhand.c, via unit_focus_update(),
   as a result of packets indicating change in activity for a unit. Also
   called when user press the "Wait" command.
- 
+
   FIXME: Add feature to focus only units of a certain category.
 
   @param accept_current The current focus can be kept if no other candidates
@@ -700,7 +700,7 @@ void unit_focus_advance(bool accept_current)
   clear_hover_state();
 
   unit_list_iterate(get_units_in_focus(), punit) {
-    /* 
+    /*
      * Is the unit which just lost focus a non-AI unit? If yes this
      * enables the auto end turn.
      */
@@ -766,7 +766,7 @@ void unit_focus_advance(bool accept_current)
 
   unit_focus_set(candidate);
 
-  /* 
+  /*
    * Handle auto-turn-done mode: If a unit was in focus (did move),
    * but now none are (no more to move) and there was at least one
    * non-AI unit this turn which was focused, then fake a Turn Done
@@ -806,7 +806,7 @@ void unit_focus_update(void)
     if ((punit->activity == ACTIVITY_IDLE
 	 || punit->activity == ACTIVITY_GOTO
 	 || unit_has_orders(punit))
-	&& punit->moves_left > 0 
+	&& punit->moves_left > 0
 	&& !punit->done_moving
         && punit->ssa_controller == SSA_NONE) {
       return;
@@ -971,7 +971,7 @@ double blink_turn_done_button(void)
   Update unit icons (and arrow) in the information display, for specified
   punit as the active unit and other units on the same square.  In practice
   punit is almost always (or maybe strictly always?) the focus unit.
-  
+
   Static vars store some info on current (ie previous) state, to avoid
   unnecessary redraws; initialise to "flag" values to always redraw first
   time.  In principle we _might_ need more info (eg ai.control, connecting),
@@ -1009,7 +1009,7 @@ void update_unit_pix_label(struct unit_list *punitlist)
       }
     }
     unit_list_iterate_end;
-    
+
     if (i > num_units_below) {
       set_unit_icons_more_arrow(TRUE);
     } else {
@@ -1414,7 +1414,7 @@ static bool can_be_irrigated(const struct tile *ptile,
 **************************************************************************/
 bool can_unit_do_connect(struct unit *punit,
                          enum unit_activity activity,
-                         struct extra_type *tgt) 
+                         struct extra_type *tgt)
 {
   struct tile *ptile = unit_tile(punit);
   struct road_type *proad = NULL;
@@ -2395,7 +2395,7 @@ void request_unit_pillage(struct unit *punit)
 /**********************************************************************//**
   Toggle display of city outlines on the map
 **************************************************************************/
-void request_toggle_city_outlines(void) 
+void request_toggle_city_outlines(void)
 {
   if (!can_client_change_view()) {
     return;
@@ -2413,7 +2413,7 @@ void request_toggle_city_output(void)
   if (!can_client_change_view()) {
     return;
   }
-  
+
   gui_options.draw_city_output = !gui_options.draw_city_output;
   update_map_canvas_visible();
 }
@@ -2421,7 +2421,7 @@ void request_toggle_city_output(void)
 /**********************************************************************//**
   Toggle display of grid lines on the map
 **************************************************************************/
-void request_toggle_map_grid(void) 
+void request_toggle_map_grid(void)
 {
   if (!can_client_change_view()) {
     return;
@@ -2434,7 +2434,7 @@ void request_toggle_map_grid(void)
 /**********************************************************************//**
   Toggle display of national borders on the map
 **************************************************************************/
-void request_toggle_map_borders(void) 
+void request_toggle_map_borders(void)
 {
   if (!can_client_change_view()) {
     return;
@@ -2447,7 +2447,7 @@ void request_toggle_map_borders(void)
 /**********************************************************************//**
   Toggle display of native tiles on the map
 **************************************************************************/
-void request_toggle_map_native(void) 
+void request_toggle_map_native(void)
 {
   if (!can_client_change_view()) {
     return;
@@ -2482,7 +2482,7 @@ void request_toggle_city_names(void)
   gui_options.draw_city_names ^= 1;
   update_map_canvas_visible();
 }
- 
+
 /**********************************************************************//**
   Toggle display of city growth (turns-to-grow)
 **************************************************************************/
diff --git a/client/editor.c b/client/editor.c
index bcc1e7e882..03c04f4d05 100644
--- a/client/editor.c
+++ b/client/editor.c
@@ -484,7 +484,7 @@ static void editor_grab_applied_player(const struct tile *ptile)
   } else if (tile_owner(ptile) != NULL) {
     apno = player_number(tile_owner(ptile));
   }
-  
+
   if (player_by_number(apno) != NULL) {
     editor_tool_set_applied_player(editor_get_tool(), apno);
     editgui_refresh();
@@ -692,7 +692,7 @@ void editor_mouse_button_press(int canvas_x, int canvas_y,
       popup_properties(ptile);
       break;
     }
-    
+
     if (modifiers == EKM_SHIFT) {
       editor->selection_mode = SELECTION_MODE_ADD;
     } else if (modifiers == EKM_ALT) {
@@ -1018,7 +1018,7 @@ void editor_set_current_tile(const struct tile *ptile)
   if (editor == NULL) {
     return;
   }
-  
+
   editor->current_tile = ptile;
 }
 
@@ -1030,7 +1030,7 @@ const struct tile *editor_get_current_tile(void)
   if (editor == NULL) {
     return NULL;
   }
-  
+
   return editor->current_tile;
 }
 
diff --git a/client/global_worklist.c b/client/global_worklist.c
index b749f20d01..28886e704b 100644
--- a/client/global_worklist.c
+++ b/client/global_worklist.c
@@ -423,7 +423,7 @@ static void global_worklist_save(const struct global_worklist *pgwl,
   fc_vsnprintf(path_str, sizeof(path_str), path, ap);
   va_end(ap);
 
-  secfile_insert_str(file, pgwl->name, "%s.wl_name", path_str);  
+  secfile_insert_str(file, pgwl->name, "%s.wl_name", path_str);
 
   switch (pgwl->status) {
   case STATUS_UNBUILT:
diff --git a/client/helpdata.c b/client/helpdata.c
index 1361cbead5..59a90dc666 100644
--- a/client/helpdata.c
+++ b/client/helpdata.c
@@ -672,7 +672,7 @@ static void insert_allows(struct universal *psource,
 static struct help_item *new_help_item(int type)
 {
   struct help_item *pitem;
-  
+
   pitem = fc_malloc(sizeof(struct help_item));
   pitem->topic = NULL;
   pitem->text = NULL;
@@ -1201,9 +1201,9 @@ void boot_help_texts(void)
           continue;
         }
       }
-      
+
       /* It wasn't a "generate" node: */
-      
+
       pitem = new_help_item(HELP_TEXT);
       pitem->topic = fc_strdup(Q_(secfile_lookup_str(sf, "%s.name",
                                                      sec_name)));
@@ -1265,7 +1265,7 @@ int num_help_items(void)
 const struct help_item *get_help_item(int pos)
 {
   int size;
-  
+
   check_help_nodes_init();
   size = help_list_size(help_nodes);
   if (pos < 0 || pos > size) {
@@ -1308,7 +1308,7 @@ get_help_item_spec(const char *name, enum help_page_type htype, int *pos)
     idx++;
   }
   help_list_iterate_end;
-  
+
   if (!pitem) {
     idx = -1;
     vitem.topic = vtopic;
@@ -1350,7 +1350,7 @@ void help_iter_start(void)
 const struct help_item *help_iter_next(void)
 {
   const struct help_item *pitem;
-  
+
   check_help_nodes_init();
   pitem = help_list_link_data(help_nodes_iterator);
   if (pitem) {
@@ -2376,7 +2376,7 @@ char *helptext_unit(char *buf, size_t bufsz, struct player *pplayer,
   }
   if (utype_has_flag(utype, UTYF_IGTER)) {
     cat_snprintf(buf, bufsz,
-                 /* TRANS: "MP" = movement points. %s may have a 
+                 /* TRANS: "MP" = movement points. %s may have a
                   * fractional part. */
                  _("%s Ignores terrain effects (moving costs at most %s MP "
                    "per tile).\n"), BULLET,
@@ -3377,7 +3377,7 @@ void helptext_advance(char *buf, size_t bufsz, struct player *pplayer,
 
   {
     int j;
-    
+
     for (j = 0; j < MAX_NUM_TECH_LIST; j++) {
       if (game.rgame.global_init_techs[j] == A_LAST) {
         break;
@@ -4447,7 +4447,7 @@ void helptext_government(char *buf, size_t bufsz, struct player *pplayer,
         struct output_type *potype =
           output_type != O_LAST ? get_output_type(output_type) : NULL;
 
-        world_value = 
+        world_value =
           get_target_bonus_effects(NULL,
                                    &(const struct req_context) {
                                      .unittype = unittype,
@@ -5116,7 +5116,7 @@ void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation,
         astr_init(&utype_names[i]);
         if (count[i] > 1) {
           /* TRANS: a unit type followed by a count. For instance,
-           * "Fighter (2)" means two Fighters. Count is never 1. 
+           * "Fighter (2)" means two Fighters. Count is never 1.
            * Used in a list. */
           astr_set(&utype_names[i], _("%s (%d)"),
                    utype_name_translation(utypes[i]), count[i]);
diff --git a/client/packhand.c b/client/packhand.c
index f7ab331991..62c90e9770 100644
--- a/client/packhand.c
+++ b/client/packhand.c
@@ -973,7 +973,7 @@ void handle_city_info(const struct packet_city_info *packet)
 
   /* Update caravan dialog */
   if ((production_changed || shield_stock_changed)
-      && action_selection_target_city() == pcity->id) {   
+      && action_selection_target_city() == pcity->id) {
     dsend_packet_unit_get_actions(&client.conn,
                                   action_selection_actor_unit(),
                                   action_selection_target_unit(),
@@ -1049,7 +1049,7 @@ static void city_packet_common(struct city *pcity, struct tile *pcenter,
     }
 
     players_iterate(pp) {
-      unit_list_iterate(pp->units, punit) { 
+      unit_list_iterate(pp->units, punit) {
 	if (punit->homecity == pcity->id) {
           unit_list_prepend(pcity->units_supported, punit);
         }
@@ -1244,7 +1244,7 @@ void handle_city_short_info(const struct packet_city_short_info *packet)
     }
 
     city_name_set(pcity, packet->name);
-    
+
     memset(pcity->feel, 0, sizeof(pcity->feel));
     memset(pcity->specialists, 0, sizeof(pcity->specialists));
   }
@@ -1790,7 +1790,7 @@ static bool handle_unit_packet_common(struct unit *packet_unit)
       repaint_unit = TRUE;
 
       /* Wakeup Focus */
-      if (gui_options.wakeup_focus 
+      if (gui_options.wakeup_focus
           && plr != nullptr
           && is_human(plr)
           && owner == plr
@@ -2342,7 +2342,7 @@ void handle_game_info(const struct packet_game_info *pinfo)
   if (update_aifill_button || update_ai_skill_level) {
     update_start_page();
   }
-  
+
   if (can_client_change_view()) {
     update_info_label();
   }
@@ -2909,7 +2909,7 @@ void handle_conn_info(const struct packet_conn_info *pinfo)
             pinfo->observer, (int) pinfo->access_level);
   log_debug("conn_info \"%s\" \"%s\" \"%s\"",
             pinfo->username, pinfo->addr, pinfo->capability);
-  
+
   if (!pinfo->used) {
     /* Forget the connection */
     if (!pconn) {
@@ -3459,7 +3459,7 @@ void handle_tile_info(const struct packet_tile_info *packet)
   }
 
   if (known_changed || tile_changed) {
-    /* 
+    /*
      * A tile can only change if it was known before and is still
      * known. In the other cases the tile is new or removed.
      */
@@ -4697,7 +4697,7 @@ void handle_ruleset_nation(const struct packet_ruleset_nation *packet)
   }
 
   /* set later by PACKET_NATION_AVAILABILITY */
-  pnation->client.is_pickable = FALSE; 
+  pnation->client.is_pickable = FALSE;
   pnation->is_playable = packet->is_playable;
   pnation->barb_type = packet->barbarian_type;
 
diff --git a/client/plrdlg_common.c b/client/plrdlg_common.c
index c25f266adf..2beedb1c5e 100644
--- a/client/plrdlg_common.c
+++ b/client/plrdlg_common.c
@@ -210,7 +210,7 @@ static int cmp_love(const struct player *player1,
   } else {
     love2 = player2->ai_common.love[player_index(client.conn.playing)];
   }
-  
+
   return love1 - love2;
 }
 
diff --git a/client/repodlgs_common.c b/client/repodlgs_common.c
index f463e0f4a7..4efeb9e4ed 100644
--- a/client/repodlgs_common.c
+++ b/client/repodlgs_common.c
@@ -99,7 +99,7 @@ void get_economy_report_data(struct improvement_entry *entries,
 }
 
 /************************************************************************//**
-  Returns an array of units with gold_upkeep. Number of units in 
+  Returns an array of units with gold_upkeep. Number of units in
   the array is added to num_entries_used.
 ****************************************************************************/
 void get_economy_report_units_data(struct unit_entry *entries,
diff --git a/client/servers.c b/client/servers.c
index 2ae8b847f7..58e71ac5e4 100644
--- a/client/servers.c
+++ b/client/servers.c
@@ -225,7 +225,7 @@ static struct server_list *parse_metaserver_data(fz_FILE *f)
     for (j = 0; j < pserver->nplayers ; j++) {
       const char *name, *nation, *type, *plrhost;
 
-      name = secfile_lookup_str_default(file, "", 
+      name = secfile_lookup_str_default(file, "",
                                         "server%d.player%d.name", i, j);
       pserver->players[j].name = fc_strdup(name);
 
@@ -233,7 +233,7 @@ static struct server_list *parse_metaserver_data(fz_FILE *f)
                                         "server%d.player%d.type", i, j);
       pserver->players[j].type = fc_strdup(type);
 
-      plrhost = secfile_lookup_str_default(file, "", 
+      plrhost = secfile_lookup_str_default(file, "",
                                            "server%d.player%d.host", i, j);
       pserver->players[j].host = fc_strdup(plrhost);
 
@@ -554,7 +554,7 @@ static bool begin_lanserver_scan(struct server_scan *scan)
 #ifndef FREECIV_HAVE_WINSOCK
   /* Set the Time-to-Live field for the packet  */
   ttl = SERVER_LAN_TTL;
-  if (setsockopt(send_sock, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&ttl, 
+  if (setsockopt(send_sock, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&ttl,
                  sizeof(ttl))) {
     char errstr[2048];
 
@@ -569,7 +569,7 @@ static bool begin_lanserver_scan(struct server_scan *scan)
   }
 #endif /* FREECIV_HAVE_WINSOCK */
 
-  if (setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST, (const char*)&opt, 
+  if (setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST, (const char*)&opt,
                  sizeof(opt))) {
     char errstr[2048];
 
@@ -584,7 +584,7 @@ static bool begin_lanserver_scan(struct server_scan *scan)
   dio_output_init(&dout, buffer, sizeof(buffer));
   dio_put_uint8_raw(&dout, SERVER_LAN_VERSION);
   size = dio_output_used(&dout);
- 
+
 
   if (sendto(send_sock, buffer, size, 0, &addr.saddr,
              sockaddr_size(&addr)) < 0) {
diff --git a/client/themes_common.c b/client/themes_common.c
index d17876b2ee..a1592796a0 100644
--- a/client/themes_common.c
+++ b/client/themes_common.c
@@ -39,7 +39,7 @@
   - Theme implementation is gui specific and most themes can not be shared
     between different guis.
   Theme is recognized by its name.
-  
+
   Theme is stored in a directory called like the theme. The directory contains
   some data files. Each gui defines its own format in the
   get_usable_themes_in_directory() function.
@@ -48,7 +48,7 @@
 /* A directory containing a list of usable themes */
 struct theme_directory {
   /* Path on the filesystem */
-  char *path; 
+  char *path;
   /* Array of theme names */
   char **themes;
   /* Themes array length */
-- 
2.47.2

