aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-14 22:44:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-14 22:44:55 +0000
commita75cd602ebfaf527c83177aa31df55e03e2e854e (patch)
treed3e741e23d8fa363adac0a34b4179d47ab270190
parente54b1e9f0f881374060eef0e4c54bdd192cf7f34 (diff)
downloadmandoc-a75cd602ebfaf527c83177aa31df55e03e2e854e.tar.gz
mandoc-a75cd602ebfaf527c83177aa31df55e03e2e854e.tar.zst
mandoc-a75cd602ebfaf527c83177aa31df55e03e2e854e.zip
simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional change
-rw-r--r--libroff.h6
-rw-r--r--tbl.c8
-rw-r--r--tbl_layout.c12
-rw-r--r--tbl_opts.c7
4 files changed, 16 insertions, 17 deletions
diff --git a/libroff.h b/libroff.h
index dd7ad75a..866edf78 100644
--- a/libroff.h
+++ b/libroff.h
@@ -1,4 +1,4 @@
-/* $Id: libroff.h,v 1.33 2014/12/01 08:05:52 schwarze Exp $ */
+/* $Id: libroff.h,v 1.34 2015/01/14 22:44:55 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -69,8 +69,8 @@ void tbl_restart(int, int, struct tbl_node *);
void tbl_free(struct tbl_node *);
void tbl_reset(struct tbl_node *);
enum rofferr tbl_read(struct tbl_node *, int, const char *, int);
-int tbl_option(struct tbl_node *, int, const char *);
-int tbl_layout(struct tbl_node *, int, const char *);
+void tbl_option(struct tbl_node *, int, const char *);
+void tbl_layout(struct tbl_node *, int, const char *);
int tbl_data(struct tbl_node *, int, const char *);
int tbl_cdata(struct tbl_node *, int, const char *);
const struct tbl_span *tbl_span(struct tbl_node *);
diff --git a/tbl.c b/tbl.c
index bfed242b..dc59266d 100644
--- a/tbl.c
+++ b/tbl.c
@@ -1,4 +1,4 @@
-/* $Id: tbl.c,v 1.30 2014/08/10 23:54:41 schwarze Exp $ */
+/* $Id: tbl.c,v 1.31 2015/01/14 22:44:55 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -55,9 +55,11 @@ tbl_read(struct tbl_node *tbl, int ln, const char *p, int offs)
switch (tbl->part) {
case TBL_PART_OPTS:
- return(tbl_option(tbl, ln, p) ? ROFF_IGN : ROFF_ERR);
+ tbl_option(tbl, ln, p);
+ return(ROFF_IGN);
case TBL_PART_LAYOUT:
- return(tbl_layout(tbl, ln, p) ? ROFF_IGN : ROFF_ERR);
+ tbl_layout(tbl, ln, p);
+ return(ROFF_IGN);
case TBL_PART_CDATA:
return(tbl_cdata(tbl, ln, p) ? ROFF_TBL : ROFF_IGN);
default:
diff --git a/tbl_layout.c b/tbl_layout.c
index 033074af..29a6cee2 100644
--- a/tbl_layout.c
+++ b/tbl_layout.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_layout.c,v 1.30 2014/11/25 21:41:47 schwarze Exp $ */
+/* $Id: tbl_layout.c,v 1.31 2015/01/14 22:44:55 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -299,7 +299,7 @@ cell(struct tbl_node *tbl, struct tbl_row *rp,
return(mods(tbl, cell_alloc(tbl, rp, c, vert), ln, p, pos));
}
-int
+void
tbl_layout(struct tbl_node *tbl, int ln, const char *p)
{
struct tbl_row *rp;
@@ -320,18 +320,18 @@ tbl_layout(struct tbl_node *tbl, int ln, const char *p)
rp = NULL;
continue;
case '\0': /* Next row on next input line. */
- return(1);
+ return;
case '.': /* End of layout. */
pos++;
tbl->part = TBL_PART_DATA;
if (tbl->first_row != NULL)
- return(1);
+ return;
mandoc_msg(MANDOCERR_TBLNOLAYOUT,
tbl->parse, ln, pos, NULL);
rp = mandoc_calloc(1, sizeof(*rp));
cell_alloc(tbl, rp, TBL_CELL_LEFT, 0);
tbl->first_row = tbl->last_row = rp;
- return(1);
+ return;
default: /* Cell. */
break;
}
@@ -345,7 +345,7 @@ tbl_layout(struct tbl_node *tbl, int ln, const char *p)
tbl->last_row = rp;
}
if ( ! cell(tbl, rp, ln, p, &pos))
- return(1);
+ return;
}
}
diff --git a/tbl_opts.c b/tbl_opts.c
index d5ad42f7..4716e436 100644
--- a/tbl_opts.c
+++ b/tbl_opts.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_opts.c,v 1.15 2014/11/26 17:51:55 schwarze Exp $ */
+/* $Id: tbl_opts.c,v 1.16 2015/01/14 22:44:55 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -252,7 +252,7 @@ again: /*
/* NOTREACHED */
}
-int
+void
tbl_option(struct tbl_node *tbl, int ln, const char *p)
{
int pos;
@@ -265,7 +265,4 @@ tbl_option(struct tbl_node *tbl, int ln, const char *p)
pos = 0;
opt(tbl, ln, p, &pos);
-
- /* Always succeed. */
- return(1);
}