From fd82b3982a645e7cd58b97ac91a59f77107f8192 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 24 Aug 2024 13:07:51 +0300
Subject: [PATCH 25/25] Remove trailing spaces from utility/ source files

See RM #802

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 utility/fcbacktrace.h  |  2 +-
 utility/genhash.c      |  2 +-
 utility/genhash.h      |  4 ++--
 utility/log.c          |  8 ++++----
 utility/md5.c          |  2 +-
 utility/md5.h          |  4 ++--
 utility/mem.c          |  2 +-
 utility/netintf.c      | 12 ++++++------
 utility/randseed.c     | 14 +++++++-------
 utility/registry_ini.c |  2 +-
 utility/registry_ini.h |  2 +-
 utility/registry_xml.h |  4 ++--
 utility/specvec.h      |  2 +-
 13 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/utility/fcbacktrace.h b/utility/fcbacktrace.h
index c0856720f5..3ae835c8e7 100644
--- a/utility/fcbacktrace.h
+++ b/utility/fcbacktrace.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
diff --git a/utility/genhash.c b/utility/genhash.c
index d64d47edd3..e8d42494da 100644
--- a/utility/genhash.c
+++ b/utility/genhash.c
@@ -111,7 +111,7 @@ genhash_val_t genhash_str_val_func(const char *vkey)
   unsigned long result = 0;
 
   for (; *vkey != '\0'; vkey++) {
-    result *= 5; 
+    result *= 5;
     result += *vkey;
   }
   result &= 0xFFFFFFFF; /* To make results independent of sizeof(long) */
diff --git a/utility/genhash.h b/utility/genhash.h
index 2369dd0320..17597b283d 100644
--- a/utility/genhash.h
+++ b/utility/genhash.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
@@ -134,4 +134,4 @@ void *genhash_iter_value(const struct iterator *genhash_iter);
 }
 #endif /* __cplusplus */
 
