]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_hash/rte_jhash.h
hash: fix build on non-x86 arch
[dpdk.git] / lib / librte_hash / rte_jhash.h
index e230449a939e21be66b18518f9ce8bb7eabc4685..f9a8266cf6a0627ea953fa1b5f294ddc47f6867b 100644 (file)
@@ -46,6 +46,7 @@ extern "C" {
 
 #include <stdint.h>
 #include <string.h>
+#include <limits.h>
 
 #include <rte_log.h>
 #include <rte_byteorder.h>
@@ -122,7 +123,7 @@ __rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc,
        const uint32_t *k = key;
        const uint32_t s = 0;
 #else
-       const uint32_t *k = (uint32_t *)(uintptr_t)key & (uintptr_t)~3);
+       const uint32_t *k = (uint32_t *)((uintptr_t)key & (uintptr_t)~3);
        const uint32_t s = ((uintptr_t)key & 3) * CHAR_BIT;
 #endif
        if (!check_align || s == 0) {