Author: cazfi Date: Sat Jan 2 18:25:15 2016 New Revision: 31308 URL: http://svn.gna.org/viewcvs/freeciv?rev=31308&view=rev Log: Gave extra causes and rmcauses sensible types.
See bug #24182 Modified: branches/S2_6/common/extras.h branches/S2_6/common/fc_types.h Modified: branches/S2_6/common/extras.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/extras.h?rev=31308&r1=31307&r2=31308&view=diff ============================================================================== --- branches/S2_6/common/extras.h (original) +++ branches/S2_6/common/extras.h Sat Jan 2 18:25:15 2016 @@ -66,8 +66,8 @@ int id; struct name_translation name; enum extra_category category; - enum extra_cause causes; - enum extra_rmcause rmcauses; + uint8_t causes; + uint8_t rmcauses; char graphic_str[MAX_LEN_NAME]; char graphic_alt[MAX_LEN_NAME]; Modified: branches/S2_6/common/fc_types.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/fc_types.h?rev=31308&r1=31307&r2=31308&view=diff ============================================================================== --- branches/S2_6/common/fc_types.h (original) +++ branches/S2_6/common/fc_types.h Sat Jan 2 18:25:15 2016 @@ -621,6 +621,9 @@ #define EC_NATURAL_DEFENSIVE (EC_NONE + 3) #define EC_LAST (EC_NONE + 4) +/* packets.def and struct extra_type reserve 8 bits (0-7) for these. */ +FC_STATIC_ASSERT(EC_COUNT < 8, extra_causes_over_limit); + /* Used in the network protocol. */ #define SPECENUM_NAME extra_rmcause #define SPECENUM_VALUE0 ERM_PILLAGE @@ -632,6 +635,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