source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Simplify: replace one global flag by one local variable.
Date: Wed, 30 Jul 2014 16:06:36 -0400 (EDT)	[thread overview]
Message-ID: <201407302006.s6UK6amV001755@krisdoz.my.domain> (raw)

Log Message:
-----------
Simplify: replace one global flag by one local variable.
No functional change.

Modified Files:
--------------
    mdocml:
        libman.h
        man.c

Revision Data
-------------
Index: man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -Lman.c -Lman.c -u -p -r1.133 -r1.134
--- man.c
+++ man.c
@@ -478,10 +478,11 @@ man_ptext(struct man *man, int line, cha
 static int
 man_pmacro(struct man *man, int ln, char *buf, int offs)
 {
-	int		 i, ppos;
-	enum mant	 tok;
 	char		 mac[5];
 	struct man_node	*n;
+	enum mant	 tok;
+	int		 i, ppos;
+	int		 bline;
 
 	if ('"' == buf[offs]) {
 		mandoc_msg(MANDOCERR_COMMENT_BAD, man->parse,
@@ -581,14 +582,9 @@ man_pmacro(struct man *man, int ln, char
 		man->flags &= ~MAN_BLINE;
 	}
 
-	/*
-	 * Save the fact that we're in the next-line for a block.  In
-	 * this way, embedded roff instructions can "remember" state
-	 * when they exit.
-	 */
+	/* Remember whether we are in next-line scope for a block head. */
 
-	if (MAN_BLINE & man->flags)
-		man->flags |= MAN_BPLINE;
+	bline = man->flags & MAN_BLINE;
 
 	/* Call to handler... */
 
@@ -610,11 +606,10 @@ man_pmacro(struct man *man, int ln, char
 	 * above-parsed macro, so return.
 	 */
 
-	if ( ! (MAN_BPLINE & man->flags)) {
+	if ( ! bline) {
 		man->flags &= ~MAN_ILINE;
 		return(1);
 	}
-	man->flags &= ~MAN_BPLINE;
 
 	/*
 	 * If we're in a block scope, then allow this macro to slip by
Index: libman.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libman.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -Llibman.h -Llibman.h -u -p -r1.59 -r1.60
--- libman.h
+++ libman.h
@@ -31,7 +31,6 @@ struct	man {
 #define	MAN_BLINE	(1 << 2) /* Next-line block scope. */
 #define	MAN_ILINE	(1 << 3) /* Ignored in next-line scope. */
 #define	MAN_LITERAL	(1 << 4) /* Literal input. */
-#define	MAN_BPLINE	(1 << 5)
 #define	MAN_NEWLINE	(1 << 6) /* first macro/text in a line */
 	enum man_next	 next; /* where to put the next node */
 	struct man_node	*last; /* the last parsed node */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-07-30 20:06 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=201407302006.s6UK6amV001755@krisdoz.my.domain \
    --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).