]> Pileus Git - ~andy/fetchmail/commitdiff
Fix various compiler warnings.
authorMatthias Andree <matthias.andree@gmx.de>
Fri, 18 Jun 2004 19:51:39 +0000 (19:51 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Fri, 18 Jun 2004 19:51:39 +0000 (19:51 -0000)
svn path=/trunk/; revision=3899

12 files changed:
base64.c
daemon.c
driver.c
env.c
imap.c
netrc.c
pop3.c
rfc822.c
socket.c
transact.c
uid.c
unmime.c

index a8c7f1c156182f6dfde33a93f0d059bf8ed4ff7e..03c6db44dde353c8baeefb7c776acf422ad723ce 100644 (file)
--- a/base64.c
+++ b/base64.c
@@ -8,6 +8,7 @@
  * scheme used here.
  */
 #include "config.h"
+#include "fetchmail.h"
 #include <ctype.h>
 
 static const char base64digits[] =
index b5291d82eb967fefa3c09f250fbb36d608016e7f..3dcb55c36d154176aca51f63ecbb773beeee9cb2 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -53,7 +53,7 @@
 #include "fetchmail.h"
 #include "tunable.h"
 
-RETSIGTYPE
+static RETSIGTYPE
 sigchld_handler (int sig)
 /* process SIGCHLD to obtain the exit code of the terminating process */
 {
index ed58fcd8f2b014c3030857532f722b1ef20cfdf7..7bd120950665c24f3c10c536eefc89bf4aaab53d 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -815,24 +815,25 @@ flagthemail:
     return(PS_SUCCESS);
 }
 
-static int do_session(ctl, proto, maxfetch)
 /* retrieve messages from server using given protocol method table */
-struct query *ctl;             /* parsed options with merged-in defaults */
-const struct method *proto;    /* protocol method table */
-const int maxfetch;            /* maximum number of messages to fetch */
+static int do_session(
+       /* parsed options with merged-in defaults */
+       struct query *ctl,
+       /* protocol method table */
+       const struct method *proto,
+       /* maximum number of messages to fetch */
+       const int maxfetch)
 {
-    int js;
-#ifdef HAVE_VOLATILE
+    static int *msgsizes;
     volatile int err, mailserver_socket = -1;  /* pacifies -Wall */
-#else
-    int err, mailserver_socket = -1;
-#endif /* HAVE_VOLATILE */
+    int deletions = 0, js;
     const char *msg;
     SIGHANDLERTYPE pipesave;
     SIGHANDLERTYPE alrmsave;
 
     ctl->server.base_protocol = proto;
 
+    msgsizes = NULL;
     pass = 0;
     err = 0;
     init_transact(proto);
@@ -924,8 +925,7 @@ const int maxfetch;         /* maximum number of messages to fetch */
     else
     {
        char buf[MSGBUFSIZE+1], *realhost;
-       int count, new, bytes, deletions = 0;
-       int *msgsizes = (int *)NULL;
+       int count, new, bytes;
 #if INET6_ENABLE
        int fetches, dispatches, oldphase;
 #else /* INET6_ENABLE */
diff --git a/env.c b/env.c
index d578f0c676ec88fbeb9d4c8dab23aba318e56a62..6b6a7d071b9e7ada6bbc80d3b90795682222b6da 100644 (file)
--- a/env.c
+++ b/env.c
@@ -30,7 +30,7 @@
 #include <locale.h>
 #endif
 
-extern char *getenv(); /* needed on sysV68 R3V7.1. */
+extern char *getenv(const char *);     /* needed on sysV68 R3V7.1. */
 
 extern char *program_name;
 
diff --git a/imap.c b/imap.c
index 5d977061f4c44e2497db267ff086d30f4d83ead6..bae1d50adf3ec13e5379f66799dfb844f7366e2a 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -23,7 +23,7 @@
 #endif /* OPIE_ENABLE */
 
 #ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(); /* needed on sysV68 R3V7.1. */
+extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
 #endif /* strstr */
 
 /* imap_version values */
diff --git a/netrc.c b/netrc.c
index 665a1f90b0733c4eb8e1728ec5fe1cb304583225..188f998636a5b4baa7b1bc325c2a2a7c90bbbf60 100644 (file)
--- a/netrc.c
+++ b/netrc.c
@@ -320,10 +320,7 @@ search_netrc (list, host, login)
 
 #include <errno.h>
 
-int
-main (argc, argv)
-     int argc;
-     char **argv;
+int main (int argc, char **argv)
 {
     struct stat sb;
     char *program_name, *file, *host, *login;
diff --git a/pop3.c b/pop3.c
index ec8cbdf5e846854e3949e9bef3acbe1d70b52791..80e0903fdbcf8b446df97f0e37dda1c81ff67cac 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -26,7 +26,7 @@
 #endif /* OPIE_ENABLE */
 
 #ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(); /* needed on sysV68 R3V7.1. */
+extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
 #endif /* strstr */
 
 static int last;
index 28dac71d96b2399abbf21790dafac2b79bdbbc30..cd6fb17ab37265bdfe3e539c36597bcf5ecc9226 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
@@ -24,10 +24,12 @@ MIT license.  Compile with -DMAIN to build the demonstrator.
 #include  <string.h>
 #include  <stdlib.h>
 
-#ifndef MAIN
 #include "fetchmail.h"
+
+#ifndef MAIN
 #include "i18n.h"
 #else
+#include  <unistd.h>
 static int verbose;
 char *program_name = "rfc822";
 #endif /* MAIN */
@@ -39,11 +41,11 @@ char *program_name = "rfc822";
 
 #define HEADER_END(p)  ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t'))
 
-unsigned char *reply_hack(buf, host, length)
+unsigned char *reply_hack(
+       unsigned char *buf              /* header to be hacked */,
+       const unsigned char *host       /* server hostname */,
+        int *length)
 /* hack message headers so replies will work properly */
-unsigned char *buf;            /* header to be hacked */
-const unsigned char *host;     /* server hostname */
-int *length;
 {
     unsigned char *from, *cp, last_nws = '\0', *parens_from = NULL;
     int parendepth, state, has_bare_name_part, has_host_part;
@@ -213,9 +215,8 @@ int *length;
     return(buf);
 }
 
-unsigned char *nxtaddr(hdr)
+unsigned char *nxtaddr(const unsigned char *hdr /* header to be parsed, NUL to continue previous hdr */)
 /* parse addresses in succession out of a specified RFC822 header */
-const unsigned char *hdr;      /* header to be parsed, NUL to continue previous hdr */
 {
     static unsigned char address[BUFSIZ];
     static int tp;
@@ -392,10 +393,11 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr *
 static void parsebuf(unsigned char *longbuf, int reply)
 {
     unsigned char      *cp;
+    int                        dummy;
 
     if (reply)
     {
-       reply_hack(longbuf, "HOSTNAME.NET");
+       reply_hack(longbuf, "HOSTNAME.NET", &dummy);
        printf("Rewritten buffer: %s", longbuf);
     }
     else
@@ -408,7 +410,7 @@ static void parsebuf(unsigned char *longbuf, int reply)
 
 
 
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
     unsigned char      buf[BUFSIZ], longbuf[BUFSIZ];
     int                        ch, reply;
@@ -450,6 +452,7 @@ main(int argc, char *argv[])
            fputs(longbuf, stdout);
        parsebuf(longbuf, reply);
     }
+    exit(0);
 }
 #endif /* MAIN */
 
index 4b1b32035789df021979e6b04c1f816882d905f8..83fd4d647429df4cccd68a013846bbd8d5f2f37e 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -80,7 +80,7 @@ extern int mailserver_socket_temp;    /* Socket to close if connect timeout */
 #endif /* NET_SECURITY */
 
 #ifdef HAVE_SOCKETPAIR
-char *const *parse_plugin(const char *plugin, const char *host, const char *service)
+static char *const *parse_plugin(const char *plugin, const char *host, const char *service)
 {      const char **argvec;
        const char *c, *p;
        char *cp, *plugin_copy;
@@ -752,7 +752,7 @@ SSL *SSLGetContext( int sock )
 }
 
 
-int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
+static int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
 {
        char buf[257];
        X509 *x509_cert;
@@ -884,12 +884,12 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict )
        return (ok_return);
 }
 
-int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx )
+static int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx )
 {
        return SSL_verify_callback(ok_return, ctx, 0);
 }
 
-int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx )
+static int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx )
 {
        return SSL_verify_callback(ok_return, ctx, 1);
 }
