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:
@@ -1564,8 +1564,6 @@ fcn_name (const char *name) \
|
|||||||
__VA_ARGS__ \
|
__VA_ARGS__ \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
{ entry_cmd; } \
|
|
||||||
\
|
|
||||||
if (NM_MORE_ASSERT_ONCE (5)) { \
|
if (NM_MORE_ASSERT_ONCE (5)) { \
|
||||||
int i; \
|
int i; \
|
||||||
\
|
\
|
||||||
@@ -1576,6 +1574,8 @@ fcn_name (const char *name) \
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
{ entry_cmd; } \
|
||||||
|
\
|
||||||
if (G_LIKELY (name)) { \
|
if (G_LIKELY (name)) { \
|
||||||
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) > 1); \
|
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) > 1); \
|
||||||
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) < G_MAXUINT / 2u - 10u); \
|
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) < G_MAXUINT / 2u - 10u); \
|
||||||
|
Reference in New Issue
Block a user