From e7f723539d39f20092aabfb5b51826807e016fe3 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 21 Jul 2012 14:26:19 +0200 Subject: [PATCH] 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 ++++-- src/fe-gtk/chanlist.c | 5 ++++- src/fe-gtk/editlist.c | 4 +++- src/fe-gtk/fe-gtk.c | 3 ++- src/fe-gtk/fe-gtk.vcxproj | 2 ++ src/fe-gtk/fe-gtk.vcxproj.filters | 6 ++++++ src/fe-gtk/fkeys.c | 5 ++++- src/fe-gtk/gtkutil.c | 1 + src/fe-gtk/maingui.c | 8 +++++++- src/fe-gtk/menu.c | 2 ++ src/fe-gtk/notifygui.c | 1 + src/fe-gtk/palette.c | 4 +++- src/fe-gtk/plugin-tray.c | 3 +++ src/fe-gtk/rawlog.c | 4 +++- src/fe-gtk/servlistgui.c | 1 + src/fe-gtk/servlistgui.h | 1 + src/fe-gtk/setup.c | 1 + src/fe-gtk/setup.h | 1 + src/fe-gtk/sexy-spell-entry.c | 1 + src/fe-gtk/userlistgui.c | 1 + src/fe-gtk/xtext.c | 2 ++ 33 files changed, 92 insertions(+), 22 deletions(-) create mode 100644 src/fe-gtk/servlistgui.h create mode 100644 src/fe-gtk/setup.h 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; diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c index 5090e9c4..e75b97bc 100644 --- a/src/fe-gtk/chanlist.c +++ b/src/fe-gtk/chanlist.c @@ -22,7 +22,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif @@ -54,6 +56,7 @@ #include "../common/server.h" #include "gtkutil.h" #include "maingui.h" +#include "menu.h" #include "custom-list.h" diff --git a/src/fe-gtk/editlist.c b/src/fe-gtk/editlist.c index d374d064..05be3128 100644 --- a/src/fe-gtk/editlist.c +++ b/src/fe-gtk/editlist.c @@ -23,7 +23,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 4a20006a..295d68a1 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -57,6 +57,7 @@ #include "fkeys.h" #include "plugin-tray.h" #include "urlgrab.h" +#include "setup.h" #ifdef USE_XLIB #include @@ -866,7 +867,7 @@ fe_ctrl_gui (session *sess, fe_gui_action action, int arg) mg_detach (sess, arg); /* arg: 0=toggle 1=detach 2=attach */ break; case FE_GUI_APPLY: - setup_apply_real (TRUE, TRUE); + setup_apply_real (TRUE, TRUE, TRUE); } } diff --git a/src/fe-gtk/fe-gtk.vcxproj b/src/fe-gtk/fe-gtk.vcxproj index b38e132a..1095b419 100644 --- a/src/fe-gtk/fe-gtk.vcxproj +++ b/src/fe-gtk/fe-gtk.vcxproj @@ -120,6 +120,8 @@ + + diff --git a/src/fe-gtk/fe-gtk.vcxproj.filters b/src/fe-gtk/fe-gtk.vcxproj.filters index 8a232dae..370a1ad4 100644 --- a/src/fe-gtk/fe-gtk.vcxproj.filters +++ b/src/fe-gtk/fe-gtk.vcxproj.filters @@ -102,6 +102,12 @@ Header Files + + Header Files + + + Header Files + diff --git a/src/fe-gtk/fkeys.c b/src/fe-gtk/fkeys.c index 611697de..dcab0946 100644 --- a/src/fe-gtk/fkeys.c +++ b/src/fe-gtk/fkeys.c @@ -24,12 +24,15 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif #include "fe-gtk.h" +#include #include #include #include diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index 5fcaa194..165f8d4e 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -53,6 +53,7 @@ #include "pixmaps.h" #ifdef WIN32 +#include #if 0 /* native file dialogs */ #include "../common/fe.h" #include "../common/thread.h" diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 307420f4..32fa83cb 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -54,6 +54,7 @@ #include "../common/modes.h" #include "../common/url.h" #include "../common/util.h" +#include "../common/text.h" #include "fe-gtk.h" #include "banlist.h" @@ -2801,7 +2802,10 @@ mg_inputbox_rightclick (GtkEntry *entry, GtkWidget *menu) static void mg_create_entry (session *sess, GtkWidget *box) { - GtkWidget *sw, *hbox, *but, *entry; + GtkWidget *hbox, *but, *entry; +#ifdef USE_GTKSPELL + GtkWidget *sw; +#endif session_gui *gui = sess->gui; hbox = gtk_hbox_new (FALSE, 0); @@ -3695,7 +3699,9 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui GdkGCValues val; int half, width, height; int ox, oy; +#if 0 GtkPaned *paned; +#endif GdkDrawable *draw; /* ignore file drops */ diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index c4912212..400b709b 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -23,6 +23,7 @@ #ifdef WIN32 #include +#include #else #include #endif @@ -72,6 +73,7 @@ #include "urlgrab.h" #include "userlistgui.h" #include "menu.h" +#include "servlistgui.h" static GSList *submenu_list; diff --git a/src/fe-gtk/notifygui.c b/src/fe-gtk/notifygui.c index 33d09a48..679b3f02 100644 --- a/src/fe-gtk/notifygui.c +++ b/src/fe-gtk/notifygui.c @@ -45,6 +45,7 @@ #include "../common/server.h" #include "../common/util.h" #include "../common/userlist.h" +#include "../common/outbound.h" #include "gtkutil.h" #include "maingui.h" #include "palette.h" diff --git a/src/fe-gtk/palette.c b/src/fe-gtk/palette.c index 104700c2..81ad13d7 100644 --- a/src/fe-gtk/palette.c +++ b/src/fe-gtk/palette.c @@ -22,7 +22,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 13eacacf..2d8b79c0 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -8,6 +8,7 @@ #include "../common/server.h" #include "../common/fe.h" #include "../common/util.h" +#include "../common/outbound.h" #include "fe-gtk.h" #include "pixmaps.h" #include "maingui.h" @@ -497,9 +498,11 @@ static void tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) { GtkWidget *menu; +#ifndef WIN32 GtkWidget *submenu; GtkWidget *item; int away_status; +#endif /* ph may have an invalid context now */ xchat_set_context (ph, xchat_find_context (ph, NULL, NULL)); diff --git a/src/fe-gtk/rawlog.c b/src/fe-gtk/rawlog.c index e2862b2d..78a7eb2f 100644 --- a/src/fe-gtk/rawlog.c +++ b/src/fe-gtk/rawlog.c @@ -21,7 +21,9 @@ #include #include -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index a19ea233..d54ee077 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -37,6 +37,7 @@ #include "../common/servlist.h" #include "../common/cfgfiles.h" #include "../common/fe.h" +#include "../common/util.h" #include "fe-gtk.h" #include "gtkutil.h" diff --git a/src/fe-gtk/servlistgui.h b/src/fe-gtk/servlistgui.h new file mode 100644 index 00000000..f2c2d14d --- /dev/null +++ b/src/fe-gtk/servlistgui.h @@ -0,0 +1 @@ +void servlist_autojoinedit (ircnet *net, char *channel, gboolean add); diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 4dc568e6..9d1079ad 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -21,6 +21,7 @@ #include "palette.h" #include "pixmaps.h" #include "menu.h" +#include "plugin-tray.h" #include #include diff --git a/src/fe-gtk/setup.h b/src/fe-gtk/setup.h new file mode 100644 index 00000000..646ba18e --- /dev/null +++ b/src/fe-gtk/setup.h @@ -0,0 +1 @@ +void setup_apply_real (int new_pix, int do_ulist, int do_layout); \ No newline at end of file diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c index d6f4ad63..cd4850be 100644 --- a/src/fe-gtk/sexy-spell-entry.c +++ b/src/fe-gtk/sexy-spell-entry.c @@ -35,6 +35,7 @@ #ifdef WIN32 #include "typedef.h" +#include #endif #include "../common/cfgfiles.h" diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c index f040a6a1..5edee739 100644 --- a/src/fe-gtk/userlistgui.c +++ b/src/fe-gtk/userlistgui.c @@ -40,6 +40,7 @@ #include "../common/modes.h" #include "../common/notify.h" #include "../common/xchatc.h" +#include "../common/fe.h" #include "gtkutil.h" #include "palette.h" #include "maingui.h" diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index e23eaf83..38ae2a89 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -76,6 +76,8 @@ #ifdef WIN32 #include +#include +#include #include #else #include