X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fhashfunc-test.c;h=67e613cb34983f349453bc0640d3b42cc55b184b;hb=8f29ef125a903b92ea6c098567615e28322c9b20;hp=8ff4fc0af20912d50337fe157a8d68f771bc23ae;hpb=031256ad2e123eec58521f8e3eb9496c197641d2;p=libucw.git diff --git a/ucw/hashfunc-test.c b/ucw/hashfunc-test.c index 8ff4fc0a..67e613cb 100644 --- a/ucw/hashfunc-test.c +++ b/ucw/hashfunc-test.c @@ -3,7 +3,7 @@ * it is faster than the classical version ;-) */ -#include "ucw/hashfunc.h" +#include #include #include @@ -14,7 +14,7 @@ #define TEST_TIME 1000000 /* The shift of the string according to the alignment. */ -static uns alignment = 0; +static uint alignment = 0; static void random_string(byte *str, int len) @@ -25,11 +25,11 @@ random_string(byte *str, int len) str[len] = 0; } -static uns +static uint elapsed_time(void) { static struct timeval last_tv, tv; - uns elapsed; + uint elapsed; gettimeofday(&tv, NULL); elapsed = (tv.tv_sec - last_tv.tv_sec) * 1000000 + (tv.tv_usec - last_tv.tv_usec); last_tv = tv; @@ -83,7 +83,7 @@ main(int argc, char **argv) printf("%d strings tested OK\n", i); for (i=0; strings[i]; i++) { - uns h1, h2; + uint h1, h2; h1 = hash_string(strings[i]); h2 = hash_string_nocase(strings[i]); if (h1 != hash_block(strings[i], str_len(strings[i]))) @@ -96,10 +96,10 @@ main(int argc, char **argv) for (i=0; lengths[i] >= 0; i++) { byte str[lengths[i] + 1 + alignment]; - uns count = TEST_TIME / (lengths[i] + 10); - uns el1 = 0, el2 = 0, elh = 0, elhn = 0; - uns tot1 = 0, tot2 = 0, hash = 0, hashn = 0; - uns j; + uint count = TEST_TIME / (lengths[i] + 10); + uint el1 = 0, el2 = 0, elh = 0, elhn = 0; + uint tot1 = 0, tot2 = 0, hash = 0, hashn = 0; + uint j; for (j=0; j