Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] [PATCH] C++ cleanup, new is reserved word (PR#1317)
Home

[Freeciv-Dev] [PATCH] C++ cleanup, new is reserved word (PR#1317)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] [PATCH] C++ cleanup, new is reserved word (PR#1317)
From: Markus Linnala <maage@xxxxxxxxx>
Date: Sun, 10 Mar 2002 08:36:36 -0800 (PST)

new is reserved word at C++.

diff -ur -X freeciv/diff_ignore freeciv/common/rand.c 
freeciv-cvs-xxx/common/rand.c
--- freeciv/common/rand.c       Tue Mar  5 17:46:02 2002
+++ freeciv-cvs-xxx/common/rand.c       Sun Mar 10 13:52:02 2002
@@ -180,7 +180,7 @@
 void test_random1(int n)
 {
   RANDOM_STATE saved_state;
-  int i, old = 0, new;
+  int i, old = 0, new_val;
   bool didchange, olddidchange = FALSE;
   int behaviourchange = 0, behavioursame = 0;
 
@@ -188,9 +188,9 @@
   /* mysrand(time(NULL)); */  /* use current state */
 
   for (i = 0; i < n+2; i++) {
-    new = myrand(2);
+    new_val = myrand(2);
     if (i > 0) {               /* have old */
-      didchange = (new != old);
+      didchange = (new_val != old);
       if (i > 1) {             /* have olddidchange */
        if (didchange != olddidchange) {
          ++behaviourchange;
@@ -200,7 +200,7 @@
       }
       olddidchange = didchange;
     }
-    old = new;
+    old = new_val;
   }
   freelog(LOG_NORMAL, "test_random1(%d) same: %d, change: %d",
          n, behavioursame, behaviourchange);

-- 
//Markus



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [PATCH] C++ cleanup, new is reserved word (PR#1317), Markus Linnala <=