Sun, 06 Oct 2013 18:15:19 +0530
Merged soc.2013.gobjectification branch
--- a/configure.ac Thu Oct 03 06:47:52 2013 +0530 +++ b/configure.ac Sun Oct 06 18:15:19 2013 +0530 @@ -1485,6 +1485,19 @@ AC_PATH_PROG(pidginpath, pidgin) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ + #if !defined(__clang__) + #error + #endif +])], have_clang=yes, have_clang=no) + +if test "x$have_clang" = "xyes"; then + GLIB_LIBS=`echo $GLIB_LIBS | $sedpath 's/-pthread/-lpthread/'` + + dnl Enable address sanitizer. + CFLAGS="$CFLAGS -faddress-sanitizer -g -fno-omit-frame-pointer -fno-inline -fno-optimize-sibling-calls" +fi + dnl ####################################################################### dnl # Check for D-Bus libraries dnl #######################################################################
--- a/finch/gntmedia.c Thu Oct 03 06:47:52 2013 +0530 +++ b/finch/gntmedia.c Sun Oct 06 18:15:19 2013 +0530 @@ -408,9 +408,9 @@ if (!purple_protocol_initiate_media(account, purple_conversation_get_name(conv), PURPLE_MEDIA_AUDIO)) - return PURPLE_CMD_STATUS_FAILED; + return PURPLE_CMD_RET_FAILED; - return PURPLE_CMD_STATUS_OK; + return PURPLE_CMD_RET_OK; } static GstElement *
--- a/finch/gntnotify.c Thu Oct 03 06:47:52 2013 +0530 +++ b/finch/gntnotify.c Sun Oct 06 18:15:19 2013 +0530 @@ -47,20 +47,20 @@ } emaildialog; static void -notify_msg_window_destroy_cb(GntWidget *window, PurpleNotifyMsgType type) +notify_msg_window_destroy_cb(GntWidget *window, PurpleNotifyType type) { purple_notify_close(type, window); } static void * -finch_notify_message(PurpleNotifyMsgType type, const char *title, - const char *primary, const char *secondary, +finch_notify_common(PurpleNotifyType ntype, PurpleNotifyMsgType msgtype, + const char *title, const char *primary, const char *secondary, PurpleRequestCommonParameters *cpar) { GntWidget *window, *button; GntTextFormatFlags pf = 0, sf = 0; - switch (type) + switch (msgtype) { case PURPLE_NOTIFY_MSG_ERROR: sf |= GNT_TEXT_FLAG_BOLD; @@ -85,24 +85,16 @@ if (secondary) { GntWidget *msg; - /* XXX: This is broken. type is PurpleNotifyMsgType, not - * PurpleNotifyType. Also, the if() followed by the - * inner switch doesn't make much sense. - */ - if ((int)type == (int)PURPLE_NOTIFY_FORMATTED) { + if (ntype == PURPLE_NOTIFY_FORMATTED) { int width = -1, height = -1; char *plain = (char*)secondary; msg = gnt_text_view_new(); gnt_text_view_set_flag(GNT_TEXT_VIEW(msg), GNT_TEXT_VIEW_TOP_ALIGN | GNT_TEXT_VIEW_NO_SCROLL); - switch ((int)type) { - case (int)PURPLE_NOTIFY_FORMATTED: - plain = purple_markup_strip_html(secondary); - if (gnt_util_parse_xhtml_to_textview(secondary, GNT_TEXT_VIEW(msg))) - break; - /* Fallthrough */ - default: - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(msg), plain, sf); - } + + plain = purple_markup_strip_html(secondary); + if (!gnt_util_parse_xhtml_to_textview(secondary, GNT_TEXT_VIEW(msg))) + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(msg), plain, sf); + gnt_text_view_attach_scroll_widget(GNT_TEXT_VIEW(msg), button); gnt_util_get_text_bound(plain, &width, &height); gnt_widget_set_size(msg, width + 3, height + 1); @@ -119,7 +111,7 @@ g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), window); g_signal_connect(G_OBJECT(window), "destroy", - G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type)); + G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(ntype)); gnt_widget_show(window); return window; @@ -146,6 +138,15 @@ gnt_widget_destroy(widget); } +static void * +finch_notify_message(PurpleNotifyMsgType type, const char *title, + const char *primary, const char *secondary, + PurpleRequestCommonParameters *cpar) +{ + return finch_notify_common(PURPLE_NOTIFY_MESSAGE, type, title, primary, + secondary, cpar); +} + static void *finch_notify_formatted(const char *title, const char *primary, const char *secondary, const char *text) { @@ -157,7 +158,8 @@ void *ret; purple_markup_html_to_xhtml(t, &xhtml, NULL); - ret = finch_notify_message(PURPLE_NOTIFY_FORMATTED, title, primary, xhtml, NULL); + ret = finch_notify_common(PURPLE_NOTIFY_FORMATTED, + PURPLE_NOTIFY_MSG_INFO, title, primary, xhtml, NULL); g_free(t); g_free(xhtml); @@ -250,7 +252,8 @@ return NULL; } - ret = finch_notify_message(PURPLE_NOTIFY_EMAIL, _("New Mail"), _("You have mail!"), message->str, NULL); + ret = finch_notify_common(PURPLE_NOTIFY_EMAIL, PURPLE_NOTIFY_MSG_INFO, + _("New Mail"), _("You have mail!"), message->str, NULL); g_string_free(message, TRUE); return ret; } @@ -504,7 +507,8 @@ static void * finch_notify_uri(const char *url) { - return finch_notify_message(PURPLE_NOTIFY_URI, _("URI"), url, NULL, NULL); + return finch_notify_common(PURPLE_NOTIFY_URI, PURPLE_NOTIFY_MSG_INFO, + _("URI"), url, NULL, NULL); } static PurpleNotifyUiOps ops =
--- a/finch/plugins/gnttinyurl.c Thu Oct 03 06:47:52 2013 +0530 +++ b/finch/plugins/gnttinyurl.c Sun Oct 06 18:15:19 2013 +0530 @@ -384,7 +384,7 @@ /* XXX: The following expects that finch_notify_message gets called. This * may not always happen, e.g. when another plugin sets its own * notify_message. So tread carefully. */ - win = purple_notify_message(NULL, PURPLE_NOTIFY_URI, _("URI"), uri, + win = purple_notify_message(NULL, PURPLE_NOTIFY_MSG_INFO, _("URI"), uri, _("Please wait while TinyURL fetches a shorter URL ..."), NULL, NULL, NULL); if (!GNT_IS_WINDOW(win) || !g_object_get_data(G_OBJECT(win), "info-widget")) return win;
--- a/finch/plugins/lastlog.c Thu Oct 03 06:47:52 2013 +0530 +++ b/finch/plugins/lastlog.c Sun Oct 06 18:15:19 2013 +0530 @@ -88,7 +88,7 @@ g_signal_connect(G_OBJECT(win), "key_pressed", G_CALLBACK(window_kpress_cb), tv); g_strfreev(strings); - return PURPLE_CMD_STATUS_OK; + return PURPLE_CMD_RET_OK; } static FinchPluginInfo *
--- a/libpurple/glibcompat.h Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/glibcompat.h Sun Oct 06 18:15:19 2013 +0530 @@ -25,6 +25,20 @@ * Also, any public API should not depend on this file. */ +#ifdef __clang__ + +#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS +#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + _Pragma ("clang diagnostic push") \ + _Pragma ("clang diagnostic ignored \"-Wdeprecated-declarations\"") + +#undef G_GNUC_END_IGNORE_DEPRECATIONS +#define G_GNUC_END_IGNORE_DEPRECATIONS \ + _Pragma ("clang diagnostic pop") + +#endif /* __clang__ */ + + #if !GLIB_CHECK_VERSION(2, 32, 0) #define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
--- a/libpurple/media/backend-fs2.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/media/backend-fs2.c Sun Oct 06 18:15:19 2013 +0530 @@ -181,6 +181,66 @@ purple_media_backend_fs2_init(PurpleMediaBackendFs2 *self) {} +static FsCandidateType +purple_media_candidate_type_to_fs(PurpleMediaCandidateType type) +{ + switch (type) { + case PURPLE_MEDIA_CANDIDATE_TYPE_HOST: + return FS_CANDIDATE_TYPE_HOST; + case PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX: + return FS_CANDIDATE_TYPE_SRFLX; + case PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX: + return FS_CANDIDATE_TYPE_PRFLX; + case PURPLE_MEDIA_CANDIDATE_TYPE_RELAY: + return FS_CANDIDATE_TYPE_RELAY; + case PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST: + return FS_CANDIDATE_TYPE_MULTICAST; + } + g_return_val_if_reached(FS_CANDIDATE_TYPE_HOST); +} + +static PurpleMediaCandidateType +purple_media_candidate_type_from_fs(FsCandidateType type) +{ + switch (type) { + case FS_CANDIDATE_TYPE_HOST: + return PURPLE_MEDIA_CANDIDATE_TYPE_HOST; + case FS_CANDIDATE_TYPE_SRFLX: + return PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX; + case FS_CANDIDATE_TYPE_PRFLX: + return PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX; + case FS_CANDIDATE_TYPE_RELAY: + return PURPLE_MEDIA_CANDIDATE_TYPE_RELAY; + case FS_CANDIDATE_TYPE_MULTICAST: + return PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST; + } + g_return_val_if_reached(PURPLE_MEDIA_CANDIDATE_TYPE_HOST); +} + +static FsNetworkProtocol +purple_media_network_protocol_to_fs(PurpleMediaNetworkProtocol protocol) +{ + switch (protocol) { + case PURPLE_MEDIA_NETWORK_PROTOCOL_UDP: + return FS_NETWORK_PROTOCOL_UDP; + case PURPLE_MEDIA_NETWORK_PROTOCOL_TCP: + return FS_NETWORK_PROTOCOL_TCP; + } + g_return_val_if_reached(FS_NETWORK_PROTOCOL_TCP); +} + +static PurpleMediaNetworkProtocol +purple_media_network_protocol_from_fs(FsNetworkProtocol protocol) +{ + switch (protocol) { + case FS_NETWORK_PROTOCOL_UDP: + return PURPLE_MEDIA_NETWORK_PROTOCOL_UDP; + case FS_NETWORK_PROTOCOL_TCP: + return PURPLE_MEDIA_NETWORK_PROTOCOL_TCP; + } + g_return_val_if_reached(PURPLE_MEDIA_NETWORK_PROTOCOL_TCP); +} + #if GST_CHECK_VERSION(1,0,0) static GstPadProbeReturn event_probe_cb(GstPad *srcpad, GstPadProbeInfo *info, gpointer unused) @@ -554,8 +614,8 @@ NULL); fscandidate = fs_candidate_new(foundation, - component_id, type, - proto, ip, port); + component_id, purple_media_candidate_type_to_fs(type), + purple_media_network_protocol_to_fs(proto), ip, port); fscandidate->base_ip = base_ip; fscandidate->base_port = base_port; @@ -592,8 +652,10 @@ return NULL; candidate = purple_media_candidate_new(fscandidate->foundation, - fscandidate->component_id, fscandidate->type, - fscandidate->proto, fscandidate->ip, fscandidate->port); + fscandidate->component_id, + purple_media_candidate_type_from_fs(fscandidate->type), + purple_media_network_protocol_from_fs(fscandidate->proto), + fscandidate->ip, fscandidate->port); g_object_set(candidate, "base-ip", fscandidate->base_ip, "base-port", fscandidate->base_port,
--- a/libpurple/plugins/keyrings/gnomekeyring.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/plugins/keyrings/gnomekeyring.c Sun Oct 06 18:15:19 2013 +0530 @@ -110,7 +110,7 @@ _("Access denied.")); gnomekeyring_cancel_queue(); } else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON || - GNOME_KEYRING_RESULT_IO_ERROR) { + result == GNOME_KEYRING_RESULT_IO_ERROR) { error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_BACKENDFAIL, _("Communication with GNOME Keyring failed.")); @@ -183,7 +183,7 @@ _("Access denied.")); gnomekeyring_cancel_queue(); } else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON || - GNOME_KEYRING_RESULT_IO_ERROR) { + result == GNOME_KEYRING_RESULT_IO_ERROR) { error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_BACKENDFAIL, _("Communication with GNOME Keyring failed."));
--- a/libpurple/plugins/perl/common/Cipher.xs Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/plugins/perl/common/Cipher.xs Sun Oct 06 18:15:19 2013 +0530 @@ -60,7 +60,7 @@ size_t digest_size; CODE: digest_size = purple_cipher_get_digest_size(cipher); - SvUPGRADE(digest, SVt_PV); + SvUPGRADE_common(digest, SVt_PV); buff = (guchar *)SvGROW(digest, digest_size); if (purple_cipher_digest(cipher, buff, digest_size)) { SvCUR_set(digest, digest_size); @@ -83,7 +83,7 @@ CODE: digest_size = purple_cipher_get_digest_size(cipher); str_len = 2 * digest_size; - SvUPGRADE(digest_s, SVt_PV); + SvUPGRADE_common(digest_s, SVt_PV); buff = SvGROW(digest_s, str_len + 1); if (purple_cipher_digest_to_str(cipher, buff, str_len + 1)) { SvCUR_set(digest_s, str_len); @@ -109,7 +109,7 @@ CODE: data = (guchar *)SvPV(input, input_len); output_len = input_len + purple_cipher_get_block_size(cipher); - SvUPGRADE(output, SVt_PV); + SvUPGRADE_common(output, SVt_PV); buff = (guchar *)SvGROW(output, output_len); ret = purple_cipher_encrypt(cipher, data, input_len, buff, output_len); if (ret >= 0) { @@ -136,7 +136,7 @@ CODE: data = (guchar *)SvPV(input, input_len); output_len = input_len + purple_cipher_get_block_size(cipher); - SvUPGRADE(output, SVt_PV); + SvUPGRADE_common(output, SVt_PV); buff = (guchar *)SvGROW(output, output_len); ret = purple_cipher_decrypt(cipher, data, input_len, buff, output_len); if (ret >= 0) {
--- a/libpurple/plugins/perl/perl-common.h Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/plugins/perl/perl-common.h Sun Oct 06 18:15:19 2013 +0530 @@ -34,6 +34,12 @@ #define PURPLE_PERL_BOOT(x) \ purple_perl_callXS(boot_Purple__##x, cv, mark) +#ifdef HAVE_NEW_SVUPGRADE +# define SvUPGRADE_common(a, b) SvUPGRADE(a, b) +#else +# define SvUPGRADE_common(a, b) if (!SvUPGRADE(a, b)) { croak("Cannot upgrade variable"); } +#endif + typedef struct _PurplePerlInfoStrings PurplePerlInfoStrings; typedef struct
--- a/libpurple/plugins/ssl/ssl-gnutls.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Sun Oct 06 18:15:19 2013 +0530 @@ -309,7 +309,7 @@ gnutls_x509_crt_import (cert, &cert_list[i], GNUTLS_X509_FMT_DER); - gnutls_x509_crt_get_fingerprint(cert, GNUTLS_MAC_SHA, + gnutls_x509_crt_get_fingerprint(cert, GNUTLS_DIG_SHA, fpr_bin, &fpr_bin_sz); fpr_asc = @@ -977,7 +977,7 @@ /* Extract the fingerprint */ g_return_val_if_fail( - 0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_MAC_SHA, + 0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_DIG_SHA, hashbuf, &tmpsz), NULL);
--- a/libpurple/protocols/gg/Makefile.am Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/gg/Makefile.am Sun Oct 06 18:15:19 2013 +0530 @@ -1,6 +1,6 @@ #V=0 #CFLAGS = -g -O0 -GADU_EXTRA = -Wall -Wextra -fno-inline +GADU_EXTRA = #GADU_EXTRA += -Werror pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
--- a/libpurple/protocols/jabber/jabber.h Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/jabber/jabber.h Sun Oct 06 18:15:19 2013 +0530 @@ -316,7 +316,7 @@ typedef struct _JabberBytestreamsStreamhost { char *jid; char *host; - int port; + guint16 port; char *zeroconf; } JabberBytestreamsStreamhost;
--- a/libpurple/protocols/jabber/si.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/jabber/si.c Sun Oct 06 18:15:19 2013 +0530 @@ -58,7 +58,7 @@ STREAM_METHOD_UNKNOWN = 0, STREAM_METHOD_BYTESTREAMS = 2 << 1, STREAM_METHOD_IBB = 2 << 2, - STREAM_METHOD_UNSUPPORTED = 2 << 31 + STREAM_METHOD_UNSUPPORTED = 2 << 30 } stream_method; GList *streamhosts; @@ -616,11 +616,11 @@ return; } - purple_debug_info("jabber", "going to test %hu different methods\n", jsx->rxqueue[1]); + purple_debug_info("jabber", "going to test %u different methods\n", (guint)jsx->rxqueue[1]); for(i=0; i<jsx->rxqueue[1]; i++) { - purple_debug_info("jabber", "testing %hu\n", jsx->rxqueue[i+2]); + purple_debug_info("jabber", "testing %u\n", (guint)jsx->rxqueue[i+2]); if(jsx->rxqueue[i+2] == 0x00) { g_free(jsx->rxqueue); jsx->rxlen = 0;
--- a/libpurple/protocols/msn/msnutils.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/msn/msnutils.c Sun Oct 06 18:15:19 2013 +0530 @@ -124,7 +124,7 @@ } g_snprintf(tag, sizeof(tag), - "<FONT COLOR=\"#%02hx%02hx%02hx\">", + "<FONT COLOR=\"#%02x%02x%02x\">", colors[0] & 0xFF, colors[1] & 0xFF, colors[2] & 0xFF);
--- a/libpurple/protocols/mxit/chunk.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/mxit/chunk.c Sun Oct 06 18:15:19 2013 +0530 @@ -382,7 +382,7 @@ */ int mxit_chunk_create_set_avatar( char* chunkdata, const unsigned char* data, int datalen ) { - const char fileid[MXIT_CHUNK_FILEID_LEN]; + char fileid[MXIT_CHUNK_FILEID_LEN]; int pos = 0; /* id [8 bytes] */
--- a/libpurple/protocols/myspace/myspace.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/myspace/myspace.c Sun Oct 06 18:15:19 2013 +0530 @@ -513,8 +513,7 @@ (*((buf)) = (unsigned char)((data)>>24)&0xff), \ (*((buf)+1) = (unsigned char)((data)>>16)&0xff), \ (*((buf)+2) = (unsigned char)((data)>>8)&0xff), \ - (*((buf)+3) = (unsigned char)(data)&0xff), \ - 4) + (*((buf)+3) = (unsigned char)(data)&0xff)) /** * Compute the base64'd login challenge response based on username, password, nonce, and IPs.
--- a/libpurple/protocols/oscar/family_feedbag.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/oscar/family_feedbag.c Sun Oct 06 18:15:19 2013 +0530 @@ -1161,8 +1161,8 @@ /* Need to add the 0x00d5 TLV to the TLV chain */ csumdata = (guint8 *)g_malloc((iconsumlen+2)*sizeof(guint8)); - aimutil_put8(&csumdata[0], 0x00); - aimutil_put8(&csumdata[1], iconsumlen); + (void)aimutil_put8(&csumdata[0], 0x00); + (void)aimutil_put8(&csumdata[1], iconsumlen); memcpy(&csumdata[2], iconsum, iconsumlen); aim_tlvlist_replace_raw(&tmp->data, 0x00d5, (iconsumlen+2) * sizeof(guint8), csumdata); g_free(csumdata);
--- a/libpurple/protocols/oscar/oscar.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/oscar/oscar.c Sun Oct 06 18:15:19 2013 +0530 @@ -1669,7 +1669,7 @@ purple_debug_info("oscar", "Received a channel 4 message of type 0x%02hx.\n", - args->type); + (guint16)args->type); /* * Split up the message at the delimeter character, then convert each @@ -1914,7 +1914,7 @@ default: { purple_debug_info("oscar", "Received a channel 4 message of unknown type " - "(type 0x%02hx).\n", args->type & 0xFF); + "(type 0x%02x).\n", args->type & 0xFF); } break; } @@ -2264,7 +2264,7 @@ exchangecount = va_arg(ap, int); exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); - g_string_append_printf(msg, "chat info: Max Concurrent Rooms: %hd, Exchange List (%d total): ", maxrooms, exchangecount); + g_string_append_printf(msg, "chat info: Max Concurrent Rooms: %d, Exchange List (%d total): ", (int)maxrooms, exchangecount); for (i = 0; i < exchangecount; i++) { g_string_append_printf(msg, "%hu", exchanges[i].number); if (exchanges[i].name) { @@ -2305,9 +2305,9 @@ ck = va_arg(ap, char *); purple_debug_misc("oscar", - "created room: %s %hu %hu %hu %u %hu %hu %hu %hu %s %s\n", + "created room: %s %hu %hu %hu %u %hu %hu %u %hu %s %s\n", fqcn ? fqcn : "(null)", exchange, instance, flags, createtime, - maxmsglen, maxoccupancy, createperms, unknown, + maxmsglen, maxoccupancy, (guint)createperms, unknown, name ? name : "(null)", ck); aim_chat_join(od, exchange, ck, instance); } @@ -3907,7 +3907,7 @@ if (perm_deny != 0 && perm_deny != purple_account_get_privacy_type(account)) { purple_debug_info("oscar", - "ssi: changing permdeny from %d to %hu\n", purple_account_get_privacy_type(account), perm_deny); + "ssi: changing permdeny from %d to %u\n", purple_account_get_privacy_type(account), (guint)perm_deny); purple_account_set_privacy_type(account, perm_deny); } } @@ -4171,7 +4171,7 @@ va_end(ap); purple_debug_info("oscar", - "ssi: received authorization reply from %s. Reply is 0x%04hx\n", bn, reply); + "ssi: received authorization reply from %s. Reply is 0x%02hx\n", bn, (guint16)reply); buddy = purple_blist_find_buddy(purple_connection_get_account(gc), bn); if (buddy && (purple_buddy_get_alias_only(buddy)))
--- a/libpurple/protocols/oscar/tlv.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/oscar/tlv.c Sun Oct 06 18:15:19 2013 +0530 @@ -319,7 +319,7 @@ { guint8 v8[1]; - aimutil_put8(v8, value); + (void)aimutil_put8(v8, value); return aim_tlvlist_add_raw(list, type, 1, v8); } @@ -336,7 +336,7 @@ { guint8 v16[2]; - aimutil_put16(v16, value); + (void)aimutil_put16(v16, value); return aim_tlvlist_add_raw(list, type, 2, v16); } @@ -353,7 +353,7 @@ { guint8 v32[4]; - aimutil_put32(v32, value); + (void)aimutil_put32(v32, value); return aim_tlvlist_add_raw(list, type, 4, v32); } @@ -585,7 +585,7 @@ { guint8 v8[1]; - aimutil_put8(v8, value); + (void)aimutil_put8(v8, value); return aim_tlvlist_replace_raw(list, type, 1, v8); } @@ -604,7 +604,7 @@ { guint8 v32[4]; - aimutil_put32(v32, value); + (void)aimutil_put32(v32, value); return aim_tlvlist_replace_raw(list, type, 4, v32); }
--- a/libpurple/protocols/oscar/userinfo.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/protocols/oscar/userinfo.c Sun Oct 06 18:15:19 2013 +0530 @@ -335,11 +335,11 @@ if ((bi != NULL) && (bi->ipaddr != 0)) { char tmp2[40]; - sprintf(tmp2, "%hhu.%hhu.%hhu.%hhu", - (bi->ipaddr & 0xff000000) >> 24, - (bi->ipaddr & 0x00ff0000) >> 16, - (bi->ipaddr & 0x0000ff00) >> 8, - (bi->ipaddr & 0x000000ff)); + sprintf(tmp2, "%u.%u.%u.%u", + 0xFF & ((bi->ipaddr & 0xff000000) >> 24), + 0xFF & ((bi->ipaddr & 0x00ff0000) >> 16), + 0xFF & ((bi->ipaddr & 0x0000ff00) >> 8), + 0xFF & (bi->ipaddr & 0x000000ff)); purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), tmp2); } @@ -399,11 +399,11 @@ oscar_user_info_convert_and_add(account, od, user_info, _("Nick"), info->nick); if ((bi != NULL) && (bi->ipaddr != 0)) { char tstr[40]; - sprintf(tstr, "%hhu.%hhu.%hhu.%hhu", - (bi->ipaddr & 0xff000000) >> 24, - (bi->ipaddr & 0x00ff0000) >> 16, - (bi->ipaddr & 0x0000ff00) >> 8, - (bi->ipaddr & 0x000000ff)); + sprintf(tstr, "%u.%u.%u.%u", + 0xFF & ((bi->ipaddr & 0xff000000) >> 24), + 0xFF & ((bi->ipaddr & 0x00ff0000) >> 16), + 0xFF & ((bi->ipaddr & 0x0000ff00) >> 8), + 0xFF & ((bi->ipaddr & 0x000000ff))); purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), tstr); } oscar_user_info_convert_and_add(account, od, user_info, _("First Name"), info->first);
--- a/libpurple/util.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/util.c Sun Oct 06 18:15:19 2013 +0530 @@ -166,7 +166,7 @@ ascii = g_malloc(len * 2 + 1); for (i = 0; i < len; i++) - g_snprintf(&ascii[i * 2], 3, "%02hx", data[i] & 0xFF); + g_snprintf(&ascii[i * 2], 3, "%02x", data[i] & 0xFF); return ascii; } @@ -234,7 +234,7 @@ ascii = g_malloc(len * 3 + 1); for (i = 0; i < len; i++) - g_snprintf(&ascii[i * 3], 4, "%02hx:", data[i] & 0xFF); + g_snprintf(&ascii[i * 3], 4, "%02x:", data[i] & 0xFF); /* Replace the final colon with NULL */ ascii[len * 3 - 1] = 0; @@ -3750,7 +3750,7 @@ for (i = 0; i < len; i++) if (binary[i] < 32 || binary[i] > 126) - g_string_append_printf(ret, "\\x%02hx", binary[i] & 0xFF); + g_string_append_printf(ret, "\\x%02x", binary[i] & 0xFF); else if (binary[i] == '\\') g_string_append(ret, "\\\\"); else
--- a/libpurple/xfer.c Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/xfer.c Sun Oct 06 18:15:19 2013 +0530 @@ -63,8 +63,8 @@ FILE *dest_fp; /**< The destination file pointer. */ char *remote_ip; /**< The remote IP address. */ - int local_port; /**< The local port. */ - int remote_port; /**< The remote port. */ + guint16 local_port; /**< The local port. */ + guint16 remote_port; /**< The remote port. */ int fd; /**< The socket file descriptor. */ int watcher; /**< Watcher. */ @@ -842,7 +842,7 @@ (double)purple_xfer_get_size(xfer)); } -unsigned int +guint16 purple_xfer_get_local_port(const PurpleXfer *xfer) { PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); @@ -862,7 +862,7 @@ return priv->remote_ip; } -unsigned int +guint16 purple_xfer_get_remote_port(const PurpleXfer *xfer) { PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); @@ -1013,7 +1013,7 @@ } void -purple_xfer_set_local_port(PurpleXfer *xfer, unsigned int local_port) +purple_xfer_set_local_port(PurpleXfer *xfer, guint16 local_port) { PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); @@ -1571,8 +1571,7 @@ } void -purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, - unsigned int port) +purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, guint16 port) { PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer); PurpleInputCondition cond;
--- a/libpurple/xfer.h Thu Oct 03 06:47:52 2013 +0530 +++ b/libpurple/xfer.h Sun Oct 06 18:15:19 2013 +0530 @@ -354,7 +354,7 @@ * * @return The port number on this end. */ -unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer); +guint16 purple_xfer_get_local_port(const PurpleXfer *xfer); /** * Returns the remote IP address in the file transfer. @@ -372,7 +372,7 @@ * * @return The port number on the other end. */ -unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer); +guint16 purple_xfer_get_remote_port(const PurpleXfer *xfer); /** * Returns the time the transfer of a file started. @@ -471,7 +471,7 @@ * @param xfer The file transfer. * @param local_port The local port. */ -void purple_xfer_set_local_port(PurpleXfer *xfer, unsigned int local_port); +void purple_xfer_set_local_port(PurpleXfer *xfer, guint16 local_port); /** * Sets the current working position in the active file transfer. This @@ -637,8 +637,7 @@ * @param ip The IP address to connect to. * @param port The port to connect to. */ -void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, - unsigned int port); +void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, guint16 port); /** * Ends a file transfer.
--- a/pidgin/gtkimhtml.c Thu Oct 03 06:47:52 2013 +0530 +++ b/pidgin/gtkimhtml.c Sun Oct 06 18:15:19 2013 +0530 @@ -733,7 +733,7 @@ } if (GTK_IMHTML(imhtml)->tip) { - if ((tip == GTK_IMHTML(imhtml)->tip)) { + if (tip == GTK_IMHTML(imhtml)->tip) { g_slist_free(tags); return FALSE; }
--- a/pidgin/gtksourceiter.c Thu Oct 03 06:47:52 2013 +0530 +++ b/pidgin/gtksourceiter.c Sun Oct 06 18:15:19 2013 +0530 @@ -575,10 +575,11 @@ g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (str != NULL, FALSE); - if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) - return gtk_text_iter_forward_search (iter, str, flags, - match_start, match_end, - limit); + if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) { + return gtk_text_iter_forward_search (iter, str, + (GtkTextSearchFlags)flags, match_start, match_end, + limit); + } if (limit && gtk_text_iter_compare (iter, limit) >= 0) return FALSE; @@ -678,10 +679,11 @@ g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (str != NULL, FALSE); - if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) - return gtk_text_iter_backward_search (iter, str, flags, - match_start, match_end, - limit); + if ((flags & GTK_SOURCE_SEARCH_CASE_INSENSITIVE) == 0) { + return gtk_text_iter_backward_search (iter, str, + (GtkTextSearchFlags)flags, match_start, match_end, + limit); + } if (limit && gtk_text_iter_compare (iter, limit) <= 0) return FALSE;