aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2013-03-13 21:58:53 +0100
committerMike Pall <mike>2013-03-13 21:58:53 +0100
commiteea48c8b263f4fb294200f394764a6eba1de877a (patch)
tree8d739efbe1a2362497d6a6da961c2df11e58ff3b
parentdac2825e9d626d910fc2657d1d9b68d225f18b57 (diff)
downloadluajit-eea48c8b263f4fb294200f394764a6eba1de877a.tar.gz
luajit-eea48c8b263f4fb294200f394764a6eba1de877a.tar.bz2
luajit-eea48c8b263f4fb294200f394764a6eba1de877a.zip
Fix rotate definitions for variable shifts.
-rw-r--r--src/lj_def.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_def.h b/src/lj_def.h
index 83eb67bc..250729f7 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -101,8 +101,8 @@ typedef unsigned int uintptr_t;
101#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) 101#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
102 102
103/* Every half-decent C compiler transforms this into a rotate instruction. */ 103/* Every half-decent C compiler transforms this into a rotate instruction. */
104#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(8*sizeof(x)-(n)))) 104#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1))))
105#define lj_ror(x, n) (((x)<<(8*sizeof(x)-(n))) | ((x)>>(n))) 105#define lj_ror(x, n) (((x)<<(-(int)(n)&(8*sizeof(x)-1))) | ((x)>>(n)))
106 106
107/* A really naive Bloom filter. But sufficient for our needs. */ 107/* A really naive Bloom filter. But sufficient for our needs. */
108typedef uintptr_t BloomFilter; 108typedef uintptr_t BloomFilter;