Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12907) fix gcc4 warnings
Home

[Freeciv-Dev] (PR#12907) fix gcc4 warnings

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12907) fix gcc4 warnings
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Apr 2005 00:42:45 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch fixes a few warnings under gcc4.

-jason

Index: client/clinet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v
retrieving revision 1.115
diff -u -r1.115 clinet.c
--- client/clinet.c     15 Apr 2005 20:24:43 -0000      1.115
+++ client/clinet.c     27 Apr 2005 07:42:19 -0000
@@ -812,7 +812,7 @@
 # if defined(__VMS) && !defined(_DECC_V4_SOURCE)
     size_t fromlen;
 # else
-    int fromlen;
+  unsigned int fromlen;
 # endif
   union my_sockaddr fromend;
   struct hostent *from;
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.296
diff -u -r1.296 tilespec.c
--- client/tilespec.c   25 Apr 2005 06:19:31 -0000      1.296
+++ client/tilespec.c   27 Apr 2005 07:42:20 -0000
@@ -3703,8 +3703,8 @@
                      const struct unit *punit, const struct city *pcity,
                      const struct city *citymode)
 {
-  Terrain_type_id ttype, ttype_near[8];
-  enum tile_special_type tspecial, tspecial_near[8];
+  Terrain_type_id ttype = T_UNKNOWN, ttype_near[8];
+  enum tile_special_type tspecial = S_NO_SPECIAL, tspecial_near[8];
   int tileno, dir;
   struct unit *pfocus = get_unit_in_focus();
   struct drawn_sprite *save_sprs = sprs;
Index: common/packets.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.c,v
retrieving revision 1.274
diff -u -r1.274 packets.c
--- common/packets.c    29 Mar 2005 17:46:48 -0000      1.274
+++ common/packets.c    27 Apr 2005 07:42:20 -0000
@@ -158,9 +158,9 @@
        PACKET_PROCESSING_FINISHED || packet_type == PACKET_THAW_HINT) {
       pc->compression.frozen_level--;
       if (pc->compression.frozen_level == 0) {
-       unsigned long int compressed_size = 12 + pc->compression.queue.size * 
1.001;
+       uLongf compressed_size = 12 + pc->compression.queue.size * 1.001;
        int error;
-       unsigned char compressed[compressed_size];
+       Bytef compressed[compressed_size];
 
        error =
            compress2(compressed, &compressed_size,
Index: common/aicore/cm.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/cm.c,v
retrieving revision 1.62
diff -u -r1.62 cm.c
--- common/aicore/cm.c  7 Apr 2005 04:36:02 -0000       1.62
+++ common/aicore/cm.c  27 Apr 2005 07:42:20 -0000
@@ -465,7 +465,7 @@
   Note this isn't the same as the number of *tiles* that are better.  There
   may be more than one tile of each type (see tile_type_num_tiles).
 ****************************************************************************/
-static const int tile_type_num_prereqs(const struct cm_tile_type *ptype)
+static int tile_type_num_prereqs(const struct cm_tile_type *ptype)
 {
   return ptype->better_types.size;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12907) fix gcc4 warnings, Jason Short <=