diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-12 22:43:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2011-11-12 22:43:19 +0000 |
commit | 10bf10f861a942cc33eaf0b5b4d66d82497dff78 (patch) | |
tree | fa608959131c6d9b27122cbbf4a58498d6dcbb0a /usr.bin/mandoc | |
parent | 1f83a6d516dd9b712874ff76db6d9c81a62079bc (diff) |
mark some arguments "const" that will not be changed; from kristaps@
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/chars.c | 17 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/mandoc/chars.c b/usr.bin/mandoc/chars.c index 8e0acdc58ff..c66f95a7b49 100644 --- a/usr.bin/mandoc/chars.c +++ b/usr.bin/mandoc/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.22 2011/09/18 10:25:28 schwarze Exp $ */ +/* $Id: chars.c,v 1.23 2011/11/12 22:43:18 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -47,7 +47,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) @@ -92,7 +93,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; @@ -109,7 +110,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 @@ -124,7 +126,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; @@ -139,9 +142,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); diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index f0f6fd10cb3..10887828d8c 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.42 2011/11/05 16:02:18 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.43 2011/11/12 22:43:18 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -409,9 +409,9 @@ struct mchars *mchars_alloc(void); void mchars_free(struct mchars *); char mchars_num2char(const char *, size_t); int mchars_num2uc(const char *, size_t); -int mchars_spec2cp(struct mchars *, +int mchars_spec2cp(const struct mchars *, const char *, size_t); -const char *mchars_spec2str(struct mchars *, +const char *mchars_spec2str(const struct mchars *, const char *, size_t, size_t *); struct mparse *mparse_alloc(enum mparset, enum mandoclevel, mandocmsg, void *); |