From: schwarze Date: Tue, 6 Oct 2015 18:30:43 +0000 (+0000) Subject: modernize style: "return" is not a function; ok cmp(1) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=526e306b37c2cee3174737654802531ef5182a7a;p=openbsd modernize style: "return" is not a function; ok cmp(1) --- diff --git a/usr.bin/mandoc/att.c b/usr.bin/mandoc/att.c index a1cd433ae42..c1e7a04157f 100644 --- a/usr.bin/mandoc/att.c +++ b/usr.bin/mandoc/att.c @@ -1,4 +1,4 @@ -/* $OpenBSD: att.c,v 1.10 2015/04/02 21:03:18 schwarze Exp $ */ +/* $OpenBSD: att.c,v 1.11 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -44,5 +44,5 @@ mdoc_a2att(const char *p) LINE("V.3", "AT&T System\\~V Release\\~3 UNIX"); LINE("V.4", "AT&T System\\~V Release\\~4 UNIX"); - return(NULL); + return NULL; } diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c index 4d72f06e921..ffa6b6bf801 100644 --- a/usr.bin/mandoc/cgi.c +++ b/usr.bin/mandoc/cgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgi.c,v 1.47 2015/04/18 16:34:03 schwarze Exp $ */ +/* $OpenBSD: cgi.c,v 1.48 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -330,13 +330,13 @@ http_decode(char *p) for ( ; '\0' != *p; p++, q++) { if ('%' == *p) { if ('\0' == (hex[0] = *(p + 1))) - return(0); + return 0; if ('\0' == (hex[1] = *(p + 2))) - return(0); + return 0; if (1 != sscanf(hex, "%x", &c)) - return(0); + return 0; if ('\0' == c) - return(0); + return 0; *q = (char)c; p += 2; @@ -345,7 +345,7 @@ http_decode(char *p) } *q = '\0'; - return(1); + return 1; } static void @@ -497,10 +497,10 @@ validate_urifrag(const char *frag) if ( ! (isalnum((unsigned char)*frag) || '-' == *frag || '.' == *frag || '/' == *frag || '_' == *frag)) - return(0); + return 0; frag++; } - return(1); + return 1; } static int @@ -509,13 +509,13 @@ validate_manpath(const struct req *req, const char* manpath) size_t i; if ( ! strcmp(manpath, "mandoc")) - return(1); + return 1; for (i = 0; i < req->psz; i++) if ( ! strcmp(manpath, req->p[i])) - return(1); + return 1; - return(0); + return 0; } static int @@ -525,8 +525,8 @@ validate_filename(const char *file) if ('.' == file[0] && '/' == file[1]) file += 2; - return ( ! (strstr(file, "../") || strstr(file, "/..") || - (strncmp(file, "man", 3) && strncmp(file, "cat", 3)))); + return ! (strstr(file, "../") || strstr(file, "/..") || + (strncmp(file, "man", 3) && strncmp(file, "cat", 3))); } static void @@ -1029,7 +1029,7 @@ main(void) if (setitimer(ITIMER_VIRTUAL, &itimer, NULL) == -1) { fprintf(stderr, "setitimer: %s\n", strerror(errno)); pg_error_internal(); - return(EXIT_FAILURE); + return EXIT_FAILURE; } /* Scan our run-time environment. */ @@ -1041,7 +1041,7 @@ main(void) fprintf(stderr, "unsafe SCRIPT_NAME \"%s\"\n", scriptname); pg_error_internal(); - return(EXIT_FAILURE); + return EXIT_FAILURE; } /* @@ -1054,7 +1054,7 @@ main(void) fprintf(stderr, "MAN_DIR: %s: %s\n", MAN_DIR, strerror(errno)); pg_error_internal(); - return(EXIT_FAILURE); + return EXIT_FAILURE; } memset(&req, 0, sizeof(struct req)); @@ -1070,13 +1070,13 @@ main(void) else if ( ! validate_manpath(&req, req.q.manpath)) { pg_error_badrequest( "You specified an invalid manpath."); - return(EXIT_FAILURE); + return EXIT_FAILURE; } if ( ! (NULL == req.q.arch || validate_urifrag(req.q.arch))) { pg_error_badrequest( "You specified an invalid architecture."); - return(EXIT_FAILURE); + return EXIT_FAILURE; } /* Dispatch to the three different pages. */ @@ -1101,7 +1101,7 @@ main(void) for (i = 0; i < (int)req.psz; i++) free(req.p[i]); free(req.p); - return(EXIT_SUCCESS); + return EXIT_SUCCESS; } /* diff --git a/usr.bin/mandoc/chars.c b/usr.bin/mandoc/chars.c index a606e72b385..9522fc71ead 100644 --- a/usr.bin/mandoc/chars.c +++ b/usr.bin/mandoc/chars.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chars.c,v 1.36 2015/02/17 20:33:44 schwarze Exp $ */ +/* $OpenBSD: chars.c,v 1.37 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014 Ingo Schwarze @@ -93,7 +93,7 @@ mchars_alloc(void) } tab->htab = htab; - return(tab); + return tab; } int @@ -102,7 +102,7 @@ mchars_spec2cp(const struct mchars *arg, const char *p, size_t sz) const struct ln *ln; ln = find(arg, p, sz); - return(ln != NULL ? ln->unicode : sz == 1 ? (unsigned char)*p : -1); + return ln != NULL ? ln->unicode : sz == 1 ? (unsigned char)*p : -1; } int @@ -111,7 +111,7 @@ mchars_num2char(const char *p, size_t sz) int i; i = mandoc_strntoi(p, sz, 10); - return(i >= 0 && i < 256 ? i : -1); + return i >= 0 && i < 256 ? i : -1; } int @@ -121,7 +121,7 @@ mchars_num2uc(const char *p, size_t sz) i = mandoc_strntoi(p, sz, 16); assert(i >= 0 && i <= 0x10FFFF); - return(i); + return i; } const char * @@ -133,11 +133,11 @@ mchars_spec2str(const struct mchars *arg, ln = find(arg, p, sz); if (ln == NULL) { *rsz = 1; - return(sz == 1 ? p : NULL); + return sz == 1 ? p : NULL; } *rsz = strlen(ln->ascii); - return(ln->ascii); + return ln->ascii; } const char * @@ -147,8 +147,8 @@ mchars_uc2str(int uc) for (i = 0; i < LINES_MAX; i++) if (uc == lines[i].unicode) - return(lines[i].ascii); - return(""); + return lines[i].ascii; + return ""; } static const struct ln * @@ -160,14 +160,14 @@ find(const struct mchars *tab, const char *p, size_t sz) assert(p); if (0 == sz || p[0] < PRINT_LO || p[0] > PRINT_HI) - return(NULL); + return NULL; hash = (int)p[0] - PRINT_LO; for (pp = tab->htab[hash]; pp; pp = pp->next) if (0 == strncmp(pp->code, p, sz) && '\0' == pp->code[(int)sz]) - return(pp); + return pp; - return(NULL); + return NULL; } diff --git a/usr.bin/mandoc/eqn.c b/usr.bin/mandoc/eqn.c index 9079978060e..fc521c890a6 100644 --- a/usr.bin/mandoc/eqn.c +++ b/usr.bin/mandoc/eqn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eqn.c,v 1.21 2015/03/03 22:22:20 bentley Exp $ */ +/* $OpenBSD: eqn.c,v 1.22 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -300,10 +300,10 @@ eqn_read(struct eqn_node **epp, int ln, while (' ' == *p || '\t' == *p) p++; if ('\0' == *p) - return(er); + return er; mandoc_vmsg(MANDOCERR_ARG_SKIP, ep->parse, ln, pos, "EN %s", p); - return(er); + return er; } /* @@ -322,7 +322,7 @@ eqn_read(struct eqn_node **epp, int ln, ep->sz += sz; strlcat(ep->data, p + pos, ep->sz + 1); strlcat(ep->data, " ", ep->sz + 1); - return(ROFF_IGN); + return ROFF_IGN; } struct eqn_node * @@ -337,7 +337,7 @@ eqn_alloc(int pos, int line, struct mparse *parse) p->eqn.pos = pos; p->gsize = EQN_DEFSIZE; - return(p); + return p; } /* @@ -351,9 +351,9 @@ eqn_def_find(struct eqn_node *ep, const char *key, size_t sz) for (i = 0; i < (int)ep->defsz; i++) if (ep->defs[i].keysz && STRNEQ(ep->defs[i].key, ep->defs[i].keysz, key, sz)) - return(&ep->defs[i]); + return &ep->defs[i]; - return(NULL); + return NULL; } /* @@ -380,7 +380,7 @@ again: if (lim >= EQN_NEST_MAX) { mandoc_msg(MANDOCERR_ROFFLOOP, ep->parse, ep->eqn.ln, ep->eqn.pos, NULL); - return(NULL); + return NULL; } ep->cur = ep->rew; @@ -388,7 +388,7 @@ again: q = 0; if ('\0' == *start) - return(NULL); + return NULL; if (quote == *start) { ep->cur++; @@ -430,7 +430,7 @@ again: /* Quotes aren't expanded for values. */ if (q || ! repl) - return(start); + return start; if (NULL != (def = eqn_def_find(ep, start, *sz))) { diff = def->valsz - *sz; @@ -449,7 +449,7 @@ again: goto again; } - return(start); + return start; } /* @@ -460,7 +460,7 @@ static const char * eqn_nexttok(struct eqn_node *ep, size_t *sz) { - return(eqn_next(ep, '"', sz, 1)); + return eqn_next(ep, '"', sz, 1); } /* @@ -470,7 +470,7 @@ static const char * eqn_nextrawtok(struct eqn_node *ep, size_t *sz) { - return(eqn_next(ep, '"', sz, 0)); + return eqn_next(ep, '"', sz, 0); } /* @@ -496,12 +496,12 @@ eqn_tok_parse(struct eqn_node *ep, char **p) quoted = ep->data[ep->cur] == '"'; if (NULL == (start = eqn_nexttok(ep, &sz))) - return(EQN_TOK_EOF); + return EQN_TOK_EOF; if (quoted) { if (p != NULL) *p = mandoc_strndup(start, sz); - return(EQN_TOK__MAX); + return EQN_TOK__MAX; } for (i = 0; i < EQN_TOK__MAX; i++) { @@ -514,7 +514,7 @@ eqn_tok_parse(struct eqn_node *ep, char **p) if (i == EQN_TOK__MAX && NULL != p) *p = mandoc_strndup(start, sz); - return(i); + return i; } static void @@ -555,7 +555,7 @@ eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent) parent->first = bp; parent->last = bp; - return(bp); + return bp; } /* @@ -585,7 +585,7 @@ eqn_box_makebinary(struct eqn_node *ep, newb->first = newb->last = b; newb->first->next = NULL; b->parent = newb; - return(newb); + return newb; } /* @@ -710,7 +710,7 @@ eqn_parse(struct eqn_node *ep, struct eqn_box *parent) */ if (ep->data == NULL) - return(ROFF_IGN); + return ROFF_IGN; next_tok: tok = eqn_tok_parse(ep, &p); @@ -1058,7 +1058,7 @@ this_tok: * End of file! * TODO: make sure we're not in an open subexpression. */ - return(ROFF_EQN); + return ROFF_EQN; default: assert(tok == EQN_TOK__MAX); assert(NULL != p); @@ -1102,7 +1102,7 @@ eqn_end(struct eqn_node **epp) ep->eqn.root = mandoc_calloc(1, sizeof(struct eqn_box)); ep->eqn.root->expectargs = UINT_MAX; - return(eqn_parse(ep, ep->eqn.root)); + return eqn_parse(ep, ep->eqn.root); } void diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index e3062b8c3be..b33d43917fc 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.57 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.58 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze @@ -143,7 +143,7 @@ html_alloc(const struct mchars *mchars, const struct manoutput *outopts) if (outopts->fragment) h->oflags |= HTML_FRAGMENT; - return(h); + return h; } void @@ -279,7 +279,7 @@ html_strlen(const char *cp) cp++; switch (mandoc_escape(&cp, NULL, NULL)) { case ESCAPE_ERROR: - return(sz); + return sz; case ESCAPE_UNICODE: /* FALLTHROUGH */ case ESCAPE_NUMBERED: @@ -299,7 +299,7 @@ html_strlen(const char *cp) break; } } - return(sz); + return sz; } static int @@ -328,9 +328,9 @@ print_escape(char c) case ASCII_BREAK: break; default: - return(0); + return 0; } - return(1); + return 1; } static int @@ -430,7 +430,7 @@ print_encode(struct html *h, const char *p, int norecurse) putchar(c); } - return(nospace); + return nospace; } static void @@ -492,7 +492,7 @@ print_otag(struct html *h, enum htmltag tag, if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags) putchar('\n'); - return(t); + return t; } static void diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index 76694b39c58..c06cefcfe74 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.149 2015/07/28 18:38:05 schwarze Exp $ */ +/* $OpenBSD: main.c,v 1.150 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -139,7 +139,7 @@ main(int argc, char *argv[]) if (0 == strncmp(progname, "mandocdb", 8) || 0 == strncmp(progname, "makewhatis", 10)) - return(mandocdb(argc, argv)); + return mandocdb(argc, argv); /* Search options. */ @@ -200,13 +200,13 @@ main(int argc, char *argv[]) fprintf(stderr, "%s: -I %s: Bad argument\n", progname, optarg); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } if (defos) { fprintf(stderr, "%s: -I %s: Duplicate argument\n", progname, optarg); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } defos = mandoc_strdup(optarg + 3); break; @@ -215,7 +215,7 @@ main(int argc, char *argv[]) break; case 'K': if ( ! koptions(&options, optarg)) - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; break; case 'k': search.argmode = ARG_EXPR; @@ -244,11 +244,11 @@ main(int argc, char *argv[]) break; case 'T': if ( ! toptions(&curp, optarg)) - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; break; case 'W': if ( ! woptions(&curp, optarg)) - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; break; case 'w': outmode = OUTMODE_FLN; @@ -397,7 +397,7 @@ main(int argc, char *argv[]) /* mandoc(1) */ if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; if (use_pager && ! isatty(STDOUT_FILENO)) use_pager = 0; @@ -481,7 +481,7 @@ out: tag_unlink(); } - return((int)rc); + return (int)rc; } static void @@ -559,7 +559,7 @@ fs_lookup(const struct manpaths *paths, size_t ipath, file = mandoc_strdup(*globinfo.gl_pathv); globfree(&globinfo); if (globres != 0) - return(0); + return 0; found: fprintf(stderr, "%s: outdated mandoc.db lacks %s(%s) entry, run " @@ -573,7 +573,7 @@ found: page->bits = NAME_FILE & NAME_MASK; page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10; page->form = form; - return(1); + return 1; } static void @@ -798,9 +798,9 @@ koptions(int *options, char *arg) } else { fprintf(stderr, "%s: -K %s: Bad argument\n", progname, arg); - return(0); + return 0; } - return(1); + return 1; } static int @@ -818,10 +818,10 @@ moptions(int *options, char *arg) else { fprintf(stderr, "%s: -m %s: Bad argument\n", progname, arg); - return(0); + return 0; } - return(1); + return 1; } static int @@ -852,10 +852,10 @@ toptions(struct curparse *curp, char *arg) else { fprintf(stderr, "%s: -T %s: Bad argument\n", progname, arg); - return(0); + return 0; } - return(1); + return 1; } static int @@ -895,11 +895,11 @@ woptions(struct curparse *curp, char *arg) default: fprintf(stderr, "%s: -W %s: Bad argument\n", progname, o); - return(0); + return 0; } } - return(1); + return 1; } static void @@ -980,7 +980,7 @@ spawn_pager(struct tag_files *tag_files) case 0: break; default: - return(pager_pid); + return pager_pid; } /* The child process becomes the pager. */ diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 828bbfafd7e..d0f023136f9 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man.c,v 1.112 2015/09/04 21:24:26 schwarze Exp $ */ +/* $OpenBSD: man.c,v 1.113 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -60,9 +60,9 @@ man_parseln(struct roff_man *man, int ln, char *buf, int offs) if (man->last->type != ROFFT_EQN || ln > man->last->line) man->flags |= MAN_NEWLINE; - return (roff_getcontrol(man->roff, buf, &offs) ? + return roff_getcontrol(man->roff, buf, &offs) ? man_pmacro(man, ln, buf, offs) : - man_ptext(man, ln, buf, offs)); + man_ptext(man, ln, buf, offs); } static void @@ -95,7 +95,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) if (man->flags & MAN_LITERAL) { roff_word_alloc(man, line, offs, buf + offs); man_descope(man, line, offs); - return(1); + return 1; } for (i = offs; buf[i] == ' '; i++) @@ -113,7 +113,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) roff_elem_alloc(man, line, offs, MAN_sp); man->next = ROFF_NEXT_SIBLING; } - return(1); + return 1; } /* @@ -150,7 +150,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) man->last->flags |= MAN_EOS; man_descope(man, line, offs); - return(1); + return 1; } static int @@ -181,7 +181,7 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs) if (tok == TOKEN_NONE) { mandoc_msg(MANDOCERR_MACRO, man->parse, ln, ppos, buf + ppos - 1); - return(1); + return 1; } /* Skip a leading escape sequence or tab. */ @@ -232,7 +232,7 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs) n = man->last; if (n->type == ROFFT_BODY && strcmp(n->prev->child->string, "NAME")) - return(2); + return 2; } /* @@ -243,14 +243,14 @@ man_pmacro(struct roff_man *man, int ln, char *buf, int offs) if ( ! bline || man->flags & MAN_ELINE || man_macros[tok].flags & MAN_NSCOPED) - return(1); + return 1; assert(man->flags & MAN_BLINE); man->flags &= ~MAN_BLINE; man_unscope(man, man->last->parent); roff_body_alloc(man, ln, ppos, man->last->tok); - return(1); + return 1; } void @@ -328,5 +328,5 @@ man_mparse(const struct roff_man *man) { assert(man && man->parse); - return(man->parse); + return man->parse; } diff --git a/usr.bin/mandoc/man_hash.c b/usr.bin/mandoc/man_hash.c index 5e6d90020cb..be57bc5d07b 100644 --- a/usr.bin/mandoc/man_hash.c +++ b/usr.bin/mandoc/man_hash.c @@ -1,6 +1,7 @@ -/* $OpenBSD: man_hash.c,v 1.23 2015/04/19 13:59:37 schwarze Exp $ */ +/* $OpenBSD: man_hash.c,v 1.24 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -79,20 +80,20 @@ man_hash_find(const char *tmp) int tok; if ('\0' == (x = tmp[0])) - return(TOKEN_NONE); + return TOKEN_NONE; if ( ! (isalpha((unsigned char)x))) - return(TOKEN_NONE); + return TOKEN_NONE; HASH_ROW(x); for (i = 0; i < HASH_DEPTH; i++) { if (UCHAR_MAX == (y = table[x + i])) - return(TOKEN_NONE); + return TOKEN_NONE; tok = y; if (0 == strcmp(tmp, man_macronames[tok])) - return(tok); + return tok; } - return(TOKEN_NONE); + return TOKEN_NONE; } diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index 9a8407156b5..a1adad2cda1 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.71 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.72 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -276,11 +276,11 @@ a2width(const struct roff_node *n, struct roffsu *su) { if (n->type != ROFFT_TEXT) - return(0); + return 0; if (a2roffsu(n->string, su, SCALE_EN)) - return(1); + return 1; - return(0); + return 0; } static void @@ -369,7 +369,7 @@ man_br_pre(MAN_ARGS) /* So the div isn't empty: */ print_text(h, "\\~"); - return(0); + return 0; } static int @@ -381,12 +381,12 @@ man_SH_pre(MAN_ARGS) mh->fl &= ~MANH_LITERAL; PAIR_CLASS_INIT(&tag, "section"); print_otag(h, TAG_DIV, 1, &tag); - return(1); + return 1; } else if (n->type == ROFFT_BODY) - return(1); + return 1; print_otag(h, TAG_H1, 0, NULL); - return(1); + return 1; } static int @@ -442,7 +442,7 @@ man_alt_pre(MAN_ARGS) if (savelit) mh->fl |= MANH_LITERAL; - return(0); + return 0; } static int @@ -452,7 +452,7 @@ man_SM_pre(MAN_ARGS) print_otag(h, TAG_SMALL, 0, NULL); if (MAN_SB == n->tok) print_otag(h, TAG_B, 0, NULL); - return(1); + return 1; } static int @@ -464,12 +464,12 @@ man_SS_pre(MAN_ARGS) mh->fl &= ~MANH_LITERAL; PAIR_CLASS_INIT(&tag, "subsection"); print_otag(h, TAG_DIV, 1, &tag); - return(1); + return 1; } else if (n->type == ROFFT_BODY) - return(1); + return 1; print_otag(h, TAG_H2, 0, NULL); - return(1); + return 1; } static int @@ -477,11 +477,11 @@ man_PP_pre(MAN_ARGS) { if (n->type == ROFFT_HEAD) - return(0); + return 0; else if (n->type == ROFFT_BLOCK) print_bvspace(h, n); - return(1); + return 1; } static int @@ -491,10 +491,10 @@ man_IP_pre(MAN_ARGS) if (n->type == ROFFT_BODY) { print_otag(h, TAG_DD, 0, NULL); - return(1); + return 1; } else if (n->type != ROFFT_HEAD) { print_otag(h, TAG_DL, 0, NULL); - return(1); + return 1; } /* FIXME: width specification. */ @@ -518,7 +518,7 @@ man_IP_pre(MAN_ARGS) } } - return(0); + return 0; } static int @@ -529,9 +529,9 @@ man_HP_pre(MAN_ARGS) const struct roff_node *np; if (n->type == ROFFT_HEAD) - return(0); + return 0; else if (n->type != ROFFT_BLOCK) - return(1); + return 1; np = n->head->child; @@ -547,7 +547,7 @@ man_HP_pre(MAN_ARGS) PAIR_STYLE_INIT(&tag[0], h); PAIR_CLASS_INIT(&tag[1], "spacer"); print_otag(h, TAG_DIV, 2, tag); - return(1); + return 1; } static int @@ -576,7 +576,7 @@ man_OP_pre(MAN_ARGS) print_stagq(h, tt); h->flags |= HTML_NOSPACE; print_text(h, "]"); - return(0); + return 0; } static int @@ -584,7 +584,7 @@ man_B_pre(MAN_ARGS) { print_otag(h, TAG_B, 0, NULL); - return(1); + return 1; } static int @@ -592,7 +592,7 @@ man_I_pre(MAN_ARGS) { print_otag(h, TAG_I, 0, NULL); - return(1); + return 1; } static int @@ -605,7 +605,7 @@ man_literal_pre(MAN_ARGS) } else mh->fl |= MANH_LITERAL; - return(0); + return 0; } static int @@ -613,14 +613,14 @@ man_in_pre(MAN_ARGS) { print_otag(h, TAG_BR, 0, NULL); - return(0); + return 0; } static int man_ign_pre(MAN_ARGS) { - return(0); + return 0; } static int @@ -630,9 +630,9 @@ man_RS_pre(MAN_ARGS) struct roffsu su; if (n->type == ROFFT_HEAD) - return(0); + return 0; else if (n->type == ROFFT_BODY) - return(1); + return 1; SCALE_HS_INIT(&su, INDENT); if (n->head->child) @@ -642,7 +642,7 @@ man_RS_pre(MAN_ARGS) bufcat_su(h, "margin-left", &su); PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); - return(1); + return 1; } static int @@ -665,5 +665,5 @@ man_UR_pre(MAN_ARGS) print_man_nodelist(man, n->child, mh, h); - return(0); + return 0; } diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index 166c60023ae..997ab2c6cd1 100644 --- a/usr.bin/mandoc/man_macro.c +++ b/usr.bin/mandoc/man_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_macro.c,v 1.73 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: man_macro.c,v 1.74 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze @@ -418,8 +418,8 @@ man_args(struct roff_man *man, int line, int *pos, char *buf, char **v) assert(' ' != *start); if ('\0' == *start) - return(0); + return 0; *v = mandoc_getarg(man->parse, v, line, pos); - return(1); + return 1; } diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 1fca9ac7e9d..d51182c28a6 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_term.c,v 1.137 2015/09/21 13:24:32 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.138 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -210,7 +210,7 @@ static int pre_ign(DECL_ARGS) { - return(0); + return 0; } static int @@ -218,7 +218,7 @@ pre_ll(DECL_ARGS) { term_setwidth(p, n->nchild ? n->child->string : NULL); - return(0); + return 0; } static int @@ -226,7 +226,7 @@ pre_I(DECL_ARGS) { term_fontrepl(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -253,7 +253,7 @@ pre_literal(DECL_ARGS) p->flags |= TERMP_NOSPACE; } - return(0); + return 0; } static int @@ -264,12 +264,12 @@ pre_PD(DECL_ARGS) n = n->child; if (n == NULL) { mt->pardist = 1; - return(0); + return 0; } assert(n->type == ROFFT_TEXT); if (a2roffsu(n->string, &su, SCALE_VS)) mt->pardist = term_vspan(p, &su); - return(0); + return 0; } static int @@ -323,7 +323,7 @@ pre_alternate(DECL_ARGS) p->flags |= TERMP_NOSPACE; } - return(0); + return 0; } static int @@ -331,7 +331,7 @@ pre_B(DECL_ARGS) { term_fontrepl(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -353,7 +353,7 @@ pre_OP(DECL_ARGS) term_fontrepl(p, TERMFONT_NONE); p->flags |= TERMP_NOSPACE; term_word(p, "]"); - return(0); + return 0; } static int @@ -363,7 +363,7 @@ pre_ft(DECL_ARGS) if (NULL == n->child) { term_fontlast(p); - return(0); + return 0; } cp = n->child->string; @@ -393,7 +393,7 @@ pre_ft(DECL_ARGS) default: break; } - return(0); + return 0; } static int @@ -408,7 +408,7 @@ pre_in(DECL_ARGS) if (NULL == n->child) { p->offset = mt->offset; - return(0); + return 0; } cp = n->child->string; @@ -422,7 +422,7 @@ pre_in(DECL_ARGS) cp--; if ( ! a2roffsu(++cp, &su, SCALE_EN)) - return(0); + return 0; v = (term_hspan(p, &su) + 11) / 24; @@ -435,7 +435,7 @@ pre_in(DECL_ARGS) if (p->offset > SHRT_MAX) p->offset = term_len(p, p->defindent); - return(0); + return 0; } static int @@ -456,7 +456,7 @@ pre_sp(DECL_ARGS) /* FALLTHROUGH */ case MAN_P: /* FALLTHROUGH */ - return(0); + return 0; default: break; } @@ -491,7 +491,7 @@ pre_sp(DECL_ARGS) p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); } - return(0); + return 0; } static int @@ -504,11 +504,11 @@ pre_HP(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: print_bvspace(p, n, mt->pardist); - return(1); + return 1; case ROFFT_BODY: break; default: - return(0); + return 0; } if ( ! (MANT_LITERAL & mt->fl)) { @@ -531,7 +531,7 @@ pre_HP(DECL_ARGS) p->offset = mt->offset; p->rmargin = mt->offset + len; - return(1); + return 1; } static void @@ -576,7 +576,7 @@ pre_PP(DECL_ARGS) break; } - return(n->type != ROFFT_HEAD); + return n->type != ROFFT_HEAD; } static int @@ -598,7 +598,7 @@ pre_IP(DECL_ARGS) print_bvspace(p, n, mt->pardist); /* FALLTHROUGH */ default: - return(1); + return 1; } /* Calculate the offset from the optional second argument. */ @@ -628,7 +628,7 @@ pre_IP(DECL_ARGS) if (savelit) mt->fl |= MANT_LITERAL; - return(0); + return 0; case ROFFT_BODY: p->offset = mt->offset + len; p->rmargin = p->maxrmargin; @@ -637,7 +637,7 @@ pre_IP(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -679,7 +679,7 @@ pre_TP(DECL_ARGS) print_bvspace(p, n, mt->pardist); /* FALLTHROUGH */ default: - return(1); + return 1; } /* Calculate offset. */ @@ -716,7 +716,7 @@ pre_TP(DECL_ARGS) if (savelit) mt->fl |= MANT_LITERAL; - return(0); + return 0; case ROFFT_BODY: p->offset = mt->offset + len; p->rmargin = p->maxrmargin; @@ -727,7 +727,7 @@ pre_TP(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -790,7 +790,7 @@ pre_SS(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -851,7 +851,7 @@ pre_SH(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -878,9 +878,9 @@ pre_RS(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: term_newln(p); - return(1); + return 1; case ROFFT_HEAD: - return(0); + return 0; default: break; } @@ -904,7 +904,7 @@ pre_RS(DECL_ARGS) mt->lmargincur = mt->lmarginsz; mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); - return(1); + return 1; } static void @@ -932,7 +932,7 @@ static int pre_UR(DECL_ARGS) { - return (n->type != ROFFT_HEAD); + return n->type != ROFFT_HEAD; } static void diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index a8c25a8ddba..4c1d763ac8c 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.c,v 1.61 2015/08/29 22:39:59 schwarze Exp $ */ +/* $OpenBSD: mandoc.c,v 1.62 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze @@ -81,7 +81,7 @@ mandoc_escape(const char **end, const char **start, int *sz) break; case 'C': if ('\'' != **start) - return(ESCAPE_ERROR); + return ESCAPE_ERROR; *start = ++*end; gly = ESCAPE_SPECIAL; term = '\''; @@ -97,7 +97,7 @@ mandoc_escape(const char **end, const char **start, int *sz) case ',': /* FALLTHROUGH */ case '/': - return(ESCAPE_IGNORE); + return ESCAPE_IGNORE; /* * The \z escape is supposed to output the following @@ -106,7 +106,7 @@ mandoc_escape(const char **end, const char **start, int *sz) * let us just skip the next character. */ case 'z': - return(ESCAPE_SKIPCHAR); + return ESCAPE_SKIPCHAR; /* * Handle all triggers matching \X(xy, \Xx, and \X[xxxx], where @@ -167,7 +167,7 @@ mandoc_escape(const char **end, const char **start, int *sz) /* FALLTHROUGH */ case 'o': if (**start == '\0') - return(ESCAPE_ERROR); + return ESCAPE_ERROR; if (gly == ESCAPE_ERROR) gly = ESCAPE_OVERSTRIKE; term = **start; @@ -194,7 +194,7 @@ mandoc_escape(const char **end, const char **start, int *sz) if (strchr(" %&()*+-./0123456789:<=>", **start)) { if ('\0' != **start) ++*end; - return(ESCAPE_ERROR); + return ESCAPE_ERROR; } gly = ESCAPE_IGNORE; term = **start; @@ -207,11 +207,11 @@ mandoc_escape(const char **end, const char **start, int *sz) */ case 'N': if ('\0' == **start) - return(ESCAPE_ERROR); + return ESCAPE_ERROR; (*end)++; if (isdigit((unsigned char)**start)) { *sz = 1; - return(ESCAPE_IGNORE); + return ESCAPE_IGNORE; } (*start)++; while (isdigit((unsigned char)**end)) @@ -219,7 +219,7 @@ mandoc_escape(const char **end, const char **start, int *sz) *sz = *end - *start; if ('\0' != **end) (*end)++; - return(ESCAPE_NUMBERED); + return ESCAPE_NUMBERED; /* * Sizes get a special category of their own. @@ -281,12 +281,12 @@ mandoc_escape(const char **end, const char **start, int *sz) while (**end != term) { switch (**end) { case '\0': - return(ESCAPE_ERROR); + return ESCAPE_ERROR; case '\\': (*end)++; if (ESCAPE_ERROR == mandoc_escape(end, NULL, NULL)) - return(ESCAPE_ERROR); + return ESCAPE_ERROR; break; default: (*end)++; @@ -297,7 +297,7 @@ mandoc_escape(const char **end, const char **start, int *sz) } else { assert(*sz > 0); if ((size_t)*sz > strlen(*start)) - return(ESCAPE_ERROR); + return ESCAPE_ERROR; *end += *sz; } @@ -365,7 +365,7 @@ mandoc_escape(const char **end, const char **start, int *sz) break; } - return(gly); + return gly; } /* @@ -460,7 +460,7 @@ mandoc_getarg(struct mparse *parse, char **cpp, int ln, int *pos) if ('\0' == *cp && (white || ' ' == cp[-1])) mandoc_msg(MANDOCERR_SPACE_EOL, parse, ln, *pos, NULL); - return(start); + return start; } static int @@ -474,10 +474,10 @@ a2time(time_t *t, const char *fmt, const char *p) pp = strptime(p, fmt, &tm); if (NULL != pp && '\0' == *pp) { *t = mktime(&tm); - return(1); + return 1; } - return(0); + return 0; } static char * @@ -490,7 +490,7 @@ time2a(time_t t) tm = localtime(&t); if (tm == NULL) - return(NULL); + return NULL; /* * Reserve space: @@ -510,11 +510,11 @@ time2a(time_t t) if (0 == strftime(p, 4 + 1, "%Y", tm)) goto fail; - return(buf); + return buf; fail: free(buf); - return(NULL); + return NULL; } char * @@ -536,7 +536,7 @@ mandoc_normdate(struct mparse *parse, char *in, int ln, int pos) t = 0; } out = t ? time2a(t) : NULL; - return(out ? out : mandoc_strdup(in)); + return out ? out : mandoc_strdup(in); } int @@ -546,7 +546,7 @@ mandoc_eos(const char *p, size_t sz) int enclosed, found; if (0 == sz) - return(0); + return 0; /* * End-of-sentence recognition must include situations where @@ -575,11 +575,12 @@ mandoc_eos(const char *p, size_t sz) found = 1; break; default: - return(found && (!enclosed || isalnum((unsigned char)*q))); + return found && + (!enclosed || isalnum((unsigned char)*q)); } } - return(found && !enclosed); + return found && !enclosed; } /* @@ -594,7 +595,7 @@ mandoc_strntoi(const char *p, size_t sz, int base) long v; if (sz > 31) - return(-1); + return -1; memcpy(buf, p, sz); buf[(int)sz] = '\0'; @@ -603,12 +604,12 @@ mandoc_strntoi(const char *p, size_t sz, int base) v = strtol(buf, &ep, base); if (buf[0] == '\0' || *ep != '\0') - return(-1); + return -1; if (v > INT_MAX) v = INT_MAX; if (v < INT_MIN) v = INT_MIN; - return((int)v); + return (int)v; } diff --git a/usr.bin/mandoc/mandoc_aux.c b/usr.bin/mandoc/mandoc_aux.c index c7c51217ac5..d0219b1e038 100644 --- a/usr.bin/mandoc/mandoc_aux.c +++ b/usr.bin/mandoc/mandoc_aux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc_aux.c,v 1.4 2014/11/28 19:25:03 schwarze Exp $ */ +/* $OpenBSD: mandoc_aux.c,v 1.5 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -39,7 +39,7 @@ mandoc_asprintf(char **dest, const char *fmt, ...) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ret); + return ret; } void * @@ -52,7 +52,7 @@ mandoc_calloc(size_t num, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -65,7 +65,7 @@ mandoc_malloc(size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -77,7 +77,7 @@ mandoc_realloc(void *ptr, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -89,7 +89,7 @@ mandoc_reallocarray(void *ptr, size_t num, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } char * @@ -102,7 +102,7 @@ mandoc_strdup(const char *ptr) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(p); + return p; } char * @@ -113,5 +113,5 @@ mandoc_strndup(const char *ptr, size_t sz) p = mandoc_malloc(sz + 1); memcpy(p, ptr, sz); p[(int)sz] = '\0'; - return(p); + return p; } diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c index 10c436ad90e..027ae57078f 100644 --- a/usr.bin/mandoc/mandocdb.c +++ b/usr.bin/mandoc/mandocdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandocdb.c,v 1.149 2015/09/16 09:49:48 schwarze Exp $ */ +/* $OpenBSD: mandocdb.c,v 1.150 2015/10/06 18:30:43 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze @@ -537,7 +537,7 @@ out: mpages_free(); ohash_delete(&mpages); ohash_delete(&mlinks); - return(exitcode); + return exitcode; usage: fprintf(stderr, "usage: %s [-aDnpQ] [-C file] [-Tutf8]\n" " %s [-aDnpQ] [-Tutf8] dir ...\n" @@ -547,7 +547,7 @@ usage: progname, progname, progname, progname, progname); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } /* @@ -584,7 +584,7 @@ treescan(void) if (NULL == f) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&fts_open"); - return(0); + return 0; } dsec = arch = NULL; @@ -749,7 +749,7 @@ treescan(void) } fts_close(f); - return(1); + return 1; } /* @@ -1586,7 +1586,7 @@ parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, if (SEC_SYNOPSIS != n->sec || NULL == (n = n->child) || n->type != ROFFT_TEXT) - return(0); + return 0; /* * Only consider those `Fd' macro fields that begin with an @@ -1594,10 +1594,10 @@ parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, */ if (strcmp("#include", n->string)) - return(0); + return 0; if ((n = n->next) == NULL || n->type != ROFFT_TEXT) - return(0); + return 0; /* * Strip away the enclosing angle brackets and make sure we're @@ -1609,7 +1609,7 @@ parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, start++; if (0 == (sz = strlen(start))) - return(0); + return 0; end = &start[(int)sz - 1]; if ('>' == *end || '"' == *end) @@ -1617,7 +1617,7 @@ parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, if (end > start) putkeys(mpage, start, end - start + 1, TYPE_In); - return(0); + return 0; } static void @@ -1647,7 +1647,7 @@ parse_mdoc_Fn(struct mpage *mpage, const struct roff_meta *meta, { if (n->child == NULL) - return(0); + return 0; parse_mdoc_fname(mpage, n->child); @@ -1655,7 +1655,7 @@ parse_mdoc_Fn(struct mpage *mpage, const struct roff_meta *meta, if (n->type == ROFFT_TEXT) putkey(mpage, n->string, TYPE_Fa); - return(0); + return 0; } static int @@ -1664,12 +1664,12 @@ parse_mdoc_Fo(struct mpage *mpage, const struct roff_meta *meta, { if (n->type != ROFFT_HEAD) - return(1); + return 1; if (n->child != NULL) parse_mdoc_fname(mpage, n->child); - return(0); + return 0; } static int @@ -1679,17 +1679,17 @@ parse_mdoc_Xr(struct mpage *mpage, const struct roff_meta *meta, char *cp; if (NULL == (n = n->child)) - return(0); + return 0; if (NULL == n->next) { putkey(mpage, n->string, TYPE_Xr); - return(0); + return 0; } mandoc_asprintf(&cp, "%s(%s)", n->string, n->next->string); putkey(mpage, cp, TYPE_Xr); free(cp); - return(0); + return 0; } static int @@ -1699,7 +1699,7 @@ parse_mdoc_Nd(struct mpage *mpage, const struct roff_meta *meta, if (n->type == ROFFT_BODY) deroff(&mpage->desc, n); - return(0); + return 0; } static int @@ -1721,7 +1721,7 @@ parse_mdoc_Nm(struct mpage *mpage, const struct roff_meta *meta, putkey(mpage, n->child->string, ROFFT_HEAD); mpage->name_head_done = 1; } - return(0); + return 0; } static int @@ -1729,7 +1729,7 @@ parse_mdoc_Sh(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { - return(n->sec == SEC_CUSTOM && n->type == ROFFT_HEAD); + return n->sec == SEC_CUSTOM && n->type == ROFFT_HEAD; } static int @@ -1737,7 +1737,7 @@ parse_mdoc_head(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { - return(n->type == ROFFT_HEAD); + return n->type == ROFFT_HEAD; } static int @@ -1745,7 +1745,7 @@ parse_mdoc_body(struct mpage *mpage, const struct roff_meta *meta, const struct roff_node *n) { - return(n->type == ROFFT_BODY); + return n->type == ROFFT_BODY; } /* @@ -1850,10 +1850,10 @@ utf8(unsigned int cp, char out[7]) out[4] = (cp >> 6 & 63) | 128; out[5] = (cp & 63) | 128; } else - return(0); + return 0; out[rc] = '\0'; - return(rc); + return rc; } /* @@ -1977,9 +1977,9 @@ render_string(char **public, size_t *psz) --*psz; if (dst != NULL) { (*public)[*psz] = '\0'; - return(1); + return 1; } else - return(0); + return 0; } static void @@ -2246,7 +2246,7 @@ dbopen(int real) int rc, ofl; if (nodb) - return(1); + return 1; *tempfilename = '\0'; ofl = SQLITE_OPEN_READWRITE; @@ -2257,7 +2257,7 @@ dbopen(int real) exitcode = (int)MANDOCLEVEL_SYSERR; if (SQLITE_CANTOPEN != rc) say(MANDOC_DB, "%s", sqlite3_errstr(rc)); - return(0); + return 0; } goto prepare_statements; } @@ -2271,7 +2271,7 @@ dbopen(int real) if (MPARSE_QUICK & mparse_options) { exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB "~", "%s", sqlite3_errstr(rc)); - return(0); + return 0; } (void)strlcpy(tempfilename, "/tmp/mandocdb.XXXXXX", @@ -2279,7 +2279,7 @@ dbopen(int real) if (NULL == mkdtemp(tempfilename)) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&%s", tempfilename); - return(0); + return 0; } (void)strlcat(tempfilename, "/" MANDOC_DB, sizeof(tempfilename)); @@ -2287,7 +2287,7 @@ dbopen(int real) if (SQLITE_OK != rc) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "%s: %s", tempfilename, sqlite3_errstr(rc)); - return(0); + return 0; } create_tables: @@ -2326,7 +2326,7 @@ create_tables: exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB, "%s", sqlite3_errmsg(db)); sqlite3_close(db); - return(0); + return 0; } prepare_statements: @@ -2336,7 +2336,7 @@ prepare_statements: say(MANDOC_DB, "PRAGMA foreign_keys: %s", sqlite3_errmsg(db)); sqlite3_close(db); - return(0); + return 0; } sql = "DELETE FROM mpages WHERE pageid IN " @@ -2369,24 +2369,24 @@ prepare_statements: say(MANDOC_DB, "PRAGMA synchronous: %s", sqlite3_errmsg(db)); sqlite3_close(db); - return(0); + return 0; } - return(1); + return 1; } static void * hash_calloc(size_t n, size_t sz, void *arg) { - return(mandoc_calloc(n, sz)); + return mandoc_calloc(n, sz); } static void * hash_alloc(size_t sz, void *arg) { - return(mandoc_malloc(sz)); + return mandoc_malloc(sz); } static void @@ -2435,12 +2435,12 @@ set_basedir(const char *targetdir, int report_baddir) if (2 == getcwd_status) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "getcwd: %s", startdir); - return(0); + return 0; } if (-1 == chdir(startdir)) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&chdir %s", startdir); - return(0); + return 0; } } @@ -2454,13 +2454,13 @@ set_basedir(const char *targetdir, int report_baddir) exitcode = (int)MANDOCLEVEL_BADARG; say("", "&%s: realpath", targetdir); } - return(0); + return 0; } else if (-1 == chdir(basedir)) { if (report_baddir || errno != ENOENT) { exitcode = (int)MANDOCLEVEL_BADARG; say("", "&chdir"); } - return(0); + return 0; } chdir_status = 1; cp = strchr(basedir, '\0'); @@ -2468,12 +2468,12 @@ set_basedir(const char *targetdir, int report_baddir) if (cp - basedir >= PATH_MAX - 1) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "Filename too long"); - return(0); + return 0; } *cp++ = '/'; *cp = '\0'; } - return(1); + return 1; } static void diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c index e4086c6116e..725b4e0920e 100644 --- a/usr.bin/mandoc/mansearch.c +++ b/usr.bin/mandoc/mansearch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.c,v 1.44 2015/04/01 12:48:00 schwarze Exp $ */ +/* $OpenBSD: mansearch.c,v 1.45 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015 Ingo Schwarze @@ -113,7 +113,7 @@ mansearch_setup(int start) if (start) { if (NULL != pagecache) { fprintf(stderr, "pagecache already enabled\n"); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } pagecache = mmap(NULL, PC_PAGESIZE * PC_NUMPAGES, @@ -123,30 +123,30 @@ mansearch_setup(int start) if (MAP_FAILED == pagecache) { perror("mmap"); pagecache = NULL; - return((int)MANDOCLEVEL_SYSERR); + return (int)MANDOCLEVEL_SYSERR; } c = sqlite3_config(SQLITE_CONFIG_PAGECACHE, pagecache, PC_PAGESIZE, PC_NUMPAGES); if (SQLITE_OK == c) - return((int)MANDOCLEVEL_OK); + return (int)MANDOCLEVEL_OK; fprintf(stderr, "pagecache: %s\n", sqlite3_errstr(c)); } else if (NULL == pagecache) { fprintf(stderr, "pagecache missing\n"); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } if (-1 == munmap(pagecache, PC_PAGESIZE * PC_NUMPAGES)) { perror("munmap"); pagecache = NULL; - return((int)MANDOCLEVEL_SYSERR); + return (int)MANDOCLEVEL_SYSERR; } pagecache = NULL; - return((int)MANDOCLEVEL_OK); + return (int)MANDOCLEVEL_OK; } int @@ -172,7 +172,7 @@ mansearch(const struct mansearch *search, if (argc == 0 || (e = exprcomp(search, argc, argv)) == NULL) { *sz = 0; - return(0); + return 0; } info.calloc = hash_calloc; @@ -370,7 +370,7 @@ mansearch(const struct mansearch *search, exprfree(e); free(sql); *sz = cur; - return(1); + return 1; } void @@ -394,9 +394,9 @@ manpage_compare(const void *vp1, const void *vp2) mp1 = vp1; mp2 = vp2; - return( (diff = mp2->bits - mp1->bits) ? diff : - (diff = mp1->sec - mp2->sec) ? diff : - strcasecmp(mp1->names, mp2->names)); + return (diff = mp2->bits - mp1->bits) ? diff : + (diff = mp1->sec - mp2->sec) ? diff : + strcasecmp(mp1->names, mp2->names); } static void @@ -557,7 +557,7 @@ buildoutput(sqlite3 *db, sqlite3_stmt *s, uint64_t pageid, uint64_t outbit) if (SQLITE_DONE != c) fprintf(stderr, "%s\n", sqlite3_errmsg(db)); sqlite3_reset(s); - return(output); + return output; } /* @@ -652,7 +652,7 @@ sql_statement(const struct expr *e) needop = 1; } - return(sql); + return sql; } /* @@ -735,12 +735,12 @@ exprcomp(const struct mansearch *search, int argc, char *argv[]) toopen = logic = igncase = 0; } if ( ! (toopen || logic || igncase || toclose)) - return(first); + return first; fail: if (NULL != first) exprfree(first); - return(NULL); + return NULL; } static struct expr * @@ -753,7 +753,7 @@ exprterm(const struct mansearch *search, char *buf, int cs) int i, irc; if ('\0' == *buf) - return(NULL); + return NULL; e = mandoc_calloc(1, sizeof(struct expr)); @@ -761,7 +761,7 @@ exprterm(const struct mansearch *search, char *buf, int cs) e->bits = TYPE_Nm; e->substr = buf; e->equal = 1; - return(e); + return e; } /* @@ -799,12 +799,12 @@ exprterm(const struct mansearch *search, char *buf, int cs) regerror(irc, &e->regexp, errbuf, sizeof(errbuf)); fprintf(stderr, "regcomp: %s\n", errbuf); free(e); - return(NULL); + return NULL; } } if (e->bits) - return(e); + return e; /* * Parse out all possible fields. @@ -826,13 +826,13 @@ exprterm(const struct mansearch *search, char *buf, int cs) if (i == mansearch_keymax) { if (strcasecmp(key, "any")) { free(e); - return(NULL); + return NULL; } e->bits |= ~0ULL; } } - return(e); + return e; } static void @@ -851,14 +851,14 @@ static void * hash_calloc(size_t nmemb, size_t sz, void *arg) { - return(mandoc_calloc(nmemb, sz)); + return mandoc_calloc(nmemb, sz); } static void * hash_alloc(size_t sz, void *arg) { - return(mandoc_malloc(sz)); + return mandoc_malloc(sz); } static void diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c index 05952a28873..34683e5cd5e 100644 --- a/usr.bin/mandoc/mdoc.c +++ b/usr.bin/mandoc/mdoc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc.c,v 1.141 2015/04/23 16:17:04 schwarze Exp $ */ +/* $OpenBSD: mdoc.c,v 1.142 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -109,9 +109,9 @@ mdoc_parseln(struct roff_man *mdoc, int ln, char *buf, int offs) else mdoc->flags &= ~MDOC_SYNOPSIS; - return(roff_getcontrol(mdoc->roff, buf, &offs) ? + return roff_getcontrol(mdoc->roff, buf, &offs) ? mdoc_pmacro(mdoc, ln, buf, offs) : - mdoc_ptext(mdoc, ln, buf, offs)); + mdoc_ptext(mdoc, ln, buf, offs); } void @@ -164,7 +164,7 @@ mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, int tok, p->end = end; roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_SIBLING; - return(p); + return p; } struct roff_node * @@ -195,7 +195,7 @@ mdoc_block_alloc(struct roff_man *mdoc, int line, int pos, } roff_node_append(mdoc, p); mdoc->next = ROFF_NEXT_CHILD; - return(p); + return p; } void @@ -253,7 +253,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) /* `Bl' is open without any children. */ mdoc->flags |= MDOC_FREECOL; mdoc_macro(mdoc, MDOC_It, line, offs, &offs, buf); - return(1); + return 1; } if (n->tok == MDOC_It && n->type == ROFFT_BLOCK && @@ -263,7 +263,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) /* `Bl' has block-level `It' children. */ mdoc->flags |= MDOC_FREECOL; mdoc_macro(mdoc, MDOC_It, line, offs, &offs, buf); - return(1); + return 1; } /* @@ -323,13 +323,13 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) roff_elem_alloc(mdoc, line, offs, MDOC_sp); mdoc->next = ROFF_NEXT_SIBLING; mdoc_valid_post(mdoc); - return(1); + return 1; } roff_word_alloc(mdoc, line, offs, buf+offs); if (mdoc->flags & MDOC_LITERAL) - return(1); + return 1; /* * End-of-sentence check. If the last character is an unescaped @@ -341,7 +341,7 @@ mdoc_ptext(struct roff_man *mdoc, int line, char *buf, int offs) if (mandoc_eos(buf+offs, (size_t)(end-buf-offs))) mdoc->last->flags |= MDOC_EOS; - return(1); + return 1; } /* @@ -375,7 +375,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) if (tok == TOKEN_NONE) { mandoc_msg(MANDOCERR_MACRO, mdoc->parse, ln, sv, buf + sv - 1); - return(1); + return 1; } /* Skip a leading escape sequence or tab. */ @@ -414,7 +414,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) if (NULL == mdoc->last || MDOC_It == tok || MDOC_El == tok) { mdoc_macro(mdoc, tok, ln, sv, &offs, buf); - return(1); + return 1; } n = mdoc->last; @@ -429,7 +429,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) n->end == ENDBODY_NOT && n->norm->Bl.type == LIST_column) { mdoc->flags |= MDOC_FREECOL; mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf); - return(1); + return 1; } /* @@ -444,7 +444,7 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) LIST_column == n->parent->norm->Bl.type) { mdoc->flags |= MDOC_FREECOL; mdoc_macro(mdoc, MDOC_It, ln, sv, &sv, buf); - return(1); + return 1; } /* Normal processing of a macro. */ @@ -455,9 +455,9 @@ mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, int offs) if (mdoc->quick && MDOC_Sh == tok && SEC_NAME != mdoc->last->sec) - return(2); + return 2; - return(1); + return 1; } enum mdelim @@ -465,16 +465,16 @@ mdoc_isdelim(const char *p) { if ('\0' == p[0]) - return(DELIM_NONE); + return DELIM_NONE; if ('\0' == p[1]) switch (p[0]) { case '(': /* FALLTHROUGH */ case '[': - return(DELIM_OPEN); + return DELIM_OPEN; case '|': - return(DELIM_MIDDLE); + return DELIM_MIDDLE; case '.': /* FALLTHROUGH */ case ',': @@ -490,18 +490,18 @@ mdoc_isdelim(const char *p) case ')': /* FALLTHROUGH */ case ']': - return(DELIM_CLOSE); + return DELIM_CLOSE; default: - return(DELIM_NONE); + return DELIM_NONE; } if ('\\' != p[0]) - return(DELIM_NONE); + return DELIM_NONE; if (0 == strcmp(p + 1, ".")) - return(DELIM_CLOSE); + return DELIM_CLOSE; if (0 == strcmp(p + 1, "fR|\\fP")) - return(DELIM_MIDDLE); + return DELIM_MIDDLE; - return(DELIM_NONE); + return DELIM_NONE; } diff --git a/usr.bin/mandoc/mdoc_argv.c b/usr.bin/mandoc/mdoc_argv.c index 8f719383e0f..66869e0c57c 100644 --- a/usr.bin/mandoc/mdoc_argv.c +++ b/usr.bin/mandoc/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_argv.c,v 1.60 2015/04/19 13:59:37 schwarze Exp $ */ +/* $OpenBSD: mdoc_argv.c,v 1.61 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2014, 2015 Ingo Schwarze @@ -422,7 +422,7 @@ mdoc_args(struct roff_man *mdoc, int line, int *pos, v = &v_local; fl = tok == TOKEN_NONE ? ARGSFL_NONE : mdocargs[tok].flags; if (tok != MDOC_It) - return(args(mdoc, line, pos, buf, fl, v)); + return args(mdoc, line, pos, buf, fl, v); /* * We know that we're in an `It', so it's reasonable to expect @@ -438,7 +438,7 @@ mdoc_args(struct roff_man *mdoc, int line, int *pos, break; } - return(args(mdoc, line, pos, buf, fl, v)); + return args(mdoc, line, pos, buf, fl, v); } static enum margserr @@ -451,7 +451,7 @@ args(struct roff_man *mdoc, int line, int *pos, if ('\0' == buf[*pos]) { if (MDOC_PPHRASE & mdoc->flags) - return(ARGS_EOLN); + return ARGS_EOLN; /* * If we're not in a partial phrase and the flag for * being a phrase literal is still set, the punctuation @@ -462,14 +462,14 @@ args(struct roff_man *mdoc, int line, int *pos, mdoc->parse, line, *pos, NULL); mdoc->flags &= ~MDOC_PHRASELIT; - return(ARGS_EOLN); + return ARGS_EOLN; } *v = &buf[*pos]; if (ARGSFL_DELIM == fl) if (args_checkpunct(buf, *pos)) - return(ARGS_PUNCT); + return ARGS_PUNCT; /* * First handle TABSEP items, restricted to `Bl -column'. This @@ -536,7 +536,7 @@ args(struct roff_man *mdoc, int line, int *pos, for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++) /* Skip ahead. */ ; - return(rc); + return rc; } /* @@ -573,17 +573,17 @@ args(struct roff_man *mdoc, int line, int *pos, if ('\0' == buf[*pos]) { if (MDOC_PPHRASE & mdoc->flags) - return(ARGS_QWORD); + return ARGS_QWORD; mandoc_msg(MANDOCERR_ARG_QUOTE, mdoc->parse, line, *pos, NULL); - return(ARGS_QWORD); + return ARGS_QWORD; } mdoc->flags &= ~MDOC_PHRASELIT; buf[(*pos)++] = '\0'; if ('\0' == buf[*pos]) - return(ARGS_QWORD); + return ARGS_QWORD; while (' ' == buf[*pos]) (*pos)++; @@ -592,13 +592,13 @@ args(struct roff_man *mdoc, int line, int *pos, mandoc_msg(MANDOCERR_SPACE_EOL, mdoc->parse, line, *pos, NULL); - return(ARGS_QWORD); + return ARGS_QWORD; } p = &buf[*pos]; *v = mandoc_getarg(mdoc->parse, &p, line, pos); - return(ARGS_WORD); + return ARGS_WORD; } /* @@ -620,11 +620,11 @@ args_checkpunct(const char *buf, int i) dbuf[j] = buf[i]; if (DELIMSZ == j) - return(0); + return 0; dbuf[j] = '\0'; if (DELIM_CLOSE != mdoc_isdelim(dbuf)) - return(0); + return 0; while (' ' == buf[i]) i++; @@ -637,18 +637,18 @@ args_checkpunct(const char *buf, int i) dbuf[j++] = buf[i++]; if (DELIMSZ == j) - return(0); + return 0; dbuf[j] = '\0'; d = mdoc_isdelim(dbuf); if (DELIM_NONE == d || DELIM_OPEN == d) - return(0); + return 0; while (' ' == buf[i]) i++; } - return('\0' == buf[i]); + return '\0' == buf[i]; } static void diff --git a/usr.bin/mandoc/mdoc_hash.c b/usr.bin/mandoc/mdoc_hash.c index 27752438811..d480f6ab995 100644 --- a/usr.bin/mandoc/mdoc_hash.c +++ b/usr.bin/mandoc/mdoc_hash.c @@ -1,6 +1,7 @@ -/* $OpenBSD: mdoc_hash.c,v 1.20 2015/04/19 13:59:37 schwarze Exp $ */ +/* $OpenBSD: mdoc_hash.c,v 1.21 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -65,26 +66,26 @@ mdoc_hash_find(const char *p) int major, i, j; if (0 == p[0]) - return(TOKEN_NONE); + return TOKEN_NONE; if ( ! isalpha((unsigned char)p[0]) && '%' != p[0]) - return(TOKEN_NONE); + return TOKEN_NONE; if (isalpha((unsigned char)p[1])) major = 12 * (tolower((unsigned char)p[1]) - 97); else if ('1' == p[1]) major = 12 * 26; else - return(TOKEN_NONE); + return TOKEN_NONE; if (p[2] && p[3]) - return(TOKEN_NONE); + return TOKEN_NONE; for (j = 0; j < 12; j++) { if (UCHAR_MAX == (i = table[major + j])) break; if (0 == strcmp(p, mdoc_macronames[i])) - return(i); + return i; } - return(TOKEN_NONE); + return TOKEN_NONE; } diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 7562b488d38..ecdd93bcd7a 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.111 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.112 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -522,7 +522,7 @@ mdoc_root_pre(MDOC_ARGS) free(title); free(volume); - return(1); + return 1; } static int @@ -534,11 +534,11 @@ mdoc_sh_pre(MDOC_ARGS) case ROFFT_BLOCK: PAIR_CLASS_INIT(&tag, "section"); print_otag(h, TAG_DIV, 1, &tag); - return(1); + return 1; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) h->flags &= ~(HTML_SPLIT|HTML_NOSPLIT); - return(1); + return 1; default: break; } @@ -558,7 +558,7 @@ mdoc_sh_pre(MDOC_ARGS) } else print_otag(h, TAG_H1, 0, NULL); - return(1); + return 1; } static int @@ -569,9 +569,9 @@ mdoc_ss_pre(MDOC_ARGS) if (n->type == ROFFT_BLOCK) { PAIR_CLASS_INIT(&tag, "subsection"); print_otag(h, TAG_DIV, 1, &tag); - return(1); + return 1; } else if (n->type == ROFFT_BODY) - return(1); + return 1; bufinit(h); bufcat(h, "x"); @@ -588,7 +588,7 @@ mdoc_ss_pre(MDOC_ARGS) } else print_otag(h, TAG_H2, 0, NULL); - return(1); + return 1; } static int @@ -602,7 +602,7 @@ mdoc_fl_pre(MDOC_ARGS) /* `Cm' has no leading hyphen. */ if (MDOC_Cm == n->tok) - return(1); + return 1; print_text(h, "\\-"); @@ -612,7 +612,7 @@ mdoc_fl_pre(MDOC_ARGS) n->next->flags & MDOC_LINE))) h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -621,14 +621,14 @@ mdoc_nd_pre(MDOC_ARGS) struct htmlpair tag; if (n->type != ROFFT_BODY) - return(1); + return 1; /* XXX: this tag in theory can contain block elements. */ print_text(h, "\\(em"); PAIR_CLASS_INIT(&tag, "desc"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -647,10 +647,10 @@ mdoc_nm_pre(MDOC_ARGS) print_otag(h, TAG_B, 1, &tag); if (n->child == NULL && meta->name != NULL) print_text(h, meta->name); - return(1); + return 1; case ROFFT_BODY: print_otag(h, TAG_TD, 0, NULL); - return(1); + return 1; default: break; } @@ -674,7 +674,7 @@ mdoc_nm_pre(MDOC_ARGS) print_otag(h, TAG_COL, 0, NULL); print_otag(h, TAG_TBODY, 0, NULL); print_otag(h, TAG_TR, 0, NULL); - return(1); + return 1; } static int @@ -683,7 +683,7 @@ mdoc_xr_pre(MDOC_ARGS) struct htmlpair tag[2]; if (NULL == n->child) - return(0); + return 0; PAIR_CLASS_INIT(&tag[0], "link-man"); @@ -700,7 +700,7 @@ mdoc_xr_pre(MDOC_ARGS) print_text(h, n->string); if (NULL == (n = n->next)) - return(0); + return 0; h->flags |= HTML_NOSPACE; print_text(h, "("); @@ -708,7 +708,7 @@ mdoc_xr_pre(MDOC_ARGS) print_text(h, n->string); h->flags |= HTML_NOSPACE; print_text(h, ")"); - return(0); + return 0; } static int @@ -717,7 +717,7 @@ mdoc_ns_pre(MDOC_ARGS) if ( ! (MDOC_LINE & n->flags)) h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -727,7 +727,7 @@ mdoc_ar_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "arg"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -757,7 +757,7 @@ mdoc_xx_pre(MDOC_ARGS) pp = "UNIX"; break; default: - return(1); + return 1; } PAIR_CLASS_INIT(&tag, "unix"); @@ -770,7 +770,7 @@ mdoc_xx_pre(MDOC_ARGS) print_text(h, n->child->string); h->flags = flags; } - return(0); + return 0; } static int @@ -787,7 +787,7 @@ mdoc_bx_pre(MDOC_ARGS) print_text(h, "BSD"); } else { print_text(h, "BSD"); - return(0); + return 0; } if (NULL != (n = n->next)) { @@ -797,7 +797,7 @@ mdoc_bx_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -832,7 +832,7 @@ mdoc_it_pre(MDOC_ARGS) case LIST_hyphen: /* FALLTHROUGH */ case LIST_enum: - return(0); + return 0; case LIST_diag: /* FALLTHROUGH */ case LIST_hang: @@ -909,7 +909,7 @@ mdoc_it_pre(MDOC_ARGS) } } - return(1); + return 1; } static int @@ -923,12 +923,12 @@ mdoc_bl_pre(MDOC_ARGS) if (n->type == ROFFT_BODY) { if (LIST_column == n->norm->Bl.type) print_otag(h, TAG_TBODY, 0, NULL); - return(1); + return 1; } if (n->type == ROFFT_HEAD) { if (LIST_column != n->norm->Bl.type) - return(0); + return 0; /* * For each column, print out the tag with our @@ -948,7 +948,7 @@ mdoc_bl_pre(MDOC_ARGS) print_otag(h, TAG_COL, 1, tag); } - return(0); + return 0; } SCALE_VS_INIT(&su, 0); @@ -1000,7 +1000,7 @@ mdoc_bl_pre(MDOC_ARGS) abort(); } - return(1); + return 1; } static int @@ -1040,7 +1040,7 @@ mdoc_ex_pre(MDOC_ARGS) print_text(h, "utility exits\\~0"); print_text(h, "on success, and\\~>0 if an error occurs."); - return(0); + return 0; } static int @@ -1050,7 +1050,7 @@ mdoc_em_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "emph"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1060,7 +1060,7 @@ mdoc_d1_pre(MDOC_ARGS) struct roffsu su; if (n->type != ROFFT_BLOCK) - return(1); + return 1; SCALE_VS_INIT(&su, 0); bufinit(h); @@ -1079,7 +1079,7 @@ mdoc_d1_pre(MDOC_ARGS) print_otag(h, TAG_CODE, 1, tag); } - return(1); + return 1; } static int @@ -1101,7 +1101,7 @@ mdoc_sx_pre(MDOC_ARGS) print_otag(h, TAG_I, 1, tag); print_otag(h, TAG_A, 2, tag); - return(1); + return 1; } static int @@ -1113,7 +1113,7 @@ mdoc_bd_pre(MDOC_ARGS) struct roffsu su; if (n->type == ROFFT_HEAD) - return(0); + return 0; if (n->type == ROFFT_BLOCK) { comp = n->norm->Bd.comp; @@ -1127,7 +1127,7 @@ mdoc_bd_pre(MDOC_ARGS) } if ( ! comp) print_paragraph(h); - return(1); + return 1; } /* Handle the -offset argument. */ @@ -1150,7 +1150,7 @@ mdoc_bd_pre(MDOC_ARGS) DISP_literal != n->norm->Bd.type) { PAIR_CLASS_INIT(&tag[1], "display"); print_otag(h, TAG_DIV, 2, tag); - return(1); + return 1; } PAIR_CLASS_INIT(&tag[1], "lit display"); @@ -1201,7 +1201,7 @@ mdoc_bd_pre(MDOC_ARGS) if (0 == sv) h->flags &= ~HTML_LITERAL; - return(0); + return 0; } static int @@ -1211,7 +1211,7 @@ mdoc_pa_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "file"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -1221,7 +1221,7 @@ mdoc_ad_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "addr"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -1232,12 +1232,12 @@ mdoc_an_pre(MDOC_ARGS) if (n->norm->An.auth == AUTH_split) { h->flags &= ~HTML_NOSPLIT; h->flags |= HTML_SPLIT; - return(0); + return 0; } if (n->norm->An.auth == AUTH_nosplit) { h->flags &= ~HTML_SPLIT; h->flags |= HTML_NOSPLIT; - return(0); + return 0; } if (h->flags & HTML_SPLIT) @@ -1248,7 +1248,7 @@ mdoc_an_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "author"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1259,7 +1259,7 @@ mdoc_cd_pre(MDOC_ARGS) synopsis_pre(h, n); PAIR_CLASS_INIT(&tag, "config"); print_otag(h, TAG_B, 1, &tag); - return(1); + return 1; } static int @@ -1269,7 +1269,7 @@ mdoc_dv_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "define"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1279,7 +1279,7 @@ mdoc_ev_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "env"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1289,7 +1289,7 @@ mdoc_er_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "errno"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1302,7 +1302,7 @@ mdoc_fa_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "farg"); if (n->parent->tok != MDOC_Fo) { print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } for (nn = n->child; nn; nn = nn->next) { @@ -1320,7 +1320,7 @@ mdoc_fa_pre(MDOC_ARGS) print_text(h, ","); } - return(0); + return 0; } static int @@ -1335,14 +1335,14 @@ mdoc_fd_pre(MDOC_ARGS) synopsis_pre(h, n); if (NULL == (n = n->child)) - return(0); + return 0; assert(n->type == ROFFT_TEXT); if (strcmp(n->string, "#include")) { PAIR_CLASS_INIT(&tag[0], "macro"); print_otag(h, TAG_B, 1, tag); - return(1); + return 1; } PAIR_CLASS_INIT(&tag[0], "includes"); @@ -1388,7 +1388,7 @@ mdoc_fd_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -1398,15 +1398,15 @@ mdoc_vt_pre(MDOC_ARGS) if (n->type == ROFFT_BLOCK) { synopsis_pre(h, n); - return(1); + return 1; } else if (n->type == ROFFT_ELEM) { synopsis_pre(h, n); } else if (n->type == ROFFT_HEAD) - return(0); + return 0; PAIR_CLASS_INIT(&tag, "type"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1417,7 +1417,7 @@ mdoc_ft_pre(MDOC_ARGS) synopsis_pre(h, n); PAIR_CLASS_INIT(&tag, "ftype"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -1507,7 +1507,7 @@ mdoc_fn_pre(MDOC_ARGS) print_text(h, ";"); } - return(0); + return 0; } static int @@ -1524,14 +1524,14 @@ mdoc_sm_pre(MDOC_ARGS) if ( ! (HTML_NONOSPACE & h->flags)) h->flags &= ~HTML_NOSPACE; - return(0); + return 0; } static int mdoc_skip_pre(MDOC_ARGS) { - return(0); + return 0; } static int @@ -1539,7 +1539,7 @@ mdoc_pp_pre(MDOC_ARGS) { print_paragraph(h); - return(0); + return 0; } static int @@ -1568,7 +1568,7 @@ mdoc_sp_pre(MDOC_ARGS) /* So the div isn't empty: */ print_text(h, "\\~"); - return(0); + return 0; } @@ -1578,7 +1578,7 @@ mdoc_lk_pre(MDOC_ARGS) struct htmlpair tag[2]; if (NULL == (n = n->child)) - return(0); + return 0; assert(n->type == ROFFT_TEXT); @@ -1593,7 +1593,7 @@ mdoc_lk_pre(MDOC_ARGS) for (n = n->next; n; n = n->next) print_text(h, n->string); - return(0); + return 0; } static int @@ -1617,7 +1617,7 @@ mdoc_mt_pre(MDOC_ARGS) print_tagq(h, t); } - return(0); + return 0; } static int @@ -1630,21 +1630,21 @@ mdoc_fo_pre(MDOC_ARGS) h->flags |= HTML_NOSPACE; print_text(h, "("); h->flags |= HTML_NOSPACE; - return(1); + return 1; } else if (n->type == ROFFT_BLOCK) { synopsis_pre(h, n); - return(1); + return 1; } if (n->child == NULL) - return(0); + return 0; assert(n->child->string); PAIR_CLASS_INIT(&tag, "fname"); t = print_otag(h, TAG_B, 1, &tag); print_text(h, n->child->string); print_tagq(h, t); - return(0); + return 0; } static void @@ -1711,7 +1711,7 @@ mdoc_in_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -1721,7 +1721,7 @@ mdoc_ic_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "cmd"); print_otag(h, TAG_B, 1, &tag); - return(1); + return 1; } static int @@ -1777,7 +1777,7 @@ mdoc_rv_pre(MDOC_ARGS) print_text(h, "errno"); print_tagq(h, t); print_text(h, "is set to indicate the error."); - return(0); + return 0; } static int @@ -1787,7 +1787,7 @@ mdoc_va_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "var"); print_otag(h, TAG_B, 1, &tag); - return(1); + return 1; } static int @@ -1797,7 +1797,7 @@ mdoc_ap_pre(MDOC_ARGS) h->flags |= HTML_NOSPACE; print_text(h, "\\(aq"); h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -1807,9 +1807,9 @@ mdoc_bf_pre(MDOC_ARGS) struct roffsu su; if (n->type == ROFFT_HEAD) - return(0); + return 0; else if (n->type != ROFFT_BODY) - return(1); + return 1; if (FONT_Em == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "emph"); @@ -1831,7 +1831,7 @@ mdoc_bf_pre(MDOC_ARGS) bufcat_su(h, "margin-left", &su); PAIR_STYLE_INIT(&tag[1], h); print_otag(h, TAG_DIV, 2, tag); - return(1); + return 1; } static int @@ -1841,7 +1841,7 @@ mdoc_ms_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "symb"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1849,7 +1849,7 @@ mdoc_igndelim_pre(MDOC_ARGS) { h->flags |= HTML_IGNDELIM; - return(1); + return 1; } static void @@ -1866,14 +1866,14 @@ mdoc_rs_pre(MDOC_ARGS) struct htmlpair tag; if (n->type != ROFFT_BLOCK) - return(1); + return 1; if (n->prev && SEC_SEE_ALSO == n->sec) print_paragraph(h); PAIR_CLASS_INIT(&tag, "ref"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1883,7 +1883,7 @@ mdoc_no_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "none"); print_otag(h, TAG_CODE, 1, &tag); - return(1); + return 1; } static int @@ -1893,7 +1893,7 @@ mdoc_li_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "lit"); print_otag(h, TAG_CODE, 1, &tag); - return(1); + return 1; } static int @@ -1903,7 +1903,7 @@ mdoc_sy_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "symb"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1911,7 +1911,7 @@ mdoc_bt_pre(MDOC_ARGS) { print_text(h, "is currently in beta test."); - return(0); + return 0; } static int @@ -1919,7 +1919,7 @@ mdoc_ud_pre(MDOC_ARGS) { print_text(h, "currently under development."); - return(0); + return 0; } static int @@ -1932,7 +1932,7 @@ mdoc_lb_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "lib"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1998,13 +1998,13 @@ mdoc__x_pre(MDOC_ARGS) if (MDOC__U != n->tok) { print_otag(h, t, 1, tag); - return(1); + return 1; } PAIR_HREF_INIT(&tag[1], n->child->string); print_otag(h, TAG_A, 2, tag); - return(1); + return 1; } static void @@ -2033,7 +2033,7 @@ mdoc_bk_pre(MDOC_ARGS) case ROFFT_BLOCK: break; case ROFFT_HEAD: - return(0); + return 0; case ROFFT_BODY: if (n->parent->args || 0 == n->prev->nchild) h->flags |= HTML_PREKEEP; @@ -2042,7 +2042,7 @@ mdoc_bk_pre(MDOC_ARGS) abort(); } - return(1); + return 1; } static void @@ -2059,7 +2059,7 @@ mdoc_quote_pre(MDOC_ARGS) struct htmlpair tag; if (n->type != ROFFT_BODY) - return(1); + return 1; switch (n->tok) { case MDOC_Ao: @@ -2089,7 +2089,7 @@ mdoc_quote_pre(MDOC_ARGS) case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) - return(1); + return 1; print_text(h, n->norm->Es->child->string); break; case MDOC_Do: @@ -2122,7 +2122,7 @@ mdoc_quote_pre(MDOC_ARGS) } h->flags |= HTML_NOSPACE; - return(1); + return 1; } static void @@ -2194,7 +2194,7 @@ mdoc_eo_pre(MDOC_ARGS) { if (n->type != ROFFT_BODY) - return(1); + return 1; if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && @@ -2205,7 +2205,7 @@ mdoc_eo_pre(MDOC_ARGS) n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) h->flags |= HTML_NOSPACE; - return(1); + return 1; } static void diff --git a/usr.bin/mandoc/mdoc_macro.c b/usr.bin/mandoc/mdoc_macro.c index 27e5e7edef0..1dd8a065278 100644 --- a/usr.bin/mandoc/mdoc_macro.c +++ b/usr.bin/mandoc/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_macro.c,v 1.157 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: mdoc_macro.c,v 1.158 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -241,13 +241,13 @@ lookup(struct roff_man *mdoc, int from, int line, int ppos, const char *p) res = mdoc_hash_find(p); if (res != TOKEN_NONE) { if (mdoc_macros[res].flags & MDOC_CALLABLE) - return(res); + return res; if (res != MDOC_br && res != MDOC_sp && res != MDOC_ll) mandoc_msg(MANDOCERR_MACRO_CALL, mdoc->parse, line, ppos, p); } } - return(TOKEN_NONE); + return TOKEN_NONE; } /* @@ -327,39 +327,39 @@ rew_alt(int tok) { switch (tok) { case MDOC_Ac: - return(MDOC_Ao); + return MDOC_Ao; case MDOC_Bc: - return(MDOC_Bo); + return MDOC_Bo; case MDOC_Brc: - return(MDOC_Bro); + return MDOC_Bro; case MDOC_Dc: - return(MDOC_Do); + return MDOC_Do; case MDOC_Ec: - return(MDOC_Eo); + return MDOC_Eo; case MDOC_Ed: - return(MDOC_Bd); + return MDOC_Bd; case MDOC_Ef: - return(MDOC_Bf); + return MDOC_Bf; case MDOC_Ek: - return(MDOC_Bk); + return MDOC_Bk; case MDOC_El: - return(MDOC_Bl); + return MDOC_Bl; case MDOC_Fc: - return(MDOC_Fo); + return MDOC_Fo; case MDOC_Oc: - return(MDOC_Oo); + return MDOC_Oo; case MDOC_Pc: - return(MDOC_Po); + return MDOC_Po; case MDOC_Qc: - return(MDOC_Qo); + return MDOC_Qo; case MDOC_Re: - return(MDOC_Rs); + return MDOC_Rs; case MDOC_Sc: - return(MDOC_So); + return MDOC_So; case MDOC_Xc: - return(MDOC_Xo); + return MDOC_Xo; default: - return(tok); + return tok; } } @@ -411,7 +411,7 @@ find_pending(struct roff_man *mdoc, int tok, int line, int ppos, } } } - return(irc); + return irc; } /* @@ -506,14 +506,14 @@ macro_or_word(MACRO_PROT_ARGS, int parsed) if (ntok == TOKEN_NONE) { dword(mdoc, line, ppos, p, DELIM_MAX, tok == TOKEN_NONE || mdoc_macros[tok].flags & MDOC_JOIN); - return(0); + return 0; } else { if (mdoc_macros[tok].fp == in_line_eoln) rew_elem(mdoc, tok); mdoc_macro(mdoc, ntok, line, ppos, pos, buf); if (tok == TOKEN_NONE) append_delims(mdoc, line, pos, buf); - return(1); + return 1; } } @@ -1424,9 +1424,9 @@ parse_rest(struct roff_man *mdoc, int tok, int line, int *pos, char *buf) for (;;) { la = *pos; if (mdoc_args(mdoc, line, pos, buf, tok, NULL) == ARGS_EOLN) - return(0); + return 0; if (macro_or_word(mdoc, tok, line, la, pos, buf, 1)) - return(1); + return 1; } } diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index 1a228384d34..f38c086f276 100644 --- a/usr.bin/mandoc/mdoc_man.c +++ b/usr.bin/mandoc/mdoc_man.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_man.c,v 1.91 2015/04/18 17:50:02 schwarze Exp $ */ +/* $OpenBSD: mdoc_man.c,v 1.92 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2011-2015 Ingo Schwarze * @@ -641,14 +641,14 @@ static int cond_head(DECL_ARGS) { - return(n->type == ROFFT_HEAD); + return n->type == ROFFT_HEAD; } static int cond_body(DECL_ARGS) { - return(n->type == ROFFT_BODY); + return n->type == ROFFT_BODY; } static int @@ -658,10 +658,10 @@ pre_enc(DECL_ARGS) prefix = manacts[n->tok].prefix; if (NULL == prefix) - return(1); + return 1; print_word(prefix); outflags &= ~MMAN_spc; - return(1); + return 1; } static void @@ -709,7 +709,7 @@ pre_ex(DECL_ARGS) print_word("on success, and\\~>0 if an error occurs."); outflags |= MMAN_nl; - return(0); + return 0; } static void @@ -747,7 +747,7 @@ pre__t(DECL_ARGS) outflags &= ~MMAN_spc; } else font_push('I'); - return(1); + return 1; } static void @@ -778,7 +778,7 @@ pre_sect(DECL_ARGS) putchar('\"'); outflags &= ~MMAN_spc; } - return(1); + return 1; } /* @@ -846,18 +846,18 @@ pre_an(DECL_ARGS) case AUTH_split: outflags &= ~MMAN_An_nosplit; outflags |= MMAN_An_split; - return(0); + return 0; case AUTH_nosplit: outflags &= ~MMAN_An_split; outflags |= MMAN_An_nosplit; - return(0); + return 0; default: if (MMAN_An_split & outflags) outflags |= MMAN_br; else if (SEC_AUTHORS == n->sec && ! (MMAN_An_nosplit & outflags)) outflags |= MMAN_An_split; - return(1); + return 1; } } @@ -868,7 +868,7 @@ pre_ap(DECL_ARGS) outflags &= ~MMAN_spc; print_word("'"); outflags &= ~MMAN_spc; - return(0); + return 0; } static int @@ -878,7 +878,7 @@ pre_aq(DECL_ARGS) print_word(n->nchild == 1 && n->child->tok == MDOC_Mt ? "<" : "\\(la"); outflags &= ~MMAN_spc; - return(1); + return 1; } static void @@ -902,7 +902,7 @@ pre_bd(DECL_ARGS) if (0 == n->norm->Bd.comp && NULL != n->parent->prev) outflags |= MMAN_sp; print_offs(n->norm->Bd.offs, 1); - return(1); + return 1; } static void @@ -926,11 +926,11 @@ pre_bf(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: - return(1); + return 1; case ROFFT_BODY: break; default: - return(0); + return 0; } switch (n->norm->Bf.font) { case FONT_Em: @@ -943,7 +943,7 @@ pre_bf(DECL_ARGS) font_push('R'); break; } - return(1); + return 1; } static void @@ -960,12 +960,12 @@ pre_bk(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: - return(1); + return 1; case ROFFT_BODY: outflags |= MMAN_Bk; - return(1); + return 1; default: - return(0); + return 0; } } @@ -995,11 +995,11 @@ pre_bl(DECL_ARGS) switch (n->norm->Bl.type) { case LIST_enum: n->norm->Bl.count = 0; - return(1); + return 1; case LIST_column: break; default: - return(1); + return 1; } if (n->nchild) { @@ -1009,7 +1009,7 @@ pre_bl(DECL_ARGS) print_word("."); } outflags |= MMAN_nl; - return(1); + return 1; } static void @@ -1049,7 +1049,7 @@ pre_br(DECL_ARGS) { outflags |= MMAN_br; - return(0); + return 0; } static int @@ -1064,12 +1064,12 @@ pre_bx(DECL_ARGS) } print_word("BSD"); if (NULL == n) - return(0); + return 0; outflags &= ~MMAN_spc; print_word("-"); outflags &= ~MMAN_spc; print_word(n->string); - return(0); + return 0; } static int @@ -1077,7 +1077,7 @@ pre_dl(DECL_ARGS) { print_offs("6n", 0); - return(1); + return 1; } static void @@ -1096,7 +1096,7 @@ pre_em(DECL_ARGS) { font_push('I'); - return(1); + return 1; } static int @@ -1105,11 +1105,11 @@ pre_en(DECL_ARGS) if (NULL == n->norm->Es || NULL == n->norm->Es->child) - return(1); + return 1; print_word(n->norm->Es->child->string); outflags &= ~MMAN_spc; - return(1); + return 1; } static void @@ -1139,7 +1139,7 @@ pre_eo(DECL_ARGS) n->parent->head->child != NULL && (n->child != NULL || (n->parent->tail != NULL && n->parent->tail->child != NULL))) outflags &= ~(MMAN_spc | MMAN_nl); - return(1); + return 1; } static void @@ -1182,7 +1182,7 @@ pre_fa(DECL_ARGS) if (NULL != (n = n->next)) print_word(","); } - return(0); + return 0; } static void @@ -1199,7 +1199,7 @@ pre_fd(DECL_ARGS) pre_syn(n); font_push('B'); - return(1); + return 1; } static void @@ -1218,7 +1218,7 @@ pre_fl(DECL_ARGS) print_word("\\-"); if (n->nchild) outflags &= ~MMAN_spc; - return(1); + return 1; } static void @@ -1241,7 +1241,7 @@ pre_fn(DECL_ARGS) n = n->child; if (NULL == n) - return(0); + return 0; if (MDOC_SYNPRETTY & n->flags) print_block(".HP 4n", MMAN_nl); @@ -1256,7 +1256,7 @@ pre_fn(DECL_ARGS) n = n->next; if (NULL != n) pre_fa(meta, n); - return(0); + return 0; } static void @@ -1280,7 +1280,7 @@ pre_fo(DECL_ARGS) break; case ROFFT_HEAD: if (n->child == NULL) - return(0); + return 0; if (MDOC_SYNPRETTY & n->flags) print_block(".HP 4n", MMAN_nl); font_push('B'); @@ -1293,7 +1293,7 @@ pre_fo(DECL_ARGS) default: break; } - return(1); + return 1; } static void @@ -1319,7 +1319,7 @@ pre_ft(DECL_ARGS) pre_syn(n); font_push('I'); - return(1); + return 1; } static int @@ -1336,7 +1336,7 @@ pre_in(DECL_ARGS) outflags &= ~MMAN_spc; font_push('I'); } - return(1); + return 1; } static void @@ -1371,7 +1371,7 @@ pre_it(DECL_ARGS) outflags &= ~MMAN_br; switch (bln->norm->Bl.type) { case LIST_item: - return(0); + return 0; case LIST_inset: /* FALLTHROUGH */ case LIST_diag: @@ -1382,7 +1382,7 @@ pre_it(DECL_ARGS) else print_line(".R \"", 0); outflags &= ~MMAN_spc; - return(1); + return 1; case LIST_bullet: /* FALLTHROUGH */ case LIST_dash: @@ -1398,31 +1398,31 @@ pre_it(DECL_ARGS) print_word("-"); font_pop(); outflags |= MMAN_nl; - return(0); + return 0; case LIST_enum: print_width(&bln->norm->Bl, NULL); TPremain = 0; outflags |= MMAN_nl; print_count(&bln->norm->Bl.count); outflags |= MMAN_nl; - return(0); + return 0; case LIST_hang: print_width(&bln->norm->Bl, n->child); TPremain = 0; outflags |= MMAN_nl; - return(1); + return 1; case LIST_tag: print_width(&bln->norm->Bl, n->child); putchar('\n'); outflags &= ~MMAN_spc; - return(1); + return 1; default: - return(1); + return 1; } default: break; } - return(1); + return 1; } /* @@ -1528,7 +1528,7 @@ pre_lk(DECL_ARGS) const struct roff_node *link, *descr; if (NULL == (link = n->child)) - return(0); + return 0; if (NULL != (descr = link->next)) { font_push('I'); @@ -1543,7 +1543,7 @@ pre_lk(DECL_ARGS) font_push('B'); print_word(link->string); font_pop(); - return(0); + return 0; } static int @@ -1551,7 +1551,7 @@ pre_ll(DECL_ARGS) { print_line(".ll", 0); - return(1); + return 1; } static int @@ -1559,7 +1559,7 @@ pre_li(DECL_ARGS) { font_push('R'); - return(1); + return 1; } static int @@ -1572,10 +1572,10 @@ pre_nm(DECL_ARGS) pre_syn(n); } if (n->type != ROFFT_ELEM && n->type != ROFFT_HEAD) - return(1); + return 1; name = n->child ? n->child->string : meta->name; if (NULL == name) - return(0); + return 0; if (n->type == ROFFT_HEAD) { if (NULL == n->parent->prev) outflags |= MMAN_sp; @@ -1586,7 +1586,7 @@ pre_nm(DECL_ARGS) font_push('B'); if (NULL == n->child) print_word(meta->name); - return(1); + return 1; } static void @@ -1613,7 +1613,7 @@ pre_no(DECL_ARGS) { outflags |= MMAN_spc_force; - return(1); + return 1; } static int @@ -1621,7 +1621,7 @@ pre_ns(DECL_ARGS) { outflags &= ~MMAN_spc; - return(0); + return 0; } static void @@ -1640,7 +1640,7 @@ pre_pp(DECL_ARGS) outflags |= MMAN_PP; outflags |= MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; - return(0); + return 0; } static int @@ -1651,7 +1651,7 @@ pre_rs(DECL_ARGS) outflags |= MMAN_PP | MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; } - return(1); + return 1; } static int @@ -1703,14 +1703,14 @@ pre_rv(DECL_ARGS) print_word("is set to indicate the error."); outflags |= MMAN_nl; - return(0); + return 0; } static int pre_skip(DECL_ARGS) { - return(0); + return 0; } static int @@ -1727,7 +1727,7 @@ pre_sm(DECL_ARGS) if (MMAN_Sm & outflags) outflags |= MMAN_spc; - return(0); + return 0; } static int @@ -1739,7 +1739,7 @@ pre_sp(DECL_ARGS) print_line(".PP", 0); } else print_line(".sp", 0); - return(1); + return 1; } static void @@ -1754,7 +1754,7 @@ pre_sy(DECL_ARGS) { font_push('B'); - return(1); + return 1; } static int @@ -1765,15 +1765,15 @@ pre_vt(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: pre_syn(n); - return(1); + return 1; case ROFFT_BODY: break; default: - return(0); + return 0; } } font_push('I'); - return(1); + return 1; } static void @@ -1791,16 +1791,16 @@ pre_xr(DECL_ARGS) n = n->child; if (NULL == n) - return(0); + return 0; print_node(meta, n); n = n->next; if (NULL == n) - return(0); + return 0; outflags &= ~MMAN_spc; print_word("("); print_node(meta, n); print_word(")"); - return(0); + return 0; } static int @@ -1809,9 +1809,9 @@ pre_ux(DECL_ARGS) print_word(manacts[n->tok].prefix); if (NULL == n->child) - return(0); + return 0; outflags &= ~MMAN_spc; print_word("\\ "); outflags &= ~MMAN_spc; - return(1); + return 1; } diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c index 6f36ee36758..4f0cbd1e4b8 100644 --- a/usr.bin/mandoc/mdoc_term.c +++ b/usr.bin/mandoc/mdoc_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_term.c,v 1.226 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: mdoc_term.c,v 1.227 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -533,7 +533,7 @@ a2width(const struct termp *p, const char *v) SCALE_HS_INIT(&su, term_strlen(p, v)); su.scale /= term_strlen(p, "0"); } - return(term_hspan(p, &su) / 24); + return term_hspan(p, &su) / 24; } /* @@ -597,7 +597,7 @@ termp_ll_pre(DECL_ARGS) { term_setwidth(p, n->nchild ? n->child->string : NULL); - return(0); + return 0; } static int @@ -611,7 +611,7 @@ termp_it_pre(DECL_ARGS) if (n->type == ROFFT_BLOCK) { print_bvspace(p, n->parent->parent, n); - return(1); + return 1; } bl = n->parent->parent->parent; @@ -925,17 +925,17 @@ termp_it_pre(DECL_ARGS) /* FALLTHROUGH */ case LIST_enum: if (n->type == ROFFT_HEAD) - return(0); + return 0; break; case LIST_column: if (n->type == ROFFT_HEAD) - return(0); + return 0; break; default: break; } - return(1); + return 1; } static void @@ -984,12 +984,12 @@ termp_nm_pre(DECL_ARGS) if (n->type == ROFFT_BLOCK) { p->flags |= TERMP_PREKEEP; - return(1); + return 1; } if (n->type == ROFFT_BODY) { if (NULL == n->child) - return(0); + return 0; p->flags |= TERMP_NOSPACE; cp = NULL; if (n->prev->child != NULL) @@ -1000,11 +1000,11 @@ termp_nm_pre(DECL_ARGS) p->offset += term_len(p, 6); else p->offset += term_len(p, 1) + term_strlen(p, cp); - return(1); + return 1; } if (NULL == n->child && NULL == meta->name) - return(0); + return 0; if (n->type == ROFFT_HEAD) synopsis_pre(p, n->parent); @@ -1029,7 +1029,7 @@ termp_nm_pre(DECL_ARGS) term_fontpush(p, TERMFONT_BOLD); if (NULL == n->child) term_word(p, meta->name); - return(1); + return 1; } static void @@ -1061,7 +1061,7 @@ termp_fl_pre(DECL_ARGS) n->next->flags & MDOC_LINE))) p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static int @@ -1072,7 +1072,7 @@ termp__a_pre(DECL_ARGS) if (NULL == n->next || MDOC__A != n->next->tok) term_word(p, "and"); - return(1); + return 1; } static int @@ -1082,12 +1082,12 @@ termp_an_pre(DECL_ARGS) if (n->norm->An.auth == AUTH_split) { p->flags &= ~TERMP_NOSPLIT; p->flags |= TERMP_SPLIT; - return(0); + return 0; } if (n->norm->An.auth == AUTH_nosplit) { p->flags &= ~TERMP_SPLIT; p->flags |= TERMP_NOSPLIT; - return(0); + return 0; } if (p->flags & TERMP_SPLIT) @@ -1096,7 +1096,7 @@ termp_an_pre(DECL_ARGS) if (n->sec == SEC_AUTHORS && ! (p->flags & TERMP_NOSPLIT)) p->flags |= TERMP_SPLIT; - return(1); + return 1; } static int @@ -1105,7 +1105,7 @@ termp_ns_pre(DECL_ARGS) if ( ! (MDOC_LINE & n->flags)) p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static int @@ -1113,10 +1113,10 @@ termp_rs_pre(DECL_ARGS) { if (SEC_SEE_ALSO != n->sec) - return(1); + return 1; if (n->type == ROFFT_BLOCK && n->prev != NULL) term_vspace(p); - return(1); + return 1; } static int @@ -1169,7 +1169,7 @@ termp_rv_pre(DECL_ARGS) term_word(p, "is set to indicate the error."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static int @@ -1203,7 +1203,7 @@ termp_ex_pre(DECL_ARGS) term_word(p, "on success, and\\~>0 if an error occurs."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static int @@ -1212,14 +1212,14 @@ termp_nd_pre(DECL_ARGS) if (n->type == ROFFT_BODY) term_word(p, "\\(en"); - return(1); + return 1; } static int termp_bl_pre(DECL_ARGS) { - return(n->type != ROFFT_HEAD); + return n->type != ROFFT_HEAD; } static void @@ -1235,13 +1235,13 @@ termp_xr_pre(DECL_ARGS) { if (NULL == (n = n->child)) - return(0); + return 0; assert(n->type == ROFFT_TEXT); term_word(p, n->string); if (NULL == (n = n->next)) - return(0); + return 0; p->flags |= TERMP_NOSPACE; term_word(p, "("); @@ -1253,7 +1253,7 @@ termp_xr_pre(DECL_ARGS) p->flags |= TERMP_NOSPACE; term_word(p, ")"); - return(0); + return 0; } /* @@ -1319,14 +1319,14 @@ termp_vt_pre(DECL_ARGS) if (n->type == ROFFT_ELEM) { synopsis_pre(p, n); - return(termp_under_pre(p, pair, meta, n)); + return termp_under_pre(p, pair, meta, n); } else if (n->type == ROFFT_BLOCK) { synopsis_pre(p, n); - return(1); + return 1; } else if (n->type == ROFFT_HEAD) - return(0); + return 0; - return(termp_under_pre(p, pair, meta, n)); + return termp_under_pre(p, pair, meta, n); } static int @@ -1335,7 +1335,7 @@ termp_bold_pre(DECL_ARGS) termp_tag_pre(p, pair, meta, n); term_fontpush(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -1343,7 +1343,7 @@ termp_fd_pre(DECL_ARGS) { synopsis_pre(p, n); - return(termp_bold_pre(p, pair, meta, n)); + return termp_bold_pre(p, pair, meta, n); } static void @@ -1388,7 +1388,7 @@ termp_sh_pre(DECL_ARGS) default: break; } - return(1); + return 1; } static void @@ -1414,7 +1414,7 @@ termp_bt_pre(DECL_ARGS) term_word(p, "is currently in beta test."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static void @@ -1431,7 +1431,7 @@ termp_ud_pre(DECL_ARGS) term_word(p, "currently under development."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static int @@ -1439,10 +1439,10 @@ termp_d1_pre(DECL_ARGS) { if (n->type != ROFFT_BLOCK) - return(1); + return 1; term_newln(p); p->offset += term_len(p, p->defindent + 1); - return(1); + return 1; } static int @@ -1452,7 +1452,7 @@ termp_ft_pre(DECL_ARGS) /* NB: MDOC_LINE does not effect this! */ synopsis_pre(p, n); term_fontpush(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -1466,7 +1466,7 @@ termp_fn_pre(DECL_ARGS) synopsis_pre(p, n); if (NULL == (n = n->child)) - return(0); + return 0; if (pretty) { rmargin = p->rmargin; @@ -1516,7 +1516,7 @@ termp_fn_pre(DECL_ARGS) term_flushln(p); } - return(0); + return 0; } static int @@ -1526,7 +1526,7 @@ termp_fa_pre(DECL_ARGS) if (n->parent->tok != MDOC_Fo) { term_fontpush(p, TERMFONT_UNDER); - return(1); + return 1; } for (nn = n->child; nn; nn = nn->next) { @@ -1541,7 +1541,7 @@ termp_fa_pre(DECL_ARGS) } } - return(0); + return 0; } static int @@ -1553,9 +1553,9 @@ termp_bd_pre(DECL_ARGS) if (n->type == ROFFT_BLOCK) { print_bvspace(p, n, n); - return(1); + return 1; } else if (n->type == ROFFT_HEAD) - return(0); + return 0; /* Handle the -offset argument. */ @@ -1585,7 +1585,7 @@ termp_bd_pre(DECL_ARGS) if (DISP_literal != n->norm->Bd.type && DISP_unfilled != n->norm->Bd.type && DISP_centered != n->norm->Bd.type) - return(1); + return 1; tabwidth = p->tabwidth; if (DISP_literal == n->norm->Bd.type) @@ -1643,7 +1643,7 @@ termp_bd_pre(DECL_ARGS) p->tabwidth = tabwidth; p->rmargin = rm; p->maxrmargin = rmax; - return(0); + return 0; } static void @@ -1678,7 +1678,7 @@ termp_bx_pre(DECL_ARGS) term_word(p, "BSD"); } else { term_word(p, "BSD"); - return(0); + return 0; } if (NULL != (n = n->next)) { @@ -1688,7 +1688,7 @@ termp_bx_pre(DECL_ARGS) term_word(p, n->string); } - return(0); + return 0; } static int @@ -1728,7 +1728,7 @@ termp_xx_pre(DECL_ARGS) term_word(p, n->child->string); p->flags = flags; } - return(0); + return 0; } static void @@ -1760,7 +1760,7 @@ termp_ss_pre(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -1777,7 +1777,7 @@ termp_cd_pre(DECL_ARGS) synopsis_pre(p, n); term_fontpush(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -1796,7 +1796,7 @@ termp_in_pre(DECL_ARGS) } p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -1845,14 +1845,14 @@ termp_sp_pre(DECL_ARGS) for (i = 0; i < len; i++) term_vspace(p); - return(0); + return 0; } static int termp_skip_pre(DECL_ARGS) { - return(0); + return 0; } static int @@ -1860,7 +1860,7 @@ termp_quote_pre(DECL_ARGS) { if (n->type != ROFFT_BODY && n->type != ROFFT_ELEM) - return(1); + return 1; switch (n->tok) { case MDOC_Ao: @@ -1891,7 +1891,7 @@ termp_quote_pre(DECL_ARGS) case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) - return(1); + return 1; term_word(p, n->norm->Es->child->string); break; case MDOC_Po: @@ -1918,7 +1918,7 @@ termp_quote_pre(DECL_ARGS) } p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -1993,7 +1993,7 @@ termp_eo_pre(DECL_ARGS) { if (n->type != ROFFT_BODY) - return(1); + return 1; if (n->end == ENDBODY_NOT && n->parent->head->child == NULL && @@ -2005,7 +2005,7 @@ termp_eo_pre(DECL_ARGS) (n->parent->tail != NULL && n->parent->tail->child != NULL))) p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -2042,7 +2042,7 @@ termp_fo_pre(DECL_ARGS) if (n->type == ROFFT_BLOCK) { synopsis_pre(p, n); - return(1); + return 1; } else if (n->type == ROFFT_BODY) { if (pretty) { rmargin = p->rmargin; @@ -2060,18 +2060,18 @@ termp_fo_pre(DECL_ARGS) p->offset = p->rmargin; p->rmargin = rmargin; } - return(1); + return 1; } if (NULL == n->child) - return(0); + return 0; /* XXX: we drop non-initial arguments as per groff. */ assert(n->child->string); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->child->string); - return(0); + return 0; } static void @@ -2096,9 +2096,9 @@ termp_bf_pre(DECL_ARGS) { if (n->type == ROFFT_HEAD) - return(0); + return 0; else if (n->type != ROFFT_BODY) - return(1); + return 1; if (FONT_Em == n->norm->Bf.font) term_fontpush(p, TERMFONT_UNDER); @@ -2107,7 +2107,7 @@ termp_bf_pre(DECL_ARGS) else term_fontpush(p, TERMFONT_NONE); - return(1); + return 1; } static int @@ -2124,7 +2124,7 @@ termp_sm_pre(DECL_ARGS) if (p->col && ! (TERMP_NONOSPACE & p->flags)) p->flags &= ~TERMP_NOSPACE; - return(0); + return 0; } static int @@ -2134,7 +2134,7 @@ termp_ap_pre(DECL_ARGS) p->flags |= TERMP_NOSPACE; term_word(p, "'"); p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -2169,7 +2169,7 @@ termp_li_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_NONE); - return(1); + return 1; } static int @@ -2178,7 +2178,7 @@ termp_lk_pre(DECL_ARGS) const struct roff_node *link, *descr; if (NULL == (link = n->child)) - return(0); + return 0; if (NULL != (descr = link->next)) { term_fontpush(p, TERMFONT_UNDER); @@ -2195,7 +2195,7 @@ termp_lk_pre(DECL_ARGS) term_word(p, link->string); term_fontpop(p); - return(0); + return 0; } static int @@ -2206,7 +2206,7 @@ termp_bk_pre(DECL_ARGS) case ROFFT_BLOCK: break; case ROFFT_HEAD: - return(0); + return 0; case ROFFT_BODY: if (n->parent->args || 0 == n->prev->nchild) p->flags |= TERMP_PREKEEP; @@ -2215,7 +2215,7 @@ termp_bk_pre(DECL_ARGS) abort(); } - return(1); + return 1; } static void @@ -2251,10 +2251,10 @@ termp__t_pre(DECL_ARGS) */ if (n->parent && MDOC_Rs == n->parent->tok && n->parent->norm->Rs.quote_T) - return(termp_quote_pre(p, pair, meta, n)); + return termp_quote_pre(p, pair, meta, n); term_fontpush(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -2262,7 +2262,7 @@ termp_under_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -2274,7 +2274,7 @@ termp_er_pre(DECL_ARGS) (n->parent->tok == MDOC_Bq && n->parent->parent->parent->tok == MDOC_It))) tag_put(n->child->string, 1, p->line); - return(1); + return 1; } static int @@ -2289,5 +2289,5 @@ termp_tag_pre(DECL_ARGS) n->parent->parent->prev == NULL && n->parent->parent->parent->tok == MDOC_It))) tag_put(n->child->string, 1, p->line); - return(1); + return 1; } diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 65825cb7c04..0989b3ab29a 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.209 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.210 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -1819,8 +1819,8 @@ child_an(const struct roff_node *n) for (n = n->child; n != NULL; n = n->next) if ((n->tok == MDOC_An && n->nchild) || child_an(n)) - return(1); - return(0); + return 1; + return 0; } static void @@ -2292,9 +2292,9 @@ a2sec(const char *p) for (i = 0; i < (int)SEC__MAX; i++) if (secnames[i] && 0 == strcmp(p, secnames[i])) - return((enum roff_sec)i); + return (enum roff_sec)i; - return(SEC_CUSTOM); + return SEC_CUSTOM; } static size_t @@ -2303,89 +2303,89 @@ macro2len(int macro) switch (macro) { case MDOC_Ad: - return(12); + return 12; case MDOC_Ao: - return(12); + return 12; case MDOC_An: - return(12); + return 12; case MDOC_Aq: - return(12); + return 12; case MDOC_Ar: - return(12); + return 12; case MDOC_Bo: - return(12); + return 12; case MDOC_Bq: - return(12); + return 12; case MDOC_Cd: - return(12); + return 12; case MDOC_Cm: - return(10); + return 10; case MDOC_Do: - return(10); + return 10; case MDOC_Dq: - return(12); + return 12; case MDOC_Dv: - return(12); + return 12; case MDOC_Eo: - return(12); + return 12; case MDOC_Em: - return(10); + return 10; case MDOC_Er: - return(17); + return 17; case MDOC_Ev: - return(15); + return 15; case MDOC_Fa: - return(12); + return 12; case MDOC_Fl: - return(10); + return 10; case MDOC_Fo: - return(16); + return 16; case MDOC_Fn: - return(16); + return 16; case MDOC_Ic: - return(10); + return 10; case MDOC_Li: - return(16); + return 16; case MDOC_Ms: - return(6); + return 6; case MDOC_Nm: - return(10); + return 10; case MDOC_No: - return(12); + return 12; case MDOC_Oo: - return(10); + return 10; case MDOC_Op: - return(14); + return 14; case MDOC_Pa: - return(32); + return 32; case MDOC_Pf: - return(12); + return 12; case MDOC_Po: - return(12); + return 12; case MDOC_Pq: - return(12); + return 12; case MDOC_Ql: - return(16); + return 16; case MDOC_Qo: - return(12); + return 12; case MDOC_So: - return(12); + return 12; case MDOC_Sq: - return(12); + return 12; case MDOC_Sy: - return(6); + return 6; case MDOC_Sx: - return(16); + return 16; case MDOC_Tn: - return(10); + return 10; case MDOC_Va: - return(12); + return 12; case MDOC_Vt: - return(12); + return 12; case MDOC_Xr: - return(10); + return 10; default: break; }; - return(0); + return 0; } diff --git a/usr.bin/mandoc/msec.c b/usr.bin/mandoc/msec.c index 90a300e9020..bd91cd5bfe0 100644 --- a/usr.bin/mandoc/msec.c +++ b/usr.bin/mandoc/msec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msec.c,v 1.11 2014/12/21 00:17:24 daniel Exp $ */ +/* $OpenBSD: msec.c,v 1.12 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -30,5 +30,5 @@ mandoc_a2msec(const char *p) #include "msec.in" - return(NULL); + return NULL; } diff --git a/usr.bin/mandoc/out.c b/usr.bin/mandoc/out.c index d2e8a146f7f..4c5a4313ce1 100644 --- a/usr.bin/mandoc/out.c +++ b/usr.bin/mandoc/out.c @@ -1,4 +1,4 @@ -/* $OpenBSD: out.c,v 1.32 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: out.c,v 1.33 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015 Ingo Schwarze @@ -49,7 +49,7 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) dst->unit = def == SCALE_MAX ? SCALE_BU : def; dst->scale = strtod(src, &endptr); if (endptr == src) - return(0); + return 0; switch (*endptr++) { case 'c': @@ -87,12 +87,12 @@ a2roffsu(const char *src, struct roffsu *dst, enum roffscale def) /* FALLTHROUGH */ default: if (SCALE_MAX == def) - return(0); + return 0; dst->unit = def; break; } - return(*endptr == '\0' ? 2 : 1); + return *endptr == '\0' ? 2 : 1; } /* diff --git a/usr.bin/mandoc/preconv.c b/usr.bin/mandoc/preconv.c index 532152eedad..5593990d87c 100644 --- a/usr.bin/mandoc/preconv.c +++ b/usr.bin/mandoc/preconv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: preconv.c,v 1.6 2015/03/09 21:30:27 schwarze Exp $ */ +/* $OpenBSD: preconv.c,v 1.7 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -90,17 +90,17 @@ preconv_encode(struct buf *ib, size_t *ii, struct buf *ob, size_t *oi, *oi += snprintf(ob->buf + *oi, 11, "\\[u%.4X]", accum); *ii = (char *)cu - ib->buf; *filenc &= ~MPARSE_LATIN1; - return(1); + return 1; latin: if ( ! (*filenc & MPARSE_LATIN1)) - return(0); + return 0; *oi += snprintf(ob->buf + *oi, 11, "\\[u%.4X]", (unsigned char)ib->buf[(*ii)++]); *filenc &= ~MPARSE_UTF8; - return(1); + return 1; } int @@ -121,7 +121,7 @@ preconv_cue(const struct buf *b, size_t offset) if ((sz = (size_t)(eoln - ln)) < 10 || memcmp(ln, ".\\\" -*-", 7) || memcmp(eoln - 3, "-*-", 3)) - return(MPARSE_UTF8 | MPARSE_LATIN1); + return MPARSE_UTF8 | MPARSE_LATIN1; /* Move after the header and adjust for the trailer. */ @@ -160,15 +160,15 @@ preconv_cue(const struct buf *b, size_t offset) sz--; } if (0 == sz) - return(0); + return 0; /* Check us against known encodings. */ if (phsz > 4 && !strncasecmp(ln, "utf-8", 5)) - return(MPARSE_UTF8); + return MPARSE_UTF8; if (phsz > 10 && !strncasecmp(ln, "iso-latin-1", 11)) - return(MPARSE_LATIN1); - return(0); + return MPARSE_LATIN1; + return 0; } - return(MPARSE_UTF8 | MPARSE_LATIN1); + return MPARSE_UTF8 | MPARSE_LATIN1; } diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index d060f9a8b51..c8a0017696f 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.116 2015/09/14 15:35:47 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.117 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -621,13 +621,13 @@ read_whole_file(struct mparse *curp, const char *file, int fd, if (curp->gzip == 0 && S_ISREG(st.st_mode)) { if (st.st_size > 0x7fffffff) { mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL); - return(0); + return 0; } *with_mmap = 1; fb->sz = (size_t)st.st_size; fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0); if (fb->buf != MAP_FAILED) - return(1); + return 1; } if (curp->gzip) { @@ -661,7 +661,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, read(fd, fb->buf + (int)off, fb->sz - off); if (ssz == 0) { fb->sz = off; - return(1); + return 1; } if (ssz == -1) { perror(file); @@ -672,7 +672,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, free(fb->buf); fb->buf = NULL; - return(0); + return 0; } static void @@ -757,7 +757,7 @@ mparse_readfd(struct mparse *curp, int fd, const char *file) if (fd != STDIN_FILENO && close(fd) == -1) perror(file); - return(curp->file_status); + return curp->file_status; } enum mandoclevel @@ -772,7 +772,7 @@ mparse_open(struct mparse *curp, int *fd, const char *file) /* First try to use the filename as it is. */ if ((*fd = open(file, O_RDONLY)) != -1) - return(MANDOCLEVEL_OK); + return MANDOCLEVEL_OK; /* * If that doesn't work and the filename doesn't @@ -785,14 +785,14 @@ mparse_open(struct mparse *curp, int *fd, const char *file) free(cp); if (*fd != -1) { curp->gzip = 1; - return(MANDOCLEVEL_OK); + return MANDOCLEVEL_OK; } } /* Neither worked, give up. */ mandoc_msg(MANDOCERR_FILE, curp, 0, 0, strerror(errno)); - return(MANDOCLEVEL_ERROR); + return MANDOCLEVEL_ERROR; } struct mparse * @@ -820,7 +820,7 @@ mparse_alloc(int options, enum mandoclevel wlevel, mandocmsg mmsg, curp->man->macroset = MACROSET_MAN; } curp->man->first->tok = TOKEN_NONE; - return(curp); + return curp; } void @@ -906,13 +906,13 @@ const char * mparse_strerror(enum mandocerr er) { - return(mandocerrs[er]); + return mandocerrs[er]; } const char * mparse_strlevel(enum mandoclevel lvl) { - return(mandoclevels[lvl]); + return mandoclevels[lvl]; } void @@ -928,5 +928,5 @@ mparse_getkeep(const struct mparse *p) { assert(p->secondary); - return(p->secondary->sz ? p->secondary->buf : NULL); + return p->secondary->sz ? p->secondary->buf : NULL; } diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 23ec4aa401b..d4073cfe120 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.148 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.149 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -783,17 +783,17 @@ roffhash_find(const char *p, size_t s) */ if (p[0] < ASCII_LO || p[0] > ASCII_HI) - return(ROFF_MAX); + return ROFF_MAX; buc = ROFF_HASH(p); if (NULL == (n = hash[buc])) - return(ROFF_MAX); + return ROFF_MAX; for ( ; n; n = n->next) if (0 == strncmp(n->name, p, s) && '\0' == n->name[(int)s]) - return((enum rofft)(n - roffs)); + return (enum rofft)(n - roffs); - return(ROFF_MAX); + return ROFF_MAX; } /* --- stack of request blocks -------------------------------------------- */ @@ -912,7 +912,7 @@ roff_alloc(struct mparse *parse, const struct mchars *mchars, int options) roffhash_init(); - return(r); + return r; } /* --- syntax tree state data management ---------------------------------- */ @@ -975,7 +975,7 @@ roff_man_alloc(struct roff *roff, struct mparse *parse, man->defos = defos; man->quick = quick; roff_man_alloc1(man); - return(man); + return man; } /* --- syntax tree handling ----------------------------------------------- */ @@ -1001,7 +1001,7 @@ roff_node_alloc(struct roff_man *man, int line, int pos, n->flags |= MDOC_LINE; man->flags &= ~MDOC_NEWLINE; - return(n); + return n; } void @@ -1115,7 +1115,7 @@ roff_block_alloc(struct roff_man *man, int line, int pos, int tok) n = roff_node_alloc(man, line, pos, ROFFT_BLOCK, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; - return(n); + return n; } struct roff_node * @@ -1126,7 +1126,7 @@ roff_head_alloc(struct roff_man *man, int line, int pos, int tok) n = roff_node_alloc(man, line, pos, ROFFT_HEAD, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; - return(n); + return n; } struct roff_node * @@ -1137,7 +1137,7 @@ roff_body_alloc(struct roff_man *man, int line, int pos, int tok) n = roff_node_alloc(man, line, pos, ROFFT_BODY, tok); roff_node_append(man, n); man->next = ROFF_NEXT_CHILD; - return(n); + return n; } void @@ -1354,7 +1354,7 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) if (EXPAND_LIMIT < ++expand_count) { mandoc_msg(MANDOCERR_ROFFLOOP, r->parse, ln, (int)(stesc - buf->buf), NULL); - return(ROFF_IGN); + return ROFF_IGN; } /* @@ -1461,7 +1461,7 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) } else if (buf->sz + strlen(res) > SHRT_MAX) { mandoc_msg(MANDOCERR_ROFFLOOP, r->parse, ln, (int)(stesc - buf->buf), NULL); - return(ROFF_IGN); + return ROFF_IGN; } /* Replace the escape sequence by the string. */ @@ -1477,7 +1477,7 @@ roff_res(struct roff *r, struct buf *buf, int ln, int pos) free(buf->buf); buf->buf = nbuf; } - return(ROFF_CONT); + return ROFF_CONT; } /* @@ -1502,7 +1502,7 @@ roff_parsetext(struct buf *buf, int pos, int *offs) *offs = 0; free(roffit_macro); roffit_lines = 0; - return(ROFF_REPARSE); + return ROFF_REPARSE; } else if (roffit_lines > 1) --roffit_lines; @@ -1536,7 +1536,7 @@ roff_parsetext(struct buf *buf, int pos, int *offs) *p = ASCII_HYPH; p++; } - return(ROFF_CONT); + return ROFF_CONT; } enum rofferr @@ -1558,7 +1558,7 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) (r->eqn == NULL || r->eqn_inline)) { e = roff_eqndelim(r, buf, pos); if (e == ROFF_REPARSE) - return(e); + return e; assert(e == ROFF_CONT); } @@ -1566,7 +1566,7 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) e = roff_res(r, buf, ln, pos); if (e == ROFF_IGN) - return(e); + return e; assert(e == ROFF_CONT); ctl = roff_getcontrol(r, buf->buf, &pos); @@ -1585,23 +1585,23 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) e = (*roffs[t].text)(r, t, buf, ln, pos, pos, offs); assert(e == ROFF_IGN || e == ROFF_CONT); if (e != ROFF_CONT) - return(e); + return e; } if (r->eqn != NULL) - return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs)); + return eqn_read(&r->eqn, ln, buf->buf, ppos, offs); if (r->tbl != NULL && ( ! ctl || buf->buf[pos] == '\0')) - return(tbl_read(r->tbl, ln, buf->buf, ppos)); + return tbl_read(r->tbl, ln, buf->buf, ppos); if ( ! ctl) - return(roff_parsetext(buf, pos, offs)); + return roff_parsetext(buf, pos, offs); /* Skip empty request lines. */ if (buf->buf[pos] == '"') { mandoc_msg(MANDOCERR_COMMENT_BAD, r->parse, ln, pos, NULL); - return(ROFF_IGN); + return ROFF_IGN; } else if (buf->buf[pos] == '\0') - return(ROFF_IGN); + return ROFF_IGN; /* * If a scope is open, go to the child handler for that macro, @@ -1612,7 +1612,7 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) if (r->last) { t = r->last->tok; assert(roffs[t].sub); - return((*roffs[t].sub)(r, t, buf, ln, ppos, pos, offs)); + return (*roffs[t].sub)(r, t, buf, ln, ppos, pos, offs); } /* No scope is open. This is a new request or macro. */ @@ -1626,12 +1626,12 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) mandoc_msg(MANDOCERR_TBLMACRO, r->parse, ln, pos, buf->buf + spos); if (t == ROFF_TS) - return(ROFF_IGN); + return ROFF_IGN; while (buf->buf[pos] != '\0' && buf->buf[pos] != ' ') pos++; while (buf->buf[pos] != '\0' && buf->buf[pos] == ' ') pos++; - return(tbl_read(r->tbl, ln, buf->buf, pos)); + return tbl_read(r->tbl, ln, buf->buf, pos); } /* @@ -1640,12 +1640,12 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs) */ if (t == ROFF_MAX) - return(ROFF_CONT); + return ROFF_CONT; /* Execute a roff request or a user defined macro. */ assert(roffs[t].proc); - return((*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs)); + return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); } void @@ -1685,7 +1685,7 @@ roff_parse(struct roff *r, char *buf, int *pos, int ln, int ppos) cp = buf + *pos; if ('\0' == *cp || '"' == *cp || '\t' == *cp || ' ' == *cp) - return(ROFF_MAX); + return ROFF_MAX; mac = cp; maclen = roff_getname(r, &cp, ln, ppos); @@ -1696,7 +1696,7 @@ roff_parse(struct roff *r, char *buf, int *pos, int ln, int ppos) if (ROFF_MAX != t) *pos = cp - buf; - return(t); + return t; } /* --- handling of request blocks ----------------------------------------- */ @@ -1713,7 +1713,7 @@ roff_cblock(ROFF_ARGS) if (r->last == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, ln, ppos, ".."); - return(ROFF_IGN); + return ROFF_IGN; } switch (r->last->tok) { @@ -1732,7 +1732,7 @@ roff_cblock(ROFF_ARGS) default: mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, ln, ppos, ".."); - return(ROFF_IGN); + return ROFF_IGN; } if (buf->buf[pos] != '\0') @@ -1741,7 +1741,7 @@ roff_cblock(ROFF_ARGS) roffnode_pop(r); roffnode_cleanscope(r); - return(ROFF_IGN); + return ROFF_IGN; } @@ -1836,7 +1836,7 @@ roff_block(ROFF_ARGS) if (namesz == 0 && tok != ROFF_ig) { mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, ln, ppos, roffs[tok].name); - return(ROFF_IGN); + return ROFF_IGN; } roffnode_push(r, tok, name, ln, ppos); @@ -1851,7 +1851,7 @@ roff_block(ROFF_ARGS) roff_setstrn(&r->strtab, name, namesz, "", 0, 0); if (*cp == '\0') - return(ROFF_IGN); + return ROFF_IGN; /* Get the custom end marker. */ @@ -1878,7 +1878,7 @@ roff_block(ROFF_ARGS) mandoc_vmsg(MANDOCERR_ARG_EXCESS, r->parse, ln, pos, ".%s ... %s", roffs[tok].name, cp); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -1914,8 +1914,8 @@ roff_block_sub(ROFF_ARGS) pos = i; if (roff_parse(r, buf->buf, &pos, ln, ppos) != ROFF_MAX) - return(ROFF_RERUN); - return(ROFF_IGN); + return ROFF_RERUN; + return ROFF_IGN; } } @@ -1929,11 +1929,11 @@ roff_block_sub(ROFF_ARGS) if (t != ROFF_cblock) { if (tok != ROFF_ig) roff_setstr(r, r->last->name, buf->buf + ppos, 2); - return(ROFF_IGN); + return ROFF_IGN; } assert(roffs[t].proc); - return((*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs)); + return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); } static enum rofferr @@ -1943,7 +1943,7 @@ roff_block_text(ROFF_ARGS) if (tok != ROFF_ig) roff_setstr(r, r->last->name, buf->buf + pos, 2); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -1965,7 +1965,7 @@ roff_cond_sub(ROFF_ARGS) if ((t != ROFF_MAX) && (rr || roffs[t].flags & ROFFMAC_STRUCT)) { assert(roffs[t].proc); - return((*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs)); + return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); } /* @@ -1987,7 +1987,7 @@ roff_cond_sub(ROFF_ARGS) if (*ep != '\0') ++ep; } - return(rr ? ROFF_CONT : ROFF_IGN); + return rr ? ROFF_CONT : ROFF_IGN; } static enum rofferr @@ -2008,7 +2008,7 @@ roff_cond_text(ROFF_ARGS) if (*ep != '\0') ++ep; } - return(rr ? ROFF_CONT : ROFF_IGN); + return rr ? ROFF_CONT : ROFF_IGN; } /* --- handling of numeric and conditional expressions -------------------- */ @@ -2084,7 +2084,7 @@ roff_getnum(const char *v, int *pos, int *res, int flags) *res = scaled; *pos = p + 1; - return(1); + return 1; } /* @@ -2127,7 +2127,7 @@ out: else if (*s3 != '\0') s3++; *pos = s3 - v; - return(match); + return match; } /* @@ -2149,12 +2149,12 @@ roff_evalcond(struct roff *r, int ln, char *v, int *pos) switch (v[*pos]) { case '\0': - return(0); + return 0; case 'n': /* FALLTHROUGH */ case 'o': (*pos)++; - return(wanttrue); + return wanttrue; case 'c': /* FALLTHROUGH */ case 'd': @@ -2165,30 +2165,30 @@ roff_evalcond(struct roff *r, int ln, char *v, int *pos) /* FALLTHROUGH */ case 'v': (*pos)++; - return(!wanttrue); + return !wanttrue; case 'r': cp = name = v + ++*pos; sz = roff_getname(r, &cp, ln, *pos); *pos = cp - v; - return((sz && roff_hasregn(r, name, sz)) == wanttrue); + return (sz && roff_hasregn(r, name, sz)) == wanttrue; default: break; } savepos = *pos; if (roff_evalnum(r, ln, v, pos, &number, ROFFNUM_SCALE)) - return((number > 0) == wanttrue); + return (number > 0) == wanttrue; else if (*pos == savepos) - return(roff_evalstrcond(v, pos) == wanttrue); + return roff_evalstrcond(v, pos) == wanttrue; else - return (0); + return 0; } static enum rofferr roff_line_ignore(ROFF_ARGS) { - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2197,7 +2197,7 @@ roff_insec(ROFF_ARGS) mandoc_msg(MANDOCERR_REQ_INSEC, r->parse, ln, ppos, roffs[tok].name); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2206,7 +2206,7 @@ roff_unsupp(ROFF_ARGS) mandoc_msg(MANDOCERR_REQ_UNSUPP, r->parse, ln, ppos, roffs[tok].name); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2284,7 +2284,7 @@ roff_cond(ROFF_ARGS) out: *offs = pos; - return(ROFF_RERUN); + return ROFF_RERUN; } static enum rofferr @@ -2309,11 +2309,11 @@ roff_ds(ROFF_ARGS) name = string = buf->buf + pos; if (*name == '\0') - return(ROFF_IGN); + return ROFF_IGN; namesz = roff_getname(r, &string, ln, pos); if (name[namesz] == '\\') - return(ROFF_IGN); + return ROFF_IGN; /* Read past the initial double-quote, if any. */ if (*string == '"') @@ -2322,7 +2322,7 @@ roff_ds(ROFF_ARGS) /* The rest is the value. */ roff_setstrn(&r->strtab, name, namesz, string, strlen(string), ROFF_as == tok); - return(ROFF_IGN); + return ROFF_IGN; } /* @@ -2388,11 +2388,11 @@ roff_getop(const char *v, int *pos, char *res) (*pos)++; break; default: - return(0); + return 0; } (*pos)++; - return(*res); + return *res; } /* @@ -2405,11 +2405,11 @@ roff_evalpar(struct roff *r, int ln, { if ('(' != v[*pos]) - return(roff_getnum(v, pos, res, flags)); + return roff_getnum(v, pos, res, flags); (*pos)++; if ( ! roff_evalnum(r, ln, v, pos, res, flags | ROFFNUM_WHITE)) - return(0); + return 0; /* * Omission of the closing parenthesis @@ -2420,9 +2420,9 @@ roff_evalpar(struct roff *r, int ln, if (')' == v[*pos]) (*pos)++; else if (NULL == res) - return(0); + return 0; - return(1); + return 1; } /* @@ -2446,7 +2446,7 @@ roff_evalnum(struct roff *r, int ln, const char *v, (*pos)++; if ( ! roff_evalpar(r, ln, v, pos, res, flags)) - return(0); + return 0; while (1) { if (flags & ROFFNUM_WHITE) @@ -2461,7 +2461,7 @@ roff_evalnum(struct roff *r, int ln, const char *v, (*pos)++; if ( ! roff_evalpar(r, ln, v, pos, &operand2, flags)) - return(0); + return 0; if (flags & ROFFNUM_WHITE) while (isspace((unsigned char)v[*pos])) @@ -2534,7 +2534,7 @@ roff_evalnum(struct roff *r, int ln, const char *v, abort(); } } - return(1); + return 1; } /* --- register management ------------------------------------------------ */ @@ -2580,21 +2580,21 @@ roff_getregro(const struct roff *r, const char *name) switch (*name) { case '$': /* Number of arguments of the last macro evaluated. */ - return(r->argc); + return r->argc; case 'A': /* ASCII approximation mode is always off. */ - return(0); + return 0; case 'g': /* Groff compatibility mode is always on. */ - return(1); + return 1; case 'H': /* Fixed horizontal resolution. */ - return (24); + return 24; case 'j': /* Always adjust left margin only. */ - return(0); + return 0; case 'T': /* Some output device is always defined. */ - return(1); + return 1; case 'V': /* Fixed vertical resolution. */ - return (40); + return 40; default: - return (-1); + return -1; } } @@ -2607,14 +2607,14 @@ roff_getreg(const struct roff *r, const char *name) if ('.' == name[0] && '\0' != name[1] && '\0' == name[2]) { val = roff_getregro(r, name + 1); if (-1 != val) - return (val); + return val; } for (reg = r->regtab; reg; reg = reg->next) if (0 == strcmp(name, reg->key.p)) - return(reg->val); + return reg->val; - return(0); + return 0; } static int @@ -2626,15 +2626,15 @@ roff_getregn(const struct roff *r, const char *name, size_t len) if ('.' == name[0] && 2 == len) { val = roff_getregro(r, name + 1); if (-1 != val) - return (val); + return val; } for (reg = r->regtab; reg; reg = reg->next) if (len == reg->key.sz && 0 == strncmp(name, reg->key.p, len)) - return(reg->val); + return reg->val; - return(0); + return 0; } static int @@ -2646,15 +2646,15 @@ roff_hasregn(const struct roff *r, const char *name, size_t len) if ('.' == name[0] && 2 == len) { val = roff_getregro(r, name + 1); if (-1 != val) - return(1); + return 1; } for (reg = r->regtab; reg; reg = reg->next) if (len == reg->key.sz && 0 == strncmp(name, reg->key.p, len)) - return(1); + return 1; - return(0); + return 0; } static void @@ -2680,11 +2680,11 @@ roff_nr(ROFF_ARGS) key = val = buf->buf + pos; if (*key == '\0') - return(ROFF_IGN); + return ROFF_IGN; keysz = roff_getname(r, &val, ln, pos); if (key[keysz] == '\\') - return(ROFF_IGN); + return ROFF_IGN; key[keysz] = '\0'; sign = *val; @@ -2694,7 +2694,7 @@ roff_nr(ROFF_ARGS) if (roff_evalnum(r, ln, val, NULL, &iv, ROFFNUM_SCALE)) roff_setreg(r, key, iv, sign); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2706,7 +2706,7 @@ roff_rr(ROFF_ARGS) name = cp = buf->buf + pos; if (*name == '\0') - return(ROFF_IGN); + return ROFF_IGN; namesz = roff_getname(r, &cp, ln, pos); name[namesz] = '\0'; @@ -2722,7 +2722,7 @@ roff_rr(ROFF_ARGS) free(reg->key.p); free(reg); } - return(ROFF_IGN); + return ROFF_IGN; } /* --- handler functions for roff requests -------------------------------- */ @@ -2742,7 +2742,7 @@ roff_rm(ROFF_ARGS) if (name[namesz] == '\\') break; } - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2755,7 +2755,7 @@ roff_it(ROFF_ARGS) if ( ! roff_evalnum(r, ln, buf->buf, &pos, &iv, 0)) { mandoc_msg(MANDOCERR_IT_NONUM, r->parse, ln, ppos, buf->buf + 1); - return(ROFF_IGN); + return ROFF_IGN; } while (isspace((unsigned char)buf->buf[pos])) @@ -2771,7 +2771,7 @@ roff_it(ROFF_ARGS) roffit_macro = mandoc_strdup(iv != 1 || strcmp(buf->buf + pos, "an-trap") ? buf->buf + pos : "br"); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2786,7 +2786,7 @@ roff_Dd(ROFF_ARGS) if (r->format == 0) r->format = MPARSE_MDOC; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2801,7 +2801,7 @@ roff_TH(ROFF_ARGS) if (r->format == 0) r->format = MPARSE_MAN; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2815,9 +2815,9 @@ roff_TE(ROFF_ARGS) free(buf->buf); buf->buf = mandoc_strdup(".sp"); buf->sz = 4; - return(ROFF_REPARSE); + return ROFF_REPARSE; } - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2830,7 +2830,7 @@ roff_T_(ROFF_ARGS) else tbl_restart(ppos, ln, r->tbl); - return(ROFF_IGN); + return ROFF_IGN; } /* @@ -2853,7 +2853,7 @@ roff_eqndelim(struct roff *r, struct buf *buf, int pos) cp2 = strchr(cp1, r->eqn == NULL ? r->last_eqn->odelim : r->last_eqn->cdelim); if (cp2 == NULL) - return(ROFF_CONT); + return ROFF_CONT; *cp2++ = '\0'; bef_pr = bef_nl = aft_nl = aft_pr = ""; @@ -2896,7 +2896,7 @@ roff_eqndelim(struct roff *r, struct buf *buf, int pos) /* Toggle the in-line state of the eqn subsystem. */ r->eqn_inline = r->eqn == NULL; - return(ROFF_REPARSE); + return ROFF_REPARSE; } static enum rofferr @@ -2921,7 +2921,7 @@ roff_EQ(ROFF_ARGS) mandoc_vmsg(MANDOCERR_ARG_SKIP, r->parse, ln, pos, ".EQ %s", buf->buf + pos); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2929,7 +2929,7 @@ roff_EN(ROFF_ARGS) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, ln, ppos, "EN"); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2951,7 +2951,7 @@ roff_TS(ROFF_ARGS) r->first_tbl = r->last_tbl = tbl; r->tbl = r->last_tbl = tbl; - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2959,7 +2959,7 @@ roff_brp(ROFF_ARGS) { buf->buf[pos - 1] = '\0'; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2976,7 +2976,7 @@ roff_cc(ROFF_ARGS) mandoc_vmsg(MANDOCERR_ARG_EXCESS, r->parse, ln, p - buf->buf, "cc ... %s", p); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2990,7 +2990,7 @@ roff_tr(ROFF_ARGS) if (*p == '\0') { mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, ln, ppos, "tr"); - return(ROFF_IGN); + return ROFF_IGN; } while (*p != '\0') { @@ -3002,7 +3002,7 @@ roff_tr(ROFF_ARGS) if (esc == ESCAPE_ERROR) { mandoc_msg(MANDOCERR_ESC_BAD, r->parse, ln, (int)(p - buf->buf), first); - return(ROFF_IGN); + return ROFF_IGN; } fsz = (size_t)(p - first); } @@ -3013,7 +3013,7 @@ roff_tr(ROFF_ARGS) if (esc == ESCAPE_ERROR) { mandoc_msg(MANDOCERR_ESC_BAD, r->parse, ln, (int)(p - buf->buf), second); - return(ROFF_IGN); + return ROFF_IGN; } ssz = (size_t)(p - second); } else if (*second == '\0') { @@ -3038,7 +3038,7 @@ roff_tr(ROFF_ARGS) r->xtab[(int)*first].sz = ssz; } - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -3064,11 +3064,11 @@ roff_so(ROFF_ARGS) free(buf->buf); buf->buf = cp; *offs = 0; - return(ROFF_REPARSE); + return ROFF_REPARSE; } *offs = pos; - return(ROFF_SO); + return ROFF_SO; } /* --- user defined strings and macros ------------------------------------ */ @@ -3196,8 +3196,8 @@ roff_userdef(ROFF_ARGS) buf->buf = n1; *offs = 0; - return(buf->sz > 1 && buf->buf[buf->sz - 2] == '\n' ? - ROFF_REPARSE : ROFF_APPEND); + return buf->sz > 1 && buf->buf[buf->sz - 2] == '\n' ? + ROFF_REPARSE : ROFF_APPEND; } static size_t @@ -3208,7 +3208,7 @@ roff_getname(struct roff *r, char **cpp, int ln, int pos) name = *cpp; if ('\0' == *name) - return(0); + return 0; /* Read until end of name and terminate it with NUL. */ for (cp = name; 1; cp++) { @@ -3235,7 +3235,7 @@ roff_getname(struct roff *r, char **cpp, int ln, int pos) cp++; *cpp = cp; - return(namesz); + return namesz; } /* @@ -3335,14 +3335,14 @@ roff_getstrn(const struct roff *r, const char *name, size_t len) for (n = r->strtab; n; n = n->next) if (0 == strncmp(name, n->key.p, len) && '\0' == n->key.p[(int)len]) - return(n->val.p); + return n->val.p; for (i = 0; i < PREDEFS_MAX; i++) if (0 == strncmp(name, predefs[i].name, len) && '\0' == predefs[i].name[(int)len]) - return(predefs[i].str); + return predefs[i].str; - return(NULL); + return NULL; } static void @@ -3364,14 +3364,14 @@ const struct tbl_span * roff_span(const struct roff *r) { - return(r->tbl ? tbl_span(r->tbl) : NULL); + return r->tbl ? tbl_span(r->tbl) : NULL; } const struct eqn * roff_eqn(const struct roff *r) { - return(r->last_eqn ? &r->last_eqn->eqn : NULL); + return r->last_eqn ? &r->last_eqn->eqn : NULL; } /* @@ -3389,9 +3389,9 @@ roff_strdup(const struct roff *r, const char *p) enum mandoc_esc esc; if (NULL == r->xmbtab && NULL == r->xtab) - return(mandoc_strdup(p)); + return mandoc_strdup(p); else if ('\0' == *p) - return(mandoc_strdup("")); + return mandoc_strdup(""); /* * Step through each character looking for term matches @@ -3463,14 +3463,14 @@ roff_strdup(const struct roff *r, const char *p) } res[(int)ssz] = '\0'; - return(res); + return res; } int roff_getformat(const struct roff *r) { - return(r->format); + return r->format; } /* @@ -3493,17 +3493,17 @@ roff_getcontrol(const struct roff *r, const char *cp, int *ppos) if (0 != r->control && cp[pos] == r->control) pos++; else if (0 != r->control) - return(0); + return 0; else if ('\\' == cp[pos] && '.' == cp[pos + 1]) pos += 2; else if ('.' == cp[pos] || '\'' == cp[pos]) pos++; else - return(0); + return 0; while (' ' == cp[pos] || '\t' == cp[pos]) pos++; *ppos = pos; - return(1); + return 1; } diff --git a/usr.bin/mandoc/st.c b/usr.bin/mandoc/st.c index eaa6a20843d..5ca53978e98 100644 --- a/usr.bin/mandoc/st.c +++ b/usr.bin/mandoc/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.9 2015/04/02 21:03:18 schwarze Exp $ */ +/* $OpenBSD: st.c,v 1.10 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -31,5 +31,5 @@ mdoc_a2st(const char *p) #include "st.in" - return(NULL); + return NULL; } diff --git a/usr.bin/mandoc/tag.c b/usr.bin/mandoc/tag.c index 30237d1c835..3b22b4e77b9 100644 --- a/usr.bin/mandoc/tag.c +++ b/usr.bin/mandoc/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.7 2015/08/29 15:28:19 schwarze Exp $ */ +/* $OpenBSD: tag.c,v 1.8 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2015 Ingo Schwarze * @@ -91,7 +91,7 @@ tag_init(void) tag_info.key_offset = offsetof(struct tag_entry, s); tag_info.data = NULL; ohash_init(&tag_data, 4, &tag_info); - return(&tag_files); + return &tag_files; fail: tag_unlink(); @@ -105,7 +105,7 @@ fail: *tag_files.tfn = '\0'; tag_files.ofd = -1; tag_files.tfd = -1; - return(NULL); + return NULL; } /* @@ -189,14 +189,14 @@ static void * tag_alloc(size_t sz, void *arg) { - return(mandoc_malloc(sz)); + return mandoc_malloc(sz); } static void * tag_calloc(size_t nmemb, size_t sz, void *arg) { - return(mandoc_calloc(nmemb, sz)); + return mandoc_calloc(nmemb, sz); } static void diff --git a/usr.bin/mandoc/tbl.c b/usr.bin/mandoc/tbl.c index af145363190..0e638a482f2 100644 --- a/usr.bin/mandoc/tbl.c +++ b/usr.bin/mandoc/tbl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl.c,v 1.20 2015/01/30 17:31:20 schwarze Exp $ */ +/* $OpenBSD: tbl.c,v 1.21 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2015 Ingo Schwarze @@ -64,7 +64,7 @@ tbl_read(struct tbl_node *tbl, int ln, const char *p, int pos) if (*cp == ';') { tbl_option(tbl, ln, p, &pos); if (p[pos] == '\0') - return(ROFF_IGN); + return ROFF_IGN; } } @@ -73,15 +73,15 @@ tbl_read(struct tbl_node *tbl, int ln, const char *p, int pos) switch (tbl->part) { case TBL_PART_LAYOUT: tbl_layout(tbl, ln, p, pos); - return(ROFF_IGN); + return ROFF_IGN; case TBL_PART_CDATA: - return(tbl_cdata(tbl, ln, p, pos) ? ROFF_TBL : ROFF_IGN); + return tbl_cdata(tbl, ln, p, pos) ? ROFF_TBL : ROFF_IGN; default: break; } tbl_data(tbl, ln, p, pos); - return(ROFF_TBL); + return ROFF_TBL; } struct tbl_node * @@ -96,7 +96,7 @@ tbl_alloc(int pos, int line, struct mparse *parse) tbl->part = TBL_PART_OPTS; tbl->opts.tab = '\t'; tbl->opts.decimal = '.'; - return(tbl); + return tbl; } void @@ -153,7 +153,7 @@ tbl_span(struct tbl_node *tbl) : tbl->first_span; if (span) tbl->current_span = span; - return(span); + return span; } int @@ -175,7 +175,7 @@ tbl_end(struct tbl_node **tblp) if (sp == NULL) { mandoc_msg(MANDOCERR_TBLDATA_NONE, tbl->parse, tbl->line, tbl->pos, NULL); - return(0); + return 0; } - return(1); + return 1; } diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c index 417199169a2..479d892855f 100644 --- a/usr.bin/mandoc/tbl_data.c +++ b/usr.bin/mandoc/tbl_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl_data.c,v 1.27 2015/04/19 20:34:56 schwarze Exp $ */ +/* $OpenBSD: tbl_data.c,v 1.28 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2015 Ingo Schwarze @@ -132,10 +132,10 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos) pos++; while (p[pos] != '\0') getdata(tbl, tbl->last_span, ln, p, &pos); - return(1); + return 1; } else if (p[pos] == '\0') { tbl->part = TBL_PART_DATA; - return(1); + return 1; } /* Fallthrough: T} is part of a word. */ @@ -155,7 +155,7 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos) mandoc_msg(MANDOCERR_TBLDATA_SPAN, tbl->parse, ln, pos, dat->string); - return(0); + return 0; } static struct tbl_span * @@ -176,7 +176,7 @@ newspan(struct tbl_node *tbl, int line, struct tbl_row *rp) dp->prev->next = dp; tbl->last_span = dp; - return(dp); + return dp; } void diff --git a/usr.bin/mandoc/tbl_html.c b/usr.bin/mandoc/tbl_html.c index f5c844d7588..de851e3559a 100644 --- a/usr.bin/mandoc/tbl_html.c +++ b/usr.bin/mandoc/tbl_html.c @@ -1,6 +1,7 @@ -/* $OpenBSD: tbl_html.c,v 1.11 2015/01/30 17:31:20 schwarze Exp $ */ +/* $OpenBSD: tbl_html.c,v 1.12 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons + * Copyright (c) 2014, 2015 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -34,14 +35,14 @@ static size_t html_tbl_len(size_t sz, void *arg) { - return(sz); + return sz; } static size_t html_tbl_strlen(const char *p, void *arg) { - return(strlen(p)); + return strlen(p); } static void diff --git a/usr.bin/mandoc/tbl_layout.c b/usr.bin/mandoc/tbl_layout.c index 8f95b0a5a95..7fc0cc6abf5 100644 --- a/usr.bin/mandoc/tbl_layout.c +++ b/usr.bin/mandoc/tbl_layout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl_layout.c,v 1.26 2015/04/29 12:44:10 schwarze Exp $ */ +/* $OpenBSD: tbl_layout.c,v 1.27 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2012, 2014, 2015 Ingo Schwarze @@ -353,5 +353,5 @@ cell_alloc(struct tbl_node *tbl, struct tbl_row *rp, enum tbl_cellt pos) if (tbl->opts.cols <= p->col) tbl->opts.cols = p->col + 1; - return(p); + return p; } diff --git a/usr.bin/mandoc/tbl_term.c b/usr.bin/mandoc/tbl_term.c index cd63107d17d..cda6cc2cdef 100644 --- a/usr.bin/mandoc/tbl_term.c +++ b/usr.bin/mandoc/tbl_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl_term.c,v 1.29 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: tbl_term.c,v 1.30 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze @@ -45,14 +45,14 @@ static size_t term_tbl_strlen(const char *p, void *arg) { - return(term_strlen((const struct termp *)arg, p)); + return term_strlen((const struct termp *)arg, p); } static size_t term_tbl_len(size_t sz, void *arg) { - return(term_len((const struct termp *)arg, sz)); + return term_len((const struct termp *)arg, sz); } void diff --git a/usr.bin/mandoc/term.c b/usr.bin/mandoc/term.c index bcf710ed602..a4516589e52 100644 --- a/usr.bin/mandoc/term.c +++ b/usr.bin/mandoc/term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term.c,v 1.111 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: term.c,v 1.112 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -642,7 +642,7 @@ size_t term_len(const struct termp *p, size_t sz) { - return((*p->width)(p, ' ') * sz); + return (*p->width)(p, ' ') * sz; } static size_t @@ -651,9 +651,9 @@ cond_width(const struct termp *p, int c, int *skip) if (*skip) { (*skip) = 0; - return(0); + return 0; } else - return((*p->width)(p, c)); + return (*p->width)(p, c); } size_t @@ -777,7 +777,7 @@ term_strlen(const struct termp *p, const char *cp) } } - return(sz); + return sz; } int @@ -820,7 +820,7 @@ term_vspan(const struct termp *p, const struct roffsu *su) abort(); } ri = r > 0.0 ? r + 0.4995 : r - 0.4995; - return(ri < 66 ? ri : 1); + return ri < 66 ? ri : 1; } /* @@ -830,5 +830,5 @@ int term_hspan(const struct termp *p, const struct roffsu *su) { - return((*p->hspan)(p, su)); + return (*p->hspan)(p, su); } diff --git a/usr.bin/mandoc/term_ascii.c b/usr.bin/mandoc/term_ascii.c index a5cac05a4e8..a9df045f27a 100644 --- a/usr.bin/mandoc/term_ascii.c +++ b/usr.bin/mandoc/term_ascii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term_ascii.c,v 1.34 2015/09/26 00:53:15 schwarze Exp $ */ +/* $OpenBSD: term_ascii.c,v 1.35 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -103,28 +103,28 @@ ascii_init(enum termenc enc, const struct mchars *mchars, if (outopts->synopsisonly) p->synopsisonly = 1; - return(p); + return p; } void * ascii_alloc(const struct mchars *mchars, const struct manoutput *outopts) { - return(ascii_init(TERMENC_ASCII, mchars, outopts)); + return ascii_init(TERMENC_ASCII, mchars, outopts); } void * utf8_alloc(const struct mchars *mchars, const struct manoutput *outopts) { - return(ascii_init(TERMENC_UTF8, mchars, outopts)); + return ascii_init(TERMENC_UTF8, mchars, outopts); } void * locale_alloc(const struct mchars *mchars, const struct manoutput *outopts) { - return(ascii_init(TERMENC_LOCALE, mchars, outopts)); + return ascii_init(TERMENC_LOCALE, mchars, outopts); } static void @@ -164,7 +164,7 @@ static size_t ascii_width(const struct termp *p, int c) { - return(1); + return 1; } void @@ -249,7 +249,7 @@ ascii_hspan(const struct termp *p, const struct roffsu *su) default: abort(); } - return(r > 0.0 ? r + 0.01 : r - 0.01); + return r > 0.0 ? r + 0.01 : r - 0.01; } const char * @@ -324,8 +324,8 @@ ascii_uc2str(int uc) assert(uc >= 0); if ((size_t)uc < sizeof(tab)/sizeof(tab[0])) - return(tab[uc]); - return(mchars_uc2str(uc)); + return tab[uc]; + return mchars_uc2str(uc); } static size_t @@ -338,7 +338,7 @@ locale_width(const struct termp *p, int c) rc = wcwidth(c); if (rc < 0) rc = 0; - return(rc); + return rc; } static void diff --git a/usr.bin/mandoc/term_ps.c b/usr.bin/mandoc/term_ps.c index d40133171b5..22a25d6cfc1 100644 --- a/usr.bin/mandoc/term_ps.c +++ b/usr.bin/mandoc/term_ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term_ps.c,v 1.39 2015/04/04 17:46:58 schwarze Exp $ */ +/* $OpenBSD: term_ps.c,v 1.40 2015/10/06 18:30:44 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -511,7 +511,7 @@ pdf_alloc(const struct mchars *mchars, const struct manoutput *outopts) if (NULL != (p = pspdf_alloc(mchars, outopts))) p->type = TERMTYPE_PDF; - return(p); + return p; } void * @@ -522,7 +522,7 @@ ps_alloc(const struct mchars *mchars, const struct manoutput *outopts) if (NULL != (p = pspdf_alloc(mchars, outopts))) p->type = TERMTYPE_PS; - return(p); + return p; } static struct termp * @@ -611,7 +611,7 @@ pspdf_alloc(const struct mchars *mchars, const struct manoutput *outopts) p->ps->lineheight = lineheight; p->defrmargin = pagex - (marginx * 2); - return(p); + return p; } static void @@ -1265,7 +1265,7 @@ ps_width(const struct termp *p, int c) else c -= 32; - return((size_t)fonts[(int)TERMFONT_NONE].gly[c].wx); + return (size_t)fonts[(int)TERMFONT_NONE].gly[c].wx; } static int @@ -1320,7 +1320,7 @@ ps_hspan(const struct termp *p, const struct roffsu *su) break; } - return(r * 24.0); + return r * 24.0; } static void