diff --git a/lang/b/compiler/b.h b/lang/b/compiler/b.h index f5a11fd2a..8f1240a65 100644 --- a/lang/b/compiler/b.h +++ b/lang/b/compiler/b.h @@ -47,7 +47,7 @@ struct hshtab hshtab[HSHSIZ]; int hshused; int eof; int peekc; -char ctab[128]; +const char* ctab; struct hshtab *bsym; struct hshtab *paraml, *parame; int cval; diff --git a/lang/b/compiler/b0.c b/lang/b/compiler/b0.c index 2bf936805..d2993daf7 100644 --- a/lang/b/compiler/b0.c +++ b/lang/b/compiler/b0.c @@ -1287,7 +1287,8 @@ int opdope[] = { 000000 /* NAME */ }; -char ctab[128] = { +const char ctaba[129] = { + EOFC, /* -1 */ EOFC, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, LETTER, SPACE, NEWLN, SPACE, SPACE, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, UNKN, @@ -1305,6 +1306,7 @@ char ctab[128] = { LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LBRACE, OR, RBRACE, NOT, UNKN }; +const char* ctab = &ctaba[1]; /* allows indexing with -1 */ /* debug function */ void printtoken(int tok, FILE *out)