diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-06 18:32:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-06 18:32:19 +0000 |
commit | cdd9965f2080354017315270cbc3dc2da6378df9 (patch) | |
tree | abceb46c894355584ad94178001ebb10ff35db04 | |
parent | 2c5e2d1085930e82ce52bf9402182a0630e8f39d (diff) | |
download | mandoc-cdd9965f2080354017315270cbc3dc2da6378df9.tar.gz |
modernize style: "return" is not a function
-rw-r--r-- | att.c | 2 | ||||
-rw-r--r-- | cgi.c | 36 | ||||
-rw-r--r-- | chars.c | 22 | ||||
-rw-r--r-- | compat_isblank.c | 2 | ||||
-rw-r--r-- | compat_mkdtemp.c | 8 | ||||
-rw-r--r-- | compat_sqlite3_errstr.c | 2 | ||||
-rw-r--r-- | compat_vasprintf.c | 4 | ||||
-rw-r--r-- | demandoc.c | 4 | ||||
-rw-r--r-- | eqn.c | 40 | ||||
-rw-r--r-- | html.c | 14 | ||||
-rw-r--r-- | lib.c | 2 | ||||
-rw-r--r-- | main.c | 40 | ||||
-rw-r--r-- | man.c | 20 | ||||
-rw-r--r-- | man_hash.c | 11 | ||||
-rw-r--r-- | man_html.c | 60 | ||||
-rw-r--r-- | man_macro.c | 4 | ||||
-rw-r--r-- | man_term.c | 64 | ||||
-rw-r--r-- | mandoc.c | 51 | ||||
-rw-r--r-- | mandoc_aux.c | 14 | ||||
-rw-r--r-- | mandocdb.c | 84 | ||||
-rw-r--r-- | manpage.c | 10 | ||||
-rw-r--r-- | mansearch.c | 46 | ||||
-rw-r--r-- | mdoc.c | 48 | ||||
-rw-r--r-- | mdoc_argv.c | 32 | ||||
-rw-r--r-- | mdoc_hash.c | 13 | ||||
-rw-r--r-- | mdoc_html.c | 190 | ||||
-rw-r--r-- | mdoc_macro.c | 48 | ||||
-rw-r--r-- | mdoc_man.c | 142 | ||||
-rw-r--r-- | mdoc_term.c | 156 | ||||
-rw-r--r-- | mdoc_validate.c | 92 | ||||
-rw-r--r-- | msec.c | 2 | ||||
-rw-r--r-- | out.c | 6 | ||||
-rw-r--r-- | preconv.c | 18 | ||||
-rw-r--r-- | read.c | 26 | ||||
-rw-r--r-- | roff.c | 256 | ||||
-rw-r--r-- | st.c | 2 | ||||
-rw-r--r-- | tag.c | 8 | ||||
-rw-r--r-- | tbl.c | 16 | ||||
-rw-r--r-- | tbl_data.c | 8 | ||||
-rw-r--r-- | tbl_html.c | 5 | ||||
-rw-r--r-- | tbl_layout.c | 2 | ||||
-rw-r--r-- | tbl_term.c | 4 | ||||
-rw-r--r-- | term.c | 12 | ||||
-rw-r--r-- | term_ascii.c | 18 | ||||
-rw-r--r-- | term_ps.c | 10 | ||||
-rw-r--r-- | test-dirent-namlen.c | 2 | ||||
-rw-r--r-- | test-fgetln.c | 2 | ||||
-rw-r--r-- | test-fts.c | 10 | ||||
-rw-r--r-- | test-getsubopt.c | 4 | ||||
-rw-r--r-- | test-isblank.c | 2 | ||||
-rw-r--r-- | test-mkdtemp.c | 4 | ||||
-rw-r--r-- | test-mmap.c | 2 | ||||
-rw-r--r-- | test-ohash.c | 4 | ||||
-rw-r--r-- | test-reallocarray.c | 2 | ||||
-rw-r--r-- | test-sqlite3.c | 8 | ||||
-rw-r--r-- | test-sqlite3_errstr.c | 2 | ||||
-rw-r--r-- | test-strcasestr.c | 2 | ||||
-rw-r--r-- | test-stringlist.c | 10 | ||||
-rw-r--r-- | test-strlcat.c | 4 | ||||
-rw-r--r-- | test-strlcpy.c | 4 | ||||
-rw-r--r-- | test-strptime.c | 4 | ||||
-rw-r--r-- | test-strsep.c | 2 | ||||
-rw-r--r-- | test-strtonum.c | 18 | ||||
-rw-r--r-- | test-vasprintf.c | 8 | ||||
-rw-r--r-- | test-wchar.c | 12 |
65 files changed, 882 insertions, 878 deletions
@@ -46,5 +46,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; } @@ -332,13 +332,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; @@ -347,7 +347,7 @@ http_decode(char *p) } *q = '\0'; - return(1); + return 1; } static void @@ -499,10 +499,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 @@ -511,13 +511,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 @@ -527,8 +527,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 @@ -1031,7 +1031,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. */ @@ -1043,7 +1043,7 @@ main(void) fprintf(stderr, "unsafe SCRIPT_NAME \"%s\"\n", scriptname); pg_error_internal(); - return(EXIT_FAILURE); + return EXIT_FAILURE; } /* @@ -1056,7 +1056,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)); @@ -1072,13 +1072,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. */ @@ -1103,7 +1103,7 @@ main(void) for (i = 0; i < (int)req.psz; i++) free(req.p[i]); free(req.p); - return(EXIT_SUCCESS); + return EXIT_SUCCESS; } /* @@ -95,7 +95,7 @@ mchars_alloc(void) } tab->htab = htab; - return(tab); + return tab; } int @@ -104,7 +104,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 @@ -113,7 +113,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 @@ -123,7 +123,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 * @@ -135,11 +135,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 * @@ -149,8 +149,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 * @@ -162,14 +162,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/compat_isblank.c b/compat_isblank.c index af8bdce8..0d3ebbc4 100644 --- a/compat_isblank.c +++ b/compat_isblank.c @@ -27,7 +27,7 @@ int isblank(int c) { - return(c == ' ' || c == '\t'); + return c == ' ' || c == '\t'; } #endif diff --git a/compat_mkdtemp.c b/compat_mkdtemp.c index d12fa87a..92144d83 100644 --- a/compat_mkdtemp.c +++ b/compat_mkdtemp.c @@ -45,17 +45,17 @@ mkdtemp(char *path) for (tries = INT_MAX; tries; tries--) { if (mktemp(path) == NULL) { errno = EEXIST; - return(NULL); + return NULL; } if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR) == 0) - return(path); + return path; if (errno != EEXIST) - return(NULL); + return NULL; for (cp = start; *cp != '\0'; cp++) *cp = 'X'; } errno = EEXIST; - return(NULL); + return NULL; } #endif diff --git a/compat_sqlite3_errstr.c b/compat_sqlite3_errstr.c index c6238488..8a6ace28 100644 --- a/compat_sqlite3_errstr.c +++ b/compat_sqlite3_errstr.c @@ -10,7 +10,7 @@ const char * sqlite3_errstr(int rc) { - return(rc ? "unknown error" : "not an error"); + return rc ? "unknown error" : "not an error"; } #endif diff --git a/compat_vasprintf.c b/compat_vasprintf.c index bfeb96dd..72e8dbcf 100644 --- a/compat_vasprintf.c +++ b/compat_vasprintf.c @@ -46,11 +46,11 @@ vasprintf(char **ret, const char *format, va_list ap) if (sz != -1 && (*ret = malloc(sz + 1)) != NULL) { if (vsnprintf(*ret, sz + 1, format, ap) == sz) - return(sz); + return sz; free(*ret); } *ret = NULL; - return(-1); + return -1; } #endif @@ -73,7 +73,7 @@ main(int argc, char *argv[]) break; default: usage(); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } argc -= optind; @@ -97,7 +97,7 @@ main(int argc, char *argv[]) mparse_free(mp); mchars_free(mchars); - return((int)MANDOCLEVEL_OK); + return (int)MANDOCLEVEL_OK; } static void @@ -302,10 +302,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; } /* @@ -324,7 +324,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 * @@ -339,7 +339,7 @@ eqn_alloc(int pos, int line, struct mparse *parse) p->eqn.pos = pos; p->gsize = EQN_DEFSIZE; - return(p); + return p; } /* @@ -353,9 +353,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; } /* @@ -382,7 +382,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; @@ -390,7 +390,7 @@ again: q = 0; if ('\0' == *start) - return(NULL); + return NULL; if (quote == *start) { ep->cur++; @@ -432,7 +432,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; @@ -451,7 +451,7 @@ again: goto again; } - return(start); + return start; } /* @@ -462,7 +462,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); } /* @@ -472,7 +472,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); } /* @@ -498,12 +498,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++) { @@ -516,7 +516,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 @@ -557,7 +557,7 @@ eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent) parent->first = bp; parent->last = bp; - return(bp); + return bp; } /* @@ -587,7 +587,7 @@ eqn_box_makebinary(struct eqn_node *ep, newb->first = newb->last = b; newb->first->next = NULL; b->parent = newb; - return(newb); + return newb; } /* @@ -712,7 +712,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); @@ -1060,7 +1060,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); @@ -1104,7 +1104,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 @@ -145,7 +145,7 @@ html_alloc(const struct mchars *mchars, const struct manoutput *outopts) if (outopts->fragment) h->oflags |= HTML_FRAGMENT; - return(h); + return h; } void @@ -281,7 +281,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: @@ -301,7 +301,7 @@ html_strlen(const char *cp) break; } } - return(sz); + return sz; } static int @@ -330,9 +330,9 @@ print_escape(char c) case ASCII_BREAK: break; default: - return(0); + return 0; } - return(1); + return 1; } static int @@ -432,7 +432,7 @@ print_encode(struct html *h, const char *p, int norecurse) putchar(c); } - return(nospace); + return nospace; } static void @@ -494,7 +494,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 @@ -33,5 +33,5 @@ mdoc_a2lib(const char *p) #include "lib.in" - return(NULL); + return NULL; } @@ -148,7 +148,7 @@ main(int argc, char *argv[]) #if HAVE_SQLITE3 if (strcmp(progname, BINM_MAKEWHATIS) == 0) - return(mandocdb(argc, argv)); + return mandocdb(argc, argv); #endif /* Search options. */ @@ -210,13 +210,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; @@ -225,7 +225,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; @@ -254,11 +254,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; @@ -349,7 +349,7 @@ main(int argc, char *argv[]) if (search.argmode != ARG_NAME) { fputs("mandoc: database support not compiled in\n", stderr); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } sz = 0; #endif @@ -418,7 +418,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; @@ -504,7 +504,7 @@ out: tag_unlink(); } - return((int)rc); + return (int)rc; } static void @@ -582,7 +582,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: #if HAVE_SQLITE3 @@ -598,7 +598,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 @@ -823,9 +823,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 @@ -843,10 +843,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 @@ -877,10 +877,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 @@ -920,11 +920,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 @@ -1005,7 +1005,7 @@ spawn_pager(struct tag_files *tag_files) case 0: break; default: - return(pager_pid); + return pager_pid; } /* The child process becomes the pager. */ @@ -62,9 +62,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 @@ -97,7 +97,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++) @@ -115,7 +115,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; } /* @@ -152,7 +152,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 @@ -183,7 +183,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. */ @@ -234,7 +234,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; } /* @@ -245,14 +245,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 @@ -330,5 +330,5 @@ man_mparse(const struct roff_man *man) { assert(man && man->parse); - return(man->parse); + return man->parse; } @@ -1,6 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -81,20 +82,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; } @@ -278,11 +278,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 @@ -371,7 +371,7 @@ man_br_pre(MAN_ARGS) /* So the div isn't empty: */ print_text(h, "\\~"); - return(0); + return 0; } static int @@ -383,12 +383,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 @@ -444,7 +444,7 @@ man_alt_pre(MAN_ARGS) if (savelit) mh->fl |= MANH_LITERAL; - return(0); + return 0; } static int @@ -454,7 +454,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 @@ -466,12 +466,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 @@ -479,11 +479,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 @@ -493,10 +493,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. */ @@ -520,7 +520,7 @@ man_IP_pre(MAN_ARGS) } } - return(0); + return 0; } static int @@ -531,9 +531,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; @@ -549,7 +549,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 @@ -578,7 +578,7 @@ man_OP_pre(MAN_ARGS) print_stagq(h, tt); h->flags |= HTML_NOSPACE; print_text(h, "]"); - return(0); + return 0; } static int @@ -586,7 +586,7 @@ man_B_pre(MAN_ARGS) { print_otag(h, TAG_B, 0, NULL); - return(1); + return 1; } static int @@ -594,7 +594,7 @@ man_I_pre(MAN_ARGS) { print_otag(h, TAG_I, 0, NULL); - return(1); + return 1; } static int @@ -607,7 +607,7 @@ man_literal_pre(MAN_ARGS) } else mh->fl |= MANH_LITERAL; - return(0); + return 0; } static int @@ -615,14 +615,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 @@ -632,9 +632,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) @@ -644,7 +644,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 @@ -667,5 +667,5 @@ man_UR_pre(MAN_ARGS) print_man_nodelist(man, n->child, mh, h); - return(0); + return 0; } diff --git a/man_macro.c b/man_macro.c index e0da576c..aa0ba895 100644 --- a/man_macro.c +++ b/man_macro.c @@ -420,8 +420,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; } @@ -212,7 +212,7 @@ static int pre_ign(DECL_ARGS) { - return(0); + return 0; } static int @@ -220,7 +220,7 @@ pre_ll(DECL_ARGS) { term_setwidth(p, n->nchild ? n->child->string : NULL); - return(0); + return 0; } static int @@ -228,7 +228,7 @@ pre_I(DECL_ARGS) { term_fontrepl(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -255,7 +255,7 @@ pre_literal(DECL_ARGS) p->flags |= TERMP_NOSPACE; } - return(0); + return 0; } static int @@ -266,12 +266,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 @@ -325,7 +325,7 @@ pre_alternate(DECL_ARGS) p->flags |= TERMP_NOSPACE; } - return(0); + return 0; } static int @@ -333,7 +333,7 @@ pre_B(DECL_ARGS) { term_fontrepl(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -355,7 +355,7 @@ pre_OP(DECL_ARGS) term_fontrepl(p, TERMFONT_NONE); p->flags |= TERMP_NOSPACE; term_word(p, "]"); - return(0); + return 0; } static int @@ -365,7 +365,7 @@ pre_ft(DECL_ARGS) if (NULL == n->child) { term_fontlast(p); - return(0); + return 0; } cp = n->child->string; @@ -395,7 +395,7 @@ pre_ft(DECL_ARGS) default: break; } - return(0); + return 0; } static int @@ -410,7 +410,7 @@ pre_in(DECL_ARGS) if (NULL == n->child) { p->offset = mt->offset; - return(0); + return 0; } cp = n->child->string; @@ -424,7 +424,7 @@ pre_in(DECL_ARGS) cp--; if ( ! a2roffsu(++cp, &su, SCALE_EN)) - return(0); + return 0; v = (term_hspan(p, &su) + 11) / 24; @@ -437,7 +437,7 @@ pre_in(DECL_ARGS) if (p->offset > SHRT_MAX) p->offset = term_len(p, p->defindent); - return(0); + return 0; } static int @@ -458,7 +458,7 @@ pre_sp(DECL_ARGS) /* FALLTHROUGH */ case MAN_P: /* FALLTHROUGH */ - return(0); + return 0; default: break; } @@ -493,7 +493,7 @@ pre_sp(DECL_ARGS) p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); } - return(0); + return 0; } static int @@ -506,11 +506,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)) { @@ -533,7 +533,7 @@ pre_HP(DECL_ARGS) p->offset = mt->offset; p->rmargin = mt->offset + len; - return(1); + return 1; } static void @@ -578,7 +578,7 @@ pre_PP(DECL_ARGS) break; } - return(n->type != ROFFT_HEAD); + return n->type != ROFFT_HEAD; } static int @@ -600,7 +600,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. */ @@ -630,7 +630,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; @@ -639,7 +639,7 @@ pre_IP(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -681,7 +681,7 @@ pre_TP(DECL_ARGS) print_bvspace(p, n, mt->pardist); /* FALLTHROUGH */ default: - return(1); + return 1; } /* Calculate offset. */ @@ -718,7 +718,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; @@ -729,7 +729,7 @@ pre_TP(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -792,7 +792,7 @@ pre_SS(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -853,7 +853,7 @@ pre_SH(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -880,9 +880,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; } @@ -906,7 +906,7 @@ pre_RS(DECL_ARGS) mt->lmargincur = mt->lmarginsz; mt->lmargin[mt->lmargincur] = term_len(p, p->defindent); - return(1); + return 1; } static void @@ -934,7 +934,7 @@ static int pre_UR(DECL_ARGS) { - return (n->type != ROFFT_HEAD); + return n->type != ROFFT_HEAD; } static void @@ -83,7 +83,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 = '\''; @@ -99,7 +99,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 @@ -108,7 +108,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 @@ -169,7 +169,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; @@ -196,7 +196,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; @@ -209,11 +209,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)) @@ -221,7 +221,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. @@ -283,12 +283,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)++; @@ -299,7 +299,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; } @@ -367,7 +367,7 @@ mandoc_escape(const char **end, const char **start, int *sz) break; } - return(gly); + return gly; } /* @@ -462,7 +462,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 @@ -479,10 +479,10 @@ a2time(time_t *t, const char *fmt, const char *p) #endif if (NULL != pp && '\0' == *pp) { *t = mktime(&tm); - return(1); + return 1; } - return(0); + return 0; } static char * @@ -495,7 +495,7 @@ time2a(time_t t) tm = localtime(&t); if (tm == NULL) - return(NULL); + return NULL; /* * Reserve space: @@ -515,11 +515,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 * @@ -541,7 +541,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 @@ -551,7 +551,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 @@ -580,11 +580,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; } /* @@ -599,7 +600,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'; @@ -608,12 +609,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/mandoc_aux.c b/mandoc_aux.c index 76d05643..51dd8dff 100644 --- a/mandoc_aux.c +++ b/mandoc_aux.c @@ -41,7 +41,7 @@ mandoc_asprintf(char **dest, const char *fmt, ...) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ret); + return ret; } void * @@ -54,7 +54,7 @@ mandoc_calloc(size_t num, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -67,7 +67,7 @@ mandoc_malloc(size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -79,7 +79,7 @@ mandoc_realloc(void *ptr, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } void * @@ -91,7 +91,7 @@ mandoc_reallocarray(void *ptr, size_t num, size_t size) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(ptr); + return ptr; } char * @@ -104,7 +104,7 @@ mandoc_strdup(const char *ptr) perror(NULL); exit((int)MANDOCLEVEL_SYSERR); } - return(p); + return p; } char * @@ -115,5 +115,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; } @@ -547,7 +547,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" @@ -557,7 +557,7 @@ usage: progname, progname, progname, progname, progname); - return((int)MANDOCLEVEL_BADARG); + return (int)MANDOCLEVEL_BADARG; } /* @@ -594,7 +594,7 @@ treescan(void) if (NULL == f) { exitcode = (int)MANDOCLEVEL_SYSERR; say("", "&fts_open"); - return(0); + return 0; } dsec = arch = NULL; @@ -763,7 +763,7 @@ treescan(void) } fts_close(f); - return(1); + return 1; } /* @@ -1604,7 +1604,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 @@ -1612,10 +1612,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 @@ -1627,7 +1627,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) @@ -1635,7 +1635,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 @@ -1665,7 +1665,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); @@ -1673,7 +1673,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 @@ -1682,12 +1682,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 @@ -1697,17 +1697,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 @@ -1717,7 +1717,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 @@ -1739,7 +1739,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 @@ -1747,7 +1747,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 @@ -1755,7 +1755,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 @@ -1763,7 +1763,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; } /* @@ -1868,10 +1868,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; } /* @@ -1995,9 +1995,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 @@ -2264,7 +2264,7 @@ dbopen(int real) int rc, ofl; if (nodb) - return(1); + return 1; *tempfilename = '\0'; ofl = SQLITE_OPEN_READWRITE; @@ -2275,7 +2275,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; } @@ -2289,7 +2289,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", @@ -2297,7 +2297,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)); @@ -2305,7 +2305,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: @@ -2344,7 +2344,7 @@ create_tables: exitcode = (int)MANDOCLEVEL_SYSERR; say(MANDOC_DB, "%s", sqlite3_errmsg(db)); sqlite3_close(db); - return(0); + return 0; } prepare_statements: @@ -2354,7 +2354,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 " @@ -2388,25 +2388,25 @@ prepare_statements: say(MANDOC_DB, "PRAGMA synchronous: %s", sqlite3_errmsg(db)); sqlite3_close(db); - return(0); + return 0; } #endif - 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 @@ -2455,12 +2455,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; } } @@ -2474,13 +2474,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'); @@ -2488,12 +2488,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 @@ -99,12 +99,12 @@ main(int argc, char *argv[]) if (0 == sz) { free(res); - return(EXIT_FAILURE); + return EXIT_FAILURE; } else if (1 == sz && term) { i = 1; goto show; } else if (NULL == res) - return(EXIT_FAILURE); + return EXIT_FAILURE; for (i = 0; i < sz; i++) { printf("%6zu %s: %s\n", @@ -117,7 +117,7 @@ main(int argc, char *argv[]) for (i = 0; i < sz; i++) free(res[i].file); free(res); - return(EXIT_SUCCESS); + return EXIT_SUCCESS; } i = 1; @@ -135,7 +135,7 @@ main(int argc, char *argv[]) for (i = 0; i < sz; i++) free(res[i].file); free(res); - return(EXIT_SUCCESS); + return EXIT_SUCCESS; } show: cmd = res[i - 1].form ? "mandoc" : "cat"; @@ -154,7 +154,7 @@ usage: "[-s section] " "expr ...\n", progname); - return(EXIT_FAILURE); + return EXIT_FAILURE; } static void diff --git a/mansearch.c b/mansearch.c index 5c38e71f..cb7c6609 100644 --- a/mansearch.c +++ b/mansearch.c @@ -121,7 +121,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, @@ -131,30 +131,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 @@ -180,7 +180,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; @@ -378,7 +378,7 @@ mansearch(const struct mansearch *search, exprfree(e); free(sql); *sz = cur; - return(1); + return 1; } void @@ -402,9 +402,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 @@ -565,7 +565,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; } /* @@ -660,7 +660,7 @@ sql_statement(const struct expr *e) needop = 1; } - return(sql); + return sql; } /* @@ -743,12 +743,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 * @@ -761,7 +761,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)); @@ -769,7 +769,7 @@ exprterm(const struct mansearch *search, char *buf, int cs) e->bits = TYPE_Nm; e->substr = buf; e->equal = 1; - return(e); + return e; } /* @@ -807,12 +807,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. @@ -834,13 +834,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 @@ -859,14 +859,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 @@ -111,9 +111,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 @@ -166,7 +166,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 * @@ -197,7 +197,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 @@ -255,7 +255,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 && @@ -265,7 +265,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; } /* @@ -325,13 +325,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 @@ -343,7 +343,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; } /* @@ -377,7 +377,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. */ @@ -416,7 +416,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; @@ -431,7 +431,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; } /* @@ -446,7 +446,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. */ @@ -457,9 +457,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 @@ -467,16 +467,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 ',': @@ -492,18 +492,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/mdoc_argv.c b/mdoc_argv.c index d7b75057..03c59e1c 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -424,7 +424,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 @@ -440,7 +440,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 @@ -453,7 +453,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 @@ -464,14 +464,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 @@ -538,7 +538,7 @@ args(struct roff_man *mdoc, int line, int *pos, for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++) /* Skip ahead. */ ; - return(rc); + return rc; } /* @@ -575,17 +575,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)++; @@ -594,13 +594,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; } /* @@ -622,11 +622,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++; @@ -639,18 +639,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/mdoc_hash.c b/mdoc_hash.c index 8543e38c..2204ac5a 100644 --- a/mdoc_hash.c +++ b/mdoc_hash.c @@ -1,6 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -67,26 +68,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/mdoc_html.c b/mdoc_html.c index b5a944ad..af3bd24e 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -524,7 +524,7 @@ mdoc_root_pre(MDOC_ARGS) free(title); free(volume); - return(1); + return 1; } static int @@ -536,11 +536,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; } @@ -560,7 +560,7 @@ mdoc_sh_pre(MDOC_ARGS) } else print_otag(h, TAG_H1, 0, NULL); - return(1); + return 1; } static int @@ -571,9 +571,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"); @@ -590,7 +590,7 @@ mdoc_ss_pre(MDOC_ARGS) } else print_otag(h, TAG_H2, 0, NULL); - return(1); + return 1; } static int @@ -604,7 +604,7 @@ mdoc_fl_pre(MDOC_ARGS) /* `Cm' has no leading hyphen. */ if (MDOC_Cm == n->tok) - return(1); + return 1; print_text(h, "\\-"); @@ -614,7 +614,7 @@ mdoc_fl_pre(MDOC_ARGS) n->next->flags & MDOC_LINE))) h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -623,14 +623,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 @@ -649,10 +649,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; } @@ -676,7 +676,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 @@ -685,7 +685,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"); @@ -702,7 +702,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, "("); @@ -710,7 +710,7 @@ mdoc_xr_pre(MDOC_ARGS) print_text(h, n->string); h->flags |= HTML_NOSPACE; print_text(h, ")"); - return(0); + return 0; } static int @@ -719,7 +719,7 @@ mdoc_ns_pre(MDOC_ARGS) if ( ! (MDOC_LINE & n->flags)) h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -729,7 +729,7 @@ mdoc_ar_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "arg"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -759,7 +759,7 @@ mdoc_xx_pre(MDOC_ARGS) pp = "UNIX"; break; default: - return(1); + return 1; } PAIR_CLASS_INIT(&tag, "unix"); @@ -772,7 +772,7 @@ mdoc_xx_pre(MDOC_ARGS) print_text(h, n->child->string); h->flags = flags; } - return(0); + return 0; } static int @@ -789,7 +789,7 @@ mdoc_bx_pre(MDOC_ARGS) print_text(h, "BSD"); } else { print_text(h, "BSD"); - return(0); + return 0; } if (NULL != (n = n->next)) { @@ -799,7 +799,7 @@ mdoc_bx_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -834,7 +834,7 @@ mdoc_it_pre(MDOC_ARGS) case LIST_hyphen: /* FALLTHROUGH */ case LIST_enum: - return(0); + return 0; case LIST_diag: /* FALLTHROUGH */ case LIST_hang: @@ -911,7 +911,7 @@ mdoc_it_pre(MDOC_ARGS) } } - return(1); + return 1; } static int @@ -925,12 +925,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 <COL> tag with our @@ -950,7 +950,7 @@ mdoc_bl_pre(MDOC_ARGS) print_otag(h, TAG_COL, 1, tag); } - return(0); + return 0; } SCALE_VS_INIT(&su, 0); @@ -1002,7 +1002,7 @@ mdoc_bl_pre(MDOC_ARGS) abort(); } - return(1); + return 1; } static int @@ -1042,7 +1042,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 @@ -1052,7 +1052,7 @@ mdoc_em_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "emph"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1062,7 +1062,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); @@ -1081,7 +1081,7 @@ mdoc_d1_pre(MDOC_ARGS) print_otag(h, TAG_CODE, 1, tag); } - return(1); + return 1; } static int @@ -1103,7 +1103,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 @@ -1115,7 +1115,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; @@ -1129,7 +1129,7 @@ mdoc_bd_pre(MDOC_ARGS) } if ( ! comp) print_paragraph(h); - return(1); + return 1; } /* Handle the -offset argument. */ @@ -1152,7 +1152,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"); @@ -1203,7 +1203,7 @@ mdoc_bd_pre(MDOC_ARGS) if (0 == sv) h->flags &= ~HTML_LITERAL; - return(0); + return 0; } static int @@ -1213,7 +1213,7 @@ mdoc_pa_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "file"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -1223,7 +1223,7 @@ mdoc_ad_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "addr"); print_otag(h, TAG_I, 1, &tag); - return(1); + return 1; } static int @@ -1234,12 +1234,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) @@ -1250,7 +1250,7 @@ mdoc_an_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "author"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1261,7 +1261,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 @@ -1271,7 +1271,7 @@ mdoc_dv_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "define"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1281,7 +1281,7 @@ mdoc_ev_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "env"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1291,7 +1291,7 @@ mdoc_er_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "errno"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1304,7 +1304,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) { @@ -1322,7 +1322,7 @@ mdoc_fa_pre(MDOC_ARGS) print_text(h, ","); } - return(0); + return 0; } static int @@ -1337,14 +1337,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"); @@ -1390,7 +1390,7 @@ mdoc_fd_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -1400,15 +1400,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 @@ -1419,7 +1419,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 @@ -1509,7 +1509,7 @@ mdoc_fn_pre(MDOC_ARGS) print_text(h, ";"); } - return(0); + return 0; } static int @@ -1526,14 +1526,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 @@ -1541,7 +1541,7 @@ mdoc_pp_pre(MDOC_ARGS) { print_paragraph(h); - return(0); + return 0; } static int @@ -1570,7 +1570,7 @@ mdoc_sp_pre(MDOC_ARGS) /* So the div isn't empty: */ print_text(h, "\\~"); - return(0); + return 0; } @@ -1580,7 +1580,7 @@ mdoc_lk_pre(MDOC_ARGS) struct htmlpair tag[2]; if (NULL == (n = n->child)) - return(0); + return 0; assert(n->type == ROFFT_TEXT); @@ -1595,7 +1595,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 @@ -1619,7 +1619,7 @@ mdoc_mt_pre(MDOC_ARGS) print_tagq(h, t); } - return(0); + return 0; } static int @@ -1632,21 +1632,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 @@ -1713,7 +1713,7 @@ mdoc_in_pre(MDOC_ARGS) print_text(h, n->string); } - return(0); + return 0; } static int @@ -1723,7 +1723,7 @@ mdoc_ic_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "cmd"); print_otag(h, TAG_B, 1, &tag); - return(1); + return 1; } static int @@ -1779,7 +1779,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 @@ -1789,7 +1789,7 @@ mdoc_va_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "var"); print_otag(h, TAG_B, 1, &tag); - return(1); + return 1; } static int @@ -1799,7 +1799,7 @@ mdoc_ap_pre(MDOC_ARGS) h->flags |= HTML_NOSPACE; print_text(h, "\\(aq"); h->flags |= HTML_NOSPACE; - return(1); + return 1; } static int @@ -1809,9 +1809,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"); @@ -1833,7 +1833,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 @@ -1843,7 +1843,7 @@ mdoc_ms_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "symb"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1851,7 +1851,7 @@ mdoc_igndelim_pre(MDOC_ARGS) { h->flags |= HTML_IGNDELIM; - return(1); + return 1; } static void @@ -1868,14 +1868,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 @@ -1885,7 +1885,7 @@ mdoc_no_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "none"); print_otag(h, TAG_CODE, 1, &tag); - return(1); + return 1; } static int @@ -1895,7 +1895,7 @@ mdoc_li_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "lit"); print_otag(h, TAG_CODE, 1, &tag); - return(1); + return 1; } static int @@ -1905,7 +1905,7 @@ mdoc_sy_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "symb"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -1913,7 +1913,7 @@ mdoc_bt_pre(MDOC_ARGS) { print_text(h, "is currently in beta test."); - return(0); + return 0; } static int @@ -1921,7 +1921,7 @@ mdoc_ud_pre(MDOC_ARGS) { print_text(h, "currently under development."); - return(0); + return 0; } static int @@ -1934,7 +1934,7 @@ mdoc_lb_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "lib"); print_otag(h, TAG_SPAN, 1, &tag); - return(1); + return 1; } static int @@ -2000,13 +2000,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 @@ -2035,7 +2035,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; @@ -2044,7 +2044,7 @@ mdoc_bk_pre(MDOC_ARGS) abort(); } - return(1); + return 1; } static void @@ -2061,7 +2061,7 @@ mdoc_quote_pre(MDOC_ARGS) struct htmlpair tag; if (n->type != ROFFT_BODY) - return(1); + return 1; switch (n->tok) { case MDOC_Ao: @@ -2091,7 +2091,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: @@ -2124,7 +2124,7 @@ mdoc_quote_pre(MDOC_ARGS) } h->flags |= HTML_NOSPACE; - return(1); + return 1; } static void @@ -2196,7 +2196,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 && @@ -2207,7 +2207,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/mdoc_macro.c b/mdoc_macro.c index 69b6f77c..e30a789e 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -243,13 +243,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; } /* @@ -329,39 +329,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; } } @@ -413,7 +413,7 @@ find_pending(struct roff_man *mdoc, int tok, int line, int ppos, } } } - return(irc); + return irc; } /* @@ -508,14 +508,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; } } @@ -1426,9 +1426,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; } } @@ -643,14 +643,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 @@ -660,10 +660,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 @@ -711,7 +711,7 @@ pre_ex(DECL_ARGS) print_word("on success, and\\~>0 if an error occurs."); outflags |= MMAN_nl; - return(0); + return 0; } static void @@ -749,7 +749,7 @@ pre__t(DECL_ARGS) outflags &= ~MMAN_spc; } else font_push('I'); - return(1); + return 1; } static void @@ -780,7 +780,7 @@ pre_sect(DECL_ARGS) putchar('\"'); outflags &= ~MMAN_spc; } - return(1); + return 1; } /* @@ -848,18 +848,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; } } @@ -870,7 +870,7 @@ pre_ap(DECL_ARGS) outflags &= ~MMAN_spc; print_word("'"); outflags &= ~MMAN_spc; - return(0); + return 0; } static int @@ -880,7 +880,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 @@ -904,7 +904,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 @@ -928,11 +928,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: @@ -945,7 +945,7 @@ pre_bf(DECL_ARGS) font_push('R'); break; } - return(1); + return 1; } static void @@ -962,12 +962,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; } } @@ -997,11 +997,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) { @@ -1011,7 +1011,7 @@ pre_bl(DECL_ARGS) print_word("."); } outflags |= MMAN_nl; - return(1); + return 1; } static void @@ -1051,7 +1051,7 @@ pre_br(DECL_ARGS) { outflags |= MMAN_br; - return(0); + return 0; } static int @@ -1066,12 +1066,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 @@ -1079,7 +1079,7 @@ pre_dl(DECL_ARGS) { print_offs("6n", 0); - return(1); + return 1; } static void @@ -1098,7 +1098,7 @@ pre_em(DECL_ARGS) { font_push('I'); - return(1); + return 1; } static int @@ -1107,11 +1107,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 @@ -1141,7 +1141,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 @@ -1184,7 +1184,7 @@ pre_fa(DECL_ARGS) if (NULL != (n = n->next)) print_word(","); } - return(0); + return 0; } static void @@ -1201,7 +1201,7 @@ pre_fd(DECL_ARGS) pre_syn(n); font_push('B'); - return(1); + return 1; } static void @@ -1220,7 +1220,7 @@ pre_fl(DECL_ARGS) print_word("\\-"); if (n->nchild) outflags &= ~MMAN_spc; - return(1); + return 1; } static void @@ -1243,7 +1243,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); @@ -1258,7 +1258,7 @@ pre_fn(DECL_ARGS) n = n->next; if (NULL != n) pre_fa(meta, n); - return(0); + return 0; } static void @@ -1282,7 +1282,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'); @@ -1295,7 +1295,7 @@ pre_fo(DECL_ARGS) default: break; } - return(1); + return 1; } static void @@ -1321,7 +1321,7 @@ pre_ft(DECL_ARGS) pre_syn(n); font_push('I'); - return(1); + return 1; } static int @@ -1338,7 +1338,7 @@ pre_in(DECL_ARGS) outflags &= ~MMAN_spc; font_push('I'); } - return(1); + return 1; } static void @@ -1373,7 +1373,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: @@ -1384,7 +1384,7 @@ pre_it(DECL_ARGS) else print_line(".R \"", 0); outflags &= ~MMAN_spc; - return(1); + return 1; case LIST_bullet: /* FALLTHROUGH */ case LIST_dash: @@ -1400,31 +1400,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; } /* @@ -1530,7 +1530,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'); @@ -1545,7 +1545,7 @@ pre_lk(DECL_ARGS) font_push('B'); print_word(link->string); font_pop(); - return(0); + return 0; } static int @@ -1553,7 +1553,7 @@ pre_ll(DECL_ARGS) { print_line(".ll", 0); - return(1); + return 1; } static int @@ -1561,7 +1561,7 @@ pre_li(DECL_ARGS) { font_push('R'); - return(1); + return 1; } static int @@ -1574,10 +1574,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; @@ -1588,7 +1588,7 @@ pre_nm(DECL_ARGS) font_push('B'); if (NULL == n->child) print_word(meta->name); - return(1); + return 1; } static void @@ -1615,7 +1615,7 @@ pre_no(DECL_ARGS) { outflags |= MMAN_spc_force; - return(1); + return 1; } static int @@ -1623,7 +1623,7 @@ pre_ns(DECL_ARGS) { outflags &= ~MMAN_spc; - return(0); + return 0; } static void @@ -1642,7 +1642,7 @@ pre_pp(DECL_ARGS) outflags |= MMAN_PP; outflags |= MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; - return(0); + return 0; } static int @@ -1653,7 +1653,7 @@ pre_rs(DECL_ARGS) outflags |= MMAN_PP | MMAN_sp | MMAN_nl; outflags &= ~MMAN_br; } - return(1); + return 1; } static int @@ -1705,14 +1705,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 @@ -1729,7 +1729,7 @@ pre_sm(DECL_ARGS) if (MMAN_Sm & outflags) outflags |= MMAN_spc; - return(0); + return 0; } static int @@ -1741,7 +1741,7 @@ pre_sp(DECL_ARGS) print_line(".PP", 0); } else print_line(".sp", 0); - return(1); + return 1; } static void @@ -1756,7 +1756,7 @@ pre_sy(DECL_ARGS) { font_push('B'); - return(1); + return 1; } static int @@ -1767,15 +1767,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 @@ -1793,16 +1793,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 @@ -1811,9 +1811,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/mdoc_term.c b/mdoc_term.c index 768f7f74..95958a6d 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -535,7 +535,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; } /* @@ -599,7 +599,7 @@ termp_ll_pre(DECL_ARGS) { term_setwidth(p, n->nchild ? n->child->string : NULL); - return(0); + return 0; } static int @@ -613,7 +613,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; @@ -927,17 +927,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 @@ -986,12 +986,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) @@ -1002,11 +1002,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); @@ -1031,7 +1031,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 @@ -1063,7 +1063,7 @@ termp_fl_pre(DECL_ARGS) n->next->flags & MDOC_LINE))) p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static int @@ -1074,7 +1074,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 @@ -1084,12 +1084,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) @@ -1098,7 +1098,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 @@ -1107,7 +1107,7 @@ termp_ns_pre(DECL_ARGS) if ( ! (MDOC_LINE & n->flags)) p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static int @@ -1115,10 +1115,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 @@ -1171,7 +1171,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 @@ -1205,7 +1205,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 @@ -1214,14 +1214,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 @@ -1237,13 +1237,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, "("); @@ -1255,7 +1255,7 @@ termp_xr_pre(DECL_ARGS) p->flags |= TERMP_NOSPACE; term_word(p, ")"); - return(0); + return 0; } /* @@ -1321,14 +1321,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 @@ -1337,7 +1337,7 @@ termp_bold_pre(DECL_ARGS) termp_tag_pre(p, pair, meta, n); term_fontpush(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -1345,7 +1345,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 @@ -1390,7 +1390,7 @@ termp_sh_pre(DECL_ARGS) default: break; } - return(1); + return 1; } static void @@ -1416,7 +1416,7 @@ termp_bt_pre(DECL_ARGS) term_word(p, "is currently in beta test."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static void @@ -1433,7 +1433,7 @@ termp_ud_pre(DECL_ARGS) term_word(p, "currently under development."); p->flags |= TERMP_SENTENCE; - return(0); + return 0; } static int @@ -1441,10 +1441,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 @@ -1454,7 +1454,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 @@ -1468,7 +1468,7 @@ termp_fn_pre(DECL_ARGS) synopsis_pre(p, n); if (NULL == (n = n->child)) - return(0); + return 0; if (pretty) { rmargin = p->rmargin; @@ -1518,7 +1518,7 @@ termp_fn_pre(DECL_ARGS) term_flushln(p); } - return(0); + return 0; } static int @@ -1528,7 +1528,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) { @@ -1543,7 +1543,7 @@ termp_fa_pre(DECL_ARGS) } } - return(0); + return 0; } static int @@ -1555,9 +1555,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. */ @@ -1587,7 +1587,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) @@ -1645,7 +1645,7 @@ termp_bd_pre(DECL_ARGS) p->tabwidth = tabwidth; p->rmargin = rm; p->maxrmargin = rmax; - return(0); + return 0; } static void @@ -1680,7 +1680,7 @@ termp_bx_pre(DECL_ARGS) term_word(p, "BSD"); } else { term_word(p, "BSD"); - return(0); + return 0; } if (NULL != (n = n->next)) { @@ -1690,7 +1690,7 @@ termp_bx_pre(DECL_ARGS) term_word(p, n->string); } - return(0); + return 0; } static int @@ -1730,7 +1730,7 @@ termp_xx_pre(DECL_ARGS) term_word(p, n->child->string); p->flags = flags; } - return(0); + return 0; } static void @@ -1762,7 +1762,7 @@ termp_ss_pre(DECL_ARGS) break; } - return(1); + return 1; } static void @@ -1779,7 +1779,7 @@ termp_cd_pre(DECL_ARGS) synopsis_pre(p, n); term_fontpush(p, TERMFONT_BOLD); - return(1); + return 1; } static int @@ -1798,7 +1798,7 @@ termp_in_pre(DECL_ARGS) } p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -1847,14 +1847,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 @@ -1862,7 +1862,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: @@ -1893,7 +1893,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: @@ -1920,7 +1920,7 @@ termp_quote_pre(DECL_ARGS) } p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -1995,7 +1995,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 && @@ -2007,7 +2007,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 @@ -2044,7 +2044,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; @@ -2062,18 +2062,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 @@ -2098,9 +2098,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); @@ -2109,7 +2109,7 @@ termp_bf_pre(DECL_ARGS) else term_fontpush(p, TERMFONT_NONE); - return(1); + return 1; } static int @@ -2126,7 +2126,7 @@ termp_sm_pre(DECL_ARGS) if (p->col && ! (TERMP_NONOSPACE & p->flags)) p->flags &= ~TERMP_NOSPACE; - return(0); + return 0; } static int @@ -2136,7 +2136,7 @@ termp_ap_pre(DECL_ARGS) p->flags |= TERMP_NOSPACE; term_word(p, "'"); p->flags |= TERMP_NOSPACE; - return(1); + return 1; } static void @@ -2171,7 +2171,7 @@ termp_li_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_NONE); - return(1); + return 1; } static int @@ -2180,7 +2180,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); @@ -2197,7 +2197,7 @@ termp_lk_pre(DECL_ARGS) term_word(p, link->string); term_fontpop(p); - return(0); + return 0; } static int @@ -2208,7 +2208,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; @@ -2217,7 +2217,7 @@ termp_bk_pre(DECL_ARGS) abort(); } - return(1); + return 1; } static void @@ -2253,10 +2253,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 @@ -2264,7 +2264,7 @@ termp_under_pre(DECL_ARGS) { term_fontpush(p, TERMFONT_UNDER); - return(1); + return 1; } static int @@ -2276,7 +2276,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 @@ -2291,5 +2291,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/mdoc_validate.c b/mdoc_validate.c index 70fb6f1d..138a73a2 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1828,8 +1828,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 @@ -2301,9 +2301,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 @@ -2312,89 +2312,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; } @@ -32,5 +32,5 @@ mandoc_a2msec(const char *p) #include "msec.in" - return(NULL); + return NULL; } @@ -51,7 +51,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': @@ -89,12 +89,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; } /* @@ -92,17 +92,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 @@ -123,7 +123,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. */ @@ -162,15 +162,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; } @@ -627,13 +627,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; } #endif @@ -668,7 +668,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); @@ -679,7 +679,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, free(fb->buf); fb->buf = NULL; - return(0); + return 0; } static void @@ -748,7 +748,7 @@ mparse_readmem(struct mparse *curp, void *buf, size_t len, blk.sz = len; mparse_parse_buffer(curp, blk, file); - return(curp->file_status); + return curp->file_status; } /* @@ -779,7 +779,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 @@ -794,7 +794,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 @@ -807,14 +807,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 * @@ -842,7 +842,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 @@ -928,13 +928,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 @@ -950,5 +950,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; } @@ -785,17 +785,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 -------------------------------------------- */ @@ -914,7 +914,7 @@ roff_alloc(struct mparse *parse, const struct mchars *mchars, int options) roffhash_init(); - return(r); + return r; } /* --- syntax tree state data management ---------------------------------- */ @@ -977,7 +977,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 ----------------------------------------------- */ @@ -1003,7 +1003,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 @@ -1117,7 +1117,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 * @@ -1128,7 +1128,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 * @@ -1139,7 +1139,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 @@ -1356,7 +1356,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; } /* @@ -1463,7 +1463,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. */ @@ -1479,7 +1479,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; } /* @@ -1504,7 +1504,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; @@ -1538,7 +1538,7 @@ roff_parsetext(struct buf *buf, int pos, int *offs) *p = ASCII_HYPH; p++; } - return(ROFF_CONT); + return ROFF_CONT; } enum rofferr @@ -1560,7 +1560,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); } @@ -1568,7 +1568,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); @@ -1587,23 +1587,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, @@ -1614,7 +1614,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. */ @@ -1628,12 +1628,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); } /* @@ -1642,12 +1642,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 @@ -1687,7 +1687,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); @@ -1698,7 +1698,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 ----------------------------------------- */ @@ -1715,7 +1715,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) { @@ -1734,7 +1734,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') @@ -1743,7 +1743,7 @@ roff_cblock(ROFF_ARGS) roffnode_pop(r); roffnode_cleanscope(r); - return(ROFF_IGN); + return ROFF_IGN; } @@ -1838,7 +1838,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); @@ -1853,7 +1853,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. */ @@ -1880,7 +1880,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 @@ -1916,8 +1916,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; } } @@ -1931,11 +1931,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 @@ -1945,7 +1945,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 @@ -1967,7 +1967,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); } /* @@ -1989,7 +1989,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 @@ -2010,7 +2010,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 -------------------- */ @@ -2086,7 +2086,7 @@ roff_getnum(const char *v, int *pos, int *res, int flags) *res = scaled; *pos = p + 1; - return(1); + return 1; } /* @@ -2129,7 +2129,7 @@ out: else if (*s3 != '\0') s3++; *pos = s3 - v; - return(match); + return match; } /* @@ -2151,12 +2151,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': @@ -2167,30 +2167,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 @@ -2199,7 +2199,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 @@ -2208,7 +2208,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 @@ -2286,7 +2286,7 @@ roff_cond(ROFF_ARGS) out: *offs = pos; - return(ROFF_RERUN); + return ROFF_RERUN; } static enum rofferr @@ -2311,11 +2311,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 == '"') @@ -2324,7 +2324,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; } /* @@ -2390,11 +2390,11 @@ roff_getop(const char *v, int *pos, char *res) (*pos)++; break; default: - return(0); + return 0; } (*pos)++; - return(*res); + return *res; } /* @@ -2407,11 +2407,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 @@ -2422,9 +2422,9 @@ roff_evalpar(struct roff *r, int ln, if (')' == v[*pos]) (*pos)++; else if (NULL == res) - return(0); + return 0; - return(1); + return 1; } /* @@ -2448,7 +2448,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) @@ -2463,7 +2463,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])) @@ -2536,7 +2536,7 @@ roff_evalnum(struct roff *r, int ln, const char *v, abort(); } } - return(1); + return 1; } /* --- register management ------------------------------------------------ */ @@ -2582,21 +2582,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; } } @@ -2609,14 +2609,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 @@ -2628,15 +2628,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 @@ -2648,15 +2648,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 @@ -2682,11 +2682,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; @@ -2696,7 +2696,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 @@ -2708,7 +2708,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'; @@ -2724,7 +2724,7 @@ roff_rr(ROFF_ARGS) free(reg->key.p); free(reg); } - return(ROFF_IGN); + return ROFF_IGN; } /* --- handler functions for roff requests -------------------------------- */ @@ -2744,7 +2744,7 @@ roff_rm(ROFF_ARGS) if (name[namesz] == '\\') break; } - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2757,7 +2757,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])) @@ -2773,7 +2773,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 @@ -2788,7 +2788,7 @@ roff_Dd(ROFF_ARGS) if (r->format == 0) r->format = MPARSE_MDOC; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2803,7 +2803,7 @@ roff_TH(ROFF_ARGS) if (r->format == 0) r->format = MPARSE_MAN; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2817,9 +2817,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 @@ -2832,7 +2832,7 @@ roff_T_(ROFF_ARGS) else tbl_restart(ppos, ln, r->tbl); - return(ROFF_IGN); + return ROFF_IGN; } /* @@ -2855,7 +2855,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 = ""; @@ -2898,7 +2898,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 @@ -2923,7 +2923,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 @@ -2931,7 +2931,7 @@ roff_EN(ROFF_ARGS) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, ln, ppos, "EN"); - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -2953,7 +2953,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 @@ -2961,7 +2961,7 @@ roff_brp(ROFF_ARGS) { buf->buf[pos - 1] = '\0'; - return(ROFF_CONT); + return ROFF_CONT; } static enum rofferr @@ -2978,7 +2978,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 @@ -2992,7 +2992,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') { @@ -3004,7 +3004,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); } @@ -3015,7 +3015,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') { @@ -3040,7 +3040,7 @@ roff_tr(ROFF_ARGS) r->xtab[(int)*first].sz = ssz; } - return(ROFF_IGN); + return ROFF_IGN; } static enum rofferr @@ -3066,11 +3066,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 ------------------------------------ */ @@ -3198,8 +3198,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 @@ -3210,7 +3210,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++) { @@ -3237,7 +3237,7 @@ roff_getname(struct roff *r, char **cpp, int ln, int pos) cp++; *cpp = cp; - return(namesz); + return namesz; } /* @@ -3337,14 +3337,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 @@ -3366,14 +3366,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; } /* @@ -3391,9 +3391,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 @@ -3465,14 +3465,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; } /* @@ -3495,17 +3495,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; } @@ -33,5 +33,5 @@ mdoc_a2st(const char *p) #include "st.in" - return(NULL); + return NULL; } @@ -97,7 +97,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(); @@ -111,7 +111,7 @@ fail: *tag_files.tfn = '\0'; tag_files.ofd = -1; tag_files.tfd = -1; - return(NULL); + return NULL; } /* @@ -195,14 +195,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 @@ -66,7 +66,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; } } @@ -75,15 +75,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 * @@ -98,7 +98,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 @@ -155,7 +155,7 @@ tbl_span(struct tbl_node *tbl) : tbl->first_span; if (span) tbl->current_span = span; - return(span); + return span; } int @@ -177,7 +177,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; } @@ -134,10 +134,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. */ @@ -157,7 +157,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 * @@ -178,7 +178,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 @@ -1,6 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -36,14 +37,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/tbl_layout.c b/tbl_layout.c index 1bfcee1b..5f6e3e21 100644 --- a/tbl_layout.c +++ b/tbl_layout.c @@ -355,5 +355,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; } @@ -47,14 +47,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 @@ -644,7 +644,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 @@ -653,9 +653,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 @@ -779,7 +779,7 @@ term_strlen(const struct termp *p, const char *cp) } } - return(sz); + return sz; } int @@ -822,7 +822,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; } /* @@ -832,5 +832,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/term_ascii.c b/term_ascii.c index b715c17f..58969f03 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -115,28 +115,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 @@ -176,7 +176,7 @@ static size_t ascii_width(const struct termp *p, int c) { - return(1); + return 1; } void @@ -261,7 +261,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 * @@ -336,8 +336,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); } #if HAVE_WCHAR @@ -351,7 +351,7 @@ locale_width(const struct termp *p, int c) rc = wcwidth(c); if (rc < 0) rc = 0; - return(rc); + return rc; } static void @@ -516,7 +516,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 * @@ -527,7 +527,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 * @@ -616,7 +616,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 @@ -1270,7 +1270,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 @@ -1325,7 +1325,7 @@ ps_hspan(const struct termp *p, const struct roffsu *su) break; } - return(r * 24.0); + return r * 24.0; } static void diff --git a/test-dirent-namlen.c b/test-dirent-namlen.c index 4a007892..032e75eb 100644 --- a/test-dirent-namlen.c +++ b/test-dirent-namlen.c @@ -6,5 +6,5 @@ main(void) { struct dirent entry; - return (sizeof(entry.d_namlen) == 0); + return sizeof(entry.d_namlen) == 0; } diff --git a/test-fgetln.c b/test-fgetln.c index ac225a17..c2abf06d 100644 --- a/test-fgetln.c +++ b/test-fgetln.c @@ -7,5 +7,5 @@ main(void) { size_t sz; fclose(stdin); - return(NULL != fgetln(stdin, &sz)); + return fgetln(stdin, &sz) != NULL; } @@ -18,25 +18,25 @@ main(void) if (ftsp == NULL) { perror("fts_open"); - return(1); + return 1; } entry = fts_read(ftsp); if (entry == NULL) { perror("fts_read"); - return(1); + return 1; } if (fts_set(ftsp, entry, FTS_SKIP) != 0) { perror("fts_set"); - return(1); + return 1; } if (fts_close(ftsp) != 0) { perror("fts_close"); - return(1); + return 1; } - return(0); + return 0; } diff --git a/test-getsubopt.c b/test-getsubopt.c index 1a29d3e4..73347343 100644 --- a/test-getsubopt.c +++ b/test-getsubopt.c @@ -29,6 +29,6 @@ main(void) char token0[] = "k"; char *const tokens[] = { token0, NULL }; char *value = NULL; - return( ! (0 == getsubopt(&options, tokens, &value) - && value == buf+2 && options == buf+3)); + return ! (getsubopt(&options, tokens, &value) == 0 + && value == buf+2 && options == buf+3); } diff --git a/test-isblank.c b/test-isblank.c index f91232ac..eb2cfdfc 100644 --- a/test-isblank.c +++ b/test-isblank.c @@ -3,5 +3,5 @@ int main(void) { - return(!isblank(' ') || !isblank('\t') || isblank('_')); + return !isblank(' ') || !isblank('\t') || isblank('_'); } diff --git a/test-mkdtemp.c b/test-mkdtemp.c index 8e1c46ca..a0cb30e2 100644 --- a/test-mkdtemp.c +++ b/test-mkdtemp.c @@ -7,6 +7,6 @@ main(void) char dirname[] = "/tmp/temp.XXXXXX"; if (mkdtemp(dirname) != dirname) - return(1); - return(rmdir(dirname) == -1); + return 1; + return rmdir(dirname) == -1; } diff --git a/test-mmap.c b/test-mmap.c index c322a34d..3a6232d9 100644 --- a/test-mmap.c +++ b/test-mmap.c @@ -5,5 +5,5 @@ int main(void) { - return(MAP_FAILED != mmap(NULL, 1, PROT_READ, MAP_SHARED, -1, 0)); + return mmap(NULL, 1, PROT_READ, MAP_SHARED, -1, 0) != MAP_FAILED; } diff --git a/test-ohash.c b/test-ohash.c index 522ad708..138d520d 100644 --- a/test-ohash.c +++ b/test-ohash.c @@ -3,8 +3,8 @@ #include <stdlib.h> #include <ohash.h> -void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); } -void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); } +void *xmalloc(size_t sz, void *arg) { return calloc(1,sz); } +void *xcalloc(size_t nmemb, size_t sz, void *arg) { return calloc(nmemb,sz); } void xfree(void *p, void *arg) { free(p); } int diff --git a/test-reallocarray.c b/test-reallocarray.c index 9a514e8e..f99e685d 100644 --- a/test-reallocarray.c +++ b/test-reallocarray.c @@ -3,5 +3,5 @@ int main(void) { - return( ! reallocarray(NULL, 2, 2)); + return !reallocarray(NULL, 2, 2); } diff --git a/test-sqlite3.c b/test-sqlite3.c index af2343e5..0ec76744 100644 --- a/test-sqlite3.c +++ b/test-sqlite3.c @@ -29,19 +29,19 @@ main(void) NULL) != SQLITE_OK) { perror("test.db"); fprintf(stderr, "sqlite3_open_v2: %s", sqlite3_errmsg(db)); - return(1); + return 1; } unlink("test.db"); if (sqlite3_exec(db, "PRAGMA foreign_keys = ON", NULL, NULL, NULL) != SQLITE_OK) { fprintf(stderr, "sqlite3_exec: %s", sqlite3_errmsg(db)); - return(1); + return 1; } if (sqlite3_close(db) != SQLITE_OK) { fprintf(stderr, "sqlite3_close: %s", sqlite3_errmsg(db)); - return(1); + return 1; } - return(0); + return 0; } diff --git a/test-sqlite3_errstr.c b/test-sqlite3_errstr.c index 041bf628..4d3c7c54 100644 --- a/test-sqlite3_errstr.c +++ b/test-sqlite3_errstr.c @@ -4,5 +4,5 @@ int main(void) { - return(strcmp(sqlite3_errstr(SQLITE_OK), "not an error")); + return strcmp(sqlite3_errstr(SQLITE_OK), "not an error"); } diff --git a/test-strcasestr.c b/test-strcasestr.c index 479ba913..c3a87de8 100644 --- a/test-strcasestr.c +++ b/test-strcasestr.c @@ -9,5 +9,5 @@ main(void) { const char *big = "BigString"; char *cp = strcasestr(big, "Gst"); - return(big + 2 != cp); + return cp != big + 2; } diff --git a/test-stringlist.c b/test-stringlist.c index 0cc1cd3d..c7b849e9 100644 --- a/test-stringlist.c +++ b/test-stringlist.c @@ -24,14 +24,14 @@ main(void) char teststr[] = "test"; if ((sl = sl_init()) == NULL) - return(1); + return 1; if (sl_add(sl, teststr)) - return(2); + return 2; if (sl->sl_cur != 1) - return(3); + return 3; if (sl->sl_str[0] != teststr) - return(4); + return 4; sl_free(sl, 0); - return(0); + return 0; } diff --git a/test-strlcat.c b/test-strlcat.c index b74ce6f4..48ab38a4 100644 --- a/test-strlcat.c +++ b/test-strlcat.c @@ -4,6 +4,6 @@ int main(void) { char buf[3] = "a"; - return( ! (2 == strlcat(buf, "b", sizeof(buf)) && - 'a' == buf[0] && 'b' == buf[1] && '\0' == buf[2])); + return ! (strlcat(buf, "b", sizeof(buf)) == 2 && + buf[0] == 'a' && buf[1] == 'b' && buf[2] == '\0'); } diff --git a/test-strlcpy.c b/test-strlcpy.c index 05fa5094..12e1db39 100644 --- a/test-strlcpy.c +++ b/test-strlcpy.c @@ -4,6 +4,6 @@ int main(void) { char buf[2] = ""; - return( ! (1 == strlcpy(buf, "a", sizeof(buf)) && - 'a' == buf[0] && '\0' == buf[1])); + return ! (strlcpy(buf, "a", sizeof(buf)) == 1 && + buf[0] == 'a' && buf[1] == '\0'); } diff --git a/test-strptime.c b/test-strptime.c index bedc7758..d8799e94 100644 --- a/test-strptime.c +++ b/test-strptime.c @@ -9,6 +9,6 @@ main(void) { struct tm tm; const char input[] = "2014-01-04"; - return( ! (input+10 == strptime(input, "%Y-%m-%d", &tm) && - 114 == tm.tm_year && 0 == tm.tm_mon && 4 == tm.tm_mday)); + return ! (strptime(input, "%Y-%m-%d", &tm) == input + 10 && + tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4); } diff --git a/test-strsep.c b/test-strsep.c index 4c57c13e..18bbb109 100644 --- a/test-strsep.c +++ b/test-strsep.c @@ -6,5 +6,5 @@ main(void) char buf[6] = "aybxc"; char *workp = buf; char *retp = strsep(&workp, "xy"); - return( ! (retp == buf && '\0' == buf[1] && buf + 2 == workp)); + return ! (retp == buf && buf[1] == '\0' && workp == buf + 2); } diff --git a/test-strtonum.c b/test-strtonum.c index a336ea94..62e09d7a 100644 --- a/test-strtonum.c +++ b/test-strtonum.c @@ -23,20 +23,20 @@ main(void) const char *errstr; if (strtonum("1", 0, 2, &errstr) != 1) - return(1); + return 1; if (errstr != NULL) - return(2); + return 2; if (strtonum("1x", 0, 2, &errstr) != 0) - return(3); + return 3; if (errstr == NULL) - return(4); + return 4; if (strtonum("2", 0, 1, &errstr) != 0) - return(5); + return 5; if (errstr == NULL) - return(6); + return 6; if (strtonum("0", 1, 2, &errstr) != 0) - return(7); + return 7; if (errstr == NULL) - return(8); - return(0); + return 8; + return 0; } diff --git a/test-vasprintf.c b/test-vasprintf.c index dd22b9d9..660ba5f5 100644 --- a/test-vasprintf.c +++ b/test-vasprintf.c @@ -33,7 +33,7 @@ testfunc(char **ret, const char *format, ...) irc = vasprintf(ret, format, ap); va_end(ap); - return(irc); + return irc; } int @@ -42,8 +42,8 @@ main(void) char *ret; if (testfunc(&ret, "%s.", "Text") != 5) - return(1); + return 1; if (strcmp(ret, "Text.")) - return(2); - return(0); + return 2; + return 0; } diff --git a/test-wchar.c b/test-wchar.c index 72f4844e..acd10653 100644 --- a/test-wchar.c +++ b/test-wchar.c @@ -32,32 +32,32 @@ main(void) if (setlocale(LC_ALL, "") == NULL) { fputs("setlocale(LC_ALL, \"\") failed\n", stderr); - return(1); + return 1; } if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) { fputs("setlocale(LC_CTYPE, \"en_US.UTF-8\") failed\n", stderr); - return(1); + return 1; } if (sizeof(wchar_t) < 4) { fprintf(stderr, "wchar_t is only %zu bytes\n", sizeof(wchar_t)); - return(1); + return 1; } if ((width = wcwidth(L' ')) != 1) { fprintf(stderr, "wcwidth(L' ') returned %d\n", width); - return(1); + return 1; } dup2(STDERR_FILENO, STDOUT_FILENO); wc = L'*'; if (putwchar(wc) != (wint_t)wc) { fputs("bad putwchar return value\n", stderr); - return(1); + return 1; } - return(0); + return 0; } |