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 E4FE21BC40 for ; Mon, 14 May 2018 01:17:10 +0200 (CEST) To: Thomas Monjalon Cc: dev@dpdk.org References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> <152609035240.121661.17896359108855967217.stgit@localhost.localdomain> <3918757.SVKzEjPn4h@xps> From: Andy Green Message-ID: Date: Mon, 14 May 2018 07:17:06 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: <3918757.SVKzEjPn4h@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 06/24] /lib/librte_eal: stage cast from uint64 to long 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: Sun, 13 May 2018 23:17:11 -0000 On 05/14/2018 12:24 AM, Thomas Monjalon wrote: > 12/05/2018 03:59, Andy Green: >> warning: conversion to 'uint64_t' {aka 'long unsigned int'} >> from 'long int' may change the sign of the result >> [-Wsign-conversion] >> val = lrand48(); >> ^~~~~~~ > [...] >> rte_rand(void) >> { >> uint64_t val; >> - val = lrand48(); >> + val = (unsigned long)lrand48(); > > I think the right cast is uint64_t. > It makes a difference in 32-bit environment. Yes, you are right thanks. I changed it accordingly. -Andy > >