From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CBFEA203BA511 for ; Thu, 29 Nov 2018 07:17:34 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 07:17:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="96787133" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 29 Nov 2018 07:17:34 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.186]) by FMSMSX108.amr.corp.intel.com ([169.254.9.157]) with mapi id 14.03.0415.000; Thu, 29 Nov 2018 07:17:33 -0800 From: "Carsey, Jaben" To: Ard Biesheuvel , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Gao, Liming" Thread-Topic: [edk2] [PATCH 2/6] BaseTools/CommonLib: use explicit 64-bit type in Strtoi() Thread-Index: AQHUh9+GqdsXYtQQVk2BwCpIICFL2aVm3Ytw Date: Thu, 29 Nov 2018 15:17:34 +0000 Message-ID: References: <20181129123129.25095-1-ard.biesheuvel@linaro.org> <20181129123129.25095-3-ard.biesheuvel@linaro.org> In-Reply-To: <20181129123129.25095-3-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzQzODk1MTItYWJhNC00ZDZmLTg3NzItYTI1YTViYWQ3ZTEyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVm5odFVXQ2JWRlM4RDJaUnp0WmNFRWFYelFDZ09Ydks3Z1pBRGNQdnFlZVZBc0tSbmpqVjNYRjhLT1p4OHpVbSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [PATCH 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: Thu, 29 Nov 2018 15:17:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Ard Biesheuvel > Sent: Thursday, November 29, 2018 4:31 AM > To: edk2-devel@lists.01.org > Cc: Laszlo Ersek ; Gao, Liming > Subject: [edk2] [PATCH 2/6] BaseTools/CommonLib: use explicit 64-bit type > in Strtoi() >=20 > Don't use the native word size string to number parsing routines, > but instead, use the 64-bit one and cast to UINTN. >=20 > 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. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > BaseTools/Source/C/Common/CommonLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/C/Common/CommonLib.c > b/BaseTools/Source/C/Common/CommonLib.c > index bea6af0a45b1..c5e32b1292e0 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); > } > } >=20 > -- > 2.19.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel