j
k
j a
j l
...#define ROTL32(n,x) (((x)<<(n)) | ((x)>>((-(n)&31))))
#define ROTL32(n,x) (((x)<<(n)) | ((x)>>((-(n)&31))))
The problem is n==0, not n==32. So this fixes the undefined behavior:
#define ROTL32(n,x) ((n)==0?(x):(((x)<<(n)) | ((x)>>(32-(n)))))
John
Back to the thread
Back to the list