public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Zhaozh1x <zhiqiangx.zhao@intel.com>
Cc: edk2-devel@lists.01.org, Liming Gao <liming.gao@intel.com>
Subject: Re: [PATCH] BaseTools: covert "unicode string" to "byte array" if value type diff.
Date: Wed, 17 Oct 2018 20:37:06 +0200	[thread overview]
Message-ID: <341b8d54-3e4f-93f5-006b-8ea455652c75@redhat.com> (raw)
In-Reply-To: <20181017110822.62976-1-zhiqiangx.zhao@intel.com>

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 <zhiqiangx.zhao@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
> ---
>  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


  reply	other threads:[~2018-10-17 18:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 11:08 [PATCH] BaseTools: covert "unicode string" to "byte array" if value type diff Zhaozh1x
2018-10-17 18:37 ` Laszlo Ersek [this message]
2018-10-17 18:48   ` Carsey, Jaben
2018-10-18  0:42     ` Feng, YunhuaX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=341b8d54-3e4f-93f5-006b-8ea455652c75@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox