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 | 7f5351a1e9d07e9a65c22430e56ff4c50c4a9bdf (patch) | |
tree | e11bfd5999a90dc1e0b895076fb6eb87f5b41506 | |
parent | 9830303b6541ca2717331d52b40997c9e566a48b (diff) | |
download | mandoc-7f5351a1e9d07e9a65c22430e56ff4c50c4a9bdf.tar.gz |
Const-ify some mchars arguments. I think these are non-const for historical
dumbness on my part.
-rw-r--r-- | chars.c | 15 | ||||
-rw-r--r-- | mandoc.3 | 4 | ||||
-rw-r--r-- | mandoc.h | 4 |
3 files changed, 13 insertions, 10 deletions
@@ -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); @@ -76,14 +76,14 @@ .Fn mchars_num2uc "const char *cp" "size_t sz" .Ft "const char *" .Fo mchars_spec2str -.Fa "struct mchars *p" +.Fa "const struct mchars *p" .Fa "const char *cp" .Fa "size_t sz" .Fa "size_t *rsz" .Fc .Ft int .Fo mchars_spec2cp -.Fa "struct mchars *p" +.Fa "const struct mchars *p" .Fa "const char *cp" .Fa "size_t sz" .Ft "const char *" @@ -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 *); |