From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03349A00BE for ; Thu, 10 Feb 2022 16:43:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B375842759; Thu, 10 Feb 2022 16:43:15 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 1CA0B426F7; Thu, 10 Feb 2022 16:43:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507788; x=1676043788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pw8h7l85GTUAWLoIdKJY/D6EzLxrtOlOWNXgp0QmUVE=; b=fmgffaW3W710WjxKhG53SYdGFlQIy/ExWXGzkFsrHG0FAlnVZ8n9acU6 U1pqOKhbo9OHQn73d214IGrF7muxXgpL5IKQ7Q1GgE6kBJCRu7Icxm1D+ bdgktpySOw0byryV29ieMld37YrpXDTkXbgdPXomk23uGkAp5z6RhrahA 8W2O4TMRdrlMjzLDyhmYifyItgcfyq2/lzUl3mbDEE+mtUUt1xL0sSel1 dTma33FVLYhYkJTqr5gr+Fb5KF1rvmeqfzpxYRFwMdcJMi73oQ9c3PNpU e/yEMGg3PsEB8gEkAo5Rudf2NKnybWpS7ozxn8b0hJiJnfcD50fTw7BqM g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101183" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101183" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 07:43:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723465" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:43:01 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , kevin.laatz@intel.com, cristian.dumitrescu@intel.com, stable@dpdk.org, Gavin Hu , Jerin Jacob Subject: [PATCH v4 5/7] table: fix missing explicit casts for C++ build Date: Thu, 10 Feb 2022 15:42:37 +0000 Message-Id: <20220210154239.587185-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210154239.587185-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210154239.587185-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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: ea7be0a0386e ("lib/librte_table: add hash function headers") Cc: kevin.laatz@intel.com Cc: cristian.dumitrescu@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- lib/table/rte_table_hash_func.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/table/rte_table_hash_func.h b/lib/table/rte_table_hash_func.h index c4c35cc06a..a962ec2f68 100644 --- a/lib/table/rte_table_hash_func.h +++ b/lib/table/rte_table_hash_func.h @@ -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]); @@ -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]; @@ -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]; @@ -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]; @@ -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]; @@ -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]; @@ -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]; @@ -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]; -- 2.32.0