From: Michal Vaner Date: Sun, 20 Jul 2008 21:34:26 +0000 (+0200) Subject: Libucw: Add ROR (bitwise ROtation to Right) X-Git-Tag: holmes-import~375 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=eeb2c0a84c12ae9825bd9e12a4364430a6abe495;p=libucw.git Libucw: Add ROR (bitwise ROtation to Right) --- diff --git a/ucw/lib.h b/ucw/lib.h index c473343c..e4352ee8 100644 --- a/ucw/lib.h +++ b/ucw/lib.h @@ -43,7 +43,8 @@ #define COMPARE_LT(x,y) do { if ((x)<(y)) return 1; if ((x)>(y)) return 0; } while(0) #define COMPARE_GT(x,y) COMPARE_LT(y,x) -#define ROL(x, bits) (((x) << (bits)) | ((x) >> (sizeof(uns)*8 - (bits)))) /* Bitwise rotation of an uns to the left */ +#define ROL(x, bits) (((x) << (bits)) | ((uns)(x) >> (sizeof(uns)*8 - (bits)))) /* Bitwise rotation of an uns to the left */ +#define ROR(x, bits) (((uns)(x) >> (bits)) | ((x) << (sizeof(uns)*8 - (bits)))) /* GCC Extensions */