mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 07:40:08 +01:00
std-aux: add static-asserts about signedness for NM_CMP_DIRECT()
This commit is contained in:
parent
f27bf0b9ea
commit
5fe6b63a62
1 changed files with 9 additions and 7 deletions
|
|
@ -1302,13 +1302,15 @@ nm_ptr_to_uintptr(const void *p)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_CMP_DIRECT(a, b) \
|
||||
do { \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
\
|
||||
if (_a != _b) \
|
||||
return (_a < _b) ? -1 : 1; \
|
||||
#define NM_CMP_DIRECT(a, b) \
|
||||
do { \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
\
|
||||
G_STATIC_ASSERT(_NM_INT_SAME_SIGNEDNESS(_a, _b)); \
|
||||
\
|
||||
if (_a != _b) \
|
||||
return (_a < _b) ? -1 : 1; \
|
||||
} while (0)
|
||||
|
||||
#define NM_CMP_DIRECT_UNSAFE(a, b) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue