Skip to content

Commit

Permalink
table: fix C++ include
Browse files Browse the repository at this point in the history
[ upstream commit 097ea8e ]

Since C++ doesn't support automatic casting from void * to other types,
we need to explicitly add the casts to any header files in DPDK.

Fixes: ea7be0a ("lib/librte_table: add hash function headers")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
bruce-richardson authored and bluca committed Feb 17, 2022
1 parent 97f298e commit b6dd9d6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/librte_table/rte_table_hash_func.h
Expand Up @@ -58,8 +58,8 @@ static inline uint64_t
rte_table_hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t crc0;

crc0 = rte_crc32_u64(seed, k[0] & m[0]);
Expand All @@ -72,8 +72,8 @@ static inline uint64_t
rte_table_hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, crc0, crc1;

k0 = k[0] & m[0];
Expand All @@ -91,8 +91,8 @@ static inline uint64_t
rte_table_hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, crc0, crc1;

k0 = k[0] & m[0];
Expand All @@ -113,8 +113,8 @@ static inline uint64_t
rte_table_hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, crc0, crc1, crc2, crc3;

k0 = k[0] & m[0];
Expand All @@ -139,8 +139,8 @@ static inline uint64_t
rte_table_hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, crc0, crc1, crc2, crc3;

k0 = k[0] & m[0];
Expand All @@ -165,8 +165,8 @@ static inline uint64_t
rte_table_hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, k5, crc0, crc1, crc2, crc3;

k0 = k[0] & m[0];
Expand All @@ -192,8 +192,8 @@ static inline uint64_t
rte_table_hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5;

k0 = k[0] & m[0];
Expand Down Expand Up @@ -222,8 +222,8 @@ static inline uint64_t
rte_table_hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size,
uint64_t seed)
{
uint64_t *k = key;
uint64_t *m = mask;
uint64_t *k = (uint64_t *)key;
uint64_t *m = (uint64_t *)mask;
uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5;

k0 = k[0] & m[0];
Expand Down

0 comments on commit b6dd9d6

Please sign in to comment.