From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: simplify by getting rid of ROFF_ERR in tbl(7) parsing; no
Date: Wed, 14 Jan 2015 17:45:25 -0500 (EST) [thread overview]
Message-ID: <13988663174530091702.enqueue@fantadrom.bsd.lv> (raw)
Log Message:
-----------
simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional change
Modified Files:
--------------
mdocml:
libroff.h
tbl.c
tbl_layout.c
tbl_opts.c
Revision Data
-------------
Index: tbl_layout.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tbl_layout.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Ltbl_layout.c -Ltbl_layout.c -u -p -r1.30 -r1.31
--- tbl_layout.c
+++ tbl_layout.c
@@ -299,7 +299,7 @@ cell(struct tbl_node *tbl, struct tbl_ro
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,
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,
tbl->last_row = rp;
}
if ( ! cell(tbl, rp, ln, p, &pos))
- return(1);
+ return;
}
}
Index: tbl_opts.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tbl_opts.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -Ltbl_opts.c -Ltbl_opts.c -u -p -r1.15 -r1.16
--- tbl_opts.c
+++ tbl_opts.c
@@ -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,
pos = 0;
opt(tbl, ln, p, &pos);
-
- /* Always succeed. */
- return(1);
}
Index: tbl.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tbl.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Ltbl.c -Ltbl.c -u -p -r1.30 -r1.31
--- tbl.c
+++ tbl.c
@@ -55,9 +55,11 @@ tbl_read(struct tbl_node *tbl, int ln, c
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:
Index: libroff.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/libroff.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -Llibroff.h -Llibroff.h -u -p -r1.33 -r1.34
--- libroff.h
+++ libroff.h
@@ -69,8 +69,8 @@ void tbl_restart(int, int, struct tbl_
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 *);
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2015-01-14 22:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13988663174530091702.enqueue@fantadrom.bsd.lv \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).