From a7360838d7cc0b645b41d8b1713832ef4fbfdd64 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Sat, 28 Apr 2018 06:32:16 +0800 Subject: BaseTools: AutoGen - update to remove duplicate constant value PCD size by type is shared. just use it. 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/ValidCheckingInfoObject.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py') diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index df7a9b889a..602c90b3fe 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -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 -- cgit v1.2.3