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>
This commit is contained in:
Carsey, Jaben 2018-04-06 07:14:01 +08:00 committed by Yonghong Zhu
parent d0ef841c8e
commit 674e2014ce
1 changed files with 2 additions and 4 deletions

View File

@ -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: