Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13367) packets.def weirdness
Home

[Freeciv-Dev] (PR#13367) packets.def weirdness

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13367) packets.def weirdness
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 28 Jun 2005 14:56:26 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13367 >

In packets.def I find this strange field definition

     bitvector(bv_imprs) improvements;

and related bitvectors. This seems totally at odds with how packets.def is
structured otherwise, with type definitions setting up differences between
network data structure and code data structure.

The attached patch clears this up. It generates identical packets_gen.c|h
files as before. Can someone comment on why the current design was done as
it is?

  - Per

Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.138
diff -u -r1.138 packets.def
--- common/packets.def  27 Jun 2005 14:30:18 -0000      1.138
+++ common/packets.def  28 Jun 2005 21:55:56 -0000
@@ -187,6 +187,10 @@
 type REQ_TYPE          = uint8(enum req_source_type)
 type REQ_RANGE         = uint8(enum req_range)
 type EFFECT_TYPE       = uint8(enum effect_type)
+type BV_IMPRS          = bitvector(bv_imprs)
+type BV_FLAGS          = bitvector(bv_flags)
+type BV_ROLES          = bitvector(bv_roles)
+type BV_TERRAIN_FLAGS  = bitvector(bv_terrain_flags)
 
 # typedefs for IDs
 type PLAYER            = UINT8
@@ -512,7 +516,7 @@
   
   WORKLIST worklist;
 
-  bitvector(bv_imprs) improvements;
+  BV_IMPRS improvements;
   CITY_MAP city_map[CITY_MAP_SIZE * CITY_MAP_SIZE];
 
   BOOL did_buy, did_sell, was_happy, airlift, diplomat_investigate;
@@ -530,7 +534,7 @@
   UINT8 size;
   BOOL happy;
   BOOL unhappy;
-  bitvector(bv_imprs) improvements;
+  BV_IMPRS improvements;
   BOOL occupied;
   UINT16 tile_trade;
 end
@@ -611,7 +615,7 @@
 PACKET_CITY_SABOTAGE_LIST=37;sc,lsend
   UNIT diplomat_id;
   CITY city_id;
-  bitvector(bv_imprs) improvements;
+  BV_IMPRS improvements;
 end
 
 /************** Player packets **********************/
@@ -1052,8 +1056,8 @@
 
   STRING helptext[MAX_LEN_PACKET];
 
-  bitvector(bv_flags) flags;
-  bitvector(bv_roles) roles;
+  BV_FLAGS flags;
+  BV_ROLES roles;
 end
 
 PACKET_RULESET_GAME=97;sc,lsend
@@ -1201,7 +1205,7 @@
 PACKET_RULESET_TERRAIN=105;sc,lsend
   TERRAIN id;
 
-  bitvector(bv_terrain_flags) flags;
+  BV_TERRAIN_FLAGS flags;
 
   STRING terrain_name[MAX_LEN_NAME];
   STRING graphic_str[MAX_LEN_NAME];

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13367) packets.def weirdness, Per I. Mathisen <=