/pidgin/main: 27725cc141a8: Fix the last ppc64 warning
Tomasz Wasilczyk
twasilczyk at pidgin.im
Thu Feb 13 11:38:27 EST 2014
Changeset: 27725cc141a8b1fd72cf699547f43163bfeab8b2
Author: Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date: 2014-02-13 17:38 +0100
Branch: release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/27725cc141a8
Description:
Fix the last ppc64 warning
diffstat:
libpurple/protocols/bonjour/jabber.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diffs (50 lines):
diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -631,8 +631,8 @@ static void
_server_socket_handler(gpointer data, int server_socket, PurpleInputCondition condition)
{
BonjourJabber *jdata = data;
- struct sockaddr_storage their_addr; /* connector's address information */
- socklen_t sin_size = sizeof(struct sockaddr_storage);
+ common_sockaddr_t their_addr; /* connector's address information */
+ socklen_t sin_size = sizeof(common_sockaddr_t);
int client_socket;
int flags;
#ifdef HAVE_INET_NTOP
@@ -649,7 +649,7 @@ static void
memset(&their_addr, 0, sin_size);
- if ((client_socket = accept(server_socket, (struct sockaddr*)&their_addr, &sin_size)) == -1)
+ if ((client_socket = accept(server_socket, &their_addr.sa, &sin_size)) == -1)
return;
flags = fcntl(client_socket, F_GETFL);
@@ -660,18 +660,17 @@ static void
/* Look for the buddy that has opened the conversation and fill information */
#ifdef HAVE_INET_NTOP
- if (their_addr.ss_family == AF_INET6) {
- address_text = inet_ntop(their_addr.ss_family, &((struct sockaddr_in6 *)&their_addr)->sin6_addr,
- addrstr, sizeof(addrstr));
+ if (their_addr.sa.sa_family == AF_INET6) {
+ address_text = inet_ntop(their_addr.sa.sa_family,
+ &their_addr.in6.sin6_addr, addrstr, sizeof(addrstr));
- append_iface_if_linklocal(addrstr,
- ((struct sockaddr_in6 *)&their_addr)->sin6_scope_id);
+ append_iface_if_linklocal(addrstr, their_addr.in6.sin6_scope_id);
+ } else {
+ address_text = inet_ntop(their_addr.sa.sa_family,
+ &their_addr.in.sin_addr, addrstr, sizeof(addrstr));
}
- else
- address_text = inet_ntop(their_addr.ss_family, &((struct sockaddr_in *)&their_addr)->sin_addr,
- addrstr, sizeof(addrstr));
#else
- address_text = inet_ntoa(((struct sockaddr_in *)&their_addr)->sin_addr);
+ address_text = inet_ntoa(their_addr.in.sin_addr);
#endif
purple_debug_info("bonjour", "Received incoming connection from %s.\n", address_text);
mbba = g_new0(struct _match_buddies_by_address_t, 1);
More information about the Commits
mailing list