public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTool: Add comments in PcdValueInit.c.
@ 2018-01-31  9:45 BobCF
  2018-01-31 12:19 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2018-01-31  9:45 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

Add Comments for __FLEXIBLE_SIZE () statement.

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/DscBuildData.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 012e16a488..214e4fd569 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1325,42 +1325,44 @@ class DscBuildData(PlatformBuildClassObject):
                 for FieldName in FieldList:
                     FieldName = "." + FieldName
                     IsArray = self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
                     if IsArray:
                         Value, ValueSize = ParseFieldValue (FieldList[FieldName.strip(".")][0])
-                        CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."));
+                        CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));  // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);
                     else:
                         NewFieldName = ''
+                        FieldName_ori = FieldName.strip('.')
                         while '[' in  FieldName:
                             NewFieldName = NewFieldName + FieldName.split('[', 1)[0] + '[0]'
                             ArrayIndex = int(FieldName.split('[', 1)[1].split(']', 1)[0])
                             FieldName = FieldName.split(']', 1)[1]
                         FieldName = NewFieldName + FieldName
                         while '[' in FieldName:
                             FieldName = FieldName.rsplit('[', 1)[0]
-                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
+                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])
             for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
                 for FieldList in [inherit_OverrideValues.get(DefaultStoreName)]:
                     if not FieldList:
                         continue
                     for FieldName in FieldList:
                         FieldName = "." + FieldName
                         IsArray = self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
                         if IsArray:
                             Value, ValueSize = ParseFieldValue (FieldList[FieldName.strip(".")][0])
-                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."));
+                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);
                         else:
                             NewFieldName = ''
+                            FieldName_ori = FieldName.strip('.')
                             while '[' in  FieldName:
                                 NewFieldName = NewFieldName + FieldName.split('[', 1)[0] + '[0]'
                                 ArrayIndex = int(FieldName.split('[', 1)[1].split(']', 1)[0])
                                 FieldName = FieldName.split(']', 1)[1]
                             FieldName = NewFieldName + FieldName
                             while '[' in FieldName:
                                 FieldName = FieldName.rsplit('[', 1)[0]
-                                CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
+                                CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d); // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])
                 if skuname == SkuName:
                     break
 
             #
             # Allocate and zero buffer for the PCD
-- 
2.14.3.windows.1



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

* Re: [Patch] BaseTool: Add comments in PcdValueInit.c.
  2018-01-31  9:45 [Patch] BaseTool: Add comments in PcdValueInit.c BobCF
@ 2018-01-31 12:19 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-01-31 12:19 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: Wednesday, January 31, 2018 5:45 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: Add comments in PcdValueInit.c.
>
>Add Comments for __FLEXIBLE_SIZE () statement.
>
>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/DscBuildData.py | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 012e16a488..214e4fd569 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1325,42 +1325,44 @@ class DscBuildData(PlatformBuildClassObject):
>                 for FieldName in FieldList:
>                     FieldName = "." + FieldName
>                     IsArray = self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
>                     if IsArray:
>                         Value, ValueSize = ParseFieldValue
>(FieldList[FieldName.strip(".")][0])
>-                        CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d /
>__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %%
>__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType,
>FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."),
>ValueSize, Pcd.DatumType, FieldName.strip("."));
>+                        CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d /
>__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %%
>__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));  // From %s Line %d Value %s \n' %
>(Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType,
>FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."),
>FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2],
>FieldList[FieldName.strip(".")][0]);
>                     else:
>                         NewFieldName = ''
>+                        FieldName_ori = FieldName.strip('.')
>                         while '[' in  FieldName:
>                             NewFieldName = NewFieldName + FieldName.split('[', 1)[0] +
>'[0]'
>                             ArrayIndex = int(FieldName.split('[', 1)[1].split(']', 1)[0])
>                             FieldName = FieldName.split(']', 1)[1]
>                         FieldName = NewFieldName + FieldName
>                         while '[' in FieldName:
>                             FieldName = FieldName.rsplit('[', 1)[0]
>-                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' %
>(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
>+                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d); //
>From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."),
>ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2],
>FieldList[FieldName_ori][0])
>             for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
>                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
>                 for FieldList in [inherit_OverrideValues.get(DefaultStoreName)]:
>                     if not FieldList:
>                         continue
>                     for FieldName in FieldList:
>                         FieldName = "." + FieldName
>                         IsArray =
>self.IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
>                         if IsArray:
>                             Value, ValueSize = ParseFieldValue
>(FieldList[FieldName.strip(".")][0])
>-                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d /
>__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %%
>__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));\n' % (Pcd.DatumType,
>FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."),
>ValueSize, Pcd.DatumType, FieldName.strip("."));
>+                            CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d /
>__ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %%
>__ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s\n' %
>(Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType,
>FieldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."),
>FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2],
>FieldList[FieldName.strip(".")][0]);
>                         else:
>                             NewFieldName = ''
>+                            FieldName_ori = FieldName.strip('.')
>                             while '[' in  FieldName:
>                                 NewFieldName = NewFieldName + FieldName.split('[', 1)[0] +
>'[0]'
>                                 ArrayIndex = int(FieldName.split('[', 1)[1].split(']', 1)[0])
>                                 FieldName = FieldName.split(']', 1)[1]
>                             FieldName = NewFieldName + FieldName
>                             while '[' in FieldName:
>                                 FieldName = FieldName.rsplit('[', 1)[0]
>-                                CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' %
>(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
>+                                CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d); //
>From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."),
>ArrayIndex + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2],
>FieldList[FieldName_ori][0])
>                 if skuname == SkuName:
>                     break
>
>             #
>             # Allocate and zero buffer for the PCD
>--
>2.14.3.windows.1



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

end of thread, other threads:[~2018-01-31 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31  9:45 [Patch] BaseTool: Add comments in PcdValueInit.c BobCF
2018-01-31 12:19 ` Gao, Liming

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