diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-15 20:39:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-15 20:39:51 -0700 |
commit | 225103289d779216781b2c256c602deca1f05b2a (patch) | |
tree | f0151c1ab610002a7aab79fb572032625da99bc2 /lib.h | |
parent | f43feacabc378cbbf31beea28f41f1cb9483f4b6 (diff) | |
download | txr-225103289d779216781b2c256c602deca1f05b2a.tar.gz txr-225103289d779216781b2c256c602deca1f05b2a.tar.bz2 txr-225103289d779216781b2c256c602deca1f05b2a.zip |
less table robust against type renumbering.
* lib.c (less_tab_init): The type_prec table initialization
will become incorrect if new type enums are added other than
at the end. Let's switch to assignments. Anything not
mentioned is zero.
* lib.h: Add more advice to comment about extending type_t:
consider all places where MAX_TYPE is used.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -61,7 +61,7 @@ typedef enum type { NIL = TAG_PTR, NUM = TAG_NUM, CHR = TAG_CHR, LIT = TAG_LIT, CONS, STR, SYM, PKG, FUN, VEC, LCONS, LSTR, COBJ, ENV, BGNUM, FLNUM, RNG, BUF, MAXTYPE = BUF - /* If extending, check TYPE_SHIFT */ + /* If extending, check TYPE_SHIFT and all ocurrences of MAX_TYPE */ } type_t; #define TYPE_SHIFT 5 |