diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-19 14:00:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-19 14:00:19 +0000 |
commit | 0e017743181b76a26d2758234eb98fc736acc722 (patch) | |
tree | 7ba171af8115765e30ae82c5cb2744c4f99fbf0b /man_hash.c | |
parent | 8b443f186e2557df92e04f3b82a2ce9d2011cb7e (diff) | |
download | mandoc-0e017743181b76a26d2758234eb98fc736acc722.tar.gz mandoc-0e017743181b76a26d2758234eb98fc736acc722.tar.zst mandoc-0e017743181b76a26d2758234eb98fc736acc722.zip |
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.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_hash.c,v 1.32 2015/04/18 17:01:58 schwarze Exp $ */ +/* $Id: man_hash.c,v 1.33 2015/04/19 14:00:19 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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); } |