pandora-build v0.47 - Swapped location of ! for /bin/sh on solaris.
[awesomized/libmemcached] / libmemcached / murmur_hash.c
index c9e60f5bf6e32ec12e2b4ada421043361833c857..b95134408d287270b17508af10f2325f9d6035c4 100644 (file)
@@ -25,13 +25,13 @@ uint32_t murmur_hash(const char *key, size_t length)
   */
 
   const unsigned int m= 0x5bd1e995;
-  const unsigned int seed= (0xdeadbeef * length);
+  const size_t seed= (0xdeadbeef * length);
   const int r= 24;
 
 
   // Initialize the hash to a 'random' value
 
-  unsigned int h= seed ^ length;
+  size_t h= seed ^ length;
 
   // Mix 4 bytes at a time into the hash
 
@@ -60,6 +60,7 @@ uint32_t murmur_hash(const char *key, size_t length)
   case 2: h ^= data[1] << 8;
   case 1: h ^= data[0];
           h *= m;
+  default: break;
   };
 
   /* 
@@ -71,5 +72,5 @@ uint32_t murmur_hash(const char *key, size_t length)
   h *= m;
   h ^= h >> 15;
 
-  return h;
+  return (uint32_t) h;
 }