-#endif  /* FC__GENHASH_H */
+#endif /* FC__GENHASH_H */
diff --git a/utility/log.c b/utility/log.c
index ed9c98cc9f..663ff80dd8 100644
--- a/utility/log.c
+++ b/utility/log.c
@@ -443,7 +443,7 @@ static void log_real(enum log_level level, bool print_from_where,
     fc_mutex_allocate(&logfile_mutex);
     if (!(fs = fc_fopen(log_filename, "a"))) {
       fc_fprintf(stderr,
-                 _("Couldn't open logfile: %s for appending \"%s\".\n"), 
+                 _("Couldn't open logfile: %s for appending \"%s\".\n"),
                  log_filename, msg);
       exit(EXIT_FAILURE);
     }
@@ -460,7 +460,7 @@ static void log_real(enum log_level level, bool print_from_where,
                       "last message repeated %d times",
                       repeated-prev), repeated-prev);
       if (repeated > 2) {
-        cat_snprintf(buf, sizeof(buf), 
+        cat_snprintf(buf, sizeof(buf),
                      /* TRANS: preserve leading space */
                      PL_(" (total %d repeat)",
                          " (total %d repeats)",
@@ -477,11 +477,11 @@ static void log_real(enum log_level level, bool print_from_where,
         log_write(fs, prev_level, print_from_where, where, last_msg);
       } else {
         fc_snprintf(buf, sizeof(buf),
-                    PL_("last message repeated %d time", 
+                    PL_("last message repeated %d time",
                         "last message repeated %d times",
                         repeated - prev), repeated - prev);
         if (repeated > 2) {
-          cat_snprintf(buf, sizeof(buf), 
+          cat_snprintf(buf, sizeof(buf),
                        PL_(" (total %d repeat)", " (total %d repeats)",
                            repeated),  repeated);
         }
diff --git a/utility/md5.c b/utility/md5.c
index db52bd6f35..d5042ace7d 100644
--- a/utility/md5.c
+++ b/utility/md5.c
@@ -72,7 +72,7 @@
 
 /* Any 32-bit or wider unsigned integer data type will do */
 typedef unsigned int MD5_u32plus;
- 
+
 typedef struct {
   MD5_u32plus lo, hi;
   MD5_u32plus a, b, c, d;
diff --git a/utility/md5.h b/utility/md5.h
index 60ae3f8872..fa93d3a918 100644
--- a/utility/md5.h
+++ b/utility/md5.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
@@ -30,4 +30,4 @@ void create_md5sum(const unsigned char *input, int len,
 }
 #endif /* __cplusplus */
 
-#endif  /* FC__MD5_H */
+#endif /* FC__MD5_H */
diff --git a/utility/mem.c b/utility/mem.c
index 7ada351dc8..245d6661a6 100644
--- a/utility/mem.c
+++ b/utility/mem.c
@@ -80,7 +80,7 @@ void *fc_real_malloc(size_t size,
 #endif /* FREECIV_DEBUG */
 
   /* Some systems return nullptr on malloc(0)
-   * According to ANSI C, the return is implementation-specific, 
+   * According to ANSI C, the return is implementation-specific,
    * this is a safe guard. Having the extra byte is, of course, harmless. */
 #ifndef MALLOC_ZERO_OK
   size = MAX(size, 1);
diff --git a/utility/netintf.c b/utility/netintf.c
index d10e27cfbe..041480854a 100644
--- a/utility/netintf.c
+++ b/utility/netintf.c
@@ -95,7 +95,7 @@ static void set_socket_errno(void)
     return;
   default:
     bugreport_request("Missing errno mapping for Winsock error #%d.", err);
- 
+
     errno = 0;
   }
 }
@@ -107,9 +107,9 @@ static void set_socket_errno(void)
 int fc_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen)
 {
   int result;
-  
+
   result = connect(sockfd, serv_addr, addrlen);
-  
+
 #ifdef FREECIV_HAVE_WINSOCK
   if (result == -1) {
     set_socket_errno();
@@ -144,7 +144,7 @@ int fc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
 int fc_readsocket(int sock, void *buf, size_t size)
 {
   int result;
-  
+
 #ifdef FREECIV_HAVE_WINSOCK
   result = recv(sock, buf, size, 0);
   if (result == -1) {
@@ -163,7 +163,7 @@ int fc_readsocket(int sock, void *buf, size_t size)
 int fc_writesocket(int sock, const void *buf, size_t size)
 {
   int result;
-        
+
 #ifdef FREECIV_HAVE_WINSOCK
   result = send(sock, buf, size, 0);
   if (result == -1) {
@@ -271,7 +271,7 @@ void sockaddr_debug(union fc_sockaddr *addr, enum log_level lvl)
 #ifdef FREECIV_IPV6_SUPPORT
   char buf[INET6_ADDRSTRLEN] = "Unknown";
 
-  if (addr->saddr.sa_family == AF_INET6) { 
+  if (addr->saddr.sa_family == AF_INET6) {
     inet_ntop(AF_INET6, &addr->saddr_in6.sin6_addr, buf, INET6_ADDRSTRLEN);
     log_base(lvl, "Host: %s, Port: %d (IPv6)",
              buf, ntohs(addr->saddr_in6.sin6_port));
diff --git a/utility/randseed.c b/utility/randseed.c
index 74a3cb4012..9e74569443 100644
--- a/utility/randseed.c
+++ b/utility/randseed.c
@@ -56,7 +56,7 @@ static bool generate_seed_getentropy(randseed *ret)
    * FreeBSD and glibc on Linux (as a wrapper to getrandom()) as well.
    */
   randseed seed = 0;
-  
+
   if (getentropy(&seed, sizeof(seed)) == 0) {
     *ret = seed;
 
@@ -91,7 +91,7 @@ static bool generate_seed_bcryptgenrandom(randseed *ret)
 }
 
 /**********************************************************************//**
-  Read a 32-bit random value using /dev/urandom, if available. 
+  Read a 32-bit random value using /dev/urandom, if available.
   (Most Unix-like systems)
   Return FALSE on error, otherwise return TRUE and store seed in *ret.
 **************************************************************************/
@@ -101,11 +101,11 @@ static bool generate_seed_urandom(randseed *ret)
   /*
    * /dev/urandom should be available on most Unixen. The Wikipedia page
    * mentions Linux, FreeBSD, OpenBSD, macOS as well as Solaris, NetBSD,
-   * Tru64 UNIX 5.1B, AIX 5.2 and HP-UX 11i v2. 
+   * Tru64 UNIX 5.1B, AIX 5.2 and HP-UX 11i v2.
    *
    * However, opening it may fail if the game is running in a chroot without
    * it, or is otherwise restricted from accessing it. This is why getentropy()
-   * is preferred. 
+   * is preferred.
    */
   static const char *random_device = "/dev/urandom";
   int fd = 0;
@@ -148,12 +148,12 @@ static bool generate_seed_urandom(randseed *ret)
 static bool generate_seed_clock_gettime(randseed *ret)
 {
 #if HAVE_CLOCK_GETTIME
-  /* 
+  /*
    * clock_gettime() nominally gives nanoseconds, but the real granularity may be
    * worse, making the lowest bits less useful. On the other hand, the lower bits
    * of full seconds are the most useful, the high bits being very predictable.
    * Xor them together to hopefully get something relatively unpredictable in the
-   * bottom 30 bits. 
+   * bottom 30 bits.
    */
   randseed seed = 0;
   struct timespec tp;
@@ -187,7 +187,7 @@ static bool generate_seed_time(randseed *ret)
 
 /**********************************************************************//**
   Return a random 32-bit value to use as game seed, by whatever means
-  the underlying system provides. 
+  the underlying system provides.
 **************************************************************************/
 randseed generate_game_seed(void)
 {
diff --git a/utility/registry_ini.c b/utility/registry_ini.c
index eb084e8db9..e3b9415960 100644
--- a/utility/registry_ini.c
+++ b/utility/registry_ini.c
@@ -15,7 +15,7 @@
   The idea with this file is to create something similar to the ms-windows
   .ini files functions.
   however the interface is nice. ie:
-  secfile_lookup_str(file, "player%d.unit%d.name", plrno, unitno); 
+  secfile_lookup_str(file, "player%d.unit%d.name", plrno, unitno);
 ***************************************************************************/
 
 /**************************************************************************
diff --git a/utility/registry_ini.h b/utility/registry_ini.h
index de621f6943..28ce10a51f 100644
--- a/utility/registry_ini.h
+++ b/utility/registry_ini.h
@@ -586,7 +586,7 @@ int *secfile_lookup_enum_vec_data(const struct section_file *secfile,
                                   secfile_data_t data, const char *path, ...)
                                   fc__warn_unused_result
                                   fc__attribute((__format__ (__printf__, 6, 7)));
-  
+
 /* Sections functions. */
 struct section *secfile_section_by_name(const struct section_file *secfile,
                                         const char *section_name);
diff --git a/utility/registry_xml.h b/utility/registry_xml.h
index 147f8466a5..ccb793371c 100644
--- a/utility/registry_xml.h
+++ b/utility/registry_xml.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
@@ -29,4 +29,4 @@ struct section_file *xmlfile_load(xmlDoc *sec_doc, const char *filename);
 }
 #endif /* __cplusplus */
 
-#endif  /* FC__REGISTRY_XML_H */
+#endif /* FC__REGISTRY_XML_H */
diff --git a/utility/specvec.h b/utility/specvec.h
index 914f3f8c18..d2c723444a 100644
--- a/utility/specvec.h
+++ b/utility/specvec.h
@@ -166,7 +166,7 @@ static inline void SPECVEC_FOO(_vector_remove) (SPECVEC_VECTOR *tthis,
   atype *var;                                           \
   for (myiter##var = 0; myiter##var < (vector)->size; myiter##var++) { \
     var = &(vector)->p[myiter##var];			        \
- 
+
 /* Balance for above: */
 #define VECTOR_ITERATE_END  }}
 
-- 
2.43.0

