]> Pileus Git - ~andy/fetchmail/commitdiff
Compiler warnings fixes, preprocessor and minor general cleanup.
authorMatthias Andree <matthias.andree@gmx.de>
Fri, 18 Jun 2004 20:16:42 +0000 (20:16 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Fri, 18 Jun 2004 20:16:42 +0000 (20:16 -0000)
svn path=/trunk/; revision=3901

19 files changed:
checkalias.c
conf.c
driver.c
etrn.c
fetchmail.c
fetchmail.h
imap.c
md5.h
netrc.c
odmr.c
opie.c
options.c
pop3.c
report.c
rfc822.c
socket.c
socket.h
transact.c
uid.c

index cd5caca56bfcdfa811fd28146f9f1bcb1f312b4a..6aeda1bda501a045d987b874a3a054ae94966903 100644 (file)
@@ -216,7 +216,6 @@ int is_host_alias(const char *name, struct query *ctl)
 #ifndef __BEOS__
        case NO_ADDRESS:        /* valid, but does not have an IP address */
            return(FALSE);
-           break;
 #endif
        case NO_RECOVERY:       /* non-recoverable name server error */
        case TRY_AGAIN:         /* temporary error on authoritative server */
diff --git a/conf.c b/conf.c
index 77a4e2ca6918bf1f287818bbae62640365e699f8..240d9e40c40083d7e9ea26330a30f0c4f267a8e0 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -180,13 +180,13 @@ void dump_config(struct runctl *runp, struct query *querylist)
 #ifdef SSL_ENABLE
     printf("'ssl',");
 #endif /* SSL_ENABLE */
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
     printf("'opie',");
 #endif /* OPIE_ENABLE */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     printf("'inet6',");
 #endif /* INET6_ENABLE */
-#if NET_SECURITY
+#ifdef NET_SECURITY
     printf("'netsec',");
 #endif /* NET_SECURITY */
     printf(")\n");
@@ -247,7 +247,7 @@ void dump_config(struct runctl *runp, struct query *querylist)
 
            using_kpop =
                (ctl->server.protocol == P_POP3 &&
-#if !INET6_ENABLE
+#ifndef INET6_ENABLE
                 ctl->server.port == KPOP_PORT &&
 #else
                 ctl->server.service && !strcmp(ctl->server.service, KPOP_PORT ) &&
index 7bd120950665c24f3c10c536eefc89bf4aaab53d..fb98afd3c7e73774646b69f026531fe21ee6f8d1 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -926,7 +926,7 @@ static int do_session(
     {
        char buf[MSGBUFSIZE+1], *realhost;
        int count, new, bytes;
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
        int fetches, dispatches, oldphase;
 #else /* INET6_ENABLE */
        int port, fetches, dispatches, oldphase;
@@ -946,7 +946,7 @@ static int do_session(
        oldphase = phase;
        phase = OPEN_WAIT;
        set_timeout(mytimeout);
-#if !INET6_ENABLE
+#ifndef INET6_ENABLE
 #ifdef SSL_ENABLE
        port = ctl->server.port ? ctl->server.port : ( ctl->use_ssl ? ctl->server.base_protocol->sslport : ctl->server.base_protocol->port );
 #else
@@ -1037,7 +1037,7 @@ static int do_session(
        /* allow time for the port to be set up if we have a plugin */
        if (ctl->server.plugin)
            (void)sleep(1);
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
        if ((mailserver_socket = SockOpen(realhost, 
                             ctl->server.service ? ctl->server.service : ( ctl->use_ssl ? ctl->server.base_protocol->sslservice : ctl->server.base_protocol->service ),
                             ctl->server.netsec, ctl->server.plugin)) == -1)
@@ -1046,7 +1046,7 @@ static int do_session(
 #endif /* INET6_ENABLE */
        {
            char        errbuf[BUFSIZ];
-#if !INET6_ENABLE
+#ifndef INET6_ENABLE
            int err_no = errno;
 #ifdef HAVE_RES_SEARCH
            if (err_no != 0 && h_errno != 0)
diff --git a/etrn.c b/etrn.c
index dacd700a600fb669a86b33b602a1f5dd4b55647b..31a28705d2948c8bc919c3738c975c2b6ffb4727 100644 (file)
--- a/etrn.c
+++ b/etrn.c
@@ -65,7 +65,7 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
     for (qnp = ctl->domainlist; qnp; qnp = qnp->next)
     {
        /* ship the actual poll and get the response */
-       gen_send(sock, "ETRN %s", qnp->id);
+       gen_send(sock, "ETRN %s", (char *)qnp->id);
        if ((ok = gen_recv(sock, buf, sizeof(buf))))
            return(ok);
 
@@ -122,7 +122,7 @@ static int etrn_logout(int sock, struct query *ctl)
 static const struct method etrn =
 {
     "ETRN",            /* ESMTP ETRN extension */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     "smtp",            /* standard SMTP port */
     "smtps",           /* ssl SMTP port */
 #else /* INET6_ENABLE */
index fd0936901a271a4002fa3a10c98a4885d79f98cc..173449c18e750d397741e8b1e9b2a60d4525e3cc 100644 (file)
@@ -62,7 +62,7 @@ char *program_name;       /* the name to prefix error messages with */
 flag configdump;           /* dump control blocks for configurator */
 char *fetchmailhost;       /* either `localhost' or the host's FQDN */
 
-#if NET_SECURITY
+#ifdef NET_SECURITY
 void *request = NULL;
 int requestlen = 0;
 #endif /* NET_SECURITY */
@@ -216,19 +216,19 @@ int main(int argc, char **argv)
 #ifdef SSL_ENABLE
        printf("+SSL");
 #endif
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
        printf("+OPIE");
 #endif /* OPIE_ENABLE */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
        printf("+INET6");
 #endif /* INET6_ENABLE */
-#if NET_SECURITY
+#ifdef NET_SECURITY
        printf("+NETSEC");
 #endif /* NET_SECURITY */
 #ifdef HAVE_SOCKS
        printf("+SOCKS");
 #endif /* HAVE_SOCKS */
-#if ENABLE_NLS
+#ifdef ENABLE_NLS
        printf("+NLS");
 #endif /* ENABLE_NLS */
        putchar('\n');
@@ -630,7 +630,7 @@ int main(int argc, char **argv)
                        }
                    }
 
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__)
                    /*
                     * Don't do monitoring if we were woken by a signal.
                     * Note that interface_approve() does its own error logging.
@@ -694,7 +694,7 @@ int main(int argc, char **argv)
                            break;
                        }
 
-#if (defined(linux) && !INET6_ENABLE) || defined (__FreeBSD__)
+#if (defined(linux) && !defined(INET6_ENABLE)) || defined (__FreeBSD__)
                    if (ctl->server.monitor)
                    {
                        /*
@@ -825,7 +825,7 @@ static void optmerge(struct query *h2, struct query *h1, int force)
 #define FLAG_MERGE(fld) if (force ? !!h1->fld : !h2->fld) h2->fld = h1->fld
     FLAG_MERGE(server.via);
     FLAG_MERGE(server.protocol);
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     FLAG_MERGE(server.service);
     FLAG_MERGE(server.netsec);
 #else /* INET6_ENABLE */
@@ -1156,7 +1156,7 @@ static int load_params(int argc, char **argv, int optind)
            if (ctl->server.timeout == -1)      
                ctl->server.timeout = CLIENT_TIMEOUT;
 
-#if !INET6_ENABLE
+#ifndef INET6_ENABLE
            /* sanity checks */
            if (ctl->server.port < 0)
            {
@@ -1499,7 +1499,7 @@ static void dump_params (struct runctl *runp,
        }
 
        if (ctl->server.protocol == P_POP3 
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
            && ctl->server.service && !strcmp(ctl->server.service, KPOP_PORT)
 #else /* INET6_ENABLE */
            && ctl->server.port == KPOP_PORT
@@ -1510,7 +1510,7 @@ static void dump_params (struct runctl *runp,
                   ctl->server.authenticate == A_KERBEROS_V5 ? "V" : "IV");
        else
            printf(GT_("  Protocol is %s"), showproto(ctl->server.protocol));
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
        if (ctl->server.service)
            printf(GT_(" (using service %s)"), ctl->server.service);
        if (ctl->server.netsec)
@@ -1587,7 +1587,7 @@ static void dump_params (struct runctl *runp,
 
                printf(GT_("  Selected mailboxes are:"));
                for (idp = ctl->mailboxes; idp; idp = idp->next)
-                   printf(" %s", idp->id);
+                   printf(" %s", (char *)idp->id);
                printf("\n");
            }
            printf(GT_("  %s messages will be retrieved (--all %s).\n"),
@@ -1674,7 +1674,7 @@ static void dump_params (struct runctl *runp,
            printf(GT_("  Domains for which mail will be fetched are:"));
            for (idp = ctl->domainlist; idp; idp = idp->next)
            {
-               printf(" %s", idp->id);
+               printf(" %s", (char *)idp->id);
                if (!idp->val.status.mark)
                    printf(GT_(" (default)"));
            }
@@ -1694,7 +1694,7 @@ static void dump_params (struct runctl *runp,
                       ctl->listener);
                for (idp = ctl->smtphunt; idp; idp = idp->next)
                {
-                   printf(" %s", idp->id);
+                   printf(" %s", (char *)idp->id);
                    if (!idp->val.status.mark)
                        printf(GT_(" (default)"));
                }
@@ -1752,9 +1752,9 @@ static void dump_params (struct runctl *runp,
                    {
                        for (idp = ctl->localnames; idp; idp = idp->next)
                            if (idp->val.id2)
-                               printf("\t%s -> %s\n", idp->id, idp->val.id2);
+                               printf("\t%s -> %s\n", (char *)idp->id, (char *)idp->val.id2);
                            else
-                               printf("\t%s\n", idp->id);
+                               printf("\t%s\n", (char *)idp->id);
                        if (ctl->wildcard)
                            fputs("\t*\n", stdout);
                    }
@@ -1793,7 +1793,7 @@ static void dump_params (struct runctl *runp,
 
                            printf(GT_("  Predeclared mailserver aliases:"));
                            for (idp = ctl->server.akalist; idp; idp = idp->next)
-                               printf(" %s", idp->id);
+                               printf(" %s", (char *)idp->id);
                            putchar('\n');
                        }
                        if (ctl->server.localdomains)
@@ -1802,7 +1802,7 @@ static void dump_params (struct runctl *runp,
 
                            printf(GT_("  Local domains:"));
                            for (idp = ctl->server.localdomains; idp; idp = idp->next)
-                               printf(" %s", idp->id);
+                               printf(" %s", (char *)idp->id);
                            putchar('\n');
                        }
                    }
@@ -1843,7 +1843,7 @@ static void dump_params (struct runctl *runp,
                printf(GT_("  %d UIDs saved.\n"), count);
                if (outlevel >= O_VERBOSE)
                    for (idp = ctl->oldsaved; idp; idp = idp->next)
-                       printf("\t%s\n", idp->id);
+                       printf("\t%s\n", (char *)idp->id);
            }
        }
 
index c9d273ea8e3d927e03e55a82f81ae68a1b0a9ed6..146b1712d0ecf529ab8455e0bd993f9e391bbeda 100644 (file)
@@ -32,7 +32,7 @@
 #define                P_ETRN          7
 #define                P_ODMR          8
 
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
 #define                SMTP_PORT       "smtp"
 #define                KPOP_PORT       "kpop"
 #else /* INET6_ENABLE */
@@ -179,7 +179,7 @@ struct query;
 struct method          /* describe methods for protocol state machine */
 {
     const char *name;          /* protocol name */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     const char *service;
     const char *sslservice;
 #else /* INET6_ENABLE */
@@ -223,7 +223,7 @@ struct hostdata             /* shared among all user connections to given server */
     struct idlist *akalist;            /* server name first, then akas */
     struct idlist *localdomains;       /* list of pass-through domains */
     int protocol;                      /* protocol type */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     char *service;                     /* IPv6 service name */
     void *netsec;                      /* IPv6 security request */
 #else /* INET6_ENABLE */
@@ -692,4 +692,7 @@ char *strerror (int);
 #define ROOT_UID 0
 #endif /* __CYGWIN__ */
 
+extern int mailserver_socket_temp;
+extern char *program_name;
+
 /* fetchmail.h ends here */
diff --git a/imap.c b/imap.c
index bae1d50adf3ec13e5379f66799dfb844f7366e2a..d7f0b83f14da7318e1b0f9072f1ec5bc3f538baa 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -19,7 +19,7 @@
 
 #include  "i18n.h"
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
 #endif /* OPIE_ENABLE */
 
 #ifndef strstr         /* glibc-2.1 declares this as a macro */
@@ -162,7 +162,7 @@ static int imap_ok(int sock, char *argbuf)
     }
 }
 
-#if NTLM_ENABLE
+#ifdef NTLM_ENABLE
 #include "ntlm.h"
 
 static tSmbNtlmAuthRequest   request;             
@@ -440,7 +440,7 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
            return ok;
     }
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
     if ((ctl->server.authenticate == A_ANY 
         || ctl->server.authenticate == A_OTP)
        && strstr(capabilities, "AUTH=X-OTP"))
@@ -1113,7 +1113,7 @@ static int imap_logout(int sock, struct query *ctl)
 static const struct method imap =
 {
     "IMAP",            /* Internet Message Access Protocol */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     "imap",
     "imaps",
 #else /* INET6_ENABLE */
diff --git a/md5.h b/md5.h
index 146ff59d3724888c0743b817d97dc5d5824a6750..c396a8dcdcd93c2f25321fdeba96fc40f6819945 100644 (file)
--- a/md5.h
+++ b/md5.h
@@ -5,6 +5,8 @@
 #define HEADER_MD5_H 
 #endif
 
+#include "config.h"
+
 #if SIZEOF_INT == 4
 typedef unsigned int uint32;
 #else
diff --git a/netrc.c b/netrc.c
index 188f998636a5b4baa7b1bc325c2a2a7c90bbbf60..a9e297410364976a8a62f6a5da07736853464305 100644 (file)
--- a/netrc.c
+++ b/netrc.c
@@ -347,7 +347,7 @@ int main (int argc, char **argv)
 
     if (host && login)
     {
-       int i, status;
+       int status;
        status = 0;
 
        printf("Host: %s, Login: %s\n", host, login);
diff --git a/odmr.c b/odmr.c
index a7a3ad69940415a82aa4e041626c10ff20c9ed01..b97a73bafd35dbd89c96dea3fdf190366b0caf83 100644 (file)
--- a/odmr.c
+++ b/odmr.c
@@ -210,7 +210,7 @@ static int odmr_logout(int sock, struct query *ctl)
 static const struct method odmr =
 {
     "ODMR",            /* ODMR protocol */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     "odmr",            /* standard SMTP port */
     "odmrs",           /* ssl SMTP port */
 #else /* INET6_ENABLE */
diff --git a/opie.c b/opie.c
index 0c0b9886a7f55403134c035c24b2461908ad6147..e696e2093d6042bb5d2fb3b714786ff7c5d11741 100644 (file)
--- a/opie.c
+++ b/opie.c
@@ -17,7 +17,7 @@
 #include  "i18n.h"
 #include "md5.h"
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
 #include <opie.h>
 
 int do_otp(int sock, char *command, struct query *ctl)
index f52fd6fff3972b85f7d8dfaabe1ff44389c015d7..32590e3f4dd239862d12c5327d349852fee2e8c0 100644 (file)
--- a/options.c
+++ b/options.c
@@ -165,7 +165,7 @@ static const struct option longoptions[] = {
 
   {"principal", required_argument, (int *) 0, LA_PRINCIPAL },
 
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__)
   {"interface",        required_argument, (int *) 0, LA_INTERFACE   },
   {"monitor",  required_argument, (int *) 0, LA_MONITOR     },
 #endif /* (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__) */
@@ -362,7 +362,7 @@ struct query *ctl;  /* option record to be initialized */
            else if (strcasecmp(optarg,"kpop") == 0)
            {
                ctl->server.protocol = P_POP3;
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
                ctl->server.service = KPOP_PORT;
 #else /* INET6_ENABLE */
                ctl->server.port = KPOP_PORT;
@@ -390,7 +390,7 @@ struct query *ctl;  /* option record to be initialized */
            break;
        case 'P':
        case LA_PORT:
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
            ctl->server.service = optarg;
 #else /* INET6_ENABLE */
            ctl->server.port = xatoi(optarg, &errflag);
@@ -561,7 +561,7 @@ struct query *ctl;  /* option record to be initialized */
 
        case 'T':
        case LA_NETSEC:
-#if NET_SECURITY
+#ifdef NET_SECURITY
            ctl->server.netsec = (void *)optarg;
 #else
            fprintf(stderr, GT_("fetchmail: network security support is disabled\n"));
@@ -569,7 +569,7 @@ struct query *ctl;  /* option record to be initialized */
 #endif /* NET_SECURITY */
            break;
 
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__)
        case 'I':
        case LA_INTERFACE:
            interface_parse(optarg, &ctl->server);
@@ -675,7 +675,7 @@ struct query *ctl;  /* option record to be initialized */
        P(GT_("  -i, --idfile      specify alternate UIDs file\n"));
        P(GT_("      --postmaster  specify recipient of last resort\n"));
        P(GT_("      --nobounce    redirect bounces from user to postmaster.\n"));
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#if (defined(linux) && !defined(INET6_ENABLE)) || defined(__FreeBSD__)
        P(GT_("  -I, --interface   interface required specification\n"));
        P(GT_("  -M, --monitor     monitor interface for activity\n"));
 #endif
@@ -707,7 +707,7 @@ struct query *ctl;  /* option record to be initialized */
        P(GT_("  -l, --limit       don't fetch messages over given size\n"));
        P(GT_("  -w, --warnings    interval between warning mail notification\n"));
 
-#if NET_SECURITY
+#ifdef NET_SECURITY
        P(GT_("  -T, --netsec      set IP security request\n"));
 #endif /* NET_SECURITY */
        P(GT_("  -S, --smtphost    set SMTP forwarding host\n"));
diff --git a/pop3.c b/pop3.c
index 80e0903fdbcf8b446df97f0e37dda1c81ff67cac..fc574f64c1f92a31256cf1e3cfcc01890c094f20 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -21,7 +21,7 @@
 #include  "socket.h"
 #include  "i18n.h"
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
 #include <opie.h>
 #endif /* OPIE_ENABLE */
 
@@ -35,7 +35,7 @@ char *sdps_envfrom;
 char *sdps_envto;
 #endif /* SDPS_ENABLE */
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
 static char lastok[POPBUFSIZE+1];
 #endif /* OPIE_ENABLE */
 
@@ -54,7 +54,7 @@ static char lastok[POPBUFSIZE+1];
     flag has_ssl = FALSE;
 #endif /* SSL_ENABLE */
 
-#if NTLM_ENABLE
+#ifdef NTLM_ENABLE
 #include "ntlm.h"
 
 static tSmbNtlmAuthRequest   request;             
@@ -156,7 +156,7 @@ static int pop3_ok (int sock, char *argbuf)
 
        if (strcmp(buf,"+OK") == 0)
        {
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
            strcpy(lastok, bufp);
 #endif /* OPIE_ENABLE */
            ok = 0;
@@ -274,7 +274,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
     int ok;
     char *start,*end;
     char *msg;
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
     char *challenge;
 #endif /* OPIE_ENABLE */
 #ifdef SSL_ENABLE
@@ -440,7 +440,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
         * rather than doing SASL.
         */
        if (has_kerberos &&
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
            ctl->server.service && (strcmp(ctl->server.service, KPOP_PORT)!=0)
 #else /* INET6_ENABLE */
            ctl->server.port != KPOP_PORT
@@ -488,7 +488,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
        /* ordinary validation, no one-time password or RPA */ 
        gen_transact(sock, "USER %s", ctl->remotename);
 
-#if OPIE_ENABLE
+#ifdef OPIE_ENABLE
        /* see RFC1938: A One-Time Password System */
        if (challenge = strstr(lastok, "otp-")) {
          char response[OPIE_RESPONSE_MAX+1];
@@ -1182,7 +1182,7 @@ static int pop3_logout(int sock, struct query *ctl)
 static const struct method pop3 =
 {
     "POP3",            /* Post Office Protocol v3 */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
     "pop3",            /* standard POP3 port */
     "pop3s",           /* ssl POP3 port */
 #else /* INET6_ENABLE */
index d201c740fdca17d9b0107e86fed993270adb86cc..32e98577f884627f5a020df36f3ea8c9dd8e44fb 100644 (file)
--- a/report.c
+++ b/report.c
@@ -22,7 +22,7 @@
 #include "i18n.h"
 #include "fetchmail.h"
 
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC || HAVE_STDARG_H
+#if defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT) || defined(_LIBC) || defined(HAVE_STDARG_H)
 # if HAVE_STDARG_H
 #  include <stdarg.h>
 #  define VA_START(args, lastarg) va_start(args, lastarg)
@@ -66,10 +66,6 @@ static unsigned int report_message_count;
 
 #else
 
-/* The calling program should define program_name and set it to the
-   name of the executing program.  */
-extern char *program_name;
-
 # if !HAVE_STRERROR && !defined(strerror)
 char *strerror (int errnum)
 {
@@ -156,7 +152,7 @@ report (FILE *errfp, message, va_alist)
 
 #ifdef VA_START
        VA_START (args, message);
-# if HAVE_VPRINTF || _LIBC
+# if defined(HAVE_VPRINTF) || defined(_LIBC)
        vfprintf (errfp, message, args);
 # else
        _doprnt (message, args, errfp);
@@ -239,7 +235,7 @@ report_build (FILE *errfp, message, va_alist)
 
 #if defined(VA_START)
     VA_START (args, message);
-#if HAVE_VSNPRINTF || _LIBC
+#if defined(HAVE_VSNPRINTF) || defined(_LIBC)
     for ( ; ; )
     {
        n = vsnprintf (partial_message + partial_message_size_used,
@@ -339,7 +335,7 @@ report_complete (FILE *errfp, message, va_alist)
 
 #if defined(VA_START)
     VA_START (args, message);
-#if HAVE_VSNPRINTF || _LIBC
+#if defined(HAVE_VSNPRINTF) || defined(_LIBC)
     for ( ; ; )
     {
        n = vsnprintf (partial_message + partial_message_size_used,
@@ -412,7 +408,7 @@ report_complete (FILE *errfp, message, va_alist)
 \f
 /* Sometimes we want to have at most one error per line.  This
    variable controls whether this mode is selected or not.  */
-int error_one_per_line;
+static int error_one_per_line;
 
 void
 #ifdef HAVE_STDARG_H
@@ -459,11 +455,11 @@ report_at_line (FILE *errfp, errnum, file_name, line_number, message, va_alist)
     }
 
     if (file_name != NULL)
-       fprintf (errfp, "%s:%d: ", file_name, line_number);
+       fprintf (errfp, "%s:%u: ", file_name, line_number);
 
 #ifdef VA_START
     VA_START (args, message);
-# if HAVE_VPRINTF || _LIBC
+# if defined(HAVE_VPRINTF) || defined(_LIBC)
     vfprintf (errfp, message, args);
 # else
     _doprnt (message, args, errfp);
index cd6fb17ab37265bdfe3e539c36597bcf5ecc9226..25d193b710f646c362677db22ac303a3e1229d6e 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
@@ -95,7 +95,7 @@ unsigned char *reply_hack(
 #ifdef MAIN
        if (verbose)
        {
-           printf("state %d: %s", state, buf);
+           printf("state %d: %s", state, (char *)buf);
            printf("%*s^\n", from - buf + 10, " ");
        }
 #endif /* MAIN */
@@ -252,7 +252,7 @@ unsigned char *nxtaddr(const unsigned char *hdr /* header to be parsed, NUL to c
 #ifdef MAIN
        if (verbose)
        {
-           printf("state %d: %s", state, orighdr);
+           printf("state %d: %s", state, (char *)orighdr);
            printf("%*s^\n", hp - orighdr + 10, " ");
        }
 #endif /* MAIN */
@@ -398,12 +398,12 @@ static void parsebuf(unsigned char *longbuf, int reply)
     if (reply)
     {
        reply_hack(longbuf, "HOSTNAME.NET", &dummy);
-       printf("Rewritten buffer: %s", longbuf);
+       printf("Rewritten buffer: %s", (char *)longbuf);
     }
     else
        if ((cp = nxtaddr(longbuf)) != (unsigned char *)NULL)
            do {
-               printf("\t-> \"%s\"\n", cp);
+               printf("\t-> \"%s\"\n", (char *)cp);
            } while
                ((cp = nxtaddr((unsigned char *)NULL)) != (unsigned char *)NULL);
 }
index 83fd4d647429df4cccd68a013846bbd8d5f2f37e..108f2e308594f2b1559254ad6359848ed95d7e74 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -73,9 +73,7 @@ static int h_errno;
 
 #endif /* ndef h_errno */
 
-extern int mailserver_socket_temp;     /* Socket to close if connect timeout */
-
-#if NET_SECURITY
+#ifdef NET_SECURITY
 #include <net/security.h>
 #endif /* NET_SECURITY */
 
@@ -171,7 +169,6 @@ static int handle_plugin(const char *host,
                /* error */
                report(stderr, GT_("fetchmail: fork failed\n"));
                return -1;
-               break;
        case 0: /* child */
                /* fds[1] is the parent's end; close it for proper EOF
                ** detection */
@@ -258,13 +255,13 @@ int UnixOpen(const char *path)
     return sock;
 }
 
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
 int SockOpen(const char *host, const char *service, const char *options,
             const char *plugin)
 {
     struct addrinfo *ai, *ai0, req;
     int i;
-#if NET_SECURITY
+#ifdef NET_SECURITY
     void *request = NULL;
     int requestlen;
 #endif /* NET_SECURITY */
index a89685bccfc1f631fcaafa0ba5b8f1e10c71f802..a0a45bc1d7c49cf99dee31c016261476dc57be56 100644 (file)
--- a/socket.h
+++ b/socket.h
@@ -8,7 +8,7 @@
 #define SOCKET__
 
 /* Create a new client socket; returns (FILE *)NULL on error */
-#if INET6_ENABLE
+#ifdef INET6_ENABLE
 int SockOpen(const char *host, const char *service, const char *options,
             const char *plugin);
 #else /* INET6_ENABLE */
@@ -63,7 +63,7 @@ FIXME: document this
 */
 int UnixOpen(const char *path);
 
-#if SSL_ENABLE
+#ifdef SSL_ENABLE
 int SSLOpen(int sock, char *mycert, char *mykey, char *myproto, int certck, char *certpath,
     char *fingerprint, char *servercname, char *label);
 #endif /* SSL_ENABLE */
index b82f928c6afb40aba31c620b686e3995f66c342c..c65b8ba4b21fd56c8bf05fe92bb77d6d320ec6fc 100644 (file)
@@ -1135,10 +1135,10 @@ int readheaders(int sock,
 #endif /* HAVE_SNPRINTF */
                    "Received: from %s [%u.%u.%u.%u]\r\n", 
                    ctl->server.truename,
-                   (unsigned char)ctl->server.trueaddr[0],
-                   (unsigned char)ctl->server.trueaddr[1],
-                   (unsigned char)ctl->server.trueaddr[2],
-                   (unsigned char)ctl->server.trueaddr[3]);
+                   (unsigned int)(unsigned char)ctl->server.trueaddr[0],
+                   (unsigned int)(unsigned char)ctl->server.trueaddr[1],
+                   (unsigned int)(unsigned char)ctl->server.trueaddr[2],
+                   (unsigned int)(unsigned char)ctl->server.trueaddr[3]);
        } else {
 #ifdef HAVE_SNPRINTF
          snprintf(buf, sizeof(buf),
diff --git a/uid.c b/uid.c
index 1d9846e03fe31b4a3ac5ad4bee7de532f059b8aa..b98019b946973d0c9e5b9637f2620558a420149c 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -248,7 +248,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
                report_build(stdout, GT_("Old UID list from %s:"), 
                             ctl->server.pollname);
                for (idp = ctl->oldsaved; idp; idp = idp->next)
-                   report_build(stdout, " %s", idp->id);
+                   report_build(stdout, " %s", (char *)idp->id);
                if (!idp)
                    report_build(stdout, GT_(" <empty>"));
                report_complete(stdout, "\n");
@@ -259,7 +259,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
        {
            report_build(stdout, GT_("Scratch list of UIDs:"));
            for (idp = scratchlist; idp; idp = idp->next)
-               report_build(stdout, " %s", idp->id);
+               report_build(stdout, " %s", (char *)idp->id);
            if (!idp)
                report_build(stdout, GT_(" <empty>"));
            report_complete(stdout, "\n");
@@ -513,7 +513,7 @@ void uid_swap_lists(struct query *ctl)
        else
            report_build(stdout, GT_("New UID list from %s:"), ctl->server.pollname);
        for (idp = dofastuidl ? ctl->oldsaved : ctl->newsaved; idp; idp = idp->next)
-           report_build(stdout, " %s = %d", idp->id, idp->val.status.mark);
+           report_build(stdout, " %s = %d", (char *)idp->id, idp->val.status.mark);
        if (!idp)
            report_build(stdout, GT_(" <empty>"));
        report_complete(stdout, "\n");
@@ -562,7 +562,7 @@ void uid_discard_new_list(struct query *ctl)
         * poll are marked here. */
        report_build(stdout, GT_("Merged UID list from %s:"), ctl->server.pollname);
        for (idp = ctl->oldsaved; idp; idp = idp->next)
-           report_build(stdout, " %s = %d", idp->id, idp->val.status.mark);
+           report_build(stdout, " %s = %d", (char *)idp->id, idp->val.status.mark);
        if (!idp)
            report_build(stdout, GT_(" <empty>"));
        report_complete(stdout, "\n");
@@ -621,7 +621,7 @@ void write_saved_lists(struct query *hostlist, const char *idfile)
                    if (idp->val.status.mark == UID_SEEN
                                || idp->val.status.mark == UID_DELETED)
                        fprintf(tmpfp, "%s@%s %s\n", 
-                           ctl->remotename, ctl->server.queryname, idp->id);
+                           ctl->remotename, ctl->server.queryname, (char *)idp->id);
            }
            for (idp = scratchlist; idp; idp = idp->next)
                fputs(idp->id, tmpfp);