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 Shut up lint.
details: https://anonhg.NetBSD.org/src/rev/7d197c465ee1
branches: trunk
changeset: 780035:7d197c465ee1
user: rmind <rmind%NetBSD.org@localhost>
date: Sun Jul 08 13:42:29 2012 +0000
description:
Shut up lint.
diffstat:
common/lib/libc/hash/murmurhash/murmurhash.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r ab4a9766c033 -r 7d197c465ee1 common/lib/libc/hash/murmurhash/murmurhash.c
--- a/common/lib/libc/hash/murmurhash/murmurhash.c Sun Jul 08 12:07:12 2012 +0000
+++ b/common/lib/libc/hash/murmurhash/murmurhash.c Sun Jul 08 13:42:29 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: murmurhash.c,v 1.1 2012/07/08 01:21:12 rmind Exp $ */
+/* $NetBSD: murmurhash.c,v 1.2 2012/07/08 13:42:29 rmind Exp $ */
/*
* MurmurHash2 -- from the original code:
@@ -16,9 +16,9 @@
#include <sys/hash.h>
#if defined(_KERNEL) || defined(_STANDALONE)
-__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.1 2012/07/08 01:21:12 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: murmurhash.c,v 1.2 2012/07/08 13:42:29 rmind Exp $");
#else
-__RCSID("$NetBSD: murmurhash.c,v 1.1 2012/07/08 01:21:12 rmind Exp $");
+__RCSID("$NetBSD: murmurhash.c,v 1.2 2012/07/08 13:42:29 rmind Exp $");
#endif
uint32_t
@@ -33,7 +33,7 @@
const int r = 24;
const uint8_t *data = (const uint8_t *)key;
- uint32_t h = seed ^ len;
+ uint32_t h = seed ^ (uint32_t)len;
while (len >= sizeof(uint32_t)) {
uint32_t k;
@@ -58,8 +58,10 @@
switch (len) {
case 3:
h ^= data[2] << 16;
+ /* FALLTHROUGH */
case 2:
h ^= data[1] << 8;
+ /* FALLTHROUGH */
case 1:
h ^= data[0];
h *= m;
Home |
Main Index |
Thread Index |
Old Index