Util/Macros: replacement for GLib's G_N_ELEMENTS()

This commit is contained in:
Max Kellermann
2013-10-15 22:04:17 +02:00
parent 77429b6dd3
commit 509f8dab89
19 changed files with 100 additions and 58 deletions

View File

@@ -19,6 +19,7 @@
#include "config.h"
#include "UpdateQueue.hxx"
#include "util/Macros.hxx"
#include <glib.h>
@@ -36,9 +37,9 @@ static size_t update_queue_length;
unsigned
update_queue_push(const char *path, bool discard, unsigned base)
{
assert(update_queue_length <= G_N_ELEMENTS(update_queue));
assert(update_queue_length <= ARRAY_SIZE(update_queue));
if (update_queue_length == G_N_ELEMENTS(update_queue))
if (update_queue_length == ARRAY_SIZE(update_queue))
return 0;
update_queue[update_queue_length].path = g_strdup(path);