]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: GenC - move content from both parts of if/else
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Thu, 5 Apr 2018 23:14:01 +0000 (07:14 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 10 Apr 2018 02:05:16 +0000 (10:05 +0800)
move identical lines out of both if and else and move 1 level up.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/AutoGen/GenC.py

index 8d76aabd53674c3b061086498a14d6b6a85a9a85..36dc0ff81e4d3a038f108db0a8a7543bcda655e8 100644 (file)
@@ -1138,16 +1138,14 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
             #\r
             # For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.\r
             #\r
+            AutoGenH.Append('#define %s  %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
             if Unicode:\r
-                AutoGenH.Append('#define %s  %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
                 AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))\r
                 AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))\r
-                AutoGenH.Append('#define %s  %s%s\n' %(GetModeName, Type, PcdVariableName))\r
             else:\r
-                AutoGenH.Append('#define %s  %s%s\n' %(PcdValueName, Type, PcdVariableName))\r
                 AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))\r
                 AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVariableName, Array))\r
-                AutoGenH.Append('#define %s  %s%s\n' %(GetModeName, Type, PcdVariableName))\r
+            AutoGenH.Append('#define %s  %s%s\n' %(GetModeName, Type, PcdVariableName))\r
                 \r
             PcdDataSize = GetPcdSize(Pcd)\r
             if Pcd.Type == TAB_PCDS_FIXED_AT_BUILD:\r