start using a .clang-format code style
[m6w6/libmemcached] / src / libhashkit / jenkins.cc
index 3c6558a42ad9a21d9980dcb8983056f9dd073e1e..65aa1d11c6110269fc46e0bf7ea20e098a45200a 100644 (file)
@@ -1,5 +1,5 @@
 /*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- * 
+ *
  *  HashKit library
  *
  *  Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/
@@ -48,7 +48,7 @@
 * Add big endian support
 */
 
-#include <libhashkit/common.h>
+#include "libhashkit/common.h"
 
 #define hashsize(n) ((uint32_t)1<<(n))
 #define hashmask(n) (hashsize(n)-1)
@@ -93,10 +93,13 @@ use a bitmask.  For example, if you need only 10 bits, do
 In which case, the hash table should have hashsize(10) elements.
 */
 
+#if HAVE_ASAN
+__attribute__((no_sanitize_address,no_sanitize("address")))
+#endif
 uint32_t hashkit_jenkins(const char *key, size_t length, void *)
 {
   uint32_t a,b,c;                                          /* internal state */
-#ifndef WORDS_BIGENDIAN
+#if !WORDS_BIGENDIAN
   union { const void *ptr; size_t i; } u;
   u.ptr = key;
 #endif
@@ -104,7 +107,7 @@ uint32_t hashkit_jenkins(const char *key, size_t length, void *)
   /* Set up the internal state */
   a = b = c = 0xdeadbeef + ((uint32_t)length) + JENKINS_INITVAL;
 
-#ifndef WORDS_BIGENDIAN
+#if !WORDS_BIGENDIAN
   if ((u.i & 0x3) == 0)
   {
     const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
@@ -259,7 +262,7 @@ uint32_t hashkit_jenkins(const char *key, size_t length, void *)
     case 0 : return c;
     default : return c;
     }
-#ifndef WORDS_BIGENDIAN
+#if !WORDS_BIGENDIAN
   }
 #endif