|
@@ -101,8 +101,8 @@ typedef unsigned int uintptr_t;
|
|
#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
|
|
#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
|
|
|
|
|
|
/* Every half-decent C compiler transforms this into a rotate instruction. */
|
|
/* Every half-decent C compiler transforms this into a rotate instruction. */
|
|
-#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(8*sizeof(x)-(n))))
|
|
|
|
-#define lj_ror(x, n) (((x)<<(8*sizeof(x)-(n))) | ((x)>>(n)))
|
|
|
|
|
|
+#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1))))
|
|
|
|
+#define lj_ror(x, n) (((x)<<(-(int)(n)&(8*sizeof(x)-1))) | ((x)>>(n)))
|
|
|
|
|
|
/* A really naive Bloom filter. But sufficient for our needs. */
|
|
/* A really naive Bloom filter. But sufficient for our needs. */
|
|
typedef uintptr_t BloomFilter;
|
|
typedef uintptr_t BloomFilter;
|