a. Changed the code to use PCD's value as default value of the default value of its...
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 7 Dec 2007 09:42:49 +0000 (09:42 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 7 Dec 2007 09:42:49 +0000 (09:42 +0000)
b. Fixed an issue of comparing string with digital

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@915 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/GenC.py
Source/Python/Common/EdkIIWorkspaceBuild.py
Source/Python/Common/Misc.py

index fba6b21..2c0f187 100644 (file)
@@ -1151,8 +1151,10 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
                         Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)\r
                         Dict['SIZE_TABLE_CURRENT_LENGTH'].append(Size)\r
                         Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)\r
-                        if Pcd.MaxDatumSize != '' and Pcd.MaxDatumSize > Size:\r
-                            Size = int(Pcd.MaxDatumSize, 0)\r
+                        if Pcd.MaxDatumSize != '':\r
+                            MaxDatumSize = int(Pcd.MaxDatumSize, 0)\r
+                            if MaxDatumSize > Size:\r
+                                Size = MaxDatumSize\r
                         Dict['STRING_TABLE_LENGTH'].append(Size / 2 + 1)\r
                         StringTableIndex += 1\r
                         StringTableSize += (Size / 2 + 1)\r
index de3e239..d8f4a6f 100755 (executable)
@@ -1385,15 +1385,16 @@ class WorkspaceBuild(object):
         # Not found in any platform and fdf\r
         #\r
         if not IsFoundInDsc:\r
+            Value = Pcd.DefaultValue\r
             if NewType.startswith("Dynamic") and SkuInfoList == {}:\r
                 SkuIds = self.Build[Arch].PlatformDatabase.values()[0].SkuIds\r
-                SkuInfoList['DEFAULT'] = SkuInfoClass(SkuIdName='DEFAULT', SkuId=SkuIds['DEFAULT'], DefaultValue='0')\r
-            Value = Pcd.DefaultValue\r
-            Token = Pcd.TokenValue\r
+                SkuInfoList['DEFAULT'] = SkuInfoClass(SkuIdName='DEFAULT', SkuId=SkuIds['DEFAULT'], DefaultValue=Value)\r
             self.UnFoundPcdInDsc[(Guid, Name, NewType, Arch)] = FoundInDecFile\r
         #elif Type != '' and NewType.startswith("Dynamic"):\r
         #    NewType = Pcd.Type\r
         DatumType = Pcd.DatumType\r
+        if Token in [None, '']:\r
+            Token = Pcd.TokenValue\r
         if DatumType == "VOID*" and MaxDatumSize in ['', None]:\r
             EdkLogger.warn("\nAutoGen", "No MaxDatumSize specified for PCD %s.%s" % (Guid, Name),\r
                            ExtraData=ModuleName)\r
index 0546ab9..c8ef6a5 100755 (executable)
@@ -290,7 +290,8 @@ class TemplateString(object):
                 if RepeatTime < 0:\r
                     RepeatTime = len(Value)\r
                 elif RepeatTime != len(Value):\r
-                    EdkLogger.error("TemplateString", None, Key + " has different repeat time from others!")\r
+                    EdkLogger.error("TemplateString", PARAMETER_INVALID, Key + " has different repeat time from others!",\r
+                                    ExtraData=str(Dictionary))\r
 \r
             NewString = ''\r
             for Index in range(0, RepeatTime):\r