Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10596) Uninitialized values on current CVS running val
Home

[Freeciv-Dev] (PR#10596) Uninitialized values on current CVS running val

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jorneg@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10596) Uninitialized values on current CVS running valgrind
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 00:02:44 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10596 >

> [jorneg@xxxxxxxxxxx - Mon Oct 18 16:43:58 2004]:
> 
>  > ==11155==
> ==11155== Conditional jump or move depends on uninitialised value(s)
> ==11155==    at 0x80BE7D3: send_packet_unit_info_100 (packets_gen.c:11311)
> ==11155==    by 0x805B445: send_unit_info_to_onlookers (unittools.c:1923)
> ==11155==    by 0x805B526: send_unit_info (unittools.c:1945)
> ==11155==    by 0x806B380: do_unit_goto (gotohand.c:1302)
> ==11155==
> ==11155== Conditional jump or move depends on uninitialised value(s)
> ==11155==    at 0x80BE9ED: send_packet_unit_info_100 (packets_gen.c:11449)
> ==11155==    by 0x805B445: send_unit_info_to_onlookers (unittools.c:1923)
> ==11155==    by 0x805B526: send_unit_info (unittools.c:1945)
> ==11155==    by 0x806B380: do_unit_goto (gotohand.c:1302)

Oops.  The "connecting" field was never removed.

This patch removes it.  We have to add an optional capability with
remove-cap.  A little ugly but not too bad.

Another choice is to just leave the field in for now.  Then just the
unittools part of this patch should be taken.  But then we'll forget to
remove it later.

Another option is to add a new *manditory* capability, like +2.0b.  This
would break compatability with 2.0.0-beta1 but would keep compatability
between stable and development branches.

As you see I favor the optional capability.

jason


? diff
? newtiles
? data/isotrident/selection.png
? data/isotrident/selection.spec
Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.191
diff -u -r1.191 capstr.c
--- common/capstr.c     4 Oct 2004 19:35:14 -0000       1.191
+++ common/capstr.c     19 Oct 2004 06:57:20 -0000
@@ -75,6 +75,9 @@
 
 /* +2.0 is the capability string for the 2.0.x release(s).
  *
+ * "connecting" means the unused "connecting" field of the unit_info packet
+ * is present.
+ *
  *   - No new manditory capabilities can be added to the release branch; doing
  *     so would break network capability of supposedly "compatible" releases.
  *
@@ -82,7 +85,7 @@
  *     as long as possible.  We want to maintain network compatibility with
  *     the stable branch for as long as possible.
  */
-#define CAPABILITY "+2.0"
+#define CAPABILITY "+2.0 connecting"
 
 void init_our_capability(void)
 {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.55
diff -u -r1.55 packets.def
--- common/packets.def  25 Sep 2004 22:18:41 -0000      1.55
+++ common/packets.def  19 Oct 2004 06:57:20 -0000
@@ -607,7 +607,9 @@
   CITY homecity;
 
   UINT8 veteran;
-  BOOL ai, paradropped, connecting, transported, done_moving;
+  BOOL ai, paradropped;
+  BOOL connecting; remove-cap(connecting)
+  BOOL transported, done_moving;
 
   UNIT_TYPE type;
   UNIT transported_by; /* Only valid if transported is set. */
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.308
diff -u -r1.308 unittools.c
--- server/unittools.c  18 Oct 2004 22:40:02 -0000      1.308
+++ server/unittools.c  19 Oct 2004 06:57:21 -0000
@@ -1796,6 +1796,7 @@
   }
   packet->activity_target = punit->activity_target;
   packet->paradropped = punit->paradropped;
+  packet->connecting = FALSE;
   packet->done_moving = punit->done_moving;
   if (punit->transported_by == -1) {
     packet->transported = FALSE;

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