diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-08-06 22:55:33 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-08-06 22:55:33 (GMT) |
commit | ae2be2044d39abebfa7b8d5ce64571e72f7ff6fd (patch) | |
tree | 71b2a2bc85ec23100c9d584bcd7409080418af53 /src/core | |
parent | b070fb755b9e32bfa80e8854606f431d285ca23e (diff) |
Removed some compilation warnings.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/collections.c | 23 |
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; |