Author: cazfi
Date: Fri May 15 23:13:20 2015
New Revision: 29093

URL: http://svn.gna.org/viewcvs/freeciv?rev=29093&view=rev
Log:
Avoid compiler warning on optimization level -O3

See bug #23587

Modified:
    trunk/common/unittype.c

Modified: trunk/common/unittype.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unittype.c?rev=29093&r1=29092&r2=29093&view=diff
==============================================================================
--- trunk/common/unittype.c     (original)
+++ trunk/common/unittype.c     Fri May 15 23:13:20 2015
@@ -363,14 +363,15 @@
 static void unit_state_action_cache_set(struct unit_type *putype)
 {
   struct requirement req;
+  int uidx = utype_index(putype);
 
   /* The unit is not yet known to be allowed to perform any actions no
    * matter what its unit state is. */
   action_iterate(action_id) {
-    BV_CLR_ALL(ustate_act_cache[utype_index(putype)][action_id]);
+    BV_CLR_ALL(ustate_act_cache[uidx][action_id]);
   } action_iterate_end;
-  BV_CLR_ALL(ustate_act_cache[utype_index(putype)][ACTION_ANY]);
-  BV_CLR_ALL(ustate_act_cache[utype_index(putype)][ACTION_HOSTILE]);
+  BV_CLR_ALL(ustate_act_cache[uidx][ACTION_ANY]);
+  BV_CLR_ALL(ustate_act_cache[uidx][ACTION_HOSTILE]);
 
   if (!is_actor_unit_type(putype)) {
     /* Not an actor unit. */


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

Reply via email to