std-aux: add static-asserts about signedness for NM_CMP_DIRECT()

This commit is contained in:
Thomas Haller 2023-07-31 11:48:40 +02:00
parent f27bf0b9ea
commit 5fe6b63a62
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1307,6 +1307,8 @@ nm_ptr_to_uintptr(const void *p)
typeof(a) _a = (a); \ typeof(a) _a = (a); \
typeof(b) _b = (b); \ typeof(b) _b = (b); \
\ \
G_STATIC_ASSERT(_NM_INT_SAME_SIGNEDNESS(_a, _b)); \
\
if (_a != _b) \ if (_a != _b) \
return (_a < _b) ? -1 : 1; \ return (_a < _b) ? -1 : 1; \
} while (0) } while (0)