Added DataArray support when calculating datum size
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 7 Dec 2007 06:44:22 +0000 (06:44 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 7 Dec 2007 06:44:22 +0000 (06:44 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@913 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/EdkIIWorkspaceBuild.py

index 300066c..7a19257 100755 (executable)
@@ -1276,17 +1276,20 @@ class WorkspaceBuild(object):
                 OwnerPlatform = Dsc\r
                 Pcd = Pcds[(Name, Guid)]\r
                 if Pcd.Type != '' and Pcd.Type != None:\r
                 OwnerPlatform = Dsc\r
                 Pcd = Pcds[(Name, Guid)]\r
                 if Pcd.Type != '' and Pcd.Type != None:\r
-                    if Type != '' and Type != Pcd.Type:\r
-                        ErrorMsg = "PCD %s.%s is declared as [%s] in module\n\t%s\n\n"\\r
-                                   "    But it's used as [%s] in platform\n\t%s"\\r
-                                   % (Guid, Name, Type, ModuleName, Pcd.Type, OwnerPlatform)\r
-                        EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg)\r
-\r
                     NewType = Pcd.Type\r
                     if NewType in DataType.PCD_DYNAMIC_TYPE_LIST:\r
                         NewType = DataType.TAB_PCDS_DYNAMIC\r
                     elif NewType in DataType.PCD_DYNAMIC_EX_TYPE_LIST:\r
                         NewType = DataType.TAB_PCDS_DYNAMIC_EX\r
                     NewType = Pcd.Type\r
                     if NewType in DataType.PCD_DYNAMIC_TYPE_LIST:\r
                         NewType = DataType.TAB_PCDS_DYNAMIC\r
                     elif NewType in DataType.PCD_DYNAMIC_EX_TYPE_LIST:\r
                         NewType = DataType.TAB_PCDS_DYNAMIC_EX\r
+                else:\r
+                    NewType = Type\r
+\r
+                if Type != '' and Type != NewType:\r
+                    ErrorMsg = "PCD %s.%s is declared as [%s] in module\n\t%s\n\n"\\r
+                               "    But it's used as [%s] in platform\n\t%s"\\r
+                               % (Guid, Name, Type, ModuleName, Pcd.Type, OwnerPlatform)\r
+                    EdkLogger.error("AutoGen", PARSER_ERROR, ErrorMsg)\r
+\r
 \r
                 if Pcd.DatumType != '' and Pcd.DatumType != None:\r
                     DatumType = Pcd.DatumType\r
 \r
                 if Pcd.DatumType != '' and Pcd.DatumType != None:\r
                     DatumType = Pcd.DatumType\r
@@ -1396,6 +1399,8 @@ class WorkspaceBuild(object):
                            ExtraData=ModuleName)\r
             if Value[0] == 'L':\r
                 MaxDatumSize = str(len(Value) * 2)\r
                            ExtraData=ModuleName)\r
             if Value[0] == 'L':\r
                 MaxDatumSize = str(len(Value) * 2)\r
+            elif Value[0] == '{':\r
+                MaxDatumSize = str(len(Value.split(',')))\r
             else:\r
                 MaxDatumSize = str(len(Value))\r
 \r
             else:\r
                 MaxDatumSize = str(len(Value))\r
 \r