From e7f723539d39f20092aabfb5b51826807e016fe3 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 21 Jul 2012 14:26:19 +0200 Subject: Some aid for compiler warnings --- src/common/cfgfiles.c | 4 +++- src/common/chanopt.c | 4 +++- src/common/dcc.c | 6 +++++- src/common/identd.c | 1 + src/common/ignore.c | 4 +++- src/common/inbound.c | 4 +++- src/common/notify.c | 4 +++- src/common/outbound.c | 2 +- src/common/proto-irc.c | 1 + src/common/server.c | 9 ++++++--- src/common/ssl.c | 9 +++++++-- src/common/text.c | 4 +++- src/common/util.c | 6 ++++-- 13 files changed, 43 insertions(+), 15 deletions(-) (limited to 'src/common') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 5116037c..c2e4ee1d 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -30,7 +30,9 @@ #include "text.h" #include "xchatc.h" -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #define HEXCHAT_DIR "hexchat" #endif diff --git a/src/common/chanopt.c b/src/common/chanopt.c index 198ebe6c..8e8b0312 100644 --- a/src/common/chanopt.c +++ b/src/common/chanopt.c @@ -8,7 +8,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/common/dcc.c b/src/common/dcc.c index 4c8724d9..18d4219b 100644 --- a/src/common/dcc.c +++ b/src/common/dcc.c @@ -40,6 +40,7 @@ #ifdef WIN32 #include +#include #else #include #endif @@ -803,7 +804,6 @@ static gboolean dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc) { int er; - struct sockaddr_in addr; #ifdef WIN32 if (condition & G_IO_ERR) @@ -822,6 +822,8 @@ dcc_did_connect (GIOChannel *source, GIOCondition condition, struct DCC *dcc) } #else + struct sockaddr_in addr; + memset (&addr, 0, sizeof (addr)); addr.sin_port = htons (dcc->port); addr.sin_family = AF_INET; @@ -1980,7 +1982,9 @@ dcc_change_nick (struct server *serv, char *oldnick, char *newnick) static int is_same_file (struct DCC *dcc, struct DCC *new_dcc) { +#ifndef WIN32 struct stat st_a, st_b; +#endif /* if it's the same filename, must be same */ if (strcmp (dcc->destfile, new_dcc->destfile) == 0) diff --git a/src/common/identd.c b/src/common/identd.c index 430c7e8f..ab1a7af4 100644 --- a/src/common/identd.c +++ b/src/common/identd.c @@ -3,6 +3,7 @@ #include "inet.h" #include "xchat.h" #include "xchatc.h" +#include "text.h" static int identd_is_running = FALSE; #ifdef USE_IPV6 diff --git a/src/common/ignore.c b/src/common/ignore.c index 0ed23daa..cd0305e5 100644 --- a/src/common/ignore.c +++ b/src/common/ignore.c @@ -23,7 +23,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/common/inbound.c b/src/common/inbound.c index 89899655..ce04eaf8 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -23,7 +23,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/common/notify.c b/src/common/notify.c index 9c6e54de..2c6eb6db 100644 --- a/src/common/notify.c +++ b/src/common/notify.c @@ -24,7 +24,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/common/outbound.c b/src/common/outbound.c index a9d1e0c0..63653430 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -54,7 +54,7 @@ #include "server.h" #include "tree.h" #include "outbound.h" - +#include "chanopt.h" #ifdef USE_DEBUG extern int current_mem_usage; diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index d8a6be7c..c1ca8af3 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -41,6 +41,7 @@ #include "outbound.h" #include "util.h" #include "xchatc.h" +#include "url.h" static void diff --git a/src/common/server.c b/src/common/server.c index c8cc59e0..2e8d535d 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -33,12 +33,13 @@ #define WANTARPA #include "inet.h" -#ifndef WIN32 +#ifdef WIN32 +#include +#include +#else #include #include #include -#else -#include #endif #include "xchat.h" @@ -907,7 +908,9 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv) char outbuf[512]; char host[100]; char ip[100]; +#ifdef USE_MSPROXY char *p; +#endif waitline2 (source, tbuf, sizeof tbuf); diff --git a/src/common/ssl.c b/src/common/ssl.c index daa7416b..04fb6ac5 100644 --- a/src/common/ssl.c +++ b/src/common/ssl.c @@ -20,12 +20,17 @@ #include "inet.h" /* make it first to avoid macro redefinitions */ #include /* SSL_() */ #include /* ERR_() */ -#include /* asctime() */ +#ifdef WIN32 +#include /* RAND_seed() */ +#endif +#include /* asctime() */ #include /* strncpy() */ -#include "ssl.h" /* struct cert_info */ +#include "ssl.h" /* struct cert_info */ #include "../../config.h" /* HAVE_SNPRINTF */ #ifndef HAVE_SNPRINTF +#include +#include #define snprintf g_snprintf #endif diff --git a/src/common/text.c b/src/common/text.c index f8f08767..133facd1 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -25,7 +25,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #include #endif diff --git a/src/common/util.c b/src/common/util.c index 74146b21..28352189 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1365,10 +1365,12 @@ int my_poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { int util_exec (const char *cmd) { - int pid; char **argv; int argc; +#ifndef WIN32 + int pid; int fd; +#endif if (my_poptParseArgvString (cmd, &argc, &argv) != 0) return -1; @@ -1398,9 +1400,9 @@ util_exec (const char *cmd) int util_execv (char * const argv[]) { +#ifndef WIN32 int pid, fd; -#ifndef WIN32 pid = fork (); if (pid == -1) return -1; -- cgit 1.4.1