changeset 19282:fcc5d2de3b74

merge of '197e1b0c22949c758e407b2720f5e051f5cb4adf' and '71fc765ce0faa44411e9b8f51d5edcf908b4a1a6'
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 15 Aug 2007 03:40:42 +0000
parents 2b1172af2f8b (diff) b9f851240a5c (current diff)
children 39df1370839e
files
diffstat 6 files changed, 21 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Aug 15 00:56:53 2007 +0000
+++ b/configure.ac	Wed Aug 15 03:40:42 2007 +0000
@@ -1089,7 +1089,7 @@
 dnl #######################################################################
 
 AC_ARG_ENABLE(dbus, [AC_HELP_STRING([--enable-dbus], [enable D-Bus support])], , enable_dbus=yes)
-AC_ARG_ENABLE(nm, [AC_HELP_STRING([--enable-nm], [enable NetworkManager support (buggy) (requires D-Bus)])], enable_libnm=yes, enable_libnm=no)
+AC_ARG_ENABLE(nm, [AC_HELP_STRING([--enable-nm], [enable NetworkManager support (buggy) (requires D-Bus)])], enable_libnm=$enableval, enable_libnm=no)
 
 if test "x$enable_dbus" = "xyes" ; then
 	AC_CHECK_PROG(enable_dbus, dbus-binding-tool, yes, no)
--- a/libpurple/nat-pmp.c	Wed Aug 15 00:56:53 2007 +0000
+++ b/libpurple/nat-pmp.c	Wed Aug 15 03:40:42 2007 +0000
@@ -210,19 +210,19 @@
 				struct sockaddr addr, mask;
 
 				get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
-				bzero(&addr, sizeof(addr));
+				memset(&addr, 0, sizeof(addr));
 
 				if (rtm->rtm_addrs & RTA_DST)
-					bcopy(rti_info[RTAX_DST], &addr, rti_info[RTAX_DST]->sa_len);
+					memcpy(&addr, rti_info[RTAX_DST], sizeof(addr));
 
-				bzero(&mask, sizeof(mask));
+				memset(&mask, 0, sizeof(mask));
 
 				if (rtm->rtm_addrs & RTA_NETMASK)
-					bcopy(rti_info[RTAX_NETMASK], &mask, rti_info[RTAX_NETMASK]->sa_len);
+					memcpy(&mask, rti_info[RTAX_NETMASK], sizeof(mask));
 
 				if (rtm->rtm_addrs & RTA_GATEWAY &&
 					is_default_route(&addr, &mask)) 
