From eeb2c0a84c12ae9825bd9e12a4364430a6abe495 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 20 Jul 2008 23:34:26 +0200 Subject: [PATCH] Libucw: Add ROR (bitwise ROtation to Right) --- ucw/lib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.39.2