From 509f8dab8946cfc311def89f62352c0881e73348 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Oct 2013 22:04:17 +0200 Subject: Util/Macros: replacement for GLib's G_N_ELEMENTS() --- src/StickerDatabase.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/StickerDatabase.cxx') diff --git a/src/StickerDatabase.cxx b/src/StickerDatabase.cxx index 1cd47a605..21bf7706f 100644 --- a/src/StickerDatabase.cxx +++ b/src/StickerDatabase.cxx @@ -23,6 +23,7 @@ #include "Idle.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "util/Macros.hxx" #include "Log.hxx" #include @@ -79,7 +80,7 @@ static const char sticker_sql_create[] = ""; static sqlite3 *sticker_db; -static sqlite3_stmt *sticker_stmt[G_N_ELEMENTS(sticker_sql)]; +static sqlite3_stmt *sticker_stmt[ARRAY_SIZE(sticker_sql)]; static constexpr Domain sticker_domain("sticker"); @@ -138,7 +139,7 @@ sticker_global_init(Path &&path, Error &error) /* prepare the statements we're going to use */ - for (unsigned i = 0; i < G_N_ELEMENTS(sticker_sql); ++i) { + for (unsigned i = 0; i < ARRAY_SIZE(sticker_sql); ++i) { assert(sticker_sql[i] != NULL); sticker_stmt[i] = sticker_prepare(sticker_sql[i], error); @@ -156,7 +157,7 @@ sticker_global_finish(void) /* not configured */ return; - for (unsigned i = 0; i < G_N_ELEMENTS(sticker_stmt); ++i) { + for (unsigned i = 0; i < ARRAY_SIZE(sticker_stmt); ++i) { assert(sticker_stmt[i] != NULL); sqlite3_finalize(sticker_stmt[i]); -- cgit v1.2.3