From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.128.65; helo=mail-wm1-f65.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A8C8921195BFD for ; Mon, 3 Dec 2018 02:25:37 -0800 (PST) Received: by mail-wm1-f65.google.com with SMTP id n190so2693182wmd.0 for ; Mon, 03 Dec 2018 02:25:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EKWEQYUTZbdKUJbLGlL9L5Nk7qMxB3uDEqeHOKbM4Mo=; b=Z6cwWnFllqgyHu6K77Rsi05eZ6NMaraWtP7TKn5rVRIxgCPZY1vBqLh7kW6/fshYIB bSMfJOnKajKWIThClGOyXBr2pWbBRsgUE1RgC886RCbBCAEI4IRep584wlYwOQJIEAcB MPSkTW+gkqx9rR44Mya9DcKQvSKSqyF3wyYURicL9dvTckVi2VvCVoRo+4TaDmtRhiIo LvWWNbVL4bobN1jGi43p5n97hBa0OcMbtcncAP5gfRrFV72ddMbTjUVRyC9bhkjO+NIn UTi4sEh+NI0JoXl3xvQhqQKiUAQahnvNa7/k714eSy0OSJA7JSHaAhwcyt+ZWYnms2ud 30iw== X-Gm-Message-State: AA+aEWY/Kz6jIAhEVbETymH8jaa7gKvAT+RZAGNs7FRNxuK81PcLf9pi lrHFWC6JlFBDP9iP8MvBOANL6Q== X-Google-Smtp-Source: AFSGD/XaVOXRVaVQKvkRXwTcISytaS6PSD0cRMgayHuomlCzWdGHBuQftE+pdol2GBIk6Nt6OY8msw== X-Received: by 2002:a1c:8c05:: with SMTP id o5mr7259010wmd.29.1543832736195; Mon, 03 Dec 2018 02:25:36 -0800 (PST) Received: from ?IPv6:2a01:cb1d:8a0a:f500:48c1:8eab:256a:caf9? ([2a01:cb1d:8a0a:f500:48c1:8eab:256a:caf9]) by smtp.gmail.com with ESMTPSA id 5sm7034102wmr.37.2018.12.03.02.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 02:25:35 -0800 (PST) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: Liming Gao , Jaben Carsey , Laszlo Ersek References: <20181130224537.18936-1-ard.biesheuvel@linaro.org> <20181130224537.18936-3-ard.biesheuvel@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: <56904b0c-5b05-0902-7f78-03027081cd79@redhat.com> Date: Mon, 3 Dec 2018 11:25:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181130224537.18936-3-ard.biesheuvel@linaro.org> Subject: Re: [PATCH v2 2/6] BaseTools/CommonLib: use explicit 64-bit type in Strtoi() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 10:25:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 30/11/18 23:45, Ard Biesheuvel wrote: > Don't use the native word size string to number parsing routines, > but instead, use the 64-bit one and cast to UINTN. > > Currently, the only user is in Source/C/DevicePath/DevicePathFromText.c > which takes care to use Strtoi64 () unless it assumes the value fits > in 32-bit, so this change is a no-op even on 32-bit build hosts. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > Reviewed-by: Jaben Carsey Reviewed-by: Philippe Mathieu-Daudé > --- > BaseTools/Source/C/Common/CommonLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c > index 7c559bc3c222..4a28f635f3a8 100644 > --- a/BaseTools/Source/C/Common/CommonLib.c > +++ b/BaseTools/Source/C/Common/CommonLib.c > @@ -2252,9 +2252,9 @@ Strtoi ( > ) > { > if (IsHexStr (Str)) { > - return StrHexToUintn (Str); > + return (UINTN)StrHexToUint64 (Str); > } else { > - return StrDecimalToUintn (Str); > + return (UINTN)StrDecimalToUint64 (Str); > } > } > >