public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing.
@ 2018-06-14  3:01 BobCF
  2018-06-19  8:15 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-06-14  3:01 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

When packing HiiPcd into PcdNvStoreDefaultValueBuffer,
The boolean type pcd value packing incorrect.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenVar.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/Python/AutoGen/GenVar.py
index 3675be8de9..bf3d225c21 100644
--- a/BaseTools/Source/Python/AutoGen/GenVar.py
+++ b/BaseTools/Source/Python/AutoGen/GenVar.py
@@ -294,11 +294,11 @@ class VariableMgr(object):
             if tail:
                 for value_char in tail.split(","):
                     Buffer += pack("=B",int(value_char,16))
                 data_len += len(tail.split(","))
         elif data_type == "BOOLEAN":
-            Buffer += pack("=B",True) if var_value.upper() == "TRUE" else pack("=B",False)
+            Buffer += pack("=B",True) if var_value.upper() in ["TRUE","1"] else pack("=B",False)
             data_len += 1
         elif data_type  == DataType.TAB_UINT8:
             Buffer += pack("=B",GetIntegerValue(var_value))
             data_len += 1
         elif data_type == DataType.TAB_UINT16:
-- 
2.16.2.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing.
  2018-06-14  3:01 [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing BobCF
@ 2018-06-19  8:15 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-06-19  8:15 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Feng, Bob C
>Sent: Thursday, June 14, 2018 11:01 AM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing.
>
>When packing HiiPcd into PcdNvStoreDefaultValueBuffer,
>The boolean type pcd value packing incorrect.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenVar.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py
>b/BaseTools/Source/Python/AutoGen/GenVar.py
>index 3675be8de9..bf3d225c21 100644
>--- a/BaseTools/Source/Python/AutoGen/GenVar.py
>+++ b/BaseTools/Source/Python/AutoGen/GenVar.py
>@@ -294,11 +294,11 @@ class VariableMgr(object):
>             if tail:
>                 for value_char in tail.split(","):
>                     Buffer += pack("=B",int(value_char,16))
>                 data_len += len(tail.split(","))
>         elif data_type == "BOOLEAN":
>-            Buffer += pack("=B",True) if var_value.upper() == "TRUE" else
>pack("=B",False)
>+            Buffer += pack("=B",True) if var_value.upper() in ["TRUE","1"] else
>pack("=B",False)
>             data_len += 1
>         elif data_type  == DataType.TAB_UINT8:
>             Buffer += pack("=B",GetIntegerValue(var_value))
>             data_len += 1
>         elif data_type == DataType.TAB_UINT16:
>--
>2.16.2.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-19  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-14  3:01 [Patch] BaseTool: Fixed the bug of Boolean Hii Pcd packing BobCF
2018-06-19  8:15 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox