public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTool: Fixed the StructurePcd incorrect value.
@ 2018-01-25  7:42 BobCF
  2018-01-25 10:06 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-01-25  7:42 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

If user not set Structure overall value in Dsc,
Structure Pcd value would be 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/Workspace/BuildClassObject.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py
index e5f1f01556..947ac1f466 100644
--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
@@ -65,11 +65,11 @@ class PcdClassObject(object):
         self.validlists = validlists
         self.expressions = expressions
         self.DscDefaultValue = None
         if IsDsc:
             self.DscDefaultValue = Value
-        
+
     ## Convert the class to a string
     #
     #  Convert each member of the class to string
     #  Organize to a signle line format string
     #
@@ -107,11 +107,15 @@ class PcdClassObject(object):
     #
     def __hash__(self):
         return hash((self.TokenCName, self.TokenSpaceGuidCName))
 
 class StructurePcd(PcdClassObject):
-    def __init__(self, StructuredPcdIncludeFile="", Packages=None, Name=None, Guid=None, Type=None, DatumType=None, Value=None, Token=None, MaxDatumSize=None, SkuInfoList={}, IsOverrided=False, GuidValue=None, validateranges=[], validlists=[], expressions=[],default_store = TAB_DEFAULT_STORES_DEFAULT):
+    def __init__(self, StructuredPcdIncludeFile=None, Packages=None, Name=None, Guid=None, Type=None, DatumType=None, Value=None, Token=None, MaxDatumSize=None, SkuInfoList=None, IsOverrided=False, GuidValue=None, validateranges=None, validlists=None, expressions=None,default_store = TAB_DEFAULT_STORES_DEFAULT):
+        if SkuInfoList is None: SkuInfoList={}
+        if validateranges is None: validateranges=[]
+        if validlists is None: validlists=[]
+        if expressions is None : expressions=[]
         super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, validlists, expressions)
         self.StructuredPcdIncludeFile = StructuredPcdIncludeFile
         self.PackageDecs = Packages
         self.DefaultStoreName = [default_store]
         self.DefaultValues = collections.OrderedDict({})
@@ -435,6 +439,5 @@ class PlatformBuildClassObject(object):
     #
     # @retval string Key for hash table
     #
     def __hash__(self):
         return hash(self.MetaFile)
-
-- 
2.14.3.windows.1



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

* Re: [Patch] BaseTool: Fixed the StructurePcd incorrect value.
  2018-01-25  7:42 [Patch] BaseTool: Fixed the StructurePcd incorrect value BobCF
@ 2018-01-25 10:06 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-01-25 10:06 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, January 25, 2018 3:42 PM
>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 StructurePcd incorrect value.
>
>If user not set Structure overall value in Dsc,
>Structure Pcd value would be 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/Workspace/BuildClassObject.py | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>index e5f1f01556..947ac1f466 100644
>--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>@@ -65,11 +65,11 @@ class PcdClassObject(object):
>         self.validlists = validlists
>         self.expressions = expressions
>         self.DscDefaultValue = None
>         if IsDsc:
>             self.DscDefaultValue = Value
>-
>+
>     ## Convert the class to a string
>     #
>     #  Convert each member of the class to string
>     #  Organize to a signle line format string
>     #
>@@ -107,11 +107,15 @@ class PcdClassObject(object):
>     #
>     def __hash__(self):
>         return hash((self.TokenCName, self.TokenSpaceGuidCName))
>
> class StructurePcd(PcdClassObject):
>-    def __init__(self, StructuredPcdIncludeFile="", Packages=None,
>Name=None, Guid=None, Type=None, DatumType=None, Value=None,
>Token=None, MaxDatumSize=None, SkuInfoList={}, IsOverrided=False,
>GuidValue=None, validateranges=[], validlists=[],
>expressions=[],default_store = TAB_DEFAULT_STORES_DEFAULT):
>+    def __init__(self, StructuredPcdIncludeFile=None, Packages=None,
>Name=None, Guid=None, Type=None, DatumType=None, Value=None,
>Token=None, MaxDatumSize=None, SkuInfoList=None, IsOverrided=False,
>GuidValue=None, validateranges=None, validlists=None,
>expressions=None,default_store = TAB_DEFAULT_STORES_DEFAULT):
>+        if SkuInfoList is None: SkuInfoList={}
>+        if validateranges is None: validateranges=[]
>+        if validlists is None: validlists=[]
>+        if expressions is None : expressions=[]
>         super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Value,
>Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges,
>validlists, expressions)
>         self.StructuredPcdIncludeFile = StructuredPcdIncludeFile
>         self.PackageDecs = Packages
>         self.DefaultStoreName = [default_store]
>         self.DefaultValues = collections.OrderedDict({})
>@@ -435,6 +439,5 @@ class PlatformBuildClassObject(object):
>     #
>     # @retval string Key for hash table
>     #
>     def __hash__(self):
>         return hash(self.MetaFile)
>-
>--
>2.14.3.windows.1



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

end of thread, other threads:[~2018-01-25 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25  7:42 [Patch] BaseTool: Fixed the StructurePcd incorrect value BobCF
2018-01-25 10:06 ` Gao, Liming

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