Author: cazfi
Date: Sat Jan  2 18:25:08 2016
New Revision: 31307

URL: http://svn.gna.org/viewcvs/freeciv?rev=31307&view=rev
Log:
Gave extra causes and rmcauses sensible types.

See bug #24182

Modified:
    trunk/common/extras.h
    trunk/common/fc_types.h

Modified: trunk/common/extras.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.h?rev=31307&r1=31306&r2=31307&view=diff
==============================================================================
--- trunk/common/extras.h       (original)
+++ trunk/common/extras.h       Sat Jan  2 18:25:08 2016
@@ -66,8 +66,8 @@
   int id;
   struct name_translation name;
   enum extra_category category;
-  enum extra_cause causes;
-  enum extra_rmcause rmcauses;
+  uint16_t causes;
+  uint8_t rmcauses;
 
   char graphic_str[MAX_LEN_NAME];
   char graphic_alt[MAX_LEN_NAME];

Modified: trunk/common/fc_types.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/fc_types.h?rev=31307&r1=31306&r2=31307&view=diff
==============================================================================
--- trunk/common/fc_types.h     (original)
+++ trunk/common/fc_types.h     Sat Jan  2 18:25:08 2016
@@ -654,6 +654,9 @@
 #define EC_NATURAL_DEFENSIVE (EC_NONE + 3)
 #define EC_LAST (EC_NONE + 4)
 
+/* packets.def and struct extra_type reserve 16 bits (0-15) for these. */
+FC_STATIC_ASSERT(EC_COUNT < 16, extra_causes_over_limit);
+
 /* Used in the network protocol. */
 #define SPECENUM_NAME extra_rmcause
 #define SPECENUM_VALUE0 ERM_PILLAGE
@@ -667,6 +670,9 @@
 #define SPECENUM_COUNT ERM_COUNT
 #include "specenum_gen.h"
 #define ERM_NONE ERM_COUNT
+
+/* packets.def and struct extra_type reserve 8 bits (0-7) for these. */
+FC_STATIC_ASSERT(ERM_COUNT < 8, extra_rmcauses_over_limit);
 
 /* Used in the network protocol. */
 #define SPECENUM_NAME achievement_type


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

Reply via email to