summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-10-09 00:14:46 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-10-09 00:14:46 +0400
commit298451dccf9d2635b5975f2da454c5b3ad42cdad (patch)
treefe58dff5eaae7e2602cd4ecb2341608907df14df /tests
parent1b3c02cfe3214e4d91314d4eec2ca9d28aa58cc3 (diff)
downloadlibatomic_ops-298451dccf9d2635b5975f2da454c5b3ad42cdad.tar.gz
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).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_atomic_include.template8
1 files changed, 4 insertions, 4 deletions
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