Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12457) compile error because of misplaced variable dec
Home

[Freeciv-Dev] (PR#12457) compile error because of misplaced variable dec

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12457) compile error because of misplaced variable declaration
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Mar 2005 21:45:51 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This works in new compilers but not in old ones.  I will commit immediatly.

-jason

Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.67
diff -u -r1.67 advdiplomacy.c
--- ai/advdiplomacy.c   19 Feb 2005 23:26:25 -0000      1.67
+++ ai/advdiplomacy.c   8 Mar 2005 05:45:10 -0000
@@ -1003,11 +1003,13 @@
       continue;
     }
     tech_type_iterate(tech2) {
+      int diff;
+
       if (worth[tech2] >= 0) {
         continue;
       }
       /* tech2 is given by player1, tech is given by player2 */
-      int diff = worth[tech] + worth[tech2];
+      diff = worth[tech] + worth[tech2];
       if ((diff > 0 && player1->economic.gold >= diff)
           || (diff < 0 && player2->economic.gold >= -diff)
          || diff == 0) {

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12457) compile error because of misplaced variable declaration, Jason Short <=