From: Ivan Maidanski Date: Mon, 8 Oct 2012 20:14:46 +0000 (+0400) Subject: Eliminate warning for fetch_and_add argument in test_atomic_include X-Git-Tag: libatomic_ops-7_4_0~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=298451dccf9d2635b5975f2da454c5b3ad42cdad;p=libatomic_ops 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). --- 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