diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-11-08 00:15:23 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-11-08 00:15:23 +0000 |
commit | 61bca234bb8f66517dc609f3dc3dfbee7fb22cee (patch) | |
tree | 0793d714de0dff84624342043918a574419540c2 /chars.c | |
parent | 37dca223f8adbfb62ab71687a8b3f306804295c8 (diff) | |
download | mandoc-61bca234bb8f66517dc609f3dc3dfbee7fb22cee.tar.gz mandoc-61bca234bb8f66517dc609f3dc3dfbee7fb22cee.tar.zst mandoc-61bca234bb8f66517dc609f3dc3dfbee7fb22cee.zip |
Const-ify some mchars arguments. I think these are non-const for historical
dumbness on my part.
Diffstat (limited to 'chars.c')
-rw-r--r-- | chars.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.51 2011/09/18 14:14:15 schwarze Exp $ */ +/* $Id: chars.c,v 1.52 2011/11/08 00:15:23 kristaps Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -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) @@ -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, size_t sz, size_t *rsz) } 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); |