LOCSIZ -> NLOCATIONS, finishing limit-name cleanup.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 24 Jun 2017 14:20:36 +0000 (10:20 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 24 Jun 2017 14:20:36 +0000 (10:20 -0400)
advent.h
dungeon.c
init.c
newdungeon.py

index 63b16ffa0155707543dd67dcd2a49c880df442d9..379bb53190e9d0419ea61d1d405658259df0f2e3 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -64,8 +64,8 @@ struct game_t {
     bool wzdark;       /* whether the loc he's leaving was dark */
     long zzword;
     bool blooded;      /* has player drunk of dragon's blood? */
     bool wzdark;       /* whether the loc he's leaving was dark */
     long zzword;
     bool blooded;      /* has player drunk of dragon's blood? */
-    long abbrev[LOCSIZ + 1];
-    long atloc[LOCSIZ + 1];
+    long abbrev[NLOCATIONS + 1];
+    long atloc[NLOCATIONS + 1];
     long dseen[NDWARVES + 1];
     long dloc[NDWARVES + 1];
     long odloc[NDWARVES + 1];
     long dseen[NDWARVES + 1];
     long dloc[NDWARVES + 1];
     long odloc[NDWARVES + 1];
index a8b5f16e59af9a099160c63d2d64f2a55ac10095..fea3c6d217cda8d48857e75ee6f88e4820190a80 100644 (file)
--- a/dungeon.c
+++ b/dungeon.c
@@ -31,7 +31,7 @@ long LINUSE;
 long TRVS;
 long TRNVLS;
 long TABNDX;
 long TRVS;
 long TRNVLS;
 long TABNDX;
-long KEY[LOCSIZ + 1];
+long KEY[NLOCATIONS + 1];
 long LINES[LINSIZ + 1];
 long TRAVEL[TRVSIZ + 1];
 long KTAB[TABSIZ + 1];
 long LINES[LINSIZ + 1];
 long TRAVEL[TRVSIZ + 1];
 long KTAB[TABSIZ + 1];
@@ -321,7 +321,7 @@ static int read_database(FILE* database)
      *  pointer-words in lines. PTEXT(N) points to
      *  message for game.prop(N)=0.  Successive prop messages are
      *  found by chasing pointers. */
      *  pointer-words in lines. PTEXT(N) points to
      *  message for game.prop(N)=0.  Successive prop messages are
      *  found by chasing pointers. */
-    for (int I = 1; I <= LOCSIZ; I++) {
+    for (int I = 1; I <= NLOCATIONS; I++) {
         KEY[I] = 0;
     }
 
         KEY[I] = 0;
     }
 
@@ -431,7 +431,7 @@ static void write_file(FILE* header_file)
     fprintf(header_file, "\n");
 
     // content variables
     fprintf(header_file, "\n");
 
     // content variables
-    write_1d(header_file, KEY, LOCSIZ + 1, "KEY");
+    write_1d(header_file, KEY, NLOCATIONS + 1, "KEY");
     write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
     write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
     write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");
     write_1d(header_file, TRAVEL, TRVSIZ + 1, "TRAVEL");
     write_1d(header_file, KTAB, TABSIZ + 1, "KTAB");
     write_1d(header_file, ATAB, TABSIZ + 1, "ATAB");
diff --git a/init.c b/init.c
index b7c0249db649c6da3e40ea6d3618c4d247da4a2c..3d77a9cfb515804ed7ceb6ae82d2bb78caf7ced1 100644 (file)
--- a/init.c
+++ b/init.c
@@ -167,7 +167,7 @@ void initialise(void)
         game.link[i + NOBJECTS] = game.link[i] = 0;
     }
 
         game.link[i + NOBJECTS] = game.link[i] = 0;
     }
 
-    for (int i = 1; i <= LOCSIZ; i++) {
+    for (int i = 1; i <= NLOCATIONS; i++) {
         game.abbrev[i] = 0;
         if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
             int k = KEY[i];
         game.abbrev[i] = 0;
         if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
             int k = KEY[i];
index 36144744dae6ac31b1e6d819e4ecc713cd125d8f..3b801da6d50ba0df2e554a971f86837a3b81a981 100755 (executable)
@@ -70,7 +70,7 @@ extern obituary_t obituaries[];
 extern hint_t hints[];
 extern long conditions[];
 
 extern hint_t hints[];
 extern long conditions[];
 
-#define LOCSIZ         {}
+#define NLOCATIONS             {}
 #define NOBJECTS       {}
 #define NHINTS         {}
 #define NCLASSES       {}
 #define NOBJECTS       {}
 #define NHINTS         {}
 #define NCLASSES       {}