summaryrefslogtreecommitdiff
path: root/src/core/collections.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/collections.c')
-rw-r--r--src/core/collections.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/core/collections.c b/src/core/collections.c
index c00c760..2f28857 100644
--- a/src/core/collections.c
+++ b/src/core/collections.c
@@ -93,7 +93,9 @@ uint32_t register_collection_type(GType items)
bool load_hard_coded_collection_definitions(void)
{
+#ifndef NDEBUG
uint32_t id; /* Identifiant unique retourné */
+#endif
/**
* La liste des chargements doit se faire dans le même ordre que
@@ -101,17 +103,22 @@ bool load_hard_coded_collection_definitions(void)
* afin de garder la correspondance entre les identifiants.
*/
- id = register_collection_type(G_TYPE_BM_COLLECTION);
- assert(id == DBF_BOOKMARKS);
+#ifndef NDEBUG
+# define REGISTER_COLLECTION(tp, exp) \
+ id = register_collection_type(tp); \
+ assert(id == exp);
+#else
+# define REGISTER_COLLECTION(tp, exp) \
+ register_collection_type(tp);
+#endif
- id = register_collection_type(G_TYPE_COMMENT_COLLECTION);
- assert(id == DBF_COMMENTS);
+ REGISTER_COLLECTION(G_TYPE_BM_COLLECTION, DBF_BOOKMARKS);
- id = register_collection_type(G_TYPE_MOVE_COLLECTION);
- assert(id == DBF_MOVES);
+ REGISTER_COLLECTION(G_TYPE_COMMENT_COLLECTION, DBF_COMMENTS);
- id = register_collection_type(G_TYPE_SWITCHER_COLLECTION);
- assert(id == DBF_DISPLAY_SWITCHERS);
+ REGISTER_COLLECTION(G_TYPE_MOVE_COLLECTION, DBF_MOVES);
+
+ REGISTER_COLLECTION(G_TYPE_SWITCHER_COLLECTION, DBF_DISPLAY_SWITCHERS);
return true;