X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/3f648213cd789e9c307f834875f09da5e1d86ab1..ac335ec98abf9e1439628e44539f84a225f5d743:/mdoc_hash.c diff --git a/mdoc_hash.c b/mdoc_hash.c index 678ae0e3..25cf603d 100644 --- a/mdoc_hash.c +++ b/mdoc_hash.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_hash.c,v 1.11 2009/09/17 07:41:28 kristaps Exp $ */ +/* $Id: mdoc_hash.c,v 1.14 2010/05/08 07:30:19 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -14,6 +14,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include @@ -39,7 +43,7 @@ mdoc_hash_init(void) memset(table, UCHAR_MAX, sizeof(table)); - for (i = 0; i < MDOC_MAX; i++) { + for (i = 0; i < (int)MDOC_MAX; i++) { p = mdoc_macronames[i]; if (isalpha((u_char)p[1])) @@ -57,7 +61,7 @@ mdoc_hash_init(void) } } -int +enum mdoct mdoc_hash_find(const char *p) { int major, i, j; @@ -81,7 +85,7 @@ mdoc_hash_find(const char *p) if (UCHAR_MAX == (i = table[major + j])) break; if (0 == strcmp(p, mdoc_macronames[i])) - return(i); + return((enum mdoct)i); } return(MDOC_MAX);