From 794dab6aa5027ffaf024506140c258f6a0a9322d Mon Sep 17 00:00:00 2001 From: Dan Harkless Date: Fri, 16 Jul 1999 00:53:17 +0000 Subject: [PATCH] Eliminated compilation warnings. --- uip/mhbuildsbr.c | 11 ++++++----- uip/mhmisc.c | 2 +- uip/mhoutsbr.c | 4 ++-- uip/mhparse.c | 8 ++++---- uip/mhshowsbr.c | 3 ++- uip/mhstoresbr.c | 5 +++-- uip/msh.c | 13 +++++++++---- uip/mshcmds.c | 6 ++++-- uip/picksbr.c | 6 ++++-- uip/popsbr.c | 3 ++- uip/post.c | 14 ++++++++------ uip/rcvdist.c | 13 ++++++++----- uip/rcvtty.c | 2 ++ uip/replsbr.c | 7 ++++--- uip/sortm.c | 5 +++-- uip/spost.c | 6 ++++-- uip/viamail.c | 4 ++-- 17 files changed, 68 insertions(+), 44 deletions(-) diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 0897551..a65736f 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -227,8 +227,7 @@ pidcheck (int status) fflush (stdout); fflush (stderr); - done (1); - /* NOTREACHED */ + return done (1); } @@ -2662,7 +2661,7 @@ losing_ftp: goto losing_ftp; #endif - if (cachefile[0]) + if (cachefile[0]) { if (caching) chmod (cachefile, cachetype ? m_gmprot () : 0444); else { @@ -2676,7 +2675,7 @@ losing_ftp: fseek (gp, 0L, SEEK_SET); - while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) + while ((cc= fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) fwrite (buffer, sizeof(*buffer), cc, fp); fflush (fp); @@ -2694,6 +2693,7 @@ losing_ftp: } umask (mask); } + } fseek (ce->ce_fp, 0L, SEEK_SET); *file = ce->ce_file; @@ -3159,11 +3159,12 @@ use_forw: /* search the arguments for a folder name */ for (ap = arguments; *ap; ap++) { cp = *ap; - if (*cp == '+' || *cp == '@') + if (*cp == '+' || *cp == '@') { if (folder) adios (NULL, "only one folder per #forw directive"); else folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF); + } } /* else, use the current folder */ diff --git a/uip/mhmisc.c b/uip/mhmisc.c index 75ac158..80ebcbb 100644 --- a/uip/mhmisc.c +++ b/uip/mhmisc.c @@ -94,7 +94,7 @@ make_intermediates (char *file) { char *cp; - for (cp = file + 1; cp = strchr(cp, '/'); cp++) { + for (cp = file + 1; (cp = strchr(cp, '/')); cp++) { struct stat st; *cp = '\0'; diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 6d2914a..f2b30b6 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -73,7 +73,7 @@ int writeBase64aux (FILE *, FILE *); * static prototypes */ static int output_content (CT, FILE *); -static int output_headers (CT, FILE *); +static void output_headers (CT, FILE *); static int writeExternalBody (CT, FILE *); static int write8Bit (CT, FILE *); static int writeQuoted (CT, FILE *); @@ -219,7 +219,7 @@ output_content (CT ct, FILE *out) * Output all the header fields for a content */ -static int +static void output_headers (CT ct, FILE *out) { HF hp; diff --git a/uip/mhparse.c b/uip/mhparse.c index fc5ab20..86a08b7 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -205,8 +205,7 @@ pidcheck (int status) fflush (stdout); fflush (stderr); - done (1); - /* NOTREACHED */ + return done (1); } @@ -2400,7 +2399,7 @@ losing_ftp: goto losing_ftp; #endif - if (cachefile[0]) + if (cachefile[0]) { if (caching) chmod (cachefile, cachetype ? m_gmprot () : 0444); else { @@ -2414,7 +2413,7 @@ losing_ftp: fseek (gp, 0L, SEEK_SET); - while ((cc = fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) + while ((cc= fread (buffer, sizeof(*buffer), sizeof(buffer), gp)) > 0) fwrite (buffer, sizeof(*buffer), cc, fp); fflush (fp); @@ -2432,6 +2431,7 @@ losing_ftp: } umask (mask); } + } fseek (ce->ce_fp, 0L, SEEK_SET); *file = ce->ce_file; diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index a95ff7d..e76dbaa 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -734,11 +734,12 @@ show_multi_internal (CT ct, int serial, int alternate) for (part = m->mp_parts; part; part = part->mp_next) { p = part->mp_part; - if (p->c_pid > OK) + if (p->c_pid > OK) { if (kill (p->c_pid, 0) == NOTOK) p->c_pid = 0; else kids++; + } } while (kids > 0 && (pid = wait (&status)) != NOTOK) { diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index d849609..2d0fdc8 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -241,14 +241,15 @@ store_application (CT ct) if (tarP) { ct->c_showproc = add (zP ? "%euncompress | tar tvf -" : "%etar tvf -", NULL); - if (!ct->c_storeproc) + if (!ct->c_storeproc) { if (autosw) { ct->c_storeproc = add (zP ? "| uncompress | tar xvpf -" : "| tar xvpf -", NULL); ct->c_umask = 0022; } else { - ct->c_storeproc = add (zP ? "%m%P.tar.Z" : "%m%P.tar", NULL); + ct->c_storeproc= add (zP ? "%m%P.tar.Z" : "%m%P.tar", NULL); } + } } } diff --git a/uip/msh.c b/uip/msh.c index 6755a8c..41cf510 100644 --- a/uip/msh.c +++ b/uip/msh.c @@ -408,7 +408,7 @@ main (int argc, char **argv) m_reset (); - done (0); + return done (0); } @@ -1549,7 +1549,7 @@ parse (char *buffer, struct Cmd *cmdp) cmdp->direction = STDIO; cmdp->stream = NULL; - for (cp = buffer; c = *cp; cp++) { + for (cp = buffer; (c = *cp); cp++) { if (!isspace (c)) break; } @@ -1615,7 +1615,7 @@ parse (char *buffer, struct Cmd *cmdp) cp++; } cmdp->redirect = pp + 1;/* sigh */ - for (; c = *cp; cp++) + for (; (c = *cp); cp++) if (!isspace (c)) break; if (c == 0) { @@ -1936,6 +1936,8 @@ pINI (void) fmt2peer (RC_ERR, "pINI protocol screw-up"); done (1); /* NOTREACHED */ } + + return 1; /* dead code to satisfy the compiler */ } @@ -2067,11 +2069,12 @@ pQRY2 (void) for (msgnum = mp->curmsg; msgnum <= mp->hghmsg; msgnum++) if (does_exist (mp, msgnum)) i++; - if (i-- > 0) + if (i-- > 0) { if (topcur) k = i >= k ? 1 : k - i; else k -= i > j ? j : i; + } i = j = 0; n = 1; @@ -2292,6 +2295,8 @@ ttyR (struct Cmd *cmdp) fmt2peer (RC_ERR, "pTTY protocol screw-up"); done (1); /* NOTREACHED */ } + + return 1; /* dead code to satisfy compiler */ } diff --git a/uip/mshcmds.c b/uip/mshcmds.c index a665536..427bff6 100644 --- a/uip/mshcmds.c +++ b/uip/mshcmds.c @@ -691,7 +691,7 @@ foldcmd (char **args) packsw = 0; continue; } - if (*cp == '+' || *cp == '@') + if (*cp == '+' || *cp == '@') { if (folder) { advise (NULL, "only one folder at a time!\n"); return; @@ -699,6 +699,7 @@ foldcmd (char **args) else folder = fmsh ? path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF) : cp + 1; + } else if (msg) { advise (NULL, "only one message at a time!\n"); @@ -1192,7 +1193,7 @@ markcmd (char **args) } } - if (!addsw && !deletesw && !listsw) + if (!addsw && !deletesw && !listsw) { if (seqp) addsw++; else @@ -1205,6 +1206,7 @@ markcmd (char **args) if (!msgp) msgs[msgp++] = "all"; } + } if (!msgp) msgs[msgp++] = listsw ? "all" :"cur"; diff --git a/uip/picksbr.c b/uip/picksbr.c index 88463ed..36ca695 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -641,14 +641,15 @@ plist ebp = ibuf + strlen (ibuf); } c = *p2++; - if (lf && c != '\n') + if (lf && c != '\n') { if (c != ' ' && c != '\t') { --p2; break; } else lf = 0; - if (c == '\n') + } + if (c == '\n') { if (body) break; else { @@ -659,6 +660,7 @@ plist lf++; c = ' '; } + } if (c && p1 < &linebuf[LBSIZE - 1]) *p1++ = c; } diff --git a/uip/popsbr.c b/uip/popsbr.c index 0b0551d..f86d5d3 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -569,7 +569,7 @@ vcommand (const char *fmt, va_list ap) char *cp, buffer[BUFSIZ]; vsnprintf (buffer, sizeof(buffer), fmt, ap); - if (poprint) + if (poprint) { if (pophack) { if ((cp = strchr (buffer, ' '))) *cp = 0; @@ -580,6 +580,7 @@ vcommand (const char *fmt, va_list ap) } else fprintf (stderr, "---> %s\n", buffer); + } if (putline (buffer, output) == NOTOK) return NOTOK; diff --git a/uip/post.c b/uip/post.c index 4602dc0..8eb3b77 100644 --- a/uip/post.c +++ b/uip/post.c @@ -632,7 +632,7 @@ main (int argc, char **argv) if (verbose) printf (partno ? "Partial Message #%s Processed\n" : "Message Processed\n", partno); - done (0); + return done (0); } @@ -690,7 +690,7 @@ putfmt (char *name, char *str, FILE *out) if ((cp = strrchr(str, '\n'))) *cp = 0; - for (cp = pp = str; cp = strchr(pp, ','); pp = cp) { + for (cp = pp = str; (cp = strchr(pp, ',')); pp = cp) { *cp++ = 0; insert_fcc (hdr, pp); } @@ -704,7 +704,7 @@ putfmt (char *name, char *str, FILE *out) } tmpaddrs.m_next = NULL; - for (count = 0; cp = getname (str); count++) + for (count = 0; (cp = getname (str)); count++) if ((mp = getm (cp, NULL, 0, AD_HOST, NULL))) { if (tmpaddrs.m_next) np->m_next = mp; @@ -916,7 +916,7 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flag if (mp->m_mbox == NULL || ((flags & HTRY) && !insert (mp))) return 0; - if (!fill_in && (flags & (HBCC | HDCC)) || mp->m_ingrp) + if ((!fill_in && (flags & (HBCC | HDCC))) || mp->m_ingrp) return 1; if (!nameoutput) { @@ -938,13 +938,14 @@ putadr (char *name, char *aka, struct mailname *mp, FILE *out, unsigned int flag } len = strlen (cp); - if (linepos != nameoutput) + if (linepos != nameoutput) { if (len + linepos + 2 > outputlinelen) fprintf (out, ",\n%*s", linepos = nameoutput, ""); else { fputs (", ", out); linepos += 2; } + } fputs (cp, out); linepos += len; @@ -972,7 +973,7 @@ putgrp (char *name, char *group, FILE *out, unsigned int flags) cp = fill_in ? group : concat (group, ";", NULL); len = strlen (cp); - if (linepos > nameoutput) + if (linepos > nameoutput) { if (len + linepos + 2 > outputlinelen) { fprintf (out, ",\n%*s", nameoutput, ""); linepos = nameoutput; @@ -981,6 +982,7 @@ putgrp (char *name, char *group, FILE *out, unsigned int flags) fputs (", ", out); linepos += 2; } + } fputs (cp, out); linepos += len; diff --git a/uip/rcvdist.c b/uip/rcvdist.c index b210696..922670b 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -28,7 +28,7 @@ static char tmpfil[BUFSIZ] = ""; * prototypes */ static void rcvdistout (FILE *, char *, char *); -void done (int); +int done (int); int @@ -117,7 +117,8 @@ main (int argc, char **argv) default: done (pidXwait(child_id, postproc)); } -/* NOTREACHED */ + + return 0; /* dead code to satisfy the compiler */ } /* very similar to routine in replsbr.c */ @@ -205,13 +206,14 @@ rcvdistout (FILE *inb, char *form, char *addrs) } else { i = strlen (cp = cptr->c_text) - 1; - if (cp[i] == '\n') + if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { cp[i] = 0; cp = add (",\n\t", cp); } else cp = add ("\t", cp); + } cptr->c_text = add (tmpbuf, cp); } while (state == FLDPLUS) { @@ -252,7 +254,7 @@ finished: ; fclose (out); free (scanl); - for (nxtbuf = compbuffers, i = ncomps; cptr = *savecomp++; nxtbuf++, i--) + for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++); nxtbuf++, i--) free (cptr->c_text); while (i-- > 0) free (*nxtbuf++); @@ -261,7 +263,7 @@ finished: ; } -void +int done (int status) { if (backup[0]) @@ -272,4 +274,5 @@ done (int status) unlink (tmpfil); exit (status ? RCV_MBX : RCV_MOK); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/rcvtty.c b/uip/rcvtty.c index cb194dd..b847b56 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -167,6 +167,7 @@ main (int argc, char **argv) fclose (uf); exit (RCV_MOK); + return 0; /* dead code to satisfy the compiler */ } @@ -243,6 +244,7 @@ message_fd (char **vec) setpgid ((pid_t) 0, getpid ()); /* put in own process group */ execvp (vec[0], vec); _exit (-1); + return 1; /* dead code to satisfy compiler */ } diff --git a/uip/replsbr.c b/uip/replsbr.c index 57eb6cd..7515f11 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -160,13 +160,14 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, tmpbuf = *nxtbuf++; } else { i = strlen (cp = cptr->c_text) - 1; - if (cp[i] == '\n') + if (cp[i] == '\n') { if (cptr->c_type & CT_ADDR) { cp[i] = '\0'; cp = add (",\n\t", cp); } else { cp = add ("\t", cp); } + } cptr->c_text = add (tmpbuf, cp); } while (state == FLDPLUS) { @@ -252,7 +253,7 @@ finished: /* return dynamically allocated buffers */ free (scanl); - for (nxtbuf = compbuffers, i = ncomps; cptr = *savecomp++; nxtbuf++, i--) + for (nxtbuf = compbuffers, i = ncomps; (cptr = *savecomp++); nxtbuf++, i--) free (cptr->c_text); /* if not nxtbuf, nxtbuf already freed */ while ( i-- > 0) free (*nxtbuf++); /* free unused nxtbufs */ @@ -334,7 +335,7 @@ formataddr (char *orig, char *str) } /* concatenate all the new addresses onto 'buf' */ - for (isgroup = 0; cp = getname (str); ) { + for (isgroup = 0; (cp = getname (str)); ) { if ((mp = getm (cp, dfhost, dftype, AD_NAME, error)) == NULL) { snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error); badaddrs = add (baddr, badaddrs); diff --git a/uip/sortm.c b/uip/sortm.c index 398045b..c7f5396 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -226,13 +226,14 @@ main (int argc, char **argv) dlist[i] = &smsgs[i]; dlist[nmsgs] = 0; - if (verbose) /* announce what we're doing */ + if (verbose) { /* announce what we're doing */ if (subjsort) printf ("sorting by %s-major %s-minor\n", submajor ? subjsort : datesw, submajor ? datesw : subjsort); else printf ("sorting by datefield %s\n", datesw); + } /* first sort by date, or by subject-major, date-minor */ qsort ((char *) dlist, nmsgs, sizeof(*dlist), @@ -304,7 +305,7 @@ main (int argc, char **argv) seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ - done (0); + return done (0); } static int diff --git a/uip/spost.c b/uip/spost.c index c5b27a0..5bc41d8 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -454,6 +454,7 @@ main (int argc, char **argv) } execv ( sendmail, sargv); adios ( sendmail, "can't exec"); + return 0; /* dead code to satisfy the compiler */ } /* DRAFT GENERATION */ @@ -489,7 +490,7 @@ putfmt (char *name, char *str, FILE *out) if (hdr->flags & HFCC) { if ((cp = strrchr(str, '\n'))) *cp = 0; - for (cp = pp = str; cp = strchr(pp, ','); pp = cp) { + for (cp = pp = str; (cp = strchr(pp, ',')); pp = cp) { *cp++ = 0; insert_fcc (hdr, pp); } @@ -504,7 +505,7 @@ putfmt (char *name, char *str, FILE *out) } #endif /* notdef */ - if (*str != '\n' && *str != '\0') + if (*str != '\n' && *str != '\0') { if (aliasflg && hdr->flags & HTRY) { /* this header contains address(es) that we have to do * alias expansion on. Because of the saved state in @@ -531,6 +532,7 @@ putfmt (char *name, char *str, FILE *out) } else { fprintf (out, "%s: %s", name, str ); } + } } diff --git a/uip/viamail.c b/uip/viamail.c index bb5b12c..2ee6b3d 100644 --- a/uip/viamail.c +++ b/uip/viamail.c @@ -161,7 +161,7 @@ main (int argc, char **argv) adios (NULL, "missing -viamail \"mailpath\" switch"); via_mail (f1, f2, f3, f4, f5, delay, f7); - /* NOTREACHED */ + return 0; /* dead code to satisfy the compiler */ } @@ -245,5 +245,5 @@ via_mail (char *mailsw, char *subjsw, char *parmsw, char *descsw, fclose (fp); if (unlink (tmpfil) == -1) advise (NULL, "unable to remove temp file %s", tmpfil); - done (status); + return done (status); } -- 1.7.10.4