From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 417CC1B86F for ; Thu, 10 May 2018 04:49:39 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Thu, 10 May 2018 10:49:35 +0800 Message-ID: <152592057540.119328.17361181900420537824.stgit@localhost.localdomain> In-Reply-To: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> References: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v3 39/40] rte_hash_crc.h: explicit casts for truncation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2018 02:49:39 -0000 /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h: In function 'crc32c_sse42_u64_mimic': /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h:402:40: warning: conversion from 'uint64_t' {aka 'long unsigned int'} to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion] init_val = crc32c_sse42_u32(d.u32[0], init_val); Signed-off-by: Andy Green --- lib/librte_hash/rte_hash_crc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 5f5fb3db1..cf28031b3 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -398,9 +398,9 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) } d; d.u64 = data; - init_val = crc32c_sse42_u32(d.u32[0], init_val); - init_val = crc32c_sse42_u32(d.u32[1], init_val); - return init_val; + init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val); + init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val); + return (uint32_t)init_val; } #endif @@ -412,7 +412,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) "crc32q %[data], %[init_val];" : [init_val] "+r" (init_val) : [data] "rm" (data)); - return init_val; + return (uint32_t)init_val; } #endif