Author: sveinung
Date: Sun Apr 19 16:21:07 2015
New Revision: 28812

URL: http://svn.gna.org/viewcvs/freeciv?rev=28812&view=rev
Log:
Clean up the remains of the bit string protocol field type support.

Support for sending bit strings over the network was removed from the raw
protocol in patch #4181. (Transferring as a bit vector is more efficient)
Remove the remaining fossils of that support.

See patch #6009

Modified:
    trunk/common/dataio_json.h
    trunk/common/generate_packets.py

Modified: trunk/common/dataio_json.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/dataio_json.h?rev=28812&r1=28811&r2=28812&view=diff
==============================================================================
--- trunk/common/dataio_json.h  (original)
+++ trunk/common/dataio_json.h  Sun Apr 19 16:21:07 2015
@@ -62,8 +62,6 @@
 bool dio_get_sfloat_json(json_t *json_packet, char *key, float *dest, int 
float_factor);
 bool dio_get_memory_json(json_t *json_packet, char *key, void *dest, size_t 
dest_size);
 bool dio_get_string_json(json_t *json_packet, char *key, char *dest, size_t 
max_dest_size);
-bool dio_get_bit_string_json(json_t *json_packet, char *key, char *dest,
-                             size_t max_dest_size);
 bool dio_get_tech_list_json(json_t *json_packet, char *key, int *dest);
 bool dio_get_unit_list_json(json_t *json_packet, char *key, int *dest);
 bool dio_get_building_list_json(json_t *json_packet, char *key, int *dest);
@@ -104,7 +102,6 @@
 
 void dio_put_memory_json(struct json_data_out *dout, char *key, const void 
*value, size_t size);
 void dio_put_string_json(struct json_data_out *dout, char *key, const char 
*value);
-void dio_put_bit_string_json(struct json_data_out *dout, char *key, const char 
*value);
 void dio_put_city_map_json(struct json_data_out *dout, char *key, const char 
*value);
 void dio_put_tech_list_json(struct json_data_out *dout, char *key, const int 
*value);
 void dio_put_unit_list_json(struct json_data_out *dout, char *key, const int 
*value);

Modified: trunk/common/generate_packets.py
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/generate_packets.py?rev=28812&r1=28811&r2=28812&view=diff
==============================================================================
--- trunk/common/generate_packets.py    (original)
+++ trunk/common/generate_packets.py    Sun Apr 19 16:21:07 2015
@@ -266,7 +266,7 @@
             return "  differ = (memcmp(old->%(name)s, real_packet->%(name)s, 
%(array_size_d)s) != 0);"%self.__dict__
         if self.dataio_type=="bitvector":
             return "  differ = !BV_ARE_EQUAL(old->%(name)s, 
real_packet->%(name)s);"%self.__dict__
-        if self.dataio_type in ["string","bit_string"] and self.is_array==1:
+        if self.dataio_type in ["string"] and self.is_array==1:
             return "  differ = (strcmp(old->%(name)s, real_packet->%(name)s) 
!= 0);"%self.__dict__
         if self.is_struct and self.is_array==0:
             return "  differ = !are_%(dataio_type)ss_equal(&old->%(name)s, 
&real_packet->%(name)s);"%self.__dict__
@@ -359,7 +359,7 @@
         if self.dataio_type in ["memory"]:
             return "  DIO_PUT(%(dataio_type)s, &dout, \"%(name)s\", 
&real_packet->%(name)s, %(array_size_u)s);"%self.__dict__
 
-        arr_types=["string","bit_string","city_map","tech_list",
+        arr_types=["string","city_map","tech_list",
                    "unit_list","building_list"]
         if (self.dataio_type in arr_types and self.is_array==1) or \
            (self.dataio_type not in arr_types and self.is_array==0):
@@ -459,7 +459,7 @@
             return '''if (!DIO_BV_GET(&din, \"%(name)s\", 
real_packet->%(name)s)) {
   RECEIVE_PACKET_FIELD_ERROR(%(name)s);
 }'''%self.__dict__
-        if self.dataio_type in ["string","bit_string","city_map"] and \
+        if self.dataio_type in ["string","city_map"] and \
            self.is_array!=2:
             return '''if (!DIO_GET(%(dataio_type)s, &din, \"%(name)s\", 
real_packet->%(name)s, sizeof(real_packet->%(name)s))) {
   RECEIVE_PACKET_FIELD_ERROR(%(name)s);


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

Reply via email to