summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Common/Misc.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-11 09:14:05 -0700
committerYonghong Zhu <yonghong.zhu@intel.com>2018-04-23 11:11:20 +0800
commit656d2539be34ea0ce356857ffd4f9decdf0476b2 (patch)
treed23ecf3f2009b6c496b2bd5ac4f38a97bb6592b5 /BaseTools/Source/Python/Common/Misc.py
parentb491aa95ab9e2e831f658bb74bf9ed67bff082ac (diff)
downloadedk2-656d2539be34ea0ce356857ffd4f9decdf0476b2.tar.gz
edk2-656d2539be34ea0ce356857ffd4f9decdf0476b2.tar.bz2
edk2-656d2539be34ea0ce356857ffd4f9decdf0476b2.zip
BaseTools: replace 'UINT8','UINT16','UINT32','UINT64','VOID*' with shared constants.
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>
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r--BaseTools/Source/Python/Common/Misc.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 4f2bfd63cf..60ae98c550 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1288,22 +1288,22 @@ def ParseFieldValue (Value):
if type(Value) <> type(''):
raise BadExpression('Type %s is %s' %(Value, type(Value)))
Value = Value.strip()
- if Value.startswith('UINT8') and Value.endswith(')'):
+ if Value.startswith(TAB_UINT8) and Value.endswith(')'):
Value, Size = ParseFieldValue(Value.split('(', 1)[1][:-1])
if Size > 1:
raise BadExpression('Value (%s) Size larger than %d' %(Value, Size))
return Value, 1
- if Value.startswith('UINT16') and Value.endswith(')'):
+ if Value.startswith(TAB_UINT16) and Value.endswith(')'):
Value, Size = ParseFieldValue(Value.split('(', 1)[1][:-1])
if Size > 2:
raise BadExpression('Value (%s) Size larger than %d' %(Value, Size))
return Value, 2
- if Value.startswith('UINT32') and Value.endswith(')'):
+ if Value.startswith(TAB_UINT32) and Value.endswith(')'):
Value, Size = ParseFieldValue(Value.split('(', 1)[1][:-1])
if Size > 4:
raise BadExpression('Value (%s) Size larger than %d' %(Value, Size))
return Value, 4
- if Value.startswith('UINT64') and Value.endswith(')'):
+ if Value.startswith(TAB_UINT64) and Value.endswith(')'):
Value, Size = ParseFieldValue(Value.split('(', 1)[1][:-1])
if Size > 8:
raise BadExpression('Value (%s) Size larger than %d' % (Value, Size))
@@ -1490,7 +1490,7 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
elif PcdType in (MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_VPD):
VpdOffset = FieldList[0]
Value = Size = ''
- if not DataType == 'VOID*':
+ if not DataType == TAB_VOID:
if len(FieldList) > 1:
Value = FieldList[1]
else:
@@ -1558,7 +1558,7 @@ def AnalyzePcdData(Setting):
# For PCD value setting
#
def CheckPcdDatum(Type, Value):
- if Type == "VOID*":
+ if Type == TAB_VOID:
ValueRe = re.compile(r'\s*L?\".*\"\s*$')
if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
or (Value.startswith('{') and Value.endswith('}')) or (Value.startswith("L'") or Value.startswith("'") and Value.endswith("'"))