BaseTools: replace long by int

replace long by int
Because the long() was not exist in Python3

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Yunhua Feng
2018-12-03 10:29:40 +08:00
committed by Feng, Bob C
parent 1d2aa01cdf
commit af881abc65
8 changed files with 27 additions and 27 deletions

View File

@ -1562,7 +1562,7 @@ class FdfParser:
self.SetPcdLocalation(pcdPair)
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
self.Profile.PcdFileLineDict[pcdPair] = FileLineTuple
Obj.Size = long(Size, 0)
Obj.Size = int(Size, 0)
return True
if self._IsKeyword("ErasePolarity"):
@ -1597,7 +1597,7 @@ class FdfParser:
if not self._GetNextDecimalNumber() and not self._GetNextHexNumber():
raise Warning.Expected("address", self.FileName, self.CurrentLineNumber)
BsAddress = long(self._Token, 0)
BsAddress = int(self._Token, 0)
Obj.BsBaseAddress = BsAddress
if self._IsKeyword("RtBaseAddress"):
@ -1607,7 +1607,7 @@ class FdfParser:
if not self._GetNextDecimalNumber() and not self._GetNextHexNumber():
raise Warning.Expected("address", self.FileName, self.CurrentLineNumber)
RtAddress = long(self._Token, 0)
RtAddress = int(self._Token, 0)
Obj.RtBaseAddress = RtAddress
## _GetBlockStatements() method
@ -1655,7 +1655,7 @@ class FdfParser:
self.SetPcdLocalation(PcdPair)
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
self.Profile.PcdFileLineDict[PcdPair] = FileLineTuple
BlockSize = long(BlockSize, 0)
BlockSize = int(BlockSize, 0)
BlockNumber = None
if self._IsKeyword("NumBlocks"):
@ -1665,7 +1665,7 @@ class FdfParser:
if not self._GetNextDecimalNumber() and not self._GetNextHexNumber():
raise Warning.Expected("block numbers", self.FileName, self.CurrentLineNumber)
BlockNumber = long(self._Token, 0)
BlockNumber = int(self._Token, 0)
Obj.BlockSizeList.append((BlockSize, BlockNumber, BlockSizePcd))
return True
@ -1774,7 +1774,7 @@ class FdfParser:
Expr += CurCh
self._GetOneChar()
try:
return long(
return int(
ValueExpression(Expr,
self._CollectMacroPcd()
)(True), 0)
@ -1822,7 +1822,7 @@ class FdfParser:
RegionOffsetPcdPattern.match(self._CurrentLine()[self.CurrentOffsetWithinLine:]))
if IsRegionPcd:
RegionObj.PcdOffset = self._GetNextPcdSettings()
self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(theFd.BaseAddress, 0))
self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + int(theFd.BaseAddress, 0))
self.SetPcdLocalation(RegionObj.PcdOffset)
self._PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] = "0x%x" % RegionObj.Offset
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
@ -3134,9 +3134,9 @@ class FdfParser:
if FdfParser._Verify(Name, Value, 'UINT64'):
FmpData.MonotonicCount = Value
if FmpData.MonotonicCount.upper().startswith('0X'):
FmpData.MonotonicCount = (long)(FmpData.MonotonicCount, 16)
FmpData.MonotonicCount = int(FmpData.MonotonicCount, 16)
else:
FmpData.MonotonicCount = (long)(FmpData.MonotonicCount)
FmpData.MonotonicCount = int(FmpData.MonotonicCount)
if not self._GetNextToken():
break
else: