From ccf002223ce06012bf6bd94af7e17e132b0c43b1 Mon Sep 17 00:00:00 2001 From: "Devon H. O'Dell" Date: Wed, 2 Mar 2011 23:12:56 -0500 Subject: [PATCH] x86: fix btX functions C casts to unsigned int by default, so we were experiencing some negative undefined behavior in the 1 << 31 case. x86 now works; bts and btc are both passing. --- include/ck_pr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ck_pr.h b/include/ck_pr.h index bd5acff..29bb1a9 100644 --- a/include/ck_pr.h +++ b/include/ck_pr.h @@ -303,7 +303,7 @@ CK_PR_BIN_S(or, 8, uint8_t, |) punt = ck_pr_load_##S(target); \ previous = (T)punt; \ while (ck_pr_cas_##S##_value(target, (C)previous, \ - (C)(previous P (R (1 << offset))), &previous) == false) \ + (C)(previous P (R ((T)1 << offset))), &previous) == false) \ ck_pr_stall(); \ return ((previous >> offset) & 1); \ }