Wed, 17 Apr 2013 20:16:47 +0200
win32: get rid of printf's hh modifier (compatibility)
--- a/libpurple/protocols/jabber/si.c Wed Apr 17 18:56:03 2013 +0200 +++ b/libpurple/protocols/jabber/si.c Wed Apr 17 20:16:47 2013 +0200 @@ -616,11 +616,11 @@ return; } - purple_debug_info("jabber", "going to test %hhu different methods\n", jsx->rxqueue[1]); + purple_debug_info("jabber", "going to test %hu different methods\n", jsx->rxqueue[1]); for(i=0; i<jsx->rxqueue[1]; i++) { - purple_debug_info("jabber", "testing %hhu\n", jsx->rxqueue[i+2]); + purple_debug_info("jabber", "testing %hu\n", jsx->rxqueue[i+2]); if(jsx->rxqueue[i+2] == 0x00) { g_free(jsx->rxqueue); jsx->rxlen = 0;
--- a/libpurple/protocols/msn/msnutils.c Wed Apr 17 18:56:03 2013 +0200 +++ b/libpurple/protocols/msn/msnutils.c Wed Apr 17 20:16:47 2013 +0200 @@ -124,8 +124,9 @@ } g_snprintf(tag, sizeof(tag), - "<FONT COLOR=\"#%02hhx%02hhx%02hhx\">", - colors[0], colors[1], colors[2]); + "<FONT COLOR=\"#%02hx%02hx%02hx\">", + colors[0] & 0xFF, colors[1] & 0xFF, + colors[2] & 0xFF); pre = g_string_append(pre, tag); post = g_string_prepend(post, "</FONT>");
--- a/libpurple/protocols/oscar/oscar.c Wed Apr 17 18:56:03 2013 +0200 +++ b/libpurple/protocols/oscar/oscar.c Wed Apr 17 20:16:47 2013 +0200 @@ -898,7 +898,7 @@ msg = g_string_new("Sending hash: "); for (x = 0; x < 16; x++) - g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]); + g_string_append_printf(msg, "%02hx ", m[x] & 0xFF); g_string_append(msg, "\n"); purple_debug_misc("oscar", "%s", msg->str); g_string_free(msg, TRUE); @@ -2072,7 +2072,7 @@ default: { purple_debug_info("oscar", "Received a channel 4 message of unknown type " - "(type 0x%02hhx).\n", args->type); + "(type 0x%02hx).\n", args->type & 0xFF); } break; } @@ -2418,7 +2418,7 @@ exchangecount = va_arg(ap, int); exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); - g_string_append_printf(msg, "chat info: Max Concurrent Rooms: %hhd, Exchange List (%d total): ", maxrooms, exchangecount); + g_string_append_printf(msg, "chat info: Max Concurrent Rooms: %hd, Exchange List (%d total): ", maxrooms, exchangecount); for (i = 0; i < exchangecount; i++) { g_string_append_printf(msg, "%hu", exchanges[i].number); if (exchanges[i].name) { @@ -2459,7 +2459,7 @@ ck = va_arg(ap, char *); purple_debug_misc("oscar", - "created room: %s %hu %hu %hu %u %hu %hu %hhu %hu %s %s\n", + "created room: %s %hu %hu %hu %u %hu %hu %hu %hu %s %s\n", fqcn ? fqcn : "(null)", exchange, instance, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name ? name : "(null)", ck); @@ -3956,7 +3956,7 @@ if (curitem->name && !g_utf8_validate(curitem->name, -1, NULL)) { /* Got node with invalid UTF-8 in the name. Skip it. */ purple_debug_warning("oscar", "ssi: server list contains item of " - "type 0x%04hhx with a non-utf8 name\n", curitem->type); + "type 0x%04hx with a non-utf8 name\n", curitem->type); continue; } @@ -4049,7 +4049,7 @@ if (perm_deny != 0 && perm_deny != purple_account_get_privacy_type(account)) { purple_debug_info("oscar", - "ssi: changing permdeny from %d to %hhu\n", purple_account_get_privacy_type(account), perm_deny); + "ssi: changing permdeny from %d to %hu\n", purple_account_get_privacy_type(account), perm_deny); purple_account_set_privacy_type(account, perm_deny); } } @@ -4313,7 +4313,7 @@ va_end(ap); purple_debug_info("oscar", - "ssi: received authorization reply from %s. Reply is 0x%04hhx\n", bn, reply); + "ssi: received authorization reply from %s. Reply is 0x%04hx\n", bn, reply); buddy = purple_find_buddy(purple_connection_get_account(gc), bn); if (buddy && (purple_buddy_get_alias_only(buddy)))
--- a/libpurple/util.c Wed Apr 17 18:56:03 2013 +0200 +++ b/libpurple/util.c Wed Apr 17 20:16:47 2013 +0200 @@ -166,7 +166,7 @@ ascii = g_malloc(len * 2 + 1); for (i = 0; i < len; i++) - g_snprintf(&ascii[i * 2], 3, "%02hhx", data[i]); + g_snprintf(&ascii[i * 2], 3, "%02hx", 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, "%02hhx:", data[i]); + g_snprintf(&ascii[i * 3], 4, "%02hx:", data[i] & 0xFF); /* Replace the final colon with NULL */ ascii[len * 3 - 1] = 0; @@ -3753,7 +3753,7 @@ for (i = 0; i < len; i++) if (binary[i] < 32 || binary[i] > 126) - g_string_append_printf(ret, "\\x%02hhx", binary[i]); + g_string_append_printf(ret, "\\x%02hx", binary[i] & 0xFF); else if (binary[i] == '\\') g_string_append(ret, "\\\\"); else