summaryrefslogtreecommitdiffstats
path: root/man_hash.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:00:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:00:19 +0000
commiteed5e7f1fb85805f1b324c5a4501ed30467ae2a0 (patch)
tree78f09c634d1cfc1b83be85f07be7ee909cbd6d30 /man_hash.c
parent344327def21ee64357a9cdf57c5352f1c5575708 (diff)
downloadmandoc-eed5e7f1fb85805f1b324c5a4501ed30467ae2a0.tar.gz
Decouple the token code for "no request or macro" from the individual
high-level parsers to allow further unification of functions that only need to recognize this code, but that don't care about different high-level macrosets beyond that.
Diffstat (limited to 'man_hash.c')
-rw-r--r--man_hash.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/man_hash.c b/man_hash.c
index a0aed934..f14ad18d 100644
--- a/man_hash.c
+++ b/man_hash.c
@@ -57,8 +57,6 @@ man_hash_init(void)
memset(table, UCHAR_MAX, sizeof(table));
- assert(MAN_MAX < UCHAR_MAX);
-
for (i = 0; i < (int)MAN_MAX; i++) {
x = man_macronames[i][0];
@@ -83,20 +81,20 @@ man_hash_find(const char *tmp)
int tok;
if ('\0' == (x = tmp[0]))
- return(MAN_MAX);
+ return(TOKEN_NONE);
if ( ! (isalpha((unsigned char)x)))
- return(MAN_MAX);
+ return(TOKEN_NONE);
HASH_ROW(x);
for (i = 0; i < HASH_DEPTH; i++) {
if (UCHAR_MAX == (y = table[x + i]))
- return(MAN_MAX);
+ return(TOKEN_NONE);
tok = y;
if (0 == strcmp(tmp, man_macronames[tok]))
return(tok);
}
- return(MAN_MAX);
+ return(TOKEN_NONE);
}