BaseTools: Fix build fail when the number in validlist is long type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Bob Feng" <bob.c.feng@intel.com>
Reviewed-by: "Chen, Hesheng" <hesheng.chen@intel.com>




git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18256 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Bob Feng 2015-08-21 01:09:16 +00:00 committed by bobfeng
parent 9e8841b4f8
commit 072418e553
1 changed files with 3 additions and 4 deletions

View File

@ -31,7 +31,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
break break
else: else:
self.var_check_info.append(var_check_tab) self.var_check_info.append(var_check_tab)
def dump(self, dest, Phase): def dump(self, dest, Phase):
FormatMap = {} FormatMap = {}
@ -62,7 +62,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
itemIndex += 1 itemIndex += 1
realLength += 5 realLength += 5
for v_data in item.data: for v_data in item.data:
if type(v_data) == type(1): if type(v_data) in (int, long):
realLength += item.StorageWidth realLength += item.StorageWidth
else: else:
realLength += item.StorageWidth realLength += item.StorageWidth
@ -153,9 +153,8 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):
b = pack("=B", item.StorageWidth) b = pack("=B", item.StorageWidth)
Buffer += b Buffer += b
realLength += 1 realLength += 1
for v_data in item.data: for v_data in item.data:
if type(v_data) == type(1): if type(v_data) in (int, long):
b = pack(FormatMap[item.StorageWidth], v_data) b = pack(FormatMap[item.StorageWidth], v_data)
Buffer += b Buffer += b
realLength += item.StorageWidth realLength += item.StorageWidth