summaryrefslogtreecommitdiffstats
path: root/chars.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-20 16:46:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-20 16:46:04 +0000
commitf45f622c8ebfa925e3b5340d31a0b4f9380ff675 (patch)
tree30c393373586e5d6d990ecf3f7c77cb6d9a105d9 /chars.c
parentc64d9ad4033a749b71419ced2dc27c0b4a787818 (diff)
downloadmandoc-f45f622c8ebfa925e3b5340d31a0b4f9380ff675.tar.gz
KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
Diffstat (limited to 'chars.c')
-rw-r--r--chars.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/chars.c b/chars.c
index 9ca0d571..1e9a186e 100644
--- a/chars.c
+++ b/chars.c
@@ -52,9 +52,10 @@ struct mchars {
struct ln **htab;
};
-static const struct ln *find(const struct mchars *,
+static const struct ln *find(const struct mchars *,
const char *, size_t);
+
void
mchars_free(struct mchars *arg)
{
@@ -111,18 +112,18 @@ mchars_spec2cp(const struct mchars *arg, const char *p, size_t sz)
char
mchars_num2char(const char *p, size_t sz)
{
- int i;
+ int i;
if ((i = mandoc_strntoi(p, sz, 10)) < 0)
return('\0');
- return(i > 0 && i < 256 && isprint(i) ?
- /* LINTED */ i : '\0');
+
+ return(i > 0 && i < 256 && isprint(i) ? i : '\0');
}
int
mchars_num2uc(const char *p, size_t sz)
{
- int i;
+ int i;
if ((i = mandoc_strntoi(p, sz, 16)) < 0)
return('\0');
@@ -131,7 +132,7 @@ mchars_num2uc(const char *p, size_t sz)
}
const char *
-mchars_spec2str(const struct mchars *arg,
+mchars_spec2str(const struct mchars *arg,
const char *p, size_t sz, size_t *rsz)
{
const struct ln *ln;
@@ -160,8 +161,8 @@ find(const struct mchars *tab, const char *p, size_t sz)
hash = (int)p[0] - PRINT_LO;
for (pp = tab->htab[hash]; pp; pp = pp->next)
- if (0 == strncmp(pp->code, p, sz) &&
- '\0' == pp->code[(int)sz])
+ if (0 == strncmp(pp->code, p, sz) &&
+ '\0' == pp->code[(int)sz])
return(pp);
return(NULL);