Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14172) tilespec compiler warning
Home

[Freeciv-Dev] (PR#14172) tilespec compiler warning

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14172) tilespec compiler warning
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Oct 2005 11:14:29 -0700
Reply-to: bugs@xxxxxxxxxxx

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

tilespec.c:1211: warning: ‘hex_side’ may be used uninitialized in this 
function

This isn't actually a bug but this fixes it.  I will commit immediately.

-jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.326
diff -p -u -r1.326 tilespec.c
--- client/tilespec.c   3 Oct 2005 15:59:38 -0000       1.326
+++ client/tilespec.c   3 Oct 2005 18:13:27 -0000
@@ -1208,7 +1208,7 @@ struct tileset *tileset_read_toplevel(co
   struct section_file the_file, *file = &the_file;
   char *fname, *c;
   int i;
-  int num_spec_files, num_terrains, hex_side;
+  int num_spec_files, num_terrains;
   char **spec_filenames, **terrains;
   char *file_capstr;
   bool duplicates_ok, is_hex;
@@ -1246,11 +1246,10 @@ struct tileset *tileset_read_toplevel(co
 
   /* Read hex-tileset information. */
   is_hex = secfile_lookup_bool(file, "tilespec.is_hex");
-  if (is_hex) {
-    hex_side = secfile_lookup_int(file, "tilespec.hex_side");
-  }
   t->hex_width = t->hex_height = 0;
   if (is_hex) {
+    int hex_side = secfile_lookup_int(file, "tilespec.hex_side");
+
     if (t->is_isometric) {
       t->hex_height = hex_side;
     } else {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#14172) tilespec compiler warning, Jason Short <=