pidgin: a995956b: Tweak a few for loop conditions in the P...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Thu Dec 11 03:46:21 EST 2008


-----------------------------------------------------------------
Revision: a995956bdd592e01a1bec1387de8e4a97c4d0450
Ancestor: 0538a6873b4fbb3c72cc0b6fc4d8b690d467686d
Author: rekkanoryo at pidgin.im
Date: 2008-12-11T06:48:25
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a995956bdd592e01a1bec1387de8e4a97c4d0450

Modified files:
        libpurple/plugins/perl/common/Account.xs
        libpurple/plugins/perl/common/AccountOpts.xs
        libpurple/plugins/perl/common/Conversation.xs
        libpurple/plugins/perl/common/Prefs.xs
        libpurple/plugins/perl/common/Roomlist.xs
        libpurple/plugins/perl/common/Status.xs
        pidgin/plugins/perl/common/GtkIMHtml.xs

ChangeLog: 

Tweak a few for loop conditions in the Perl bindings per Etan's suggestion.
References #7687.

-------------- next part --------------
============================================================
--- libpurple/plugins/perl/common/Account.xs	3caae5ee8b8b68b6a59bd6759cc0db88f87716d9
+++ libpurple/plugins/perl/common/Account.xs	68aa8b1102d856e790068bf0400e19d5509b2b3c
@@ -107,7 +107,7 @@ PPCODE:
     t_GL = NULL;
     t_len = av_len((AV *)SvRV(status_types)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(status_types), i, 0)));
 
     purple_account_set_status_types(account, t_GL);
@@ -209,7 +209,7 @@ PPCODE:
     t_GL = NULL;
     t_len = av_len((AV *)SvRV(list)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(list), i, 0)));
 
     purple_account_add_buddies(account, t_GL);
@@ -238,13 +238,13 @@ PPCODE:
     t_GL1 = NULL;
     t_len = av_len((AV *)SvRV(A)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL1 = g_list_append(t_GL1, SvPVutf8_nolen(*av_fetch((AV *)SvRV(A), i, 0)));
 
     t_GL2 = NULL;
     t_len = av_len((AV *)SvRV(B)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL2 = g_list_append(t_GL2, SvPVutf8_nolen(*av_fetch((AV *)SvRV(B), i, 0)));
 
     purple_account_remove_buddies(account, t_GL1, t_GL2);
============================================================
--- libpurple/plugins/perl/common/AccountOpts.xs	f8f8960467922af88584635ffcfe5341a04b4150
+++ libpurple/plugins/perl/common/AccountOpts.xs	25f6bbb4f9a518529f327a4e255cad588244165a
@@ -44,7 +44,7 @@ CODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(values)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
 
 	RETVAL  = purple_account_option_list_new(text, pref_name, t_GL);
@@ -132,7 +132,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(values)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
 
 	purple_account_option_set_list(option, t_GL);
============================================================
--- libpurple/plugins/perl/common/Conversation.xs	96b8be4ea6755d28fd659b0211d9c4857e63654b
+++ libpurple/plugins/perl/common/Conversation.xs	67a74991cf732fd07f09a72e85444de9658222e5
@@ -336,7 +336,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(users)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
 
 	for (l = purple_conv_chat_set_users(chat, t_GL); l != NULL; l = l->next) {
@@ -374,7 +374,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(ignored)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(ignored), i, 0)));
 
 	for (l = purple_conv_chat_set_ignored(chat, t_GL); l != NULL; l = l->next) {
@@ -431,19 +431,19 @@ PPCODE:
 	t_GL_users = NULL;
 	t_len = av_len((AV *)SvRV(users)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_users = g_list_append(t_GL_users, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
 
 	t_GL_flags = NULL;
 	t_len = av_len((AV *)SvRV(flags)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_flags = g_list_append(t_GL_flags, SvPVutf8_nolen(*av_fetch((AV *)SvRV(flags), i, 0)));
 
 	t_GL_extra_msgs = NULL;
 	t_len = av_len((AV *)SvRV(extra_msgs)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_extra_msgs = g_list_append(t_GL_extra_msgs, SvPVutf8_nolen(*av_fetch((AV *)SvRV(extra_msgs), i, 0)));
 
 	purple_conv_chat_add_users(chat, t_GL_users, t_GL_extra_msgs, t_GL_flags, new_arrivals);
============================================================
--- libpurple/plugins/perl/common/Prefs.xs	c504ea24158dc6906116973d8da6814c2dff38b8
+++ libpurple/plugins/perl/common/Prefs.xs	f8e05710e3090ef5c6ad4db5722d1897ba69d88c
@@ -53,7 +53,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_add_string_list(name, t_GL);
@@ -75,7 +75,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_add_path_list(name, t_GL);
@@ -204,7 +204,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_set_string_list(name, t_GL);
@@ -226,7 +226,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_set_path_list(name, t_GL);
============================================================
--- libpurple/plugins/perl/common/Roomlist.xs	e269722b0d7ec13ce6cf111abf49cbe9b451776f
+++ libpurple/plugins/perl/common/Roomlist.xs	4093f36f2b36d0247f4a6be641bb84a40983b5f5
@@ -80,7 +80,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(fields)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(fields), i, 0)));
 
 	purple_roomlist_set_fields(list, t_GL);
============================================================
--- libpurple/plugins/perl/common/Status.xs	4a490e76dadfa22604d6b67bd31f0a298d292487
+++ libpurple/plugins/perl/common/Status.xs	da6f70b1055b47c2c1075e549221b32125af7266
@@ -85,7 +85,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(source_list)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(source_list), i, 0)));
 	}
 	purple_presence_add_list(presence, t_GL);
@@ -381,7 +381,7 @@ CODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(status_types)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(status_types), i, 0)));
 	}
 	RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id);
============================================================
--- pidgin/plugins/perl/common/GtkIMHtml.xs	1c33ca15f34fbd533485baf9d0d5da9942a0deab
+++ pidgin/plugins/perl/common/GtkIMHtml.xs	a5d10b587a0b1db3f8616887f94c13f3cc06d425
@@ -173,7 +173,7 @@ PPCODE:
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(unused)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		STRLEN t_sl;
 		t_GL = g_slist_append(t_GL, SvPV(*av_fetch((AV *)SvRV(unused), i, 0), t_sl));
 	}


More information about the Commits mailing list