/soc/2013/ankitkv/gobjectification: e9b59dd16117: Merged soc.201...
Ankit Vani
a at nevitus.org
Wed Aug 21 16:13:10 EDT 2013
Changeset: e9b59dd16117f1ce3aed387be24f6172d6180de1
Author: Ankit Vani <a at nevitus.org>
Date: 2013-08-22 01:36 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e9b59dd16117
Description:
Merged soc.2013.gobjectification branch
diffstat:
finch/gntaccount.c | 3 +-
libpurple/accounts.c | 6 ++--
libpurple/accounts.h | 2 +-
libpurple/ciphers/aescipher.c | 4 +-
libpurple/ciphers/des3cipher.c | 29 ++++++++++++++++-----------
libpurple/ciphers/descipher.c | 18 ++++++++++++----
libpurple/ciphers/hmaccipher.c | 2 +-
libpurple/ciphers/pbkdf2cipher.c | 2 +-
libpurple/media/backend-fs2.c | 2 +-
libpurple/plugins/joinpart.c | 2 +-
libpurple/plugins/keyrings/internalkeyring.c | 2 +-
libpurple/plugins/perl/perl-handlers.h | 4 +-
libpurple/plugins/signals-test.c | 2 +-
libpurple/plugins/ssl/ssl-gnutls.c | 6 +++-
libpurple/plugins/tcl/tcl_purple.h | 2 +-
libpurple/plugins/tcl/tcl_ref.c | 4 +-
libpurple/protocols/gg/account.h | 2 +-
libpurple/protocols/gg/libgadu-events.c | 4 +-
libpurple/protocols/gg/pubdir-prpl.c | 5 ++-
libpurple/protocols/gg/utils.c | 4 +-
libpurple/protocols/gg/utils.h | 2 +-
libpurple/protocols/irc/parse.c | 2 +-
libpurple/protocols/jabber/auth_scram.c | 2 +-
libpurple/protocols/jabber/jabber.c | 2 +-
libpurple/protocols/jabber/jutil.c | 10 ++++----
libpurple/protocols/jabber/presence.c | 2 +-
libpurple/protocols/jabber/si.c | 8 +++---
libpurple/protocols/msn/command.c | 2 +-
libpurple/protocols/msn/command.h | 2 +-
libpurple/protocols/msn/directconn.c | 6 ++--
libpurple/protocols/msn/history.c | 2 +-
libpurple/protocols/msn/nexus.c | 8 +++---
libpurple/protocols/msn/nexus.h | 2 +-
libpurple/protocols/msn/notification.c | 4 +-
libpurple/protocols/msn/p2p.c | 4 ++-
libpurple/protocols/msn/servconn.c | 7 ++++-
libpurple/protocols/msn/slplink.c | 4 +-
libpurple/protocols/msn/slpmsg.h | 2 +-
libpurple/protocols/msn/slpmsg_part.c | 2 +-
libpurple/protocols/msn/tlv.c | 2 +-
libpurple/protocols/msn/transaction.c | 2 +-
libpurple/protocols/msn/transaction.h | 2 +-
libpurple/protocols/myspace/myspace.c | 8 ++++--
libpurple/protocols/myspace/persist.h | 4 +-
libpurple/protocols/myspace/user.c | 6 ++--
libpurple/protocols/novell/nmrtf.c | 2 +-
libpurple/protocols/oscar/bstream.c | 7 ++++-
libpurple/protocols/oscar/family_feedbag.c | 2 +-
libpurple/protocols/oscar/oscar.c | 2 +-
libpurple/protocols/oscar/oscar.h | 8 +++---
libpurple/protocols/oscar/tlv.c | 6 ++--
libpurple/protocols/oscar/util.c | 2 +-
libpurple/protocols/silc/buddy.c | 2 +-
libpurple/protocols/silc/chat.c | 22 ++++++++++----------
libpurple/protocols/silc/ops.c | 2 +-
libpurple/protocols/silc/pk.c | 2 +-
libpurple/protocols/yahoo/libymsg.c | 4 ++-
libpurple/protocols/yahoo/libymsg.h | 2 +-
libpurple/protocols/yahoo/util.c | 4 +-
libpurple/protocols/yahoo/yahoo_packet.c | 4 +-
libpurple/protocols/yahoo/yahoo_packet.h | 2 +-
libpurple/protocols/yahoo/ycht.c | 2 +-
libpurple/protocols/zephyr/ZReadAscii.c | 2 +-
libpurple/protocols/zephyr/ZVariables.c | 2 +-
libpurple/protocols/zephyr/Zinternal.c | 4 +-
libpurple/protocols/zephyr/internal.h | 2 +-
libpurple/protocols/zephyr/zephyr.c | 6 +---
libpurple/purple-client.c | 4 +-
libpurple/stun.c | 10 ++++----
libpurple/upnp.c | 10 ++++----
libpurple/util.c | 24 ++++++++++++----------
libpurple/xmlnode.c | 4 +-
pidgin/gtkaccount.c | 3 +-
pidgin/themes/Contents/Resources/main.css | 6 +++++
74 files changed, 195 insertions(+), 159 deletions(-)
diffs (truncated from 1618 to 300 lines):
diff --git a/finch/gntaccount.c b/finch/gntaccount.c
--- a/finch/gntaccount.c
+++ b/finch/gntaccount.c
@@ -755,7 +755,8 @@ account_list_key_pressed_cb(GntWidget *w
count = g_list_length(accounts);
pos = g_list_index(accounts, account);
pos = (move + pos + count + 1) % (count + 1);
- purple_accounts_reorder(account, pos);
+ if (pos >= 0)
+ purple_accounts_reorder(account, pos);
/* I don't like this, but recreating the entire list seems to be
* the easiest way of doing it */
diff --git a/libpurple/accounts.c b/libpurple/accounts.c
--- a/libpurple/accounts.c
+++ b/libpurple/accounts.c
@@ -722,7 +722,7 @@ purple_accounts_delete(PurpleAccount *ac
}
void
-purple_accounts_reorder(PurpleAccount *account, gint new_index)
+purple_accounts_reorder(PurpleAccount *account, guint new_index)
{
gint index;
GList *l;
@@ -732,7 +732,7 @@ purple_accounts_reorder(PurpleAccount *a
index = g_list_index(accounts, account);
- if (index == -1) {
+ if (index < 0) {
purple_debug_error("account",
"Unregistered account (%s) discovered during reorder!\n",
purple_account_get_username(account));
@@ -741,7 +741,7 @@ purple_accounts_reorder(PurpleAccount *a
l = g_list_nth(accounts, index);
- if (new_index > index)
+ if (new_index > (guint)index)
new_index--;
/* Remove the old one. */
diff --git a/libpurple/accounts.h b/libpurple/accounts.h
--- a/libpurple/accounts.h
+++ b/libpurple/accounts.h
@@ -128,7 +128,7 @@ void purple_accounts_delete(PurpleAccoun
* @param account The account to reorder.
* @param new_index The new index for the account.
*/
-void purple_accounts_reorder(PurpleAccount *account, gint new_index);
+void purple_accounts_reorder(PurpleAccount *account, guint new_index);
/**
* Returns a list of all accounts.
diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -154,14 +154,14 @@ purple_aes_cipher_pad_pkcs7(const guchar
static ssize_t
purple_aes_cipher_unpad_pkcs7(guchar input[], size_t in_len)
{
- int padding_len, i;
+ guchar padding_len, i;
size_t out_len;
g_return_val_if_fail(input != NULL, -1);
g_return_val_if_fail(in_len > 0, -1);
padding_len = input[in_len - 1];
- if (padding_len <= 0 || padding_len > PURPLE_AES_BLOCK_SIZE ||
+ if (padding_len == 0 || padding_len > PURPLE_AES_BLOCK_SIZE ||
padding_len > in_len) {
purple_debug_warning("cipher-aes",
"Invalid padding length: %d (total %" G_GSIZE_FORMAT ") - "
diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -108,11 +108,11 @@ static ssize_t
purple_des3_cipher_ecb_encrypt(PurpleDES3Cipher *des3_cipher, const guchar input[],
size_t in_len, guchar output[], size_t out_size)
{
- int offset = 0;
+ gsize offset = 0;
int i = 0;
- int tmp;
+ gsize tmp;
guint8 buf[8] = {0,0,0,0,0,0,0,0};
- ssize_t out_len;
+ gsize out_len;
PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
g_return_val_if_fail(out_size >= in_len, -1);
@@ -130,6 +130,7 @@ purple_des3_cipher_ecb_encrypt(PurpleDES
out_len = in_len;
if (offset < in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
@@ -154,12 +155,13 @@ static ssize_t
purple_des3_cipher_cbc_encrypt(PurpleDES3Cipher *des3_cipher, const guchar input[],
size_t in_len, guchar output[], size_t out_size)
{
- int offset = 0;
+ gsize offset = 0;
int i = 0;
- int tmp;
+ gsize tmp;
guint8 buf[8];
- ssize_t out_len;
+ gsize out_len;
PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
+
memcpy(buf, priv->iv, 8);
g_return_val_if_fail(out_size >= in_len, -1);
@@ -181,6 +183,7 @@ purple_des3_cipher_cbc_encrypt(PurpleDES
out_len = in_len;
if (offset < in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
@@ -223,11 +226,11 @@ static ssize_t
purple_des3_cipher_ecb_decrypt(PurpleDES3Cipher *des3_cipher, const guchar input[],
size_t in_len, guchar output[], size_t out_size)
{
- int offset = 0;
+ gsize offset = 0;
int i = 0;
- int tmp;
+ gsize tmp;
guint8 buf[8] = {0,0,0,0,0,0,0,0};
- ssize_t out_len;
+ gsize out_len;
PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
g_return_val_if_fail(out_size >= in_len, -1);
@@ -246,6 +249,7 @@ purple_des3_cipher_ecb_decrypt(PurpleDES
out_len = in_len;
if (offset < in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
@@ -270,12 +274,12 @@ static ssize_t
purple_des3_cipher_cbc_decrypt(PurpleDES3Cipher *des3_cipher, const guchar input[],
size_t in_len, guchar output[], size_t out_size)
{
- int offset = 0;
+ gsize offset = 0;
int i = 0;
- int tmp;
+ gsize tmp;
guint8 buf[8] = {0,0,0,0,0,0,0,0};
guint8 link[8];
- ssize_t out_len;
+ gsize out_len;
PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
g_return_val_if_fail(out_size >= in_len, -1);
@@ -299,6 +303,7 @@ purple_des3_cipher_cbc_decrypt(PurpleDES
out_len = in_len;
if(offset<in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -430,9 +430,12 @@ purple_des_cipher_encrypt(PurpleCipher *
size_t in_len, guchar output[], size_t out_size)
{
PurpleDESCipher *des_cipher = PURPLE_DES_CIPHER(cipher);
- gint offset = 0, i = 0, tmp;
- guint8 buf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- ssize_t out_len;
+
+ gsize offset = 0;
+ int i = 0;
+ gsize tmp;
+ guint8 buf[8] = {0,0,0,0,0,0,0,0};
+ gsize out_len;
g_return_val_if_fail(out_size >= in_len, -1);
@@ -444,6 +447,7 @@ purple_des_cipher_encrypt(PurpleCipher *
out_len = in_len;
if(offset<in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
@@ -463,9 +467,12 @@ purple_des_cipher_decrypt(PurpleCipher *
size_t in_len, guchar output[], size_t out_size)
{
PurpleDESCipher *des_cipher = PURPLE_DES_CIPHER(cipher);
- int offset = 0, i = 0, tmp;
+
+ gsize offset = 0;
+ int i = 0;
+ gsize tmp;
guint8 buf[8] = {0,0,0,0,0,0,0,0};
- ssize_t out_len;
+ gsize out_len;
g_return_val_if_fail(out_size >= in_len, -1);
@@ -476,6 +483,7 @@ purple_des_cipher_decrypt(PurpleCipher *
out_len = in_len;
if(offset<in_len) {
+ g_return_val_if_fail(in_len >= offset, -1);
out_len += in_len - offset;
g_return_val_if_fail(out_size >= out_len, -1);
tmp = offset;
diff --git a/libpurple/ciphers/hmaccipher.c b/libpurple/ciphers/hmaccipher.c
--- a/libpurple/ciphers/hmaccipher.c
+++ b/libpurple/ciphers/hmaccipher.c
@@ -156,7 +156,7 @@ purple_hmac_cipher_set_key(PurpleCipher
size_t key_len)
{
PurpleHMACCipherPrivate *priv = PURPLE_HMAC_CIPHER_GET_PRIVATE(cipher);
- gint block_size, i;
+ gsize blocksize, i;
guchar *full_key;
g_return_if_fail(priv->hash);
diff --git a/libpurple/ciphers/pbkdf2cipher.c b/libpurple/ciphers/pbkdf2cipher.c
--- a/libpurple/ciphers/pbkdf2cipher.c
+++ b/libpurple/ciphers/pbkdf2cipher.c
@@ -210,7 +210,7 @@ purple_pbkdf2_cipher_digest(PurpleCipher
memset(halfkey, 0, halfkey_len);
for (iter_no = 1; iter_no <= priv->iter_count; iter_no++) {
- int i;
+ guint i;
purple_cipher_reset_state(hash);
diff --git a/libpurple/media/backend-fs2.c b/libpurple/media/backend-fs2.c
--- a/libpurple/media/backend-fs2.c
+++ b/libpurple/media/backend-fs2.c
@@ -1976,7 +1976,7 @@ create_stream(PurpleMediaBackendFs2 *sel
we need to do this to allow them to override when using non-standard
TURN modes, like Google f.ex. */
gboolean got_turn_from_protocol = FALSE;
- int i;
+ guint i;
session = get_session(self, sess_id);
diff --git a/libpurple/plugins/joinpart.c b/libpurple/plugins/joinpart.c
--- a/libpurple/plugins/joinpart.c
+++ b/libpurple/plugins/joinpart.c
@@ -80,7 +80,7 @@ static gboolean should_hide_notice(Purpl
GHashTable *users)
{
PurpleChatConversation *chat;
- int threshold;
+ guint threshold;
struct joinpart_key key;
time_t *last_said;
diff --git a/libpurple/plugins/keyrings/internalkeyring.c b/libpurple/plugins/keyrings/internalkeyring.c
--- a/libpurple/plugins/keyrings/internalkeyring.c
+++ b/libpurple/plugins/keyrings/internalkeyring.c
@@ -326,7 +326,7 @@ intkeyring_decrypt(intkeyring_buff_t *ke
verify_len = strlen(INTKEYRING_VERIFY_STR);
/* Don't remove the len > 0 check! */
- if (plaintext_len > 0 && plaintext_len > verify_len &&
+ if (plaintext_len > 0 && (gsize)plaintext_len > verify_len &&
plaintext[plaintext_len] == '\0')
{
verify_str = (gchar*)plaintext + plaintext_len - verify_len;
diff --git a/libpurple/plugins/perl/perl-handlers.h b/libpurple/plugins/perl/perl-handlers.h
--- a/libpurple/plugins/perl/perl-handlers.h
+++ b/libpurple/plugins/perl/perl-handlers.h
@@ -25,7 +25,7 @@ typedef struct
SV *callback;
SV *data;
PurplePlugin *plugin;
- int iotag;
+ guint iotag;
} PurplePerlTimeoutHandler;
@@ -44,7 +44,7 @@ typedef struct
SV *callback;
SV *data;
PurplePlugin *plugin;
- int iotag;
More information about the Commits
mailing list