From 5ccbd49adba7e6d48f4094fa6eade7a7fb8ec4cf Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 7 May 2012 16:14:37 -0500 Subject: [PATCH] Fixed places in the code relying the C99-ism of declarations in the midst of a code block. --- mts/smtp/smtp.c | 8 ++++---- sbr/fmt_scan.c | 3 ++- sbr/lock_file.c | 3 +-- sbr/mts.c | 3 +-- uip/folder.c | 2 +- uip/mhlsbr.c | 2 +- uip/mhshowsbr.c | 2 +- uip/msh.c | 2 +- uip/mshcmds.c | 3 +-- uip/picksbr.c | 6 ++---- uip/popsbr.c | 5 ++--- uip/replsbr.c | 3 +-- 12 files changed, 18 insertions(+), 24 deletions(-) diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 3ba9fbc..ba9938a 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -196,6 +196,7 @@ smtp_init (char *client, char *server, char *port, int watch, int verbose, int debug, int onex, int queued, int sasl, int saslssf, char *saslmech, char *user, int tls) { + int result, sd1, sd2; #ifdef CYRUS_SASL char *server_mechs; #else /* CYRUS_SASL */ @@ -204,7 +205,6 @@ smtp_init (char *client, char *server, char *port, int watch, int verbose, NMH_UNUSED (saslmech); NMH_UNUSED (user); #endif /* CYRUS_SASL */ - int result, sd1, sd2; if (watch) verbose = TRUE; @@ -454,6 +454,9 @@ sendmail_init (char *client, char *server, int watch, int verbose, int debug, int onex, int queued, int sasl, int saslssf, char *saslmech, char *user) { + unsigned int i, result, vecp; + int pdi[2], pdo[2]; + char *vec[15]; #ifdef CYRUS_SASL char *server_mechs; #else /* CYRUS_SASL */ @@ -463,9 +466,6 @@ sendmail_init (char *client, char *server, int watch, int verbose, NMH_UNUSED (saslmech); NMH_UNUSED (user); #endif /* CYRUS_SASL */ - unsigned int i, result, vecp; - int pdi[2], pdo[2]; - char *vec[15]; if (watch) verbose = TRUE; diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 5e4bc88..3f004e5 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -152,10 +152,11 @@ cptrimmed(char **dest, char *str, unsigned int wid, char fill, size_t n) { if (iswcntrl(wide_char) || iswspace(wide_char)) { sp += char_len; #else + int c; end--; /* isnctrl(), etc., take an int argument. Cygwin's ctype.h intentionally warns if they are passed a char. */ - int c = *sp; + c = *sp; if (iscntrl(c) || isspace(c)) { sp++; #endif diff --git a/sbr/lock_file.c b/sbr/lock_file.c index af9b16d..bbfc8fc 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -586,10 +586,9 @@ timerOFF (int fd) static void alrmser (int sig) { - NMH_UNUSED (sig); - char *lockfile; struct lock *lp; + NMH_UNUSED (sig); /* update the ctime of all the lock files */ for (lp = l_top; lp; lp = lp->l_next) { diff --git a/sbr/mts.c b/sbr/mts.c index 1bf62ce..cb11a77 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -127,11 +127,10 @@ static struct bind binds[] = { void mts_init (char *name) { - NMH_UNUSED (name); - const char *cp; FILE *fp; static int inited = 0; + NMH_UNUSED (name); if (inited++ || (fp = fopen (get_mtsconf_pathname(), "r")) == NULL) return; diff --git a/uip/folder.c b/uip/folder.c index f3b4ba4..0676bea 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -457,9 +457,9 @@ get_folder_info_body (char *fold, char *msg, boolean *crawl_children) static boolean get_folder_info_callback (char *fold, void *baton) { + boolean crawl_children; NMH_UNUSED (baton); - boolean crawl_children; get_folder_info_body (fold, NULL, &crawl_children); fflush (stdout); return crawl_children; diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index be63c25..df0a223 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -338,7 +338,7 @@ int mhl (int argc, char **argv) { int length = 0, nomore = 0; - unsigned int i, vecp = 0;; + unsigned int i, vecp = 0; int width = 0; char *cp, *folder = NULL, *form = NULL; char buf[BUFSIZ], *files[MAXARGS]; diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 9c1c0de..99db9f8 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -529,10 +529,10 @@ show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer if (xpause && isatty (fileno (stdout))) { int intr; + SIGNAL_HANDLER istat; if (SOprintf ("Press to show content...")) printf ("Press to show content..."); - SIGNAL_HANDLER istat; istat = SIGNAL (SIGINT, intrser); if ((intr = sigsetjmp (intrenv, 1)) == OK) { diff --git a/uip/msh.c b/uip/msh.c index 80bc1d2..03584f6 100644 --- a/uip/msh.c +++ b/uip/msh.c @@ -801,10 +801,10 @@ m_gMsgs (int n) FILE * msh_ready (int msgnum, int full) { - NMH_UNUSED (full); register int msgp; int fd; char *cp; + NMH_UNUSED (full); if (yp) { fclose (yp); diff --git a/uip/mshcmds.c b/uip/mshcmds.c index 9937a1d..b5debff 100644 --- a/uip/mshcmds.c +++ b/uip/mshcmds.c @@ -1075,9 +1075,8 @@ static char *hlpmsg[] = { void helpcmd (char **args) { - NMH_UNUSED (args); - int i; + NMH_UNUSED (args); for (i = 0; hlpmsg[i]; i++) { printf (hlpmsg[i], invo_name); diff --git a/uip/picksbr.c b/uip/picksbr.c index 26401f4..b92c053 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -656,12 +656,11 @@ static int GREPaction (params) plist { - NMH_UNUSED (msgnum); - int c, body, lf; long pos = start; register char *p1, *p2, *ebp, *cbp; char ibuf[BUFSIZ]; + NMH_UNUSED (msgnum); fseek (fp, start, SEEK_SET); body = 0; @@ -931,12 +930,11 @@ static int TWSaction (params) plist { - NMH_UNUSED (stop); - int state; register char *bp; char buf[BUFSIZ], name[NAMESZ]; register struct tws *tw; + NMH_UNUSED (stop); fseek (fp, start, SEEK_SET); for (state = FLD, bp = NULL;;) { diff --git a/uip/popsbr.c b/uip/popsbr.c index feb7aa0..ff28705 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -418,14 +418,13 @@ int pop_init (char *host, char *port, char *user, char *pass, char *proxy, int snoop, int sasl, char *mech) { + int fd1, fd2; + char buffer[BUFSIZ]; #ifndef CYRUS_SASL NMH_UNUSED (sasl); NMH_UNUSED (mech); #endif /* ! CYRUS_SASL */ - int fd1, fd2; - char buffer[BUFSIZ]; - if (proxy && *proxy) { int pid; int inpipe[2]; /* for reading from the server */ diff --git a/uip/replsbr.c b/uip/replsbr.c index 83f6ee8..8bf765e 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -71,8 +71,6 @@ void replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, int mime, char *form, char *filter, char *fcc, int fmtproc) { - NMH_UNUSED (msg); - register int state, i; register struct comp *cptr; register char *tmpbuf; @@ -83,6 +81,7 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, char name[NAMESZ], *scanl; unsigned char *cp; FILE *out; + NMH_UNUSED (msg); mask = umask(~m_gmprot()); if ((out = fopen (drft, "w")) == NULL) -- 1.7.10.4