changeset 26941:ef61a2b746bd

Qulogic pointed out that glib has G_N_ELEMENTS already
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 10 May 2009 22:29:28 +0000
parents 88f1db1da582
children f924c19ad9c2 10d92c213d0f
files libpurple/internal.h libpurple/protocols/myspace/myspace.c
diffstat 2 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/internal.h	Sun May 10 22:24:37 2009 +0000
+++ b/libpurple/internal.h	Sun May 10 22:29:28 2009 +0000
@@ -256,10 +256,6 @@
 
 #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. */
--- a/libpurple/protocols/myspace/myspace.c	Sun May 10 22:24:37 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Sun May 10 22:29:28 2009 +0000
@@ -861,10 +861,10 @@
 		{ "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 @@
 
 	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;