Author: cazfi
Date: Wed Jan 20 06:28:55 2016
New Revision: 31503

URL: http://svn.gna.org/viewcvs/freeciv?rev=31503&view=rev
Log:
Added macro BAD_HEURISTIC_INIT() and used it to silence some compiler warnings.

See patch #6759

Modified:
    branches/S2_5/server/diplhand.c
    branches/S2_5/utility/shared.h

Modified: branches/S2_5/server/diplhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/diplhand.c?rev=31503&r1=31502&r2=31503&view=diff
==============================================================================
--- branches/S2_5/server/diplhand.c     (original)
+++ branches/S2_5/server/diplhand.c     Wed Jan 20 06:28:55 2016
@@ -421,7 +421,8 @@
       struct player_diplstate *ds_destgiver
         = player_diplstate_get(pdest, pgiver);
       enum diplstate_type old_diplstate = ds_giverdest->type;
-      struct unit_list *pgiver_seen_units, *pdest_seen_units;
+      struct unit_list *pgiver_seen_units BAD_HEURISTIC_INIT(NULL);
+      struct unit_list *pdest_seen_units BAD_HEURISTIC_INIT(NULL);
 
       switch (pclause->type) {
       case CLAUSE_EMBASSY:

Modified: branches/S2_5/utility/shared.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/utility/shared.h?rev=31503&r1=31502&r2=31503&view=diff
==============================================================================
--- branches/S2_5/utility/shared.h      (original)
+++ branches/S2_5/utility/shared.h      Wed Jan 20 06:28:55 2016
@@ -38,6 +38,10 @@
 /* Use FC_INFINITY to denote that a certain event will never occur or
    another unreachable condition. */
 #define FC_INFINITY            (1000 * 1000 * 1000)
+
+/* Initialize something for the sole purpose of silencing false compiler 
warning
+ * about variable possibly used uninitialized. */
+#define BAD_HEURISTIC_INIT(_ini_val_) = _ini_val_
 
 enum fc_tristate { TRI_NO, TRI_YES, TRI_MAYBE };
 #define BOOL_TO_TRISTATE(tri) ((tri) ? TRI_YES : TRI_NO)


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to