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.24; helo=mga09.intel.com; envelope-from=zhiqiangx.zhao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 637CE21179258 for ; Wed, 17 Oct 2018 04:08:26 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2018 04:08:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,392,1534834800"; d="scan'208";a="273155973" Received: from tiano-zzq.ccr.corp.intel.com ([10.239.49.19]) by fmsmga006.fm.intel.com with ESMTP; 17 Oct 2018 04:08:24 -0700 From: Zhaozh1x To: edk2-devel@lists.01.org Cc: Zhaozh1x , Liming Gao , Yonghong Zhu Date: Wed, 17 Oct 2018 19:08:22 +0800 Message-Id: <20181017110822.62976-1-zhiqiangx.zhao@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [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 11:08:27 -0000 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 -- 2.14.1.windows.1