source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: Last instance of consistent "struct parse *p" function
@ 2019-04-10 14:34 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-10 14:34 UTC (permalink / raw)
  To: source

Log Message:
-----------
Last instance of consistent "struct parse *p" function argument naming.
While the previous commit caused no binary change, this one does,
but only because the argument is used in an assert(3).
Still no functional change.

Modified Files:
--------------
    docbook2mdoc:
        parse.c

Revision Data
-------------
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lparse.c -Lparse.c -u -p -r1.30 -r1.31
--- parse.c
+++ parse.c
@@ -632,7 +632,7 @@ xml_attrval(struct parse *p, const char 
  * If we're at a text node, roll that one up first.
  */
 static void
-xml_elem_end(struct parse *ps, const char *name)
+xml_elem_end(struct parse *p, const char *name)
 {
 	const struct element	*elem;
 	struct pnode		*n;
@@ -643,13 +643,13 @@ xml_elem_end(struct parse *ps, const cha
 	 * An ancestor is excluded from the tree;
 	 * keep track of the number of levels excluded.
 	 */
-	if (ps->del > 1) {
-		ps->del--;
+	if (p->del > 1) {
+		p->del--;
 		return;
 	}
 
-	if (ps->del == 0)
-		pnode_closetext(ps);
+	if (p->del == 0)
+		pnode_closetext(p);
 
 	if (name != NULL) {
 		for (elem = elements; elem->name != NULL; elem++)
@@ -657,34 +657,34 @@ xml_elem_end(struct parse *ps, const cha
 				break;
 		node = elem->node;
 	} else
-		node = ps->ncur;
+		node = p->ncur;
 
 	switch (node) {
 	case NODE_DELETE_WARN:
 	case NODE_DELETE:
-		if (ps->del > 0)
-			ps->del--;
+		if (p->del > 0)
+			p->del--;
 		break;
 	case NODE_IGNORE:
 		break;
 	case NODE_INCLUDE:
-		n = ps->cur;
-		ps->cur = ps->cur->parent;
+		n = p->cur;
+		p->cur = p->cur->parent;
 		cp = pnode_getattr_raw(n, ATTRKEY_HREF, NULL);
 		if (cp == NULL)
-			error_msg(ps, "<xi:include> element "
+			error_msg(p, "<xi:include> element "
 			    "without href attribute");
 		else
-			parse_file(ps, -1, cp);
+			parse_file(p, -1, cp);
 		pnode_unlink(n);
-		ps->flags &= ~PFLAG_SPC;
+		p->flags &= ~PFLAG_SPC;
 		break;
 	case NODE_DOCTYPE:
-		ps->flags &= ~PFLAG_EEND;
+		p->flags &= ~PFLAG_EEND;
 		/* FALLTHROUGH */
 	default:
-		if (ps->cur == NULL || node != ps->cur->node) {
-			warn_msg(ps, "element not open: </%s>", name);
+		if (p->cur == NULL || node != p->cur->node) {
+			warn_msg(p, "element not open: </%s>", name);
 			break;
 		}
 
@@ -695,16 +695,16 @@ xml_elem_end(struct parse *ps, const cha
 		 * obviously better than discarding it or crashing.
 		 */
 
-		if (ps->cur->parent != NULL || node == NODE_DOCTYPE) {
-			ps->cur = ps->cur->parent;
-			if (ps->cur != NULL)
-				ps->ncur = ps->cur->node;
+		if (p->cur->parent != NULL || node == NODE_DOCTYPE) {
+			p->cur = p->cur->parent;
+			if (p->cur != NULL)
+				p->ncur = p->cur->node;
 		} else
-			ps->tree->flags |= TREE_CLOSED;
-		ps->flags &= ~PFLAG_SPC;
+			p->tree->flags |= TREE_CLOSED;
+		p->flags &= ~PFLAG_SPC;
 		break;
 	}
-	assert(ps->del == 0);
+	assert(p->del == 0);
 }
 
 struct parse *
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-10 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 14:34 docbook2mdoc: Last instance of consistent "struct parse *p" function schwarze

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).