BaseTools: no need to do int() API work for it

int() with base=0 will already auto determine base from preceeding 0x/0X

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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-03-29 08:02:17 +08:00
committed by Yonghong Zhu
parent 4231a8193e
commit 0944818a19
4 changed files with 6 additions and 18 deletions

View File

@ -1146,10 +1146,7 @@ class FdfParser:
if Scope in ['UINT64', 'UINT8']:
ValueNumber = 0
try:
if Value.upper().startswith('0X'):
ValueNumber = int (Value, 16)
else:
ValueNumber = int (Value)
ValueNumber = int (Value, 0)
except:
EdkLogger.error("FdfParser", FORMAT_INVALID, "The value is not valid dec or hex number for %s." % Name)
if ValueNumber < 0: