]> mj.ucw.cz Git - libucw.git/commitdiff
Moved ROL() to lib.h.
authorMartin Mares <mj@ucw.cz>
Sun, 2 Oct 2005 11:22:35 +0000 (11:22 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 2 Oct 2005 11:22:35 +0000 (11:22 +0000)
lib/hashfunc.h
lib/lib.h

index c10f224910d9ba563ef401adc45ae57db011912a..e60e3f70628f38feaa843374f2e665ef9a3ac7df 100644 (file)
@@ -13,9 +13,6 @@
 
 #include "lib/lib.h"
 
-/* An equivalent of the Intel's rol instruction.  */
-#define        ROL(x, bits)    (((x) << (bits)) | ((x) >> (sizeof(uns)*8 - (bits))))
-
 /* The following functions need str to be aligned to uns.  */
 uns str_len_aligned(const byte *str) CONST;
 uns hash_string_aligned(const byte *str) CONST;
index a1e2b79238c86c2c8cce1779480179518d58a853..476061691bbf8d8e416059d2d673acc6f36d98de 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -43,6 +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 */
+
 /* GCC Extensions */
 
 #ifdef __GNUC__