# HG changeset patch # User Ka-Hing Cheung # Date 1241994568 0 # Node ID ef61a2b746bda982e4882ee06875241a098c1a40 # Parent 88f1db1da582eb3efded7b834dd2f4eb40d3a5d6 Qulogic pointed out that glib has G_N_ELEMENTS already diff -r 88f1db1da582 -r ef61a2b746bd libpurple/internal.h --- 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. */ diff -r 88f1db1da582 -r ef61a2b746bd libpurple/protocols/myspace/myspace.c --- 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;