From 4da494a24bf07d5e565fde56cb1d187bae2031ad Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 4 May 2024 13:24:37 +0300
Subject: [PATCH 66/66] advisors: Clear trailing spaces

See RM #548

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 server/advisors/advbuilding.c  |  6 +++---
 server/advisors/advcity.c      |  2 +-
 server/advisors/advcity.h      |  4 ++--
 server/advisors/advdata.c      | 30 ++++++++++++++--------------
 server/advisors/advdata.h      |  8 ++++----
 server/advisors/advgoto.h      |  4 ++--
 server/advisors/advruleset.h   |  4 ++--
 server/advisors/advspace.h     |  4 ++--
 server/advisors/autoexplorer.c | 36 +++++++++++++++++-----------------
 server/advisors/autoexplorer.h |  2 +-
 server/advisors/autoworkers.c  |  2 +-
 11 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/server/advisors/advbuilding.c b/server/advisors/advbuilding.c
index 185d7cff8d..ae540851e5 100644
--- a/server/advisors/advbuilding.c
+++ b/server/advisors/advbuilding.c
@@ -115,7 +115,7 @@ static void calculate_city_clusters(struct player *pplayer)
 }
 
 /**********************************************************************//**
-  Set building wants for human player 
+  Set building wants for human player
 **************************************************************************/
 static void ba_human_wants(struct player *pplayer, struct city *wonder_city)
 {
@@ -160,7 +160,7 @@ static void ba_human_wants(struct player *pplayer, struct city *wonder_city)
   city_list_iterate(pplayer->cities, pcity) {
     improvement_iterate(pimprove) {
       if (pcity->server.adv->building_want[improvement_index(pimprove)] != 0) {
-        CITY_LOG(LOG_DEBUG, pcity, "want to build %s with " ADV_WANT_PRINTF, 
+        CITY_LOG(LOG_DEBUG, pcity, "want to build %s with " ADV_WANT_PRINTF,
                  improvement_rule_name(pimprove),
                  pcity->server.adv->building_want[improvement_index(pimprove)]);
       }
@@ -192,7 +192,7 @@ void building_advisor(struct player *pplayer)
    || 0 >= wonder_city->surplus[O_SHIELD]
    || VUT_UTYPE == wonder_city->production.kind /* changed to defender? */
    || !is_wonder(wonder_city->production.value.building)
-   || !can_city_build_improvement_now(wonder_city, 
+   || !can_city_build_improvement_now(wonder_city,
                                       wonder_city->production.value.building)
    || !is_improvement_productive(wonder_city,
                                  wonder_city->production.value.building)) {
diff --git a/server/advisors/advcity.c b/server/advisors/advcity.c
index cc54b21026..2e75035ee8 100644
--- a/server/advisors/advcity.c
+++ b/server/advisors/advcity.c
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    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
diff --git a/server/advisors/advcity.h b/server/advisors/advcity.h
index 86e480a651..066eaf07df 100644
--- a/server/advisors/advcity.h
+++ b/server/advisors/advcity.h
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    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
@@ -18,4 +18,4 @@ struct adv_data;
 
 int adv_eval_calc_city(struct city *pcity, struct adv_data *adv);
 
-#endif   /* FC__ADVCITY_H */
+#endif /* FC__ADVCITY_H */
diff --git a/server/advisors/advdata.c b/server/advisors/advdata.c
index 22c95eba66..f165b869a4 100644
--- a/server/advisors/advdata.c
+++ b/server/advisors/advdata.c
@@ -256,7 +256,7 @@ bool is_adv_data_phase_open(struct player *pplayer)
   can see what.
 
   FIXME: We should try to find the lowest common defense strength of our
-  defending units, and ignore enemy units that are incapable of harming 
+  defending units, and ignore enemy units that are incapable of harming
   us, instead of just checking attack strength > 1.
 **************************************************************************/
 bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
@@ -313,7 +313,7 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
 
     /* The idea is that if there aren't any hostile cities on
      * our continent, the danger of land attacks is not big
-     * enough to warrant city walls. Concentrate instead on 
+     * enough to warrant city walls. Concentrate instead on
      * coastal fortresses and hunting down enemy transports. */
     city_list_iterate(aplayer->cities, acity) {
       Continent_id continent = tile_continent(acity->tile);
@@ -414,7 +414,7 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
     Continent_id continent = tile_continent(ptile);
 
     if (is_ocean_tile(ptile)) {
-      if (adv->explore.sea_done && has_handicap(pplayer, H_TARGETS) 
+      if (adv->explore.sea_done && has_handicap(pplayer, H_TARGETS)
           && !map_is_known(ptile, pplayer)) {
         /* We're not done there. */
         adv->explore.sea_done = FALSE;
@@ -427,7 +427,7 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
       /* we don't need more explaining, we got the point */
       continue;
     }
-    if (hut_on_tile(ptile) 
+    if (hut_on_tile(ptile)
         && (!has_handicap(pplayer, H_HUTS)
              || map_is_known(ptile, pplayer))) {
       adv->explore.land_done = FALSE;
@@ -492,9 +492,9 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
 
   /*** Priorities ***/
 
-  /* NEVER set these to zero! Weight values are usually multiplied by 
-   * these values, so be careful with them. They are used in city 
-   * and government calculations, and food and shields should be 
+  /* NEVER set these to zero! Weight values are usually multiplied by
+   * these values, so be careful with them. They are used in city
+   * and government calculations, and food and shields should be
    * slightly bigger because we only look at surpluses there. They
    * are all WAGs. */
   adv->food_priority = FOOD_WEIGHTING;
@@ -520,11 +520,11 @@ bool adv_data_phase_init(struct player *pplayer, bool is_new_phase)
   } else {
     adv->wants_science = TRUE;
   }
-  
+
   /* max num cities
    * The idea behind this code is that novice players don't understand that
    * expansion is critical and find it very annoying.
-   * With the following code AI players will try to be only a bit better 
+   * With the following code AI players will try to be only a bit better
    * than the best human players. This should lead to more exciting games
    * for the beginners.
    */
@@ -970,7 +970,7 @@ adv_want adv_gov_player_bonus_want(struct player *pplayer)
   our GDP (total ai_eval_calc_city) under this government.  If the very
   best of the governments is not available to us (it is not yet discovered),
   we record it in the goal.gov structure with the aim of wanting the
-  necessary tech more.  The best of the available governments is recorded 
+  necessary tech more.  The best of the available governments is recorded
   in goal.revolution.  We record the want of each government, and only
   recalculate this data every ai->govt_reeval_turns turns.
 
@@ -1065,7 +1065,7 @@ void adv_best_government(struct player *pplayer)
   /* Figure out which government is the best for us this turn. */
   governments_iterate(gov) {
     int gi = government_index(gov);
-    if (adv->government_want[gi] > best_val 
+    if (adv->government_want[gi] > best_val
         && can_change_to_government(pplayer, gov)) {
       best_val = adv->government_want[gi];
       adv->goal.revolution = gov;
@@ -1127,9 +1127,9 @@ bool adv_is_player_dangerous(struct player *pplayer,
     /* We always trust ourself */
     return FALSE;
   }
-  
+
   ds = player_diplstate_get(pplayer, aplayer)->type;
-  
+
   if (ds == DS_WAR || ds == DS_CEASEFIRE) {
     /* It's already a war or aplayer can declare it soon */
     return TRUE;
@@ -1147,10 +1147,10 @@ bool adv_is_player_dangerous(struct player *pplayer,
   }
 
   if (pplayer->ai_common.love[player_index(aplayer)] < MAX_AI_LOVE / 10) {
-    /* We don't trust players who we don't like. Note that 
+    /* We don't trust players who we don't like. Note that
      * aplayer's units inside pplayer's borders decreases AI's love */
     return TRUE;
   }
-  
+
   return FALSE;
 }
diff --git a/server/advisors/advdata.h b/server/advisors/advdata.h
index 97d4ceda52..ba11597e38 100644
--- a/server/advisors/advdata.h
+++ b/server/advisors/advdata.h
@@ -24,10 +24,10 @@
 /* server/advisors */
 #include "advtools.h"
 
-/* 
+/*
  * This file and advdata.c contains global data structures for the AI
- * and some of the functions that fill them with useful values at the 
- * start of every turn. 
+ * and some of the functions that fill them with useful values at the
+ * start of every turn.
  */
 
 enum adv_improvement_status {
@@ -134,7 +134,7 @@ struct adv_data {
     } govt;
     struct government *revolution;   /* The best gov of the now available */
   } goal;
-  
+
   /* Whether science would benefit player at all */
   bool wants_science;
 
diff --git a/server/advisors/advgoto.h b/server/advisors/advgoto.h
index 627c76f85c..83b2f803e7 100644
--- a/server/advisors/advgoto.h
+++ b/server/advisors/advgoto.h
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    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
@@ -49,4 +49,4 @@ int adv_unit_att_rating(const struct unit *punit);
 int adv_unit_def_rating_basic(const struct unit *punit);
 int adv_unit_def_rating_basic_squared(const struct unit *punit);
 
-#endif   /* FC__ADVGOTO_H */
+#endif /* FC__ADVGOTO_H */
diff --git a/server/advisors/advruleset.h b/server/advisors/advruleset.h
index e7dfd46bd1..4e31dd0596 100644
--- a/server/advisors/advruleset.h
+++ b/server/advisors/advruleset.h
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    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
@@ -15,4 +15,4 @@
 
 void adv_units_ruleset_init(void);
 
-#endif   /* FC__ADVRULESET_H */
+#endif /* FC__ADVRULESET_H */
diff --git a/server/advisors/advspace.h b/server/advisors/advspace.h
index 0b4d9f6722..652e78ef55 100644
--- a/server/advisors/advspace.h
+++ b/server/advisors/advspace.h
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    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
@@ -24,4 +24,4 @@ struct player_spaceship;
 bool adv_spaceship_autoplace(struct player *pplayer,
                              struct player_spaceship *ship);
 
-#endif  /* FC__ADVSPACE_H */
+#endif /* FC__ADVSPACE_H */
diff --git a/server/advisors/autoexplorer.c b/server/advisors/autoexplorer.c
index accff592df..b04a6aad26 100644
--- a/server/advisors/autoexplorer.c
+++ b/server/advisors/autoexplorer.c
@@ -56,7 +56,7 @@ static int likely_native(struct tile *ptile,
 {
   int native = 0;
   int foreign = 0;
-  
+
   /* We do not check H_MAP here, it should be done by map_is_known() */
   if (map_is_known(ptile, pplayer)) {
     /* we've seen the tile already. */
@@ -175,7 +175,7 @@ static bool explorer_goto(struct unit *punit, struct tile *ptile)
 #define KNOWN_SAME_TER_SCORE   0
 #define KNOWN_DIFF_TER_SCORE   51
 
-/* The maximum number of tiles that the unit might uncover in a move. 
+/* The maximum number of tiles that the unit might uncover in a move.
  * #define MAX_NEW_TILES          (1 + 4 * (unit_type_get(punit)->vision_range))
  * The previous line would be ideal, but we'd like these to be constants
  * for efficiency, so pretend vision_range == 1 */
@@ -187,7 +187,7 @@ static bool explorer_goto(struct unit *punit, struct tile *ptile)
  * As above, set vision_range == 1 */
 #define VISION_TILES           9
 
-/* The desirability of the best tile possible without cities or huts. 
+/* The desirability of the best tile possible without cities or huts.
  * TER_SCORE is given per 1% of certainty about the terrain, so
  * muliply by 100 to compensate. */
 #define BEST_NORMAL_TILE       \
@@ -201,11 +201,11 @@ static bool explorer_goto(struct unit *punit, struct tile *ptile)
 /* And we value exploring huts even more than our own cities.
  * FIXME: different desirability of entering different huts
  * in different circumstates must be specifiable by a ruleset. */
-#define HUT_SCORE              (OWN_CITY_SCORE + 1) 
+#define HUT_SCORE              (OWN_CITY_SCORE + 1)
 
 #define BEST_POSSIBLE_SCORE    (HUT_SCORE + BEST_NORMAL_TILE)
 
-static int explorer_desirable(struct tile *ptile, struct player *pplayer, 
+static int explorer_desirable(struct tile *ptile, struct player *pplayer,
                               struct unit *punit)
 {
   int radius_sq = unit_type_get(punit)->vision_radius_sq;
@@ -230,12 +230,12 @@ static int explorer_desirable(struct tile *ptile, struct player *pplayer,
     if (!map_is_known(ptile1, pplayer)) {
       unknown++;
 
-      /* FIXME: we should add OWN_CITY_SCORE to desirable if the tile 
+      /* FIXME: we should add OWN_CITY_SCORE to desirable if the tile
        * can be harvested by a city of ours. Just calculating this each
        * time becomes rather expensive. Jason Short suggests:
        * It should be easy to generate this information once, for
-       * the entire world.  It can be used by everyone and only 
-       * sometimes needs to be recalculated (actually all changes 
+       * the entire world.  It can be used by everyone and only
+       * sometimes needs to be recalculated (actually all changes
        * only require local recalculation, but that could be unstable). */
 
       desirable += (native * SAME_TER_SCORE + (100 - native) * DIFF_TER_SCORE);
@@ -280,7 +280,7 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
   /* Loop prevention */
   const struct tile *init_tile = unit_tile(punit);
 
-  /* The log of the want of the most desirable tile, 
+  /* The log of the want of the most desirable tile,
    * given nearby water, cities, etc. */
   double log_most_desirable = -FC_INFINITY;
 
@@ -331,7 +331,7 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
 
     desirable = explorer_desirable(ptile, pplayer, punit);
 
-    if (desirable <= 0) { 
+    if (desirable <= 0) {
       /* Totally non-desirable tile. No need to continue. */
       continue;
     }
@@ -339,20 +339,20 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
     /* take the natural log */
     log_desirable = log(desirable);
 
-    /* Ok, the way we calculate goodness is taking the base tile 
+    /* Ok, the way we calculate goodness is taking the base tile
      * desirability amortized by the time it takes to get there:
      *
      *     goodness = desirability * DIST_FACTOR^total_MC
      *
      * TODO: JDS notes that we should really make our exponential
      *       term dimensionless by dividing by move_rate.
-     * 
+     *
      * We want to truncate our search, so we calculate a maximum distance
      * that we would move to find the tile with the most possible desirability
      * (BEST_POSSIBLE_SCORE) that gives us the same goodness as the current
      * tile position we're looking at. Therefore we have:
      *
-     *   desirability * DIST_FACTOR^total_MC = 
+     *   desirability * DIST_FACTOR^total_MC =
      *               BEST_POSSIBLE_SCORE * DIST_FACTOR^(max distance)      (1)
      *
      * and then solve for max_dist. We only want to change max_dist when
@@ -360,7 +360,7 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
      * the conditional below. It looks cryptic, but all it is is testing which
      * of two goodnesses is bigger after taking the natural log of both sides.
      */
-    if (log_desirable + move_cost * logDF 
+    if (log_desirable + move_cost * logDF
 	> log_most_desirable + best_MC * logDF) {
 
       log_most_desirable = log_desirable;
@@ -383,7 +383,7 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
 
   /* Go to the best tile found. */
   if (best_tile != NULL) {
-    /* TODO: read the path off the map we made.  Then we can make a path 
+    /* TODO: read the path off the map we made.  Then we can make a path
      * which goes beside the unknown, with a good EC callback... */
     enum override_bool allow = NO_OVERRIDE;
 
@@ -402,12 +402,12 @@ enum unit_move_result manage_auto_explorer(struct unit *punit)
     if (punit->moves_left > 0) {
       /* We can still move on... */
       if (!same_pos(init_tile, unit_tile(punit))) {
-        /* At least we moved (and maybe even got to where we wanted).  
-         * Let's do more exploring. 
+        /* At least we moved (and maybe even got to where we wanted).
+         * Let's do more exploring.
          * (Checking only whether our position changed is unsafe: can allow
          * yoyoing on a RR) */
 	UNIT_LOG(LOG_DEBUG, punit, "recursively exploring...");
-	return manage_auto_explorer(punit);          
+	return manage_auto_explorer(punit);
       } else {
 	UNIT_LOG(LOG_DEBUG, punit, "done exploring (all finished)...");
 	return MR_PAUSE;
diff --git a/server/advisors/autoexplorer.h b/server/advisors/autoexplorer.h
index f115da04bf..f8236bece6 100644
--- a/server/advisors/autoexplorer.h
+++ b/server/advisors/autoexplorer.h
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 2004 - The Freeciv Project
    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
diff --git a/server/advisors/autoworkers.c b/server/advisors/autoworkers.c
index dd6bb504a4..657349eff4 100644
--- a/server/advisors/autoworkers.c
+++ b/server/advisors/autoworkers.c
@@ -1187,7 +1187,7 @@ void auto_workers_player(struct player *pplayer)
 
   whole_map_iterate(nmap, ptile) {
     state[tile_index(ptile)].enroute = -1;
-    state[tile_index(ptile)].eta = FC_INFINITY;    
+    state[tile_index(ptile)].eta = FC_INFINITY;
   } whole_map_iterate_end;
 
   /* Initialize the infrastructure cache, which is used shortly. */
-- 
2.43.0

