Attempt to repair GitLab build breakage.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 8 Jun 2017 01:26:45 +0000 (21:26 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 8 Jun 2017 01:26:45 +0000 (21:26 -0400)
advent.h
main.c
misc.c

index 36cf3456a712d8b399d3ecbb44634829f5fa6f8f..2cc2daab035627ba970c28f683e37d50c4863034 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -9,6 +9,7 @@
 #define DALTLC         18              /* alternate dwarf location; low room */
 #define MINTRS         50
 #define MAXTRS         79
+#define MAXPARMS       25
 
 typedef struct lcg_state
 {
diff --git a/main.c b/main.c
index 28f171200a04c73e0ec8da1aca3d02606e094d9c..03990db0ab677017a55a347bc46d814a389f81ce 100644 (file)
--- a/main.c
+++ b/main.c
@@ -14,7 +14,7 @@
 
 struct game_t game;
 
-long LNLENG, LNPOSN, PARMS[26];
+long LNLENG, LNPOSN, PARMS[MAXPARMS+1];
 char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129];
 
 long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
diff --git a/misc.c b/misc.c
index e452be2a19c7299f912635ca2758b939481776ca..b3d88742df487f9f4a389f19fa94b679b4ab7316 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -521,12 +521,9 @@ void MOVE(long object, long where)
     long from;
 
     if (object > NOBJECTS) 
-       goto L1;
-    from=game.place[object];
-    goto L2;
-L1:
-    from=game.fixed[object-NOBJECTS];
-L2:
+       from=game.fixed[object-NOBJECTS];
+    else
+       from=game.place[object];
     if (from > 0 && from <= 300)
        CARRY(object,from);
     DROP(object,where);
@@ -570,16 +567,17 @@ void DROP(long object, long where)
  *  game.holdng if the object was being toted. */
 {
     if (object > NOBJECTS)
-       goto L1;
-    if (game.place[object] == -1)
-       game.holdng=game.holdng-1;
-    game.place[object]=where;
-    goto L2;
-L1: game.fixed[object-NOBJECTS]=where;
-L2: if (where <= 0)
+       game.fixed[object-NOBJECTS] = where;
+    else
+    {
+       if (game.place[object] == -1)
+           --game.holdng;
+       game.place[object] = where;
+    }
+    if (where <= 0)
        return;
-    game.link[object]=game.atloc[where];
-    game.atloc[where]=object;
+    game.link[object] = game.atloc[where];
+    game.atloc[where] = object;
 }
 
 long ATDWRF(long where)