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=yunhuax.feng@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 680DF2117AE4D for ; Wed, 17 Oct 2018 17:42:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 17:42:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,393,1534834800"; d="scan'208";a="100375573" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 17 Oct 2018 17:42:39 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Oct 2018 17:42:39 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Oct 2018 17:42:38 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.217]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Thu, 18 Oct 2018 08:42:36 +0800 From: "Feng, YunhuaX" To: "Zhao, ZhiqiangX" CC: "edk2-devel@lists.01.org" , "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [PATCH] BaseTools: covert "unicode string" to "byte array" if value type diff. Thread-Index: AQHUZgnJ/NrUizVNFEGX5t5Vq0/rEqUjPp8AgAADQYCAAOelsA== Date: Thu, 18 Oct 2018 00:42:35 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48EFCA8@shsmsx102.ccr.corp.intel.com> References: <20181017110822.62976-1-zhiqiangx.zhao@intel.com> <341b8d54-3e4f-93f5-006b-8ea455652c75@redhat.com> In-Reply-To: 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: covert "unicode string" to "byte array" if value type diff. 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, 18 Oct 2018 00:42:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Unicode string should be start with 'L"' or "L'", but like as "Less" is n= ot Unicode string > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Carsey, Jaben > Sent: Thursday, October 18, 2018 2:49 AM > To: Laszlo Ersek ; Zhao, ZhiqiangX > > Cc: edk2-devel@lists.01.org; Gao, Liming > Subject: Re: [edk2] [PATCH] BaseTools: covert "unicode string" to "byte > array" if value type diff. >=20 >=20 >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Laszlo Ersek > > Sent: Wednesday, October 17, 2018 11:37 AM > > To: Zhao, ZhiqiangX > > Cc: edk2-devel@lists.01.org; Gao, Liming > > Subject: Re: [edk2] [PATCH] BaseTools: covert "unicode string" to "byte > > array" if value type diff. > > > > Hi, > > > > On 10/17/18 13:08, Zhaozh1x wrote: > > > For the same one VOID* pcd, if the default value type of one sku is > > > "unicode string", the other skus are "OtherVOID*"(ascii string or > > > byte array),Then covert "unicode string" to "byte array". > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > Signed-off-by: ZhiqiangX Zhao > > > Cc: Liming Gao > > > Cc: Yonghong Zhu > > > Reviewed-by: Bob Feng > > > --- > > > BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +++++++++ > > > 1 file changed, 9 insertions(+) > > > > > > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py > > b/BaseTools/Source/Python/Workspace/DscBuildData.py > > > index 7854e71db6..9b783de84b 100644 > > > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > > > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > > > @@ -2877,6 +2877,15 @@ class DscBuildData(PlatformBuildClassObject): > > > elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in > > pcd.SkuInfoList: > > > del pcd.SkuInfoList[TAB_COMMON] > > > > > > + #For the same one VOID* pcd, if the default value type of on= e sku is > > "unicode string", > > > + #the other skus are "OtherVOID*"(ascii string or byte array)= ,Then > > covert "unicode string" to "byte array". > > > + for pcd in Pcds.values(): > > > + PcdValueTypeList =3D [] > > > + for sku in pcd.SkuInfoList.values(): > > > + PcdValueTypeList.append("UnicodeString" if > > sku.DefaultValue.startswith("L") else "OtherVOID*") > > > + if "UnicodeString" in PcdValueTypeList and "OtherVOID*" = in > > PcdValueTypeList: >=20 > If you use a set instead of a list here, it will save memory any then ins= tead of > testing for both items being there, you could just check the length being= > 1 > which would also be faster than 2 "in" tests. >=20 > > > + for sku in pcd.SkuInfoList.values(): > > > + sku.DefaultValue =3D StringToArray(sku.DefaultVa= lue) if > > sku.DefaultValue.startswith("L") else sku.DefaultValue > > > > > > map(self.FilterSkuSettings, Pcds.values()) > > > return Pcds > > > > > > > no comments on the code change, just a superficial one on the subject > > line: please replace "covert" with "convert". > > > > There are two more instances of the typo in the patch: in the commit > > message, and in the new code too. (Three occurrences in total.) > > > > Normally I shouldn't obsess about such small typos, in case they don't > > obscure the intended meaning. However, "covert" did confuse me, > because > > it is an existent word, and it has a specific meaning in computing: > > > > https://en.wikipedia.org/wiki/Covert_channel > > > > Thanks! > > Laszlo > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel