source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Drop trailing whitespace, adjust a few indentations, and update
@ 2014-10-10 14:27 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-10-10 14:27 UTC (permalink / raw)
  To: source

Log Message:
-----------
Drop trailing whitespace, adjust a few indentations,
and update Copyright year while here; no code change.

Modified Files:
--------------
    mdocml:
        eqn.c
        eqn_html.c

Revision Data
-------------
Index: eqn.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/eqn.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -Leqn.c -Leqn.c -u -p -r1.50 -r1.51
--- eqn.c
+++ eqn.c
@@ -1,6 +1,6 @@
 /*	$Id$ */
 /*
- * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -554,7 +554,7 @@ eqn_box_alloc(struct eqn_node *ep, struc
  * The new EQN_SUBEXPR will have a two-child limit.
  */
 static struct eqn_box *
-eqn_box_makebinary(struct eqn_node *ep, 
+eqn_box_makebinary(struct eqn_node *ep,
 	enum eqn_post pos, struct eqn_box *parent)
 {
 	struct eqn_box	*b, *newb;
@@ -666,7 +666,7 @@ eqn_parse(struct eqn_node *ep, struct eq
 
 	assert(NULL != parent);
 again:
-	
+
 	switch ((tok = eqn_tok_parse(ep, &p))) {
 	case (EQN_TOK_UNDEF):
 		if ((rc = eqn_undef(ep)) <= 0)
@@ -680,7 +680,7 @@ again:
 	case (EQN_TOK_TDEFINE):
 		if (NULL == eqn_nextrawtok(ep, NULL))
 			EQN_MSG(MANDOCERR_EQNEOF, ep);
-		else if (NULL == eqn_next(ep, 
+		else if (NULL == eqn_next(ep,
 				ep->data[(int)ep->cur], NULL, 0))
 			EQN_MSG(MANDOCERR_EQNEOF, ep);
 		break;
@@ -707,8 +707,7 @@ again:
 			EQN_MSG(MANDOCERR_EQNSYNT, ep);
 			return(-1);
 		}
-		parent = eqn_box_makebinary
-			(ep, EQNPOS_NONE, parent);
+		parent = eqn_box_makebinary(ep, EQNPOS_NONE, parent);
 		parent->type = EQN_LISTONE;
 		parent->expectargs = 1;
 		switch (tok) {
@@ -762,7 +761,7 @@ again:
 	case (EQN_TOK_BACK):
 	case (EQN_TOK_DOWN):
 	case (EQN_TOK_UP):
-		tok = eqn_tok_parse(ep, NULL); 
+		tok = eqn_tok_parse(ep, NULL);
 		if (EQN_TOK__MAX != tok) {
 			EQN_MSG(MANDOCERR_EQNSYNT, ep);
 			return(-1);
@@ -871,7 +870,7 @@ again:
 				EQN_MSG(MANDOCERR_EQNSYNT, ep);
 				return(-1);
 			}
-		/* 
+		/*
 		 * Accept a left-right-associative set of arguments just
 		 * like sub and sup and friends but without rebalancing
 		 * under a pivot.
@@ -905,7 +904,7 @@ again:
 		 * FIXME: this is a shitty sentinel: we should really
 		 * have a native EQN_BRACE type or whatnot.
 		 */
-		while (parent->type != EQN_LIST) 
+		while (parent->type != EQN_LIST)
 			if (NULL == (parent = parent->parent)) {
 				EQN_MSG(MANDOCERR_EQNSYNT, ep);
 				return(-1);
@@ -926,20 +925,20 @@ again:
 			} else if (STRNEQ(start, sz, "floor", 5)) {
 				strlcpy(sym, "\\[rf]", sizeof(sym));
 				parent->right = mandoc_strdup(sym);
-			} else 
+			} else
 				parent->right = mandoc_strndup(start, sz);
 		}
 		if (NULL == (parent = parent->parent)) {
 			EQN_MSG(MANDOCERR_EQNSYNT, ep);
 			return(-1);
 		}
-		if (EQN_TOK_BRACE_CLOSE == tok && parent && 
-			(parent->type == EQN_PILE ||
-			 parent->type == EQN_MATRIX))
+		if (EQN_TOK_BRACE_CLOSE == tok && parent &&
+		    (parent->type == EQN_PILE ||
+		     parent->type == EQN_MATRIX))
 			parent = parent->parent;
 		/* Close out any "singleton" lists. */
-		while (parent->type == EQN_LISTONE && 
-			parent->args == parent->expectargs)
+		while (parent->type == EQN_LISTONE &&
+		    parent->args == parent->expectargs)
 			if (NULL == (parent = parent->parent)) {
 				EQN_MSG(MANDOCERR_EQNSYNT, ep);
 				return(-1);
@@ -971,7 +970,7 @@ again:
 			} else if (STRNEQ(start, sz, "floor", 5)) {
 				strlcpy(sym, "\\[lf]", sizeof(sym));
 				parent->left = mandoc_strdup(sym);
-			} else 
+			} else
 				parent->left = mandoc_strndup(start, sz);
 		}
 		break;
@@ -997,7 +996,7 @@ again:
 		parent->type = EQN_LIST;
 		break;
 	case (EQN_TOK_ABOVE):
-		while (parent->type != EQN_PILE) 
+		while (parent->type != EQN_PILE)
 			if (NULL == (parent = parent->parent)) {
 				EQN_MSG(MANDOCERR_EQNSYNT, ep);
 				return(-1);
@@ -1022,7 +1021,7 @@ again:
 		break;
 	case (EQN_TOK_EOF):
 		/*
-		 * End of file! 
+		 * End of file!
 		 * TODO: make sure we're not in an open subexpression.
 		 */
 		return(0);
@@ -1043,7 +1042,7 @@ again:
 		cur->type = EQN_TEXT;
 		for (i = 0; i < EQNSYM__MAX; i++)
 			if (0 == strcmp(eqnsyms[i].str, p)) {
-				(void)snprintf(sym, sizeof(sym), 
+				(void)snprintf(sym, sizeof(sym),
 					"\\[%s]", eqnsyms[i].sym);
 				cur->text = mandoc_strdup(sym);
 				free(p);
@@ -1055,7 +1054,7 @@ again:
 		/*
 		 * Post-process list status.
 		 */
-		while (parent->type == EQN_LISTONE && 
+		while (parent->type == EQN_LISTONE &&
 			parent->args == parent->expectargs)
 			if (NULL == (parent = parent->parent)) {
 				EQN_MSG(MANDOCERR_EQNSYNT, ep);
@@ -1067,7 +1066,7 @@ again:
 }
 
 enum rofferr
-eqn_end(struct eqn_node **epp) 
+eqn_end(struct eqn_node **epp)
 {
 	struct eqn_node	*ep;
 
Index: eqn_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/eqn_html.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -Leqn_html.c -Leqn_html.c -u -p -r1.8 -r1.9
--- eqn_html.c
+++ eqn_html.c
@@ -1,6 +1,6 @@
 /*	$Id$ */
 /*
- * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -54,7 +54,7 @@ eqn_box(struct html *p, const struct eqn
 		/* Estimate the number of rows, first. */
 		if (NULL == (child = parent->first))
 			goto out;
-		for (rows = 0; NULL != child; rows++) 
+		for (rows = 0; NULL != child; rows++)
 			child = child->next;
 		/* Print row-by-row. */
 		post = print_otag(p, TAG_MTABLE, 0, NULL);
@@ -70,12 +70,12 @@ eqn_box(struct html *p, const struct eqn
 				}
 				cell = print_otag
 					(p, TAG_MTD, 0, NULL);
-				/* 
+				/*
 				 * If we have no data for this
 				 * particular cell, then print a
 				 * placeholder and continue--don't puke.
 				 */
-				if (NULL != child) 
+				if (NULL != child)
 					eqn_box(p, child->first);
 				print_tagq(p, cell);
 				parent = parent->next;
@@ -137,14 +137,14 @@ eqn_box(struct html *p, const struct eqn
 		assert(NULL == post);
 		post = print_otag(p, TAG_MI, 0, NULL);
 		print_text(p, bp->text);
-	} else if (NULL == post) { 
+	} else if (NULL == post) {
 		if (NULL != bp->left || NULL != bp->right) {
 			PAIR_INIT(&tag[0], ATTR_OPEN,
-				NULL == bp->left ? "" : bp->left);
+			    NULL == bp->left ? "" : bp->left);
 			PAIR_INIT(&tag[1], ATTR_CLOSE,
-				NULL == bp->right ? "" : bp->right);
+			    NULL == bp->right ? "" : bp->right);
 			post = print_otag(p, TAG_MFENCED, 2, tag);
-		} 
+		}
 		if (NULL == post)
 			post = print_otag(p, TAG_MROW, 0, NULL);
 		else
@@ -158,7 +158,7 @@ out:
 		t = print_otag(p, TAG_MO, 0, NULL);
 		print_text(p, bp->bottom);
 		print_tagq(p, t);
-	} 
+	}
 	if (NULL != bp->top) {
 		t = print_otag(p, TAG_MO, 0, NULL);
 		print_text(p, bp->top);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2014-10-10 14:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 14:27 mdocml: Drop trailing whitespace, adjust a few indentations, and update 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).