From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 0C5F021951C94 for ; Thu, 27 Apr 2017 02:35:20 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 27 Apr 2017 02:35:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,383,1488873600"; d="scan'208";a="254096665" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 27 Apr 2017 02:35:19 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Apr 2017 02:35:19 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 27 Apr 2017 02:35:19 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Thu, 27 Apr 2017 17:35:11 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix a bug for BOOLEAN type value in Asbuilt inf Thread-Index: AQHSvnj/FejPD2EaZ0y/uDu00mHUlKHY9iOQ Date: Thu, 27 Apr 2017 09:35:11 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D725E17@shsmsx102.ccr.corp.intel.com> References: <1493202988-42240-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1493202988-42240-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fix a bug for BOOLEAN type value in Asbuilt inf X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Apr 2017 09:35:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Wednesday, April 26, 2017 6:36 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [edk2] [Patch] BaseTools: Fix a bug for BOOLEAN type value in Asb= uilt >inf > >When the PCD value is set to TRUE or FALSE, while it is not exchanged to >its int value, it cause error in the function int(Pcd.DefaultValue, 0). > >Cc: Liming Gao >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index 3d3dfef..75464b8 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -3923,10 +3923,17 @@ class ModuleAutoGen(AutoGen): > if TokenCName =3D=3D PatchPcd[0]: > break > else: > continue > PcdValue =3D '' >+ if Pcd.DatumType =3D=3D 'BOOLEAN': >+ BoolValue =3D Pcd.DefaultValue.upper() >+ if BoolValue =3D=3D 'TRUE': >+ Pcd.DefaultValue =3D '1' >+ elif BoolValue =3D=3D 'FALSE': >+ Pcd.DefaultValue =3D '0' >+ > if Pcd.DatumType !=3D 'VOID*': > HexFormat =3D '0x%02x' > if Pcd.DatumType =3D=3D 'UINT16': > HexFormat =3D '0x%04x' > elif Pcd.DatumType =3D=3D 'UINT32': >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel