mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01: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:
parent
e004d5f397
commit
9e46b2ef11
@ -64,7 +64,7 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
|
||||
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'x'); \
|
||||
} G_STMT_END
|
||||
#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 \
|
||||
g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
#n1 " " #cmp " " #n2, (long double) __n1, #cmp, (long double) __n2, 'f'); \
|
||||
|
Loading…
Reference in New Issue
Block a user