From 674e2014ce63040880208f2a0494fa1849f28f43 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Fri, 6 Apr 2018 07:14:01 +0800 Subject: [PATCH] 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 Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/GenC.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 8d76aabd53..36dc0ff81e 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: -- 2.39.2