Mostly confine assumptions about what token_t is to misc.c

The token_t things like WD* are presently longs and will someday be
char[6].  By introducing some trivial functions - wordeq(),
wordempty(), and wordclear() - we mostly hide the difference.

All runtime knowledge about packing now lives only in misc.c and the
list of magic WORD_* defines in advent.h.  Outside this, literals are
now accessed through #define names that could expand to either longs
or strings.

Still to be done: WD* values are sometiimes compated to zero in
ways implying they can be negative. Must figure out wat thus means.
This commit is contained in:
Eric S. Raymond 2017-06-19 17:21:45 -04:00
parent 87961483a2
commit a678b68b39
5 changed files with 28 additions and 6 deletions

2
init.c
View file

@ -131,7 +131,7 @@
* apply to players whose scores are higher than the previous N but not
* higher than this N. Note that these scores probably change with every
* modification (and particularly expansion) of the program.
* SECTION 11: Hints. Each line contains a hint number (add 10 to get cond
* Section 11: Hints. Each line contains a hint number (add 10 to get cond
* bit; see section 9), the number of turns he must be at the right loc(s)
* before triggering the hint, the points deducted for taking the hint,
* the message number (section 6) of the question, and the message number