X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=dungeon.c;h=997b49ecff7b4b472b7aaa721b715f4c9b8626e0;hp=a39e41394560b1d8f24916173a22a4e04b6a7166;hb=3215930f646e7911d541bb1d29c73e9eb19db477;hpb=ddb0df85b315cf60c529d0566254beb2c42cab2b diff --git a/dungeon.c b/dungeon.c index a39e413..997b49e 100644 --- a/dungeon.c +++ b/dungeon.c @@ -14,6 +14,7 @@ #define TRVSIZ 885 #define TOKLEN 5 #define HINTLEN 5 +#define HNTSIZ 20 #include #include @@ -54,7 +55,7 @@ long ACTSPK[VRBSIZ + 1]; static bool is_set(long var, long position) { - long mask = 1l << position; + long mask = 1L << position; bool result = (var & mask) == mask; return (result); } @@ -308,7 +309,7 @@ static void read_conditions(FILE* database) while ((loc = GETNUM(NULL)) != 0) { if (is_set(COND[loc], K)) BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE); - COND[loc] = COND[loc] + (1l << K); + COND[loc] = COND[loc] + (1L << K); } } } @@ -448,11 +449,6 @@ static int read_database(FILE* database) * whether the abbreviated description is printed. Counts modulo 5 * unless "LOOK" is used. */ -static void write_0d(FILE* header_file, long single, const char* varname) -{ - fprintf(header_file, "LOCATION long %s INITIALIZE(= %ld);\n", varname, single); -} - static void write_1d(FILE* header_file, long array[], long dim, const char* varname) { fprintf(header_file, "LOCATION long %s[] INITIALIZE(= {\n", varname); @@ -490,7 +486,6 @@ static void write_file(FILE* header_file) fprintf(header_file, "\n"); // content variables - write_0d(header_file, HNTMAX, "HNTMAX"); write_1d(header_file, OBJSND, NOBJECTS + 1, "OBJSND"); write_1d(header_file, OBJTXT, NOBJECTS + 1, "OBJTXT"); write_1d(header_file, COND, LOCSIZ + 1, "COND");