BaseTools: AutoGen - update to remove duplicate constant value

PCD size by type is shared.  just use it.

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-28 06:32:16 +08:00 committed by Yonghong Zhu
parent bff747501b
commit a7360838d7
1 changed files with 4 additions and 9 deletions

View File

@ -250,16 +250,11 @@ class VAR_CHECK_PCD_VALID_OBJ(object):
self.data = set()
self.ValidData = True
self.updateStorageWidth()
def updateStorageWidth(self):
if self.PcdDataType == TAB_UINT8 or self.PcdDataType == "BOOLEAN":
self.StorageWidth = 1
elif self.PcdDataType == TAB_UINT16:
self.StorageWidth = 2
elif self.PcdDataType == TAB_UINT32:
self.StorageWidth = 4
elif self.PcdDataType == TAB_UINT64:
self.StorageWidth = 8
else:
try:
self.StorageWidth = int(MAX_SIZE_TYPE[self.PcdDataType])
except:
self.StorageWidth = 0
self.ValidData = False