shared/tests: add parentheses around arguments of NMTST_SWAP() macro

This commit is contained in:
Thomas Haller
2019-03-22 08:53:27 +01:00
parent 19bd698357
commit 0528c1e978

View File

@@ -1136,12 +1136,13 @@ nmtst_uuid_generate (void)
#endif #endif
#define NMTST_SWAP(x,y) \ #define NMTST_SWAP(x, y) \
G_STMT_START { \ G_STMT_START { \
char __nmtst_swap_temp[sizeof(x) == sizeof(y) ? (signed) sizeof(x) : -1]; \ char __nmtst_swap_temp[sizeof((x)) == sizeof((y)) ? (signed) sizeof((x)) : -1]; \
memcpy(__nmtst_swap_temp, &y, sizeof(x)); \ \
memcpy(&y, &x, sizeof(x)); \ memcpy(__nmtst_swap_temp, &(y), sizeof (__nmtst_swap_temp)); \
memcpy(&x, __nmtst_swap_temp, sizeof(x)); \ memcpy(&(y), &(x), sizeof (__nmtst_swap_temp)); \
memcpy(&(x), __nmtst_swap_temp, sizeof (__nmtst_swap_temp)); \
} G_STMT_END } G_STMT_END
#define nmtst_assert_str_has_substr(str, substr) \ #define nmtst_assert_str_has_substr(str, substr) \