=================================================================== RCS file: /cvs/mandoc/chars.c,v retrieving revision 1.50 retrieving revision 1.53 diff -u -p -r1.50 -r1.53 --- mandoc/chars.c 2011/07/31 11:24:39 1.50 +++ mandoc/chars.c 2013/05/18 16:40:15 1.53 @@ -1,6 +1,6 @@ -/* $Id: chars.c,v 1.50 2011/07/31 11:24:39 schwarze Exp $ */ +/* $Id: chars.c,v 1.53 2013/05/18 16:40:15 schwarze Exp $ */ /* - * Copyright (c) 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any @@ -51,7 +51,8 @@ struct mchars { struct ln **htab; }; -static const struct ln *find(struct mchars *, const char *, size_t); +static const struct ln *find(const struct mchars *, + const char *, size_t); void mchars_free(struct mchars *arg) @@ -76,7 +77,7 @@ mchars_alloc(void) */ tab = mandoc_malloc(sizeof(struct mchars)); - htab = mandoc_calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **)); + htab = mandoc_calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln *)); for (i = 0; i < LINES_MAX; i++) { hash = (int)lines[i].code[0] - PRINT_LO; @@ -96,7 +97,7 @@ mchars_alloc(void) } int -mchars_spec2cp(struct mchars *arg, const char *p, size_t sz) +mchars_spec2cp(const struct mchars *arg, const char *p, size_t sz) { const struct ln *ln; @@ -113,7 +114,8 @@ mchars_num2char(const char *p, size_t sz) if ((i = mandoc_strntoi(p, sz, 10)) < 0) return('\0'); - return(i > 0 && i < 256 && isprint(i) ? i : '\0'); + return(i > 0 && i < 256 && isprint(i) ? + /* LINTED */ i : '\0'); } int @@ -128,7 +130,8 @@ mchars_num2uc(const char *p, size_t sz) } const char * -mchars_spec2str(struct mchars *arg, const char *p, size_t sz, size_t *rsz) +mchars_spec2str(const struct mchars *arg, + const char *p, size_t sz, size_t *rsz) { const struct ln *ln; @@ -143,9 +146,9 @@ mchars_spec2str(struct mchars *arg, const char *p, siz } static const struct ln * -find(struct mchars *tab, const char *p, size_t sz) +find(const struct mchars *tab, const char *p, size_t sz) { - struct ln *pp; + const struct ln *pp; int hash; assert(p);