[ekg2-commit] ekg2: ekg_hash_benchmark.c (HEAD) [gim]

CVS commit cvs w toxygen.net
Wto, 8 Maj 2007, 12:11:46 CEST


Module name:	ekg2
Changes by:	gim	2007-05-08 12:11:44

Modified files:
	ekg_hash_benchmark.c

Log message:
pingback :)

Index: ekg_hash_benchmark.c
===================================================================
RCS file: /home/cvs/ekg2/contrib/ekg_hash_benchmark.c,v
diff -d -u -r1.3 -r1.4
--- ekg_hash_benchmark.c	8 May 2007 10:06:17 -0000	1.3
+++ ekg_hash_benchmark.c	8 May 2007 10:11:43 -0000	1.4
@@ -78,7 +78,7 @@
 				}
 				return;
 			}
-			printf("nothit_add: %s vs %s\n", name, f->name);
+			printf("nothit_add: %s vs %s | %08x\n", name, f->name, hash);
 		}
 	}
 
@@ -91,12 +91,14 @@
 	return;
 }
 
+
+#define ROL(x) (((x>>25)&0x7f)|((x<<7)&0xffffff80))
 hash_t ekg_hash(const char *name) {	/* ekg_hash() from stuff.c (rev: 1.1 to 1.203, and later) */
 	hash_t hash = 0;
-	
+
 	for (; *name; name++) {
 		hash ^= *name;
-		hash <<= 1;
+		hash = ROL(hash);
 	}
 
 	return hash;


Więcej informacji o liście dyskusyjnej ekg2-commit