]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) make sure a empty database will be generated if the Uinitialized database portion...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jun 2006 06:40:50 +0000 (06:40 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 23 Jun 2006 06:40:50 +0000 (06:40 +0000)
2) add a newline at the end of Autogen.c for PCD driver/PEIM.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@606 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java

index b54f68c815f9443fd24dce85160ecd957f50f533..cf94885847058374f4a0fb5fa4a099795c76f5ae 100644 (file)
@@ -116,7 +116,7 @@ class StringTable {
                                         );  \r
             declaList.add(decl);\r
 \r
-            cInstCode = tab + " { 0 } " + String.format("/* %s */", stringTable) + commaNewLine;\r
+            cInstCode = " { 0 } " + String.format("/* %s */", stringTable);\r
             instTable.put(stringTable, cInstCode);\r
         } else {\r
 \r
@@ -1195,6 +1195,7 @@ class PcdDatabase {
         //\r
         // Generate code for every alignment size\r
         //\r
+        boolean uinitDatabaseEmpty = true;\r
         for (int align = 8; align > 0; align >>= 1) {\r
             ArrayList<String> declaListBasedOnAlignment = alignmentInitDecl.get(new Integer(align));\r
             ArrayList<String> instListBasedOnAlignment = alignmentInitInst.get(new Integer(align));\r
@@ -1215,14 +1216,23 @@ class PcdDatabase {
             }\r
             \r
             declaListBasedOnAlignment = alignmentUninitDecl.get(new Integer(align));\r
+            \r
+            if (declaListBasedOnAlignment.size() != 0) {\r
+                uinitDatabaseEmpty = false;\r
+            }\r
+            \r
             for (Object d : declaListBasedOnAlignment) {\r
                 String s = (String)d;\r
                 uninitDeclStr += tab + s;\r
             }\r
         }\r
         \r
+        if (uinitDatabaseEmpty) {\r
+            uninitDeclStr += tab + "   UINT8        dummy; /* PCD_DATABASE_UNINIT is emptry */\r\n";\r
+        }\r
+        \r
         initDeclStr += String.format("} %s_PCD_DATABASE_INIT;", phase) + newLine + newLine;\r
-        initInstStr += "};";\r
+        initInstStr += "};" + newLine;\r
         uninitDeclStr += String.format("} %s_PCD_DATABASE_UNINIT;", phase) + newLine + newLine;\r
         \r
         result.put("initDeclStr", initDeclStr);\r