X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fhashfunc.h;h=fc836b3848588a7945b26380caa65dbac4355580;hb=b4d79987a979bcbf749294c706fdc8c4ae8f9304;hp=c10f224910d9ba563ef401adc45ae57db011912a;hpb=64ee91ff842aa42160eb7a22c96049aab86d39ab;p=libucw.git diff --git a/lib/hashfunc.h b/lib/hashfunc.h index c10f2249..fc836b38 100644 --- a/lib/hashfunc.h +++ b/lib/hashfunc.h @@ -13,25 +13,22 @@ #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; -uns hash_block_aligned(const byte *str, uns len) CONST; +uns str_len_aligned(const byte *str) PURE; +uns hash_string_aligned(const byte *str) PURE; +uns hash_block_aligned(const byte *str, uns len) PURE; #ifdef CPU_ALLOW_UNALIGNED #define str_len(str) str_len_aligned(str) #define hash_string(str) hash_string_aligned(str) #define hash_block(str, len) hash_block_aligned(str, len) #else -uns str_len(const byte *str) CONST; -uns hash_string(const byte *str) CONST; -uns hash_block(const byte *str, uns len) CONST; +uns str_len(const byte *str) PURE; +uns hash_string(const byte *str) PURE; +uns hash_block(const byte *str, uns len) PURE; #endif -uns hash_string_nocase(const byte *str) CONST; +uns hash_string_nocase(const byte *str) PURE; /* * We hash integers by multiplying by a reasonably large prime with