From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 502202116DA21 for ; Wed, 17 Oct 2018 11:37:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD4137E9FD; Wed, 17 Oct 2018 18:37:08 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-50.rdu2.redhat.com [10.10.120.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id E93405F7C8; Wed, 17 Oct 2018 18:37:07 +0000 (UTC) To: Zhaozh1x Cc: edk2-devel@lists.01.org, Liming Gao References: <20181017110822.62976-1-zhiqiangx.zhao@intel.com> From: Laszlo Ersek Message-ID: <341b8d54-3e4f-93f5-006b-8ea455652c75@redhat.com> Date: Wed, 17 Oct 2018 20:37:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181017110822.62976-1-zhiqiangx.zhao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Oct 2018 18:37:08 +0000 (UTC) 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: Wed, 17 Oct 2018 18:37:09 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 one 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 = [] > + for sku in pcd.SkuInfoList.values(): > + PcdValueTypeList.append("UnicodeString" if sku.DefaultValue.startswith("L") else "OtherVOID*") > + if "UnicodeString" in PcdValueTypeList and "OtherVOID*" in PcdValueTypeList: > + for sku in pcd.SkuInfoList.values(): > + sku.DefaultValue = StringToArray(sku.DefaultValue) 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