ck_pr: Add appropriate casts to ck_pr_cas unit test.

ck_pring
Samy Al Bahra 13 years ago
parent 9dd525d9ee
commit 544de60849

@ -37,7 +37,7 @@
#define R_REPEAT 200000 #define R_REPEAT 200000
#endif #endif
#define W(w, x) (x & (uint##w##_t)~0) #define W(w, x) (uint##w##_t)((x) & (uint##w##_t)~0)
#define CK_PR_CAS_T(w, v, c, s) \ #define CK_PR_CAS_T(w, v, c, s) \
{ \ { \
@ -49,7 +49,7 @@
printf("FAIL ["); \ printf("FAIL ["); \
printf("%" PRIu##w " (%" PRIu##w " -> %" PRIu##w ")" \ printf("%" PRIu##w " (%" PRIu##w " -> %" PRIu##w ")" \
" -> %" PRIu##w "]\n", \ " -> %" PRIu##w "]\n", \
(uint##w##_t)v, c, W(w, s), t); \ (uint##w##_t)(v), (uint##w##_t)(c), W(w, s), (uint##w##_t)(t)); \
} \ } \
} }
@ -75,7 +75,7 @@
ck_pr_cas_##w((uint##w##_t *)&t, (uint##w##_t)t, 0); \ ck_pr_cas_##w((uint##w##_t *)&t, (uint##w##_t)t, 0); \
if (t != r) { \ if (t != r) { \
printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", \
t, r); \ (uint##m##_t)t, (uint##m##_t)r); \
} \ } \
} }

Loading…
Cancel
Save