aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/out.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
commit29cecee7ff6894517a32d929aecee283bb85058c (patch)
treea8b7e1f77dc92d5398b03e113570778649b94aba /out.c
parent27178e6666d82be945ee668c2530249f5c728eb6 (diff)
downloadmandoc-29cecee7ff6894517a32d929aecee283bb85058c.tar.gz
mandoc-29cecee7ff6894517a32d929aecee283bb85058c.tar.zst
mandoc-29cecee7ff6894517a32d929aecee283bb85058c.zip
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 'out.c')
-rw-r--r--out.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/out.c b/out.c
index 96d1d771..9c4e4c94 100644
--- a/out.c
+++ b/out.c
@@ -1,4 +1,4 @@
-/* $Id: out.c,v 1.47 2014/03/23 11:25:26 schwarze Exp $ */
+/* $Id: out.c,v 1.48 2014/04/20 16:46:05 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -39,7 +39,8 @@ static void tblcalc_literal(struct rofftbl *, struct roffcol *,
static void tblcalc_number(struct rofftbl *, struct roffcol *,
const struct tbl_opts *, const struct tbl_dat *);
-/*
+
+/*
* Convert a `scaling unit' to a consistent form, or fail. Scaling
* units are documented in groff.7, mdoc.7, man.7.
*/
@@ -56,10 +57,10 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def)
i = hasd = 0;
switch (*src) {
- case ('+'):
+ case '+':
src++;
break;
- case ('-'):
+ case '-':
buf[i++] = *src++;
break;
default:
@@ -87,39 +88,39 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def)
buf[i] = '\0';
switch (*src) {
- case ('c'):
+ case 'c':
unit = SCALE_CM;
break;
- case ('i'):
+ case 'i':
unit = SCALE_IN;
break;
- case ('P'):
+ case 'P':
unit = SCALE_PC;
break;
- case ('p'):
+ case 'p':
unit = SCALE_PT;
break;
- case ('f'):
+ case 'f':
unit = SCALE_FS;
break;
- case ('v'):
+ case 'v':
unit = SCALE_VS;
break;
- case ('m'):
+ case 'm':
unit = SCALE_EM;
break;
- case ('\0'):
+ case '\0':
if (SCALE_MAX == def)
return(0);
unit = SCALE_BU;
break;
- case ('u'):
+ case 'u':
unit = SCALE_BU;
break;
- case ('M'):
+ case 'M':
unit = SCALE_MM;
break;
- case ('n'):
+ case 'n':
unit = SCALE_EN;
break;
default:
@@ -153,8 +154,8 @@ tblcalc(struct rofftbl *tbl, const struct tbl_span *sp)
*/
assert(NULL == tbl->cols);
- tbl->cols = mandoc_calloc
- ((size_t)sp->opts->cols, sizeof(struct roffcol));
+ tbl->cols = mandoc_calloc((size_t)sp->opts->cols,
+ sizeof(struct roffcol));
for ( ; sp; sp = sp->next) {
if (TBL_SPAN_DATA != sp->pos)
@@ -187,26 +188,26 @@ tblcalc_data(struct rofftbl *tbl, struct roffcol *col,
/* Branch down into data sub-types. */
switch (dp->layout->pos) {
- case (TBL_CELL_HORIZ):
+ case TBL_CELL_HORIZ:
/* FALLTHROUGH */
- case (TBL_CELL_DHORIZ):
+ case TBL_CELL_DHORIZ:
sz = (*tbl->len)(1, tbl->arg);
if (col->width < sz)
col->width = sz;
break;
- case (TBL_CELL_LONG):
+ case TBL_CELL_LONG:
/* FALLTHROUGH */
- case (TBL_CELL_CENTRE):
+ case TBL_CELL_CENTRE:
/* FALLTHROUGH */
- case (TBL_CELL_LEFT):
+ case TBL_CELL_LEFT:
/* FALLTHROUGH */
- case (TBL_CELL_RIGHT):
+ case TBL_CELL_RIGHT:
tblcalc_literal(tbl, col, dp);
break;
- case (TBL_CELL_NUMBER):
+ case TBL_CELL_NUMBER:
tblcalc_number(tbl, col, opts, dp);
break;
- case (TBL_CELL_DOWN):
+ case TBL_CELL_DOWN:
break;
default:
abort();
@@ -232,7 +233,7 @@ static void
tblcalc_number(struct rofftbl *tbl, struct roffcol *col,
const struct tbl_opts *opts, const struct tbl_dat *dp)
{
- int i;
+ int i;
size_t sz, psz, ssz, d;
const char *str;
char *cp;