shared: move assertion in _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE()

Move the assertion for valid LIST first. It only checks static data,
and regardless of the entry_cmd, it should be done first.

Fixes: f4d12f7b59 ('shared: add NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE() macro for lookup of structs')
This commit is contained in:
Thomas Haller
2020-03-02 16:17:32 +01:00
parent 8b63fd8cc0
commit 4087024a9b

View File

@@ -1564,8 +1564,6 @@ fcn_name (const char *name) \
__VA_ARGS__ \
}; \
\
{ entry_cmd; } \
\
if (NM_MORE_ASSERT_ONCE (5)) { \
int i; \
\
@@ -1576,6 +1574,8 @@ fcn_name (const char *name) \
} \
} \
\
{ entry_cmd; } \
\
if (G_LIKELY (name)) { \
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) > 1); \
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) < G_MAXUINT / 2u - 10u); \