Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#4771) build fix for gcc 3.3
Home

[Freeciv-Dev] (PR#4771) build fix for gcc 3.3

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4771) build fix for gcc 3.3
From: "Rafa³ Bursig" <bursig@xxxxxxxxx>
Date: Wed, 6 Aug 2003 07:00:29 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Hi All

This is small fix which allow build without warrings on gcc 3.3

Rafal
diff -u -r freeciv/common/packets.c fc2/common/packets.c
--- freeciv/common/packets.c    2003-08-05 09:49:28.000000000 +0200
+++ fc2/common/packets.c        2003-08-05 12:56:20.000000000 +0200
@@ -186,8 +186,7 @@
 void *get_packet_from_connection(struct connection *pc,
                                 enum packet_type *ptype, bool * presult)
 {
-  int len;
-  enum packet_type type;
+  int len, type;
   struct data_in din;
 
   *presult = FALSE;
@@ -200,7 +199,7 @@
 
   dio_input_init(&din, pc->buffer->data, pc->buffer->ndata);
   dio_get_uint16(&din, &len);
-  dio_get_uint8(&din, (int *) &type);
+  dio_get_uint8(&din, &type);
 
   if(pc->first_packet) {
     /* the first packet better be short: */
@@ -214,11 +213,11 @@
 
   freelog(LOG_DEBUG, "got packet type=%d len=%d", type, len);
 
-  *ptype=type;
+  *ptype= (enum packet_type) type;
   *presult = TRUE;
 
   if (pc->incoming_packet_notify) {
-    pc->incoming_packet_notify(pc, type, len);
+    pc->incoming_packet_notify(pc, (enum packet_type) type, len);
   }
 
 #if PACKET_SIZE_STATISTICS
@@ -269,7 +268,7 @@
   }
 #endif
 
-  switch(type) {
+  switch((enum packet_type) type) {
 
   case PACKET_LOGIN_REQUEST:
     return receive_packet_login_request(pc);
@@ -3123,7 +3122,8 @@
   dio_get_uint16(&din, NULL);
   dio_get_uint8(&din, NULL);
 
-  dio_get_uint8(&din, (int *)&type);
+  dio_get_uint8(&din, &i);
+  type = (enum packet_goto_route_type) i;
   for (i = 0; i < GOTO_CHUNK; i++) {
     dio_get_uint8(&din, &pos[i].x);
     dio_get_uint8(&din, &pos[i].y);

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