From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s6ULIPMp023358 for ; Wed, 30 Jul 2014 17:18:25 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s6ULIPYx002359; Wed, 30 Jul 2014 17:18:25 -0400 (EDT) Date: Wed, 30 Jul 2014 17:18:25 -0400 (EDT) Message-Id: <201407302118.s6ULIPYx002359@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: garbage collect three unused global flags; no functional change X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- garbage collect three unused global flags; no functional change Modified Files: -------------- mdocml: libman.h libmdoc.h man.c man_macro.c mdoc.c Revision Data ------------- Index: libmdoc.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libmdoc.h,v retrieving revision 1.86 retrieving revision 1.87 diff -Llibmdoc.h -Llibmdoc.h -u -p -r1.86 -r1.87 --- libmdoc.h +++ libmdoc.h @@ -28,7 +28,6 @@ struct mdoc { const char *defos; /* default argument for .Os */ int quick; /* abort parse early */ int flags; /* parse flags */ -#define MDOC_HALT (1 << 0) /* error in parse: halt */ #define MDOC_LITERAL (1 << 1) /* in a literal scope */ #define MDOC_PBODY (1 << 2) /* in the document body */ #define MDOC_NEWLINE (1 << 3) /* first macro/text in a line */ Index: man.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v retrieving revision 1.134 retrieving revision 1.135 diff -Lman.c -Lman.c -u -p -r1.134 -r1.135 --- man.c +++ man.c @@ -68,7 +68,6 @@ const struct man_node * man_node(const struct man *man) { - assert( ! (MAN_HALT & man->flags)); return(man->first); } @@ -76,7 +75,6 @@ const struct man_meta * man_meta(const struct man *man) { - assert( ! (MAN_HALT & man->flags)); return(&man->meta); } @@ -116,11 +114,7 @@ int man_endparse(struct man *man) { - assert( ! (MAN_HALT & man->flags)); - if (man_macroend(man)) - return(1); - man->flags |= MAN_HALT; - return(0); + return(man_macroend(man)); } int @@ -129,8 +123,6 @@ man_parseln(struct man *man, int ln, cha man->flags |= MAN_NEWLINE; - assert( ! (MAN_HALT & man->flags)); - return (roff_getcontrol(man->roff, buf, &offs) ? man_pmacro(man, ln, buf, offs) : man_ptext(man, ln, buf, offs)); @@ -352,8 +344,6 @@ man_addeqn(struct man *man, const struct { struct man_node *n; - assert( ! (MAN_HALT & man->flags)); - n = man_node_alloc(man, ep->ln, ep->pos, MAN_EQN, MAN_MAX); n->eqn = ep; @@ -369,8 +359,6 @@ man_addspan(struct man *man, const struc { struct man_node *n; - assert( ! (MAN_HALT & man->flags)); - n = man_node_alloc(man, sp->line, 0, MAN_TBL, MAN_MAX); n->span = sp; @@ -590,7 +578,7 @@ man_pmacro(struct man *man, int ln, char assert(man_macros[tok].fp); if ( ! (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf)) - goto err; + return(0); /* In quick mode (for mandocdb), abort after the NAME section. */ @@ -602,46 +590,21 @@ man_pmacro(struct man *man, int ln, char } /* - * We weren't in a block-line scope when entering the - * above-parsed macro, so return. - */ - - if ( ! bline) { - man->flags &= ~MAN_ILINE; - return(1); - } - - /* - * If we're in a block scope, then allow this macro to slip by - * without closing scope around it. - */ - - if (MAN_ILINE & man->flags) { - man->flags &= ~MAN_ILINE; - return(1); - } - - /* - * If we've opened a new next-line element scope, then return - * now, as the next line will close out the block scope. + * If we are in a next-line scope for a block head, + * close it out now and switch to the body, + * unless the next-line scope is allowed to continue. */ - if (MAN_ELINE & man->flags) + if ( ! bline || man->flags & MAN_ELINE || + man_macros[tok].flags & MAN_NSCOPED) return(1); - /* Close out the block scope opened in the prior line. */ - assert(MAN_BLINE & man->flags); man->flags &= ~MAN_BLINE; if ( ! man_unscope(man, man->last->parent)) return(0); return(man_body_alloc(man, ln, ppos, man->last->tok)); - -err: /* Error out. */ - - man->flags |= MAN_HALT; - return(0); } /* Index: mdoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v retrieving revision 1.220 retrieving revision 1.221 diff -Lmdoc.c -Lmdoc.c -u -p -r1.220 -r1.221 --- mdoc.c +++ mdoc.c @@ -104,7 +104,6 @@ const struct mdoc_node * mdoc_node(const struct mdoc *mdoc) { - assert( ! (MDOC_HALT & mdoc->flags)); return(mdoc->first); } @@ -112,7 +111,6 @@ const struct mdoc_meta * mdoc_meta(const struct mdoc *mdoc) { - assert( ! (MDOC_HALT & mdoc->flags)); return(&mdoc->meta); } @@ -205,19 +203,11 @@ mdoc_alloc(struct roff *roff, struct mpa return(p); } -/* - * Climb back up the parse tree, validating open scopes. Mostly calls - * through to macro_end() in macro.c. - */ int mdoc_endparse(struct mdoc *mdoc) { - assert( ! (MDOC_HALT & mdoc->flags)); - if (mdoc_macroend(mdoc)) - return(1); - mdoc->flags |= MDOC_HALT; - return(0); + return(mdoc_macroend(mdoc)); } int @@ -225,8 +215,6 @@ mdoc_addeqn(struct mdoc *mdoc, const str { struct mdoc_node *n; - assert( ! (MDOC_HALT & mdoc->flags)); - n = node_alloc(mdoc, ep->ln, ep->pos, MDOC_MAX, MDOC_EQN); n->eqn = ep; @@ -242,8 +230,6 @@ mdoc_addspan(struct mdoc *mdoc, const st { struct mdoc_node *n; - assert( ! (MDOC_HALT & mdoc->flags)); - n = node_alloc(mdoc, sp->line, 0, MDOC_MAX, MDOC_TBL); n->span = sp; @@ -262,8 +248,6 @@ int mdoc_parseln(struct mdoc *mdoc, int ln, char *buf, int offs) { - assert( ! (MDOC_HALT & mdoc->flags)); - mdoc->flags |= MDOC_NEWLINE; /* @@ -883,11 +867,8 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, c * into macro processing. */ - if (NULL == mdoc->last || MDOC_It == tok || MDOC_El == tok) { - if ( ! mdoc_macro(mdoc, tok, ln, sv, &offs, buf)) - goto err; - return(1); - } + if (NULL == mdoc->last || MDOC_It == tok || MDOC_El == tok) + return(mdoc_macro(mdoc, tok, ln, sv, &offs, buf)); n = mdoc->last; assert(mdoc->last); @@ -900,9 +881,7 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, c if (MDOC_Bl == n->tok && MDOC_BODY == n->type && LIST_column == n->norm->Bl.type) { mdoc->flags |= MDOC_FREECOL; - if ( ! mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf)) - goto err; - return(1); + return(mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf)); } /* @@ -916,15 +895,13 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, c MDOC_Bl == n->parent->tok && LIST_column == n->parent->norm->Bl.type) { mdoc->flags |= MDOC_FREECOL; - if ( ! mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf)) - goto err; - return(1); + return(mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf)); } /* Normal processing of a macro. */ if ( ! mdoc_macro(mdoc, tok, ln, sv, &offs, buf)) - goto err; + return(0); /* In quick mode (for mandocdb), abort after the NAME section. */ @@ -933,11 +910,6 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, c return(2); return(1); - -err: /* Error out. */ - - mdoc->flags |= MDOC_HALT; - return(0); } enum mdelim Index: libman.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libman.h,v retrieving revision 1.60 retrieving revision 1.61 diff -Llibman.h -Llibman.h -u -p -r1.60 -r1.61 --- libman.h +++ libman.h @@ -26,10 +26,8 @@ struct man { struct mparse *parse; /* parse pointer */ int quick; /* abort parse early */ int flags; /* parse flags */ -#define MAN_HALT (1 << 0) /* badness happened: die */ #define MAN_ELINE (1 << 1) /* Next-line element scope. */ #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_NEWLINE (1 << 6) /* first macro/text in a line */ enum man_next next; /* where to put the next node */ Index: man_macro.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_macro.c,v retrieving revision 1.85 retrieving revision 1.86 diff -Lman_macro.c -Lman_macro.c -u -p -r1.85 -r1.86 --- man_macro.c +++ man_macro.c @@ -415,13 +415,6 @@ in_line_eoln(MACRO_PROT_ARGS) return(1); } - /* Set ignorable context, if applicable. */ - - if (MAN_NSCOPED & man_macros[tok].flags) { - assert( ! (MAN_SCOPED & man_macros[tok].flags)); - man->flags |= MAN_ILINE; - } - assert(MAN_ROOT != man->last->type); man->next = MAN_NEXT_SIBLING; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv