mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-04 20:59:21 +02:00
gtestutils.h: Fix warning with -Wsign-conversion caused by g_assert_cmpint
With gcc and clang using -Wsign-conversion a related warning is generated if code using glib 2.78.0 contains function g_assert_cmpint(). Warning is fixed by adding related casts. Related tests have been also updated and will be also compiled with -Wsign-conversion to detect related problems in future.
This commit is contained in:

committed by
Philip Withnall
parent
0b72e54c49
commit
9560e149b5
@@ -54,7 +54,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
|
||||
gint64 __n1 = (n1), __n2 = (n2); \
|
||||
if (__n1 cmp __n2) ; else \
|
||||
g_assertion_message_cmpint (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
#n1 " " #cmp " " #n2, __n1, #cmp, __n2, 'i'); \
|
||||
#n1 " " #cmp " " #n2, (guint64)__n1, #cmp, (guint64)__n2, 'i'); \
|
||||
} G_STMT_END
|
||||
#define g_assert_cmpuint(n1, cmp, n2) G_STMT_START { \
|
||||
guint64 __n1 = (n1), __n2 = (n2); \
|
||||
|
Reference in New Issue
Block a user