From e0d2898de06f42e48fd9fad49f9ccfc520c3d4de Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 4 May 2006 22:58:57 +0200 Subject: [PATCH] CONST is not PURE. Thanks to Pavel for spotting that. --- lib/hashfunc.h | 14 +++++++------- lib/str-test.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/hashfunc.h b/lib/hashfunc.h index e60e3f70..fc836b38 100644 --- a/lib/hashfunc.h +++ b/lib/hashfunc.h @@ -14,21 +14,21 @@ #include "lib/lib.h" /* 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 diff --git a/lib/str-test.c b/lib/str-test.c index 48d246fb..e289258a 100644 --- a/lib/str-test.c +++ b/lib/str-test.c @@ -105,7 +105,7 @@ main(int argc, char **argv) random_string(str + alignment, lengths[i]); elapsed_time(); /* Avoid "optimizing" by gcc, since the functions are - * attributed CONST. */ + * attributed PURE. */ tot1 += strlen(str + alignment); el1 += elapsed_time(); tot2 += str_len(str + alignment); -- 2.39.5