From: Ralph Corderoy Date: Tue, 12 Sep 2017 23:14:43 +0000 (+0100) Subject: Remove more outer wrapping parenthesis from return statements. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/96a2a03a1473522669e8848959c3aa380cf3d4eb?hp=c129bec59a25b62b25763798d4a269a7a2fabe54 Remove more outer wrapping parenthesis from return statements. For example, `return(foo(a, b));' becomes `return foo(a, b);'. --- diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 80dabb78..f8478427 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -533,7 +533,7 @@ sm_wtxt (char *buffer, int len) result = sm_wstream (buffer, len); - return (result == NOTOK ? RP_BHST : RP_OK); + return result == NOTOK ? RP_BHST : RP_OK; } @@ -632,7 +632,7 @@ sm_end (int type) status = OK; } - return (status ? RP_BHST : RP_OK); + return status ? RP_BHST : RP_OK; } diff --git a/sbr/dtime.c b/sbr/dtime.c index f661ed14..b5039ed6 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -408,6 +408,6 @@ twsort (struct tws *tw1, struct tws *tw2) if (tw2->tw_clock == 0) dmktime (tw2); - return ((c1 = tw1->tw_clock) > (c2 = tw2->tw_clock) ? 1 - : c1 == c2 ? 0 : -1); + return (c1 = tw1->tw_clock) > (c2 = tw2->tw_clock) ? 1 + : c1 == c2 ? 0 : -1; } diff --git a/sbr/dtimep.l b/sbr/dtimep.l index 90537088..09a579f9 100644 --- a/sbr/dtimep.l +++ b/sbr/dtimep.l @@ -51,7 +51,7 @@ tw.tw_year += 1900; \ if(tw.tw_year < 1970) \ tw.tw_year += 100; \ - return(&tw) + return &tw /* * Table to convert month names to numeric month. We use the diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index e5b6ae28..78fc516c 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -79,7 +79,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook) default: arglist_free(prog, vec); - return (pidwait (pid, -1)); + return pidwait(pid, -1); } } diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 426cddfc..2c8b1c75 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -576,7 +576,7 @@ lockit (struct lockinfo *li) fd = link(tmpfile, curlock); (void) m_unlink(tmpfile); - return (fd == -1 ? -1 : 0); + return fd == -1 ? -1 : 0; } #endif /* HAVE_LIBLOCKFILE */ diff --git a/sbr/m_convert.c b/sbr/m_convert.c index c4e629cb..06e31afe 100644 --- a/sbr/m_convert.c +++ b/sbr/m_convert.c @@ -293,16 +293,16 @@ m_conv (struct msgs *mp, char *str, int call) delimp = cp; if (!strcmp (buf, "first")) - return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) - ? mp->lowmsg : BADMSG); + return mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? + mp->lowmsg : BADMSG; if (!strcmp (buf, "last")) { convdir = -1; - return (mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG); + return mp->hghmsg || !(mp->msgflags & ALLOW_NEW) ? mp->hghmsg : BADMSG; } if (!strcmp (buf, "cur") || !strcmp (buf, ".")) - return (mp->curmsg > 0 ? mp->curmsg : BADMSG); + return mp->curmsg > 0 ? mp->curmsg : BADMSG; if (!strcmp (buf, "prev")) { convdir = -1; diff --git a/sbr/pidwait.c b/sbr/pidwait.c index 2e56f0b0..bd6602cb 100644 --- a/sbr/pidwait.c +++ b/sbr/pidwait.c @@ -31,5 +31,5 @@ pidwait (pid_t id, int sigsok) SIGNAL (SIGQUIT, qstat); } - return (pid == -1 ? -1 : status); + return pid == -1 ? -1 : status; } diff --git a/sbr/read_yes_or_no_if_tty.c b/sbr/read_yes_or_no_if_tty.c index 2427f59c..93484e4e 100644 --- a/sbr/read_yes_or_no_if_tty.c +++ b/sbr/read_yes_or_no_if_tty.c @@ -16,5 +16,5 @@ read_yes_or_no_if_tty (const char *prompt) if (interactive < 0) interactive = isatty (fileno (stdin)); - return (interactive ? read_switch (prompt, anoyes) : 1); + return interactive ? read_switch(prompt, anoyes) : 1; } diff --git a/sbr/refile.c b/sbr/refile.c index 4ba4908a..ade07f6e 100644 --- a/sbr/refile.c +++ b/sbr/refile.c @@ -47,6 +47,6 @@ refile (char **arg, char *file) default: arglist_free(program, vec); - return (pidwait (pid, -1)); + return pidwait(pid, -1); } } diff --git a/sbr/seq_list.c b/sbr/seq_list.c index f3a26738..b7ed5707 100644 --- a/sbr/seq_list.c +++ b/sbr/seq_list.c @@ -100,5 +100,5 @@ seq_list(struct msgs *mp, char *seqname) bp += strlen(bp); } } - return (bp > buffer? buffer : NULL); + return bp > buffer ? buffer : NULL; } diff --git a/sbr/vfgets.c b/sbr/vfgets.c index 480af139..d3946bc6 100644 --- a/sbr/vfgets.c +++ b/sbr/vfgets.c @@ -28,7 +28,7 @@ vfgets (FILE *in, char **bp) *bp = pp; return 0; } - return (ferror (in) && !feof (in) ? -1 : 1); + return ferror(in) && !feof(in) ? -1 : 1; } if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) { diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 40ec9b80..77322d4d 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -187,7 +187,7 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, if (write (md, MMDF_DELIM, j) != j) return NOTOK; - return (i != NOTOK ? OK : NOTOK); + return i != NOTOK ? OK : NOTOK; case MBOX_FORMAT: if ((j = dup (fd)) == NOTOK) diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 430a42e4..90e87e15 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -322,8 +322,8 @@ findlabel(struct format *addr) for (i = 0; i < lused; ++i) if (addr == lvec[i]) - return(i); - return(-1); + return i; + return -1; } static void @@ -435,7 +435,7 @@ f_typestr(int t) case FT_V_AMATCH: return "V_AMATCH"; default: snprintf(buf, sizeof buf, "/* ??? #%d */", t); - return(buf); + return buf; } } @@ -458,7 +458,7 @@ c_typestr(int t) FNORD(CT_ADDR, "ADDR"); FNORD(CT_DATE, "DATE"); strcat(buf, ">"); - return(buf); + return buf; } static char * @@ -477,7 +477,7 @@ c_flagsstr(int t) FNORD(CF_DATEFAB, "DATEFAB"); FNORD(CF_TRIMMED, "TRIMMED"); strcat(buf, ">"); - return(buf); + return buf; } #undef FNORD diff --git a/uip/fmttest.c b/uip/fmttest.c index 16d303f9..6b49fc66 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -982,8 +982,8 @@ findlabel(struct format *addr) for (i = 0; i < lused; ++i) if (addr == lvec[i]) - return(i); - return(-1); + return i; + return -1; } static void @@ -1101,7 +1101,7 @@ f_typestr(int t) case FT_V_AMATCH: return "V_AMATCH"; default: snprintf(buf, sizeof(buf), "/* ??? #%d */", t); - return(buf); + return buf; } } @@ -1111,7 +1111,7 @@ c_typestr(int t) static char buf[64]; snprintb(buf, sizeof(buf), t, CT_BITS); - return(buf); + return buf; } static char * @@ -1120,7 +1120,7 @@ c_flagsstr(int t) static char buf[64]; snprintb(buf, sizeof(buf), t, CF_BITS); - return(buf); + return buf; } static void diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index fdf59929..3ae8edcb 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -1620,7 +1620,7 @@ scan_content (CT ct, size_t maxunencoded) } } - return (boundaryclash ? NOTOK : OK); + return boundaryclash ? NOTOK : OK; } diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index ebb295b7..512ea2f9 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -499,7 +499,7 @@ show_content_aux2 (CT ct, int alternate, char *cracked, char *buffer, arglist_free(file, vec); if (fd != NOTOK) (*ct->c_ceclosefnx) (ct); - return (alternate ? OK : status); + return alternate ? OK : status; } } } diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 2a094f2b..09c51015 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -782,7 +782,7 @@ losing: fclose (fp); - return (cc != NOTOK ? OK : NOTOK); + return cc != NOTOK ? OK : NOTOK; } if (!ct->c_fp && (ct->c_fp = fopen (ct->c_file, "r")) == NULL) { diff --git a/uip/popsbr.c b/uip/popsbr.c index a9319054..356c341f 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -594,7 +594,7 @@ vcommand (const char *fmt, va_list ap) case OK: if (poprint) fprintf (stderr, "<--- %s\n", response); - return (*response == '+' ? OK : NOTOK); + return *response == '+' ? OK : NOTOK; case NOTOK: case DONE: diff --git a/uip/post.c b/uip/post.c index 81197fc7..1a541e21 100644 --- a/uip/post.c +++ b/uip/post.c @@ -1427,7 +1427,7 @@ annoaux (struct mailname *mp) snprintf (buffer, sizeof(buffer), "%s\n", adrformat (mp)); i = strlen (buffer); - return (write (pfd, buffer, i) == i ? OK : NOTOK); + return write(pfd, buffer, i) == i ? OK : NOTOK; } diff --git a/uip/prompter.c b/uip/prompter.c index 224734e0..fc7b2c63 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -385,7 +385,7 @@ intrser (int i) static int chrcnv (char *cp) { - return (*cp != QUOTE ? *cp : m_atoi (++cp)); + return *cp != QUOTE ? *cp : m_atoi(++cp); } diff --git a/uip/scansbr.c b/uip/scansbr.c index 457379cd..ea5cf266 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -348,7 +348,7 @@ finished: if (scnout && (ferror(scnout) || fclose (scnout) == EOF)) DIEWRERR(); - return (state != FILEEOF ? SCNERR : encrypted ? SCNENC : SCNMSG); + return state != FILEEOF ? SCNERR : encrypted ? SCNENC : SCNMSG; } diff --git a/uip/slocal.c b/uip/slocal.c index fe027ee2..6027eabd 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -636,7 +636,7 @@ usr_delivery (int fd, char *delivery, int su) } fclose (fp); - return (won ? 0 : -1); + return won ? 0 : -1; } @@ -1121,7 +1121,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) else pidstatus (status, stdout, ", failed"); } - return (status == 0 ? 0 : -1); + return status == 0 ? 0 : -1; } /* * Ruthlessly kill the child and anything diff --git a/uip/sortm.c b/uip/sortm.c index 3b5a4d8a..9f95c6d2 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -321,7 +321,7 @@ read_hdrs (struct msgs *mp, char *datesw) } } s->s_msg = 0; - return(s - smsgs); + return s - smsgs; } @@ -484,7 +484,7 @@ subsort (struct smsg **a, struct smsg **b) if ((i = strcmp ((*a)->s_subj, (*b)->s_subj))) return i; - return (dsort (a, b)); + return dsort(a, b); } static int