Comment polishing.
[open-adventure.git] / advent.h
index e75a1cd09f428f0868cbfd60f3fa1ee82fecbb23..d34310663c8f148a4efb7882862249c91b04e789 100644 (file)
--- a/advent.h
+++ b/advent.h
@@ -87,6 +87,7 @@ extern lcg_state lcgstate;
 #define READ_MODE "rb"
 #define WRITE_MODE "wb"
 extern void* xmalloc(size_t);
+extern char* xstrdup(const char*);
 extern void packed_to_token(long, char token[6]);
 extern void newspeak(char*);
 extern void PSPEAK(vocab_t,int);
@@ -114,7 +115,6 @@ extern void BUG(long) __attribute__((noreturn));
 extern bool MAPLIN(FILE *);
 extern void TYPE(void);
 extern void DATIME(long*, long*);
-extern long MOD(long,long);
 
 extern void set_seed(long);
 extern unsigned long get_next_lcg_value(void);
@@ -122,8 +122,8 @@ extern long randrange(long);
 extern void score(long);
 extern int saveresume(FILE *, bool);
 
-/*  Statement functions
- *
+/*
+ *  MOD(N,M)   = Arithmetic modulus
  *  AT(OBJ)    = true if on either side of two-placed object
  *  CNDBIT(L,N) = true if COND(L) has bit n set (bit 0 is units bit)
  *  DARK(LOC)   = true if location "LOC" is dark
@@ -136,6 +136,7 @@ extern int saveresume(FILE *, bool);
  *  PCT(N)      = true N% of the time (N integer from 0 to 100)
  *  TOTING(OBJ) = true if the OBJ is being carried */
 
+#define MOD(N,M)       ((N) % (M))
 #define TOTING(OBJ)    (game.place[OBJ] == -1)
 #define AT(OBJ) (game.place[OBJ] == game.loc || game.fixed[OBJ] == game.loc)
 #define HERE(OBJ)      (AT(OBJ) || TOTING(OBJ))