diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-04-19 13:59:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-04-19 13:59:38 +0000 |
commit | 601a90656d71823b05cfe0bb83af88865c0d0105 (patch) | |
tree | b093a348b4758cf96676df99c730368c58e43aed /usr.bin/mandoc/man_hash.c | |
parent | 0badf0b9c18d345c4cf92a460d5f62f6e300a8b1 (diff) |
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 'usr.bin/mandoc/man_hash.c')
-rw-r--r-- | usr.bin/mandoc/man_hash.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/mandoc/man_hash.c b/usr.bin/mandoc/man_hash.c index 6d6f780cc29..5e6d90020cb 100644 --- a/usr.bin/mandoc/man_hash.c +++ b/usr.bin/mandoc/man_hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_hash.c,v 1.22 2015/04/18 17:01:28 schwarze Exp $ */ +/* $OpenBSD: man_hash.c,v 1.23 2015/04/19 13:59:37 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -55,8 +55,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]; @@ -81,20 +79,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); } |