mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 07:00:21 +01:00
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:
parent
8b63fd8cc0
commit
4087024a9b
1 changed files with 2 additions and 2 deletions
|
|
@ -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); \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue