Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/hash/murmurhash Fix kernel compilation: no n...



details:   https://anonhg.NetBSD.org/src/rev/d4f3ea77fcfc
branches:  trunk
changeset: 780062:d4f3ea77fcfc
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jul 10 17:05:38 2012 +0000

description:
Fix kernel compilation: no namespace.h
Fix libc RCSID protection.
Remove useless cast.

diffstat:

 common/lib/libc/hash/murmurhash/murmurhash.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 8c1121ec24d2 -r d4f3ea77fcfc common/lib/libc/hash/murmurhash/murmurhash.c
--- a/common/lib/libc/hash/murmurhash/murmurhash.c      Mon Jul 09 21:25:46 2012 +0000
+++ b/common/lib/libc/hash/murmurhash/murmurhash.c      Tue Jul 10 17:05:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: murmurhash.c,v 1.3 2012/07/09 21:25:46 rmind Exp $     */
+/*     $NetBSD: murmurhash.c,v 1.4 2012/07/10 17:05:38 christos Exp $  */
 
 /*
  * MurmurHash2 -- from the original code:
@@ -14,12 +14,17 @@
 #include <sys/cdefs.h>
 
 #if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.3 2012/07/09 21:25:46 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.4 2012/07/10 17:05:38 christos Exp $");
+
 #else
-__RCSID("$NetBSD: murmurhash.c,v 1.3 2012/07/09 21:25:46 rmind Exp $");
+
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: murmurhash.c,v 1.4 2012/07/10 17:05:38 christos Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
 #endif
 
-#include "namespace.h"
 #include <sys/types.h>
 #include <sys/hash.h>
 
@@ -38,7 +43,7 @@
        const uint32_t m = 0x5bd1e995;
        const int r = 24;
 
-       const uint8_t *data = (const uint8_t *)key;
+       const uint8_t *data = key;
        uint32_t h = seed ^ (uint32_t)len;
 
        while (len >= sizeof(uint32_t)) {



Home | Main Index | Thread Index | Old Index