Eliminate a global variable.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 9 Jun 2017 15:19:47 +0000 (11:19 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 9 Jun 2017 15:19:47 +0000 (11:19 -0400)
actions.c
advent.h
main.c

index e878c89e9518d15029dcc9da262884379a5b8640..6a6448bafbc26492eacbdc465506cdafba072fd7 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -3,6 +3,8 @@
 #include "advent.h"
 #include "database.h"
 
 #include "advent.h"
 #include "database.h"
 
+#define VRSION 25      /* bump on save format change */
+
 /*
  * Action handlers.  Eventually we'll do lookup through a method table
  * that calls these.  Absolutely nothing like the original FORTRAN.
 /*
  * Action handlers.  Eventually we'll do lookup through a method table
  * that calls these.  Absolutely nothing like the original FORTRAN.
index 576ae4ac838894b7426de003180a6c5d58351120..41e8a87ca0357c62d9f8d1feb74e522523662038 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -185,5 +185,5 @@ extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
    STEPS, STICK, STREAM, THROW, TRIDNT, TROLL, TROLL2,
    URN, VASE, VEND, VOLCAN, WATER;
 /* everything else */
    STEPS, STICK, STREAM, THROW, TRIDNT, TROLL, TROLL2,
    URN, VASE, VEND, VOLCAN, WATER;
 /* everything else */
-extern long I, K, SPK, VRSION, WD1, WD1X, WD2, WD2X;
+extern long I, K, SPK, WD1, WD1X, WD2, WD2X;
 
 
diff --git a/main.c b/main.c
index c052c61eed6b55e2358e310bc7620f905a8674c9..c780cd70962b1dab1d80ab97a5ff48197fd39341 100644 (file)
--- a/main.c
+++ b/main.c
@@ -28,7 +28,7 @@ long AMBER, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
                RUBY, RUG, SAPPH, SAY, SECT, SIGN, SNAKE, SPK,
                STEPS, STREAM, THROW, TRIDNT, TROLL, TROLL2,
                URN, VASE, VEND,
                RUBY, RUG, SAPPH, SAY, SECT, SIGN, SNAKE, SPK,
                STEPS, STREAM, THROW, TRIDNT, TROLL, TROLL2,
                URN, VASE, VEND,
-               VOLCAN, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X;
+               VOLCAN, WATER, WD1, WD1X, WD2, WD2X;
 FILE  *logfp;
 bool oldstyle = false;
 lcg_state lcgstate;
 FILE  *logfp;
 bool oldstyle = false;
 lcg_state lcgstate;