index 2bb28edeee821e8598134b5329e7cb6fa3305149..b82f928c6afb40aba31c620b686e3995f66c342c 100644 (file)
@@ -36,7 +36,7 @@
 #include "fetchmail.h"
 
 #ifndef strstr         /* glibc-2.1 declares this as a macro */
-extern char *strstr(); /* needed on sysV68 R3V7.1. */
+extern char *strstr(const char *, const char *);       /* needed on sysV68 R3V7.1. */
 #endif /* strstr */
 
 int mytimeout;         /* value of nonreponse timeout */
@@ -87,7 +87,7 @@ static void find_server_names(const char *hdr,
     {
        char    *cp;
 
-       for (cp = nxtaddr(hdr);
+       for (cp = nxtaddr((const unsigned char *)hdr);
             cp != NULL;
             cp = nxtaddr(NULL))
        {
@@ -110,11 +110,11 @@ static void find_server_names(const char *hdr,
            {
                int sl = strlen(ctl->server.qvirtual);
  
-               if (!strncasecmp(cp, ctl->server.qvirtual, sl))
+               if (!strncasecmp((char *)cp, ctl->server.qvirtual, sl))
                    cp += sl;
            }
 
-           if ((atsign = strchr(cp, '@'))) {
+           if ((atsign = strchr((char *)cp, '@'))) {
                struct idlist   *idp;
 
                /*
@@ -125,15 +125,15 @@ static void find_server_names(const char *hdr,
                for (idp = ctl->server.localdomains; idp; idp = idp->next) {
                    char        *rhs;
 
-                   rhs = atsign + (strlen(atsign) - strlen(idp->id));
+                   rhs = atsign + (strlen(atsign) - strlen((char *)idp->id));
                    if (rhs > atsign &&
                        (rhs[-1] == '.' || rhs[-1] == '@') &&
-                       strcasecmp(rhs, idp->id) == 0)
+                       strcasecmp(rhs, (char *)idp->id) == 0)
                    {
                        if (outlevel >= O_DEBUG)
                            report(stdout, GT_("passed through %s matching %s\n"), 
                                  cp, idp->id);
-                       save_str(xmit_names, cp, XMIT_ACCEPT);
+                       save_str(xmit_names, (const char *)cp, XMIT_ACCEPT);
                        accept_count++;
                        goto nomap;
                    }
diff --git a/uid.c b/uid.c
index 91362418d06ccfdccde9ec294112cf5f78eb6acb..1d9846e03fe31b4a3ac5ad4bee7de532f059b8aa 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -271,7 +271,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
 /* return a pointer to the last element of the list to help the quick,
  * constant-time addition to the list, NOTE: this function does not dup
  * the string, the caller must do that. */
-/*@shared@*/ struct idlist **save_str_quick(/*@shared@*/ struct idlist **idl,
+/*@shared@*/ static struct idlist **save_str_quick(/*@shared@*/ struct idlist **idl,
                               /*@only@*/ char *str, flag status)
 /* save a number/UID pair on the given UID list */
 {
index fbc74f2c408403c2382ef9d0ea658157b4df5070..65f654a8549d7e9ad429b1cdcc7ff71a8820aa5a 100644 (file)
--- a/unmime.c
+++ b/unmime.c
@@ -327,7 +327,7 @@ static char *GetBoundary(char *CntType)
 }
 
 
-int CheckContentType(char *CntType)
+static int CheckContentType(char *CntType)
 {
   /*
    * Static array of Content-Type's for which we will do