summaryrefslogtreecommitdiffstats
path: root/chars.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-11-08 00:15:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-11-08 00:15:23 +0000
commit7f5351a1e9d07e9a65c22430e56ff4c50c4a9bdf (patch)
treee11bfd5999a90dc1e0b895076fb6eb87f5b41506 /chars.c
parent9830303b6541ca2717331d52b40997c9e566a48b (diff)
downloadmandoc-7f5351a1e9d07e9a65c22430e56ff4c50c4a9bdf.tar.gz
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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/chars.c b/chars.c
index 924497d3..4aa92bac 100644
--- a/chars.c
+++ b/chars.c
@@ -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);