pidgin: a543de79: Qulogic pointed out that glib has G_N_EL...

khc at pidgin.im khc at pidgin.im
Sun May 10 18:30:27 EDT 2009


-----------------------------------------------------------------
Revision: a543de79fc730fb1a32056d0da5abe0044ed9533
Ancestor: 66eb0916d2f9dd7b89e178411d116e41c93687dc
Author: khc at pidgin.im
Date: 2009-05-10T22:29:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a543de79fc730fb1a32056d0da5abe0044ed9533

Modified files:
        libpurple/internal.h libpurple/protocols/myspace/myspace.c

ChangeLog: 

Qulogic pointed out that glib has G_N_ELEMENTS already


-------------- next part --------------
============================================================
--- libpurple/internal.h	3a629baabf83974b085f126561edb8d19317879d
+++ libpurple/internal.h	dbc124585e288c7bdf107fd6594bc5518cda0ee7
@@ -256,10 +256,6 @@ type_name##_get_type (void) \
 
 #endif
 
-#ifndef ARRAY_LENGTH
-#define ARRAY_LENGTH(arr) (sizeof(arr) / sizeof(*arr))
-#endif
-
 /* Safer ways to work with static buffers. When using non-static
  * buffers, either use g_strdup_* functions (preferred) or use
  * g_strlcpy/g_strlcpy directly. */
============================================================
--- libpurple/protocols/myspace/myspace.c	67e505fcd6dc9d690b5d31fbe267be2f68fa1d0c
+++ libpurple/protocols/myspace/myspace.c	9891cd24a970ca416cb5be9d107b1e82fea993f5
@@ -861,10 +861,10 @@ msim_check_inbox_cb(MsimSession *session
 		{ "FriendRequest", MSIM_INBOX_FRIEND_REQUEST, "http://messaging.myspace.com/index.cfm?fuseaction=mail.friendRequests", NULL },
 		{ "PictureComment", MSIM_INBOX_PICTURE_COMMENT, "http://home.myspace.com/index.cfm?fuseaction=user", NULL }
 	};
-	const gchar *froms[ARRAY_LENGTH(message_types) + 1] = { "" },
-		*tos[ARRAY_LENGTH(message_types) + 1] = { "" },
-		*urls[ARRAY_LENGTH(message_types) + 1] = { "" },
-		*subjects[ARRAY_LENGTH(message_types) + 1] = { "" };
+	const gchar *froms[G_N_ELEMENTS(message_types) + 1] = { "" },
+		*tos[G_N_ELEMENTS(message_types) + 1] = { "" },
+		*urls[G_N_ELEMENTS(message_types) + 1] = { "" },
+		*subjects[G_N_ELEMENTS(message_types) + 1] = { "" };
 
 	g_return_if_fail(reply != NULL);
 
@@ -886,7 +886,7 @@ msim_check_inbox_cb(MsimSession *session
 
 	n = 0;
 
-	for (i = 0; i < sizeof(message_types) / sizeof(message_types[0]); ++i) {
+	for (i = 0; i < G_N_ELEMENTS(message_types); ++i) {
 		const gchar *key;
 		guint bit;
 


More information about the Commits mailing list