-				{					
+				{
 					if (rti_info[RTAX_GATEWAY]) {
 						struct sockaddr_in *rti_sin = (struct sockaddr_in *)rti_info[RTAX_GATEWAY];
 						sin = g_new0(struct sockaddr_in, 1);
@@ -291,10 +291,10 @@
 	sendfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
 	/* Clean out both req and resp structures */
-	bzero(&req, sizeof(PurplePmpIpRequest));
-	bzero(&resp, sizeof(PurplePmpIpResponse));
+	memset(&req, 0, sizeof(PurplePmpIpRequest));
+	memset(&resp, 0, sizeof(PurplePmpIpResponse));
 	req.version = 0;
-	req.opcode	= 0;
+	req.opcode = 0;
 
 	/* The NAT-PMP spec says we should attempt to contact the gateway 9 times, doubling the time we wait each time.
 	 * Even starting with a timeout of 0.1 seconds, that means that we have a total waiting of 204.6 seconds.
@@ -323,12 +323,12 @@
 		g_free(gateway);
 		pmp_info.status = PURPLE_PMP_STATUS_UNABLE_TO_DISCOVER;
 		return NULL;
-	}		
+	}
 
 	/* TODO: Non-blocking! */
 	len = sizeof(struct sockaddr_in);
 	if (recvfrom(sendfd, &resp, sizeof(PurplePmpIpResponse), 0, (struct sockaddr *)(&addr), &len) < 0)
-	{			
+	{
 		if (errno != EAGAIN)
 		{
 			purple_debug_info("nat-pmp", "There was an error receiving the response from the NAT-PMP device! (%s)\n", strerror(errno));
@@ -365,7 +365,7 @@
 	struct in_addr in;
 	in.s_addr = resp.address;
 	purple_debug_info("nat-pmp", "address: %s\n", inet_ntoa(in));
-#endif	
+#endif
 
 	publicsockaddr->sin_addr.s_addr = resp.address;
 
@@ -408,9 +408,9 @@
 	sendfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
 	/* Set up the req */
-	bzero(&req, sizeof(PurplePmpMapRequest));
+	memset(&req, 0, sizeof(PurplePmpMapRequest));
 	req.version = 0;
-	req.opcode	= ((type == PURPLE_PMP_TYPE_UDP) ? PMP_MAP_OPCODE_UDP : PMP_MAP_OPCODE_TCP);	
+	req.opcode = ((type == PURPLE_PMP_TYPE_UDP) ? PMP_MAP_OPCODE_UDP : PMP_MAP_OPCODE_TCP);
 	req.privateport = htons(privateport); /* What a difference byte ordering makes...d'oh! */
 	req.publicport = htons(publicport);
 	req.lifetime = htonl(lifetime);
@@ -509,7 +509,7 @@
 {
 	static int handle;
 
-	return &handle;	
+	return &handle;
 }
 
 void
@@ -517,7 +517,7 @@
 {
 	purple_signal_connect(purple_network_get_handle(), "network-configuration-changed",
 		  purple_pmp_get_handle(), PURPLE_CALLBACK(purple_pmp_network_config_changed_cb),
-		  GINT_TO_POINTER(0));	
+		  GINT_TO_POINTER(0));
 }
 #else /* #ifdef NET_RT_DUMP */
 char *
--- a/libpurple/protocols/bonjour/dns_sd_proxy.h	Wed Aug 15 00:56:53 2007 +0000
+++ b/libpurple/protocols/bonjour/dns_sd_proxy.h	Wed Aug 15 03:40:42 2007 +0000
@@ -6,14 +6,8 @@
 /* fixup to make pidgin compile against win32 bonjour */
 #ifdef _WIN32
 #define _MSL_STDINT_H
-#undef bzero
 #endif
 
 #include <dns_sd.h>
 
-/* dns_sd.h defines bzero and we also do in libc_internal.h */
-#ifdef _WIN32
-#undef bzero
 #endif
-
-#endif
--- a/libpurple/protocols/zephyr/zephyr.c	Wed Aug 15 00:56:53 2007 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Wed Aug 15 03:40:42 2007 +0000
@@ -1151,7 +1151,7 @@
 				size_t bufsize = strlen(msg) + 3;
 				char *buf = g_new0(char,bufsize);
 				g_snprintf(buf,1+strlen(msg)+2," %c%s",'\0',msg);
-				bzero((char *)&notice, sizeof(notice));
+				memset((char *)&notice, 0, sizeof(notice));
 				notice.z_kind = ACKED;
 				notice.z_port = 0;
 				notice.z_opcode = tree_child(find_node(newparsetree,"opcode"),2)->contents;
@@ -2205,7 +2205,7 @@
 	} else if (use_zeph02(zephyr)) {
 		ZNotice_t notice;
 		char *buf = g_strdup_printf("%s%c%s", sig, '\0', html_buf2);
-		bzero((char *)&notice, sizeof(notice));
+		memset((char *)&notice, 0, sizeof(notice));
 		
 		notice.z_kind = ACKED;
 		notice.z_port = 0;
--- a/libpurple/win32/libc_interface.h	Wed Aug 15 00:56:53 2007 +0000
+++ b/libpurple/win32/libc_interface.h	Wed Aug 15 03:40:42 2007 +0000
@@ -99,8 +99,6 @@
 #define strerror( errornum ) \
 wpurple_strerror( errornum )
 
-#define bzero( dest, size ) memset( dest, 0, size )
-
 /* unistd.h */
 #define read( fd, buf, buflen ) \
 wpurple_read( fd, buf, buflen )
--- a/pidgin/gtkconv.c	Wed Aug 15 00:56:53 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Aug 15 03:40:42 2007 +0000
@@ -7618,13 +7618,14 @@
  * has looked at it so we know there are no longer unseen
  * messages.
  */
-static gint
+static gboolean
 focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d)
 {
 	PidginWindow *win = d;
 	PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
 
-	gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
+	if (gtkconv)
+		gtkconv_set_unseen(gtkconv, PIDGIN_UNSEEN_NONE);
 
 	return FALSE;
 }