Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc
Home

[Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc_types.h
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Wed, 1 Dec 2004 14:51:15 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11281 >

This patch solves the forward-enum issue by moving two enums (and their
related #defines) from city.h to fc_types.h.

(I didn't want to mess with the order of the typedefs, but maybe you'll
want to group each enum with its typedef.)


-- 
             Frédéric Brière    <*>    fbriere@xxxxxxxxxxx

 =>  <fbriere@xxxxxxxxxx> IS NO MORE:  <http://www.abacomsucks.com>  <=

Index: common/fc_types.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/fc_types.h,v
retrieving revision 1.9
diff -u -r1.9 fc_types.h
--- common/fc_types.h   24 Nov 2004 03:34:57 -0000      1.9
+++ common/fc_types.h   1 Dec 2004 22:46:16 -0000
@@ -18,6 +18,18 @@
  * occurs when a type which is defined in one file is needed for a fuction
  * definition in another file */
 
+enum specialist_type {
+  SP_ELVIS, SP_SCIENTIST, SP_TAXMAN, SP_LAST
+};
+#define SP_COUNT SP_LAST
+#define SP_MAX SP_LAST
+
+enum output_type {
+  O_FOOD, O_SHIELD, O_TRADE, O_GOLD, O_LUXURY, O_SCIENCE, O_LAST
+};
+#define O_COUNT num_output_types
+#define O_MAX O_LAST
+
 typedef signed short Continent_id;
 typedef int Terrain_type_id;
 typedef enum specialist_type Specialist_type_id;
Index: common/city.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.h,v
retrieving revision 1.171
diff -u -r1.171 city.h
--- common/city.h       30 Nov 2004 08:37:03 -0000      1.171
+++ common/city.h       1 Dec 2004 22:46:17 -0000
@@ -22,22 +22,10 @@
   TYPE_UNIT, TYPE_NORMAL_IMPROVEMENT, TYPE_WONDER
 };
 
-enum specialist_type {
-  SP_ELVIS, SP_SCIENTIST, SP_TAXMAN, SP_LAST
-};
-#define SP_COUNT SP_LAST
-#define SP_MAX SP_LAST
-
 enum city_tile_type {
   C_TILE_EMPTY, C_TILE_WORKER, C_TILE_UNAVAILABLE
 };
 
-enum output_type {
-  O_FOOD, O_SHIELD, O_TRADE, O_GOLD, O_LUXURY, O_SCIENCE, O_LAST
-};
-#define O_COUNT num_output_types
-#define O_MAX O_LAST
-
 enum city_options {
   /* The first 4 are whether to auto-attack versus each unit move_type
    * from with auto-attack units within this city.  Note that these

[Prev in Thread] Current Thread [Next in Thread]