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 639AEA00BE; Thu, 10 Feb 2022 15:04:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B26EC42739; Thu, 10 Feb 2022 15:04:38 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 7D27F4272B; Thu, 10 Feb 2022 15:04:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501873; x=1676037873; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pw8h7l85GTUAWLoIdKJY/D6EzLxrtOlOWNXgp0QmUVE=; b=A9AKjy6XmCid8bMdqnkLAgZh8NmfWbyuHQO2Ii4o4+zX7/zjSezHRl+Y 8OvYR/Z8vQBtTwqjLnPPvEaJve7uqzeoUV9G8H+KHoRgrau+k7OodSNL5 jAJd4yezCwkO6JsBllhgxr+Ynf2atfQGqjqhgaByw13JXrALvBOyOCPog 2wT5kNkmf5UzgsOUOjXdbXWql2mHFZcCw8EZWokuvlR8ZQ8pSbYkpQXSu B4i2CmpJiKz03jxCHI0LaITWVIVymPt/ljXWcWllyXDpyVmttNK575PQ3 cRMGJDp0/3H1NbdFNQzFSB7tYI+3fn6EMO7H6QJI8jFyqF6wtIKH3iC8E Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781113" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781113" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 06:04:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964279" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:31 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , kevin.laatz@intel.com, cristian.dumitrescu@intel.com, stable@dpdk.org, Jerin Jacob , Gavin Hu Subject: [PATCH v3 5/7] table: fix missing explicit casts for C++ build Date: Thu, 10 Feb 2022 14:03:53 +0000 Message-Id: <20220210140355.586399-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210140355.586399-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210140355.586399-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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