summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>2018-04-06 07:14:01 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-04-10 10:05:16 +0800
commit674e2014ce63040880208f2a0494fa1849f28f43 (patch)
treee2dcb6217b6f1b1c152ce1566a94d51b28ceb2f8
parentd0ef841c8e46327b029965f2b4a79127428ce6a5 (diff)
downloadedk2-674e2014ce63040880208f2a0494fa1849f28f43.zip
edk2-674e2014ce63040880208f2a0494fa1849f28f43.tar.gz
edk2-674e2014ce63040880208f2a0494fa1849f28f43.tar.bz2
BaseTools: GenC - move content from both parts of if/else
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>
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 8d76aab..36dc0ff 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1138,16 +1138,14 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
#
# For unicode, UINT16 array will be generated, so the alignment of unicode is guaranteed.
#
+ AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
if Unicode:
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
else:
- AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, PcdVariableName))
AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s%s = %s;\n' % (Const, PcdVariableName, Array, Value))
AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVariableName, Array))
- AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
+ AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdVariableName))
PcdDataSize = GetPcdSize(Pcd)
if Pcd.Type == TAB_PCDS_FIXED_AT_BUILD: