changeset 5084:a96653493416

[gaim-migrate @ 5439] Fixed warnings (win32) committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Tue, 08 Apr 2003 18:36:50 +0000
parents 580c790bc042
children 50b58030291e
files src/gaimrc.c src/prefs.c src/util.c src/win32/libc_interface.c src/win32/libc_interface.h src/win32/systray.c src/win32/win32dep.h src/win32/wspell.c
diffstat 8 files changed, 34 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/gaimrc.c	Tue Apr 08 18:36:50 2003 +0000
@@ -1114,7 +1114,9 @@
 static void gaimrc_write_sounds(FILE *f)
 {
 	int i;
+#ifndef _WIN32
 	char *cmd;
+#endif
 	fprintf(f, "sound_files {\n");
 	for (i = 0; i < GAIM_NUM_SOUNDS; i++) {
 		char *file = gaim_sound_get_event_file(i);
--- a/src/prefs.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/prefs.c	Tue Apr 08 18:36:50 2003 +0000
@@ -67,7 +67,9 @@
 static GtkWidget *show_color_pref(GtkWidget *, gboolean);
 static void delete_prefs(GtkWidget *, void *);
 void set_default_away(GtkWidget *, gpointer);
+#ifndef _WIN32
 static gboolean program_is_valid(const char *);
+#endif
 
 struct debug_window *dw = NULL;
 GtkWidget *prefs = NULL;
@@ -258,7 +260,9 @@
 }
 
 void theme_install_theme(char *path, char *extn) {
+#ifndef _WIN32
 	gchar *command;
+#endif
 	gchar *destdir;
 	gchar *tail;
 
@@ -2211,6 +2215,7 @@
 		default_away = g_slist_nth_data(away_messages, (int)i);
 }
 
+#ifndef _WIN32
 static gboolean program_is_valid(const char *program) 
 {
 	GError *error = NULL;
@@ -2240,6 +2245,7 @@
 	
 	return is_valid;
 }
+#endif
 
 static void update_spin_value(GtkWidget *w, GtkWidget *spin)
 {
--- a/src/util.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/util.c	Tue Apr 08 18:36:50 2003 +0000
@@ -47,10 +47,10 @@
 #include "prpl.h"
 #include "gtklist.h"
 
+#ifndef _WIN32
 #include <sys/socket.h>
 #include <arpa/inet.h>
-
-#ifdef _WIN32
+#else
 #include "win32dep.h"
 #endif
 
--- a/src/win32/libc_interface.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/win32/libc_interface.c	Tue Apr 08 18:36:50 2003 +0000
@@ -326,7 +326,7 @@
 				/* newname is not a dir */
 				else {
 					remove(newname);
-					rename(oldname, newname);
+					return rename(oldname, newname);
 				}
 			}
 		}
--- a/src/win32/libc_interface.h	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/win32/libc_interface.h	Tue Apr 08 18:36:50 2003 +0000
@@ -44,6 +44,10 @@
 #define gethostbyname( name ) \
 wgaim_gethostbyname( ## name ## )
 
+/* netinet/in.h */
+#define ntohl( netlong ) \
+(unsigned int)ntohl( ## netlong ## )
+
 /* string.h */
 extern char* wgaim_strerror( int errornum );
 #define hstrerror( herror ) \
--- a/src/win32/systray.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/win32/systray.c	Tue Apr 08 18:36:50 2003 +0000
@@ -12,6 +12,7 @@
 #include "win32dep.h"
 #include "MinimizeToTray.h"
 #include "ui.h"
+#include "gtklist.h"
 
 /*
  *  DEFINES, MACROS & DATA TYPES
@@ -291,15 +292,15 @@
 	/* create popup menu */
 	if((systray_menu = CreatePopupMenu())) {
 		if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_PREFS, _("Preferences")))
-			debug_printf("AppendMenu error: %d\n", GetLastError());
+			debug_printf("AppendMenu error: %ld\n", GetLastError());
 		if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_AUTOLOGIN, _("Auto-login")))
-			debug_printf("AppendMenu error: %d\n", GetLastError());
+			debug_printf("AppendMenu error: %ld\n", GetLastError());
 		if(!AppendMenu(systray_menu, MF_SEPARATOR, 0, 0))
-			debug_printf("AppendMenu error: %d\n", GetLastError());
+			debug_printf("AppendMenu error: %ld\n", GetLastError());
 		if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_MENU_EXIT, _("Exit")))
-			debug_printf("AppendMenu error: %d\n", GetLastError());
+			debug_printf("AppendMenu error: %ld\n", GetLastError());
 	} else
-		debug_printf("CreatePopupMenu error: %d\n", GetLastError());
+		debug_printf("CreatePopupMenu error: %ld\n", GetLastError());
 }
 
 static void systray_init_icon(HWND hWnd, HICON icon) {
@@ -339,6 +340,8 @@
 	case SYSTRAY_STATE_AWAY:
 		systray_change_icon(sysicon_away, GAIM_SYSTRAY_AWAY_HINT);
 		break;
+	case SYSTRAY_STATE_COUNT: /* not a state, here to avoid warning */
+	default:
 	}
 }
 
@@ -389,10 +392,6 @@
 	systray_update_status();
 }
 
-static void st_im_recieve(struct gaim_connection *gc, void *data) {
-	
-}
-
 /*
  *  PUBLIC CODE
  */
--- a/src/win32/win32dep.h	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/win32/win32dep.h	Tue Apr 08 18:36:50 2003 +0000
@@ -5,6 +5,7 @@
 #ifndef _WIN32DEP_H_
 #define _WIN32DEP_H_
 #include <winsock.h>
+#include <process.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkevents.h>
 #include "wgaimerror.h"
@@ -18,19 +19,20 @@
 /**
  ** win32dep.c
  **/
-/* Misc */
-FARPROC wgaim_find_and_loadproc(char*, char*);
+/* Windows helper functions */
 HINSTANCE wgaim_hinstance(void);
-extern void wgaim_im_blink(GtkWidget*);
-extern char* wgaim_escape_dirsep(char*);
-extern int wgaim_gz_decompress(const char* in, const char* out);
-extern int wgaim_gz_untar(const char* filename, const char* destdir);
-
+FARPROC wgaim_find_and_loadproc(char*, char*);
 /* Determine Gaim paths */
 extern char* wgaim_install_dir(void);
 extern char* wgaim_lib_dir(void);
 extern char* wgaim_locale_dir(void);
-
+extern char* wgaim_escape_dirsep(char*);
+/* UI related */
+extern void wgaim_im_blink(GtkWidget*);
+extern void wgaim_gtk_window_move(GtkWindow *window, gint x, gint y);
+/* Utility */
+extern int wgaim_gz_decompress(const char* in, const char* out);
+extern int wgaim_gz_untar(const char* filename, const char* destdir);
 /* init / cleanup */
 extern void wgaim_init(void);
 extern void wgaim_cleanup(void);
--- a/src/win32/wspell.c	Tue Apr 08 14:31:19 2003 +0000
+++ b/src/win32/wspell.c	Tue Apr 08 18:36:50 2003 +0000
@@ -51,7 +51,7 @@
 
 void wgaim_gtkspell_init() {
 	    HKEY hKey;
-	    const char buffer[1024] = "";
+	    char buffer[1024] = "";
 	    DWORD size = sizeof(buffer);
 	    DWORD type;