]> Pileus Git - ~andy/fetchmail/commitdiff
Fix miscellaneous warnings.
authorMatthias Andree <matthias.andree@gmx.de>
Wed, 20 Oct 2004 09:14:04 +0000 (09:14 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Wed, 20 Oct 2004 09:14:04 +0000 (09:14 -0000)
svn path=/trunk/; revision=3953

12 files changed:
daemon.c
driver.c
env.c
fetchmail.c
fetchmail.h
imap.c
pop3.c
rcfile_y.y
report.c
sink.c
socket.c
transact.c

index 3dcb55c36d154176aca51f63ecbb773beeee9cb2..83de920d3828dc813b2699e0a1163a96122b7a3c 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -57,7 +57,6 @@ static RETSIGTYPE
 sigchld_handler (int sig)
 /* process SIGCHLD to obtain the exit code of the terminating process */
 {
-    extern volatile int lastsig;               /* last signal received */
     pid_t pid;
 
 #if    defined(HAVE_WAITPID)                           /* the POSIX way */
index 95ff5b913664fa744a2092e7f400027973d2e535..625f9edcf328db2edcfdccca4b2cf81909408052 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -35,6 +35,8 @@
 #include <hesiod.h>
 #endif
 
+#include <langinfo.h>
+
 #if defined(HAVE_RES_SEARCH) || defined(HAVE_GETHOSTBYNAME)
 #include <netdb.h>
 #include "mx.h"
@@ -312,7 +314,6 @@ static void send_size_warnings(struct query *ctl)
     int msg_to_send = FALSE;
     struct idlist *head=NULL, *current=NULL;
     int max_warning_poll_count;
-    char *tmp;
 
     head = ctl->skipped;
     if (!head)
@@ -333,7 +334,7 @@ static void send_size_warnings(struct query *ctl)
     if (open_warning_by_mail(ctl, (struct msgblk *)NULL))
        return;
     stuff_warning(ctl,
-           tmp = rfc2047e(
+           rfc2047e(
           GT_("Subject: Fetchmail oversized-messages warning"), nl_langinfo(CODESET)));
     stuff_warning(ctl, "");
     stuff_warning(ctl,
diff --git a/env.c b/env.c
index ae658bcd162e65ea2da5f9eeb3c06454ff6c66e0..d832811da19be3b8d745d529dcae641c82d27867 100644 (file)
--- a/env.c
+++ b/env.c
@@ -32,8 +32,6 @@
 
 extern char *getenv(const char *);     /* needed on sysV68 R3V7.1. */
 
-extern char *program_name;
-
 void envquery(int argc, char **argv)
 /* set up basic stuff from the environment (including the rc file name) */
 {
index de5215a9a2e8c6ef82050f26e4cfb7ea42bd8f2f..1756c73fce34639fbbbd89f675e0638555b42c32 100644 (file)
@@ -116,7 +116,6 @@ static char *timestamp (void)
 
 static RETSIGTYPE donothing(int sig) 
 {
-    extern volatile int lastsig;       /* declared in idle.c */
     set_signal_handler(sig, donothing);
     lastsig = sig;
 }
@@ -124,7 +123,7 @@ static RETSIGTYPE donothing(int sig)
 int main(int argc, char **argv)
 {
     int bkgd = FALSE;
-    int parsestatus, implicitmode = FALSE;
+    int implicitmode = FALSE;
     struct query *ctl;
     netrc_entry *netrc_list;
     char *netrc_file, *tmpbuf;
@@ -180,7 +179,7 @@ int main(int argc, char **argv)
     }
 #endif
 
-    if ((parsestatus = parsecmdline(argc,argv, &cmd_run, &cmd_opts)) < 0)
+    if ((parsecmdline(argc,argv, &cmd_run, &cmd_opts)) < 0)
        exit(PS_SYNTAX);
 
     if (versioninfo)
@@ -461,10 +460,8 @@ int main(int argc, char **argv)
                        GT_("fetchmail: can't find a password for %s@%s.\n"),
                        ctl->remotename, ctl->server.pollname);
                return(PS_AUTHFAIL);
-           }
-           else
-           {
-               char* password_prompt = GT_("Enter password for %s@%s: ");
+           } else {
+               const char* password_prompt = GT_("Enter password for %s@%s: ");
 
                xalloca(tmpbuf, char *, strlen(password_prompt) +
                        strlen(ctl->remotename) +
index 6de7cf8aa2690f80a2466fcf3ed90db9d008e1bc..a42dafa54d2a9ec66a85ebce57796b673daf9f30 100644 (file)
 
 #include <stdio.h>
 
-/* We need this for time_t */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
+/* We need this for strstr */
+#if !defined(HAVE_STRSTR) && !defined(strstr)
+char *strstr(const char *, const char *);
 #endif
 
 /* constants designating the various supported protocols */
@@ -518,6 +511,7 @@ extern int mytimeout;
 
 /* idle.c */
 int interruptible_idle(int interval);
+extern volatile int lastsig;
 
 /* sink.c: forwarding */
 void smtp_close(struct query *, int);
diff --git a/imap.c b/imap.c
index ff727e7e95ac48c4a1284ec98544562df8a649b8..4395129f89e0eb7e857c0093051cfe20934f31f0 100644 (file)
--- a/imap.c
+++ b/imap.c
 
 #include  "i18n.h"
 
-#ifdef OPIE_ENABLE
-#endif /* OPIE_ENABLE */
-
-#ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
 /* imap_version values */
 #define IMAP2          -1      /* IMAP2 or IMAP2BIS, RFC1176 */
 #define IMAP4          0       /* IMAP4 rev 0, RFC1730 */
diff --git a/pop3.c b/pop3.c
index ee2b9d4081a5e1e8e8e0976564f882fe4eac7c2a..826309c328220fe8308dd40f7c90b213d4609294 100644 (file)
--- a/pop3.c
+++ b/pop3.c
 #include <opie.h>
 #endif /* OPIE_ENABLE */
 
-#ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
 static int last;
 #ifdef SDPS_ENABLE
 char *sdps_envfrom;
@@ -46,12 +42,12 @@ static char lastok[POPBUFSIZE+1];
 #if defined(KERBEROS_V4) || defined(KERBEROS_V5)
     flag has_kerberos = FALSE;
 #endif /* defined(KERBEROS_V4) || defined(KERBEROS_V5) */
-    flag has_cram = FALSE;
+    static flag has_cram = FALSE;
 #ifdef OPIE_ENABLE
     flag has_otp = FALSE;
 #endif /* OPIE_ENABLE */
 #ifdef SSL_ENABLE
-    flag has_ssl = FALSE;
+    static flag has_ssl = FALSE;
 #endif /* SSL_ENABLE */
 
 #ifdef NTLM_ENABLE
index 95fc4f6945bc2beeb70e28394af8d1c28d925f9a..e11a3687c6072bfa9d6a9eb44f7c384c36da4b3d 100644 (file)
@@ -157,7 +157,7 @@ serv_option : AKA alias_list
 #else
                                                current.server.authenticate = A_KERBEROS_V4;
 #endif /* KERBEROS_V5 */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
                                            current.server.service = KPOP_PORT;
 #else /* INET6_ENABLE */
                                            current.server.port = KPOP_PORT;
@@ -179,12 +179,12 @@ serv_option       : AKA alias_list
                | CHECKALIAS            {current.server.checkalias = FLAG_TRUE;}
                | NO CHECKALIAS         {current.server.checkalias  = FLAG_FALSE;}
                | SERVICE STRING        {
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
                                        current.server.service = $2;
 #endif /* INET6_ENABLE */
                                        }
                | PORT NUMBER           {
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
                                        int port = $2;
                                        char buf[10];
                                        sprintf(buf, "%d", port);
@@ -603,5 +603,3 @@ char *prependdir (const char *file, const char *dir)
 int yywrap(void) {return 1;}
 
 /* rcfile_y.y ends here */
-
-
index 32e98577f884627f5a020df36f3ea8c9dd8e44fb..cdded484726c7a34add13e2ffd36eecf6aeb9cf7 100644 (file)
--- a/report.c
+++ b/report.c
@@ -41,7 +41,7 @@
 /* If NULL, report will flush stderr, then print on stderr the program
    name, a colon and a space.  Otherwise, report will call this
    function without parameters instead.  */
-void (*report_print_progname) (
+static void (*report_print_progname) (
 #if __STDC__ - 0
                              void
 #endif
diff --git a/sink.c b/sink.c
index 54db4029a67102fd9d62eb6d0d8e3f9527c70eb0..11763a5457d75fee10e791671dc1b788be233f55 100644 (file)
--- a/sink.c
+++ b/sink.c
@@ -30,6 +30,7 @@
 #include  <varargs.h>
 #endif
 #include  <ctype.h>
+#include  <langinfo.h>
 
 /* for W* macros after pclose() */
 #define _USE_BSD
index 15598272fa4c2ea61f1885df2b427aca67276df8..5c3861bcf10593d03c5f6c6bfe8f29bb6a4e2e8c 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -507,7 +507,7 @@ va_dcl {
 static SSL_CTX *_ctx = NULL;
 static SSL *_ssl_context[FD_SETSIZE];
 
-SSL    *SSLGetContext( int );
+static SSL     *SSLGetContext( int );
 #endif /* SSL_ENABLE */
 
 int SockWrite(int sock, char *buf, int len)
@@ -538,7 +538,9 @@ int SockRead(int sock, char *buf, int len)
 {
     char *newline, *bp = buf;
     int n;
+#ifdef FORCE_STUFFING
     int maxavailable = 0;
+#endif
 #ifdef SSL_ENABLE
     SSL *ssl;
 #endif
@@ -578,7 +580,9 @@ int SockRead(int sock, char *buf, int len)
                        (void)SSL_get_error(ssl, n);
                        return(-1);
                }
+#ifdef FORCE_STUFFING
                maxavailable = n;
+#endif
                if( 0 == n ) {
                        /* SSL_peek says no data...  Does he mean no data
                        or did the connection blow up?  If we got an error
@@ -622,7 +626,9 @@ int SockRead(int sock, char *buf, int len)
            if ((n = fm_peek(sock, bp, len)) <= 0)
 #endif
                return (-1);
+#ifdef FORCE_STUFFING
            maxavailable = n;
+#endif
            if ((newline = memchr(bp, '\n', n)) != NULL)
                n = newline - bp + 1;
 #ifndef __BEOS__
index 0c246a1d2689cd776fd905d12fd88ac63f6d61e2..901e3d3dd625b50707a82d3f200583344b7968ca 100644 (file)
 #include "socket.h"
 #include "fetchmail.h"
 
-#ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
-#endif /* strstr */
-
 int mytimeout;         /* value of nonreponse timeout */
 int suppress_tags;     /* emit tags? */
 char shroud[PASSWORDLEN*2+3];  /* string to shroud in debug output */
@@ -422,7 +418,7 @@ int readheaders(int sock,
     for (remaining = fetchlen; remaining > 0 || protocol->delimited; )
     {
        char *line, *rline;
-       int overlong = FALSE;
+       int overlong = FALSE; /* XXX FIXME: this is unused */
 
        line = xmalloc(sizeof(buf));
        linelen = 0;