/pidgin/main: 3fd1628aa718: Fixing warnings (win32, glib, others)

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sun Apr 14 10:43:32 EDT 2013


Changeset: 3fd1628aa718fbc767f6025a027bc24c72a3d8f1
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-14 16:43 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/3fd1628aa718

Description:

Fixing warnings (win32, glib, others)

diffstat:

 libpurple/glibcompat.h           |  8 +++++++-
 libpurple/ntlm.c                 |  5 +++--
 libpurple/proxy.c                |  3 +--
 libpurple/util.c                 |  2 +-
 libpurple/win32/libc_interface.c |  4 ++--
 libpurple/win32/win32dep.c       |  1 +
 6 files changed, 15 insertions(+), 8 deletions(-)

diffs (96 lines):

diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -25,12 +25,18 @@
  * Also, any public API should not depend on this file.
  */
 
+#if GLIB_CHECK_VERSION(2, 32, 0)
+
+#define g_thread_init(vtable) {}
+
 #if GLIB_CHECK_VERSION(2, 36, 0)
 
-#define g_type_init()
+#define g_type_init() {}
 
 #endif /* >= 2.36.0 */
 
+#endif /* >= 2.32.0 */
+
 
 #if !GLIB_CHECK_VERSION(2, 32, 0)
 
diff --git a/libpurple/ntlm.c b/libpurple/ntlm.c
--- a/libpurple/ntlm.c
+++ b/libpurple/ntlm.c
@@ -243,8 +243,9 @@ gensesskey(char *buffer)
 			red = 0;
 		} else if (red < 16) {
 			purple_debug_warning("ntlm", "Tried reading 16 bytes from "
-					"/dev/urandom but only got %zd.  Falling back to "
-					"inferior method\n", red);
+					"/dev/urandom but only got %"
+					G_GSSIZE_FORMAT ".  Falling back to "
+					"inferior method\n", (gssize)red);
 		}
 	} else {
 		purple_debug_warning("ntlm", "Error opening /dev/urandom: %s."
diff --git a/libpurple/proxy.c b/libpurple/proxy.c
--- a/libpurple/proxy.c
+++ b/libpurple/proxy.c
@@ -979,9 +979,8 @@ http_canread(gpointer data, gint source,
 		major = strtol(p, &p, 10);
 		error = (major == 0) || (*p != '.');
 		if(!error) {
-			int minor;
 			p++;
-			minor = strtol(p, &p, 10);
+			/* minor = strtol(p, &p, 10); */
 			error = (*p != ' ');
 			if(!error) {
 				p++;
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -3354,7 +3354,7 @@ purple_socket_speaks_ipv4(int fd)
 	case AF_INET6:
 	{
 		int val = 0;
-		guint len = sizeof(val);
+		socklen_t len = sizeof(val);
 
 		if (getsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &val, &len) != 0)
 			return FALSE;
diff --git a/libpurple/win32/libc_interface.c b/libpurple/win32/libc_interface.c
--- a/libpurple/win32/libc_interface.c
+++ b/libpurple/win32/libc_interface.c
@@ -308,7 +308,7 @@ wpurple_inet_pton(int af, const char *sr
 		struct sockaddr_in6 sin6;
 		struct sockaddr_in sin;
 	} sa;
-	size_t srcsize;
+	int srcsize;
 	
 	switch(af)
 	{
@@ -325,7 +325,7 @@ wpurple_inet_pton(int af, const char *sr
 			return -1;
 	}
 	
-	if (WSAStringToAddress(src, af, NULL, (struct sockaddr *) &sa, &srcsize) != 0)
+	if (WSAStringToAddress((LPTSTR)src, af, NULL, (struct sockaddr *) &sa, &srcsize) != 0)
 	{
 		errno = WSAGetLastError();
 		return -1;
diff --git a/libpurple/win32/win32dep.c b/libpurple/win32/win32dep.c
--- a/libpurple/win32/win32dep.c
+++ b/libpurple/win32/win32dep.c
@@ -27,6 +27,7 @@
 #include <winuser.h>
 
 #include "debug.h"
+#include "glibcompat.h"
 #include "notify.h"
 
 /*



More information about the Commits mailing list