From 298451dccf9d2635b5975f2da454c5b3ad42cdad Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 9 Oct 2012 00:14:46 +0400 Subject: Eliminate warning for fetch_and_add argument in test_atomic_include * tests/test_atomic_include.template (test_atomicXX): Cast negative "incr" argument (passed to fetch_and_add) to the unsigned proper type (to eliminate MS VC compiler "signed/unsigned mismatch" warning). --- tests/test_atomic_include.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_atomic_include.template b/tests/test_atomic_include.template index 8d4efc7..0001fa7 100644 --- a/tests/test_atomic_include.template +++ b/tests/test_atomic_include.template @@ -73,7 +73,7 @@ void test_atomicXX(void) # endif # if defined(AO_HAVE_fetch_and_addXX) TA_assert(AO_fetch_and_addXX(&x, 42) == 13); - TA_assert(AO_fetch_and_addXX(&x, -42) == 55); + TA_assert(AO_fetch_and_addXX(&x, (AO_t)(-42)) == 55); # else MISSING(AO_fetch_and_add); # endif @@ -111,7 +111,7 @@ void test_atomicXX(void) # endif # if defined(AO_HAVE_short_fetch_and_addXX) TA_assert(AO_short_fetch_and_addXX(&s, 42) == 13); - TA_assert(AO_short_fetch_and_addXX(&s, -42) == 55); + TA_assert(AO_short_fetch_and_addXX(&s, (unsigned short)-42) == 55); # else MISSING(AO_short_fetch_and_add); # endif @@ -148,7 +148,7 @@ void test_atomicXX(void) # endif # if defined(AO_HAVE_char_fetch_and_addXX) TA_assert(AO_char_fetch_and_addXX(&b, 42) == 13); - TA_assert(AO_char_fetch_and_addXX(&b, -42) == 55); + TA_assert(AO_char_fetch_and_addXX(&b, (unsigned char)-42) == 55); # else MISSING(AO_char_fetch_and_add); # endif @@ -185,7 +185,7 @@ void test_atomicXX(void) # endif # if defined(AO_HAVE_int_fetch_and_addXX) TA_assert(AO_int_fetch_and_addXX(&zz, 42) == 13); - TA_assert(AO_int_fetch_and_addXX(&zz, -42) == 55); + TA_assert(AO_int_fetch_and_addXX(&zz, (unsigned int)-42) == 55); # else MISSING(AO_int_fetch_and_add); # endif -- cgit v1.2.1