mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-05 05:09:21 +02:00
gtester: Explicitly convert arguments of g_assert_cmpfloat()
Using g_assert_cmpfloat() with a float or double causes warnings on the newest Clang version, because the macro internally promotes all values to a long double, which Clang warns about. Casting explicitly removes the warning. Closes: #1377
This commit is contained in:
@@ -64,7 +64,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
|
|||||||
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'x'); \
|
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'x'); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
#define g_assert_cmpfloat(n1,cmp,n2) G_STMT_START { \
|
#define g_assert_cmpfloat(n1,cmp,n2) G_STMT_START { \
|
||||||
long double __n1 = (n1), __n2 = (n2); \
|
long double __n1 = (long double) (n1), __n2 = (long double) (n2); \
|
||||||
if (__n1 cmp __n2) ; else \
|
if (__n1 cmp __n2) ; else \
|
||||||
g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||||
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'f'); \
|
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'f'); \
|
||||||
|
Reference in New Issue
Block a user