summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-12-03 10:29:40 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-01 11:09:18 +0800
commitaf881abc6537298feade1c0b01a2a77224635647 (patch)
treef7166d3a4dbf8604d418df17acf39b636b40b0aa /BaseTools/Source/Python/GenFds
parent1d2aa01cdf4b853a79871bd13588c71a0eb3d601 (diff)
downloadedk2-af881abc6537298feade1c0b01a2a77224635647.zip
edk2-af881abc6537298feade1c0b01a2a77224635647.tar.gz
edk2-af881abc6537298feade1c0b01a2a77224635647.tar.bz2
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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r--BaseTools/Source/Python/GenFds/AprioriSection.py2
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py18
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py8
3 files changed, 14 insertions, 14 deletions
diff --git a/BaseTools/Source/Python/GenFds/AprioriSection.py b/BaseTools/Source/Python/GenFds/AprioriSection.py
index e7b856a..55d9932 100644
--- a/BaseTools/Source/Python/GenFds/AprioriSection.py
+++ b/BaseTools/Source/Python/GenFds/AprioriSection.py
@@ -97,7 +97,7 @@ class AprioriSection (object):
% (InfFileName, GenFdsGlobalVariable.ArchList))
GuidPart = Guid.split('-')
- Buffer.write(pack('I', long(GuidPart[0], 16)))
+ Buffer.write(pack('I', int(GuidPart[0], 16)))
Buffer.write(pack('H', int(GuidPart[1], 16)))
Buffer.write(pack('H', int(GuidPart[2], 16)))
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 3bcfd2d..69cb7de 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -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:
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index 2a5d473..ae5d7fd 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -626,9 +626,9 @@ class GenFds(object):
GenFdsGlobalVariable.InfLogger('\nFV Space Information')
for FvSpaceInfo in FvSpaceInfoList:
Name = FvSpaceInfo[0]
- TotalSizeValue = long(FvSpaceInfo[1], 0)
- UsedSizeValue = long(FvSpaceInfo[2], 0)
- FreeSizeValue = long(FvSpaceInfo[3], 0)
+ TotalSizeValue = int(FvSpaceInfo[1], 0)
+ UsedSizeValue = int(FvSpaceInfo[2], 0)
+ FreeSizeValue = int(FvSpaceInfo[3], 0)
if UsedSizeValue == TotalSizeValue:
Percentage = '100'
else:
@@ -655,7 +655,7 @@ class GenFds(object):
if PcdValue == '':
return
- Int64PcdValue = long(PcdValue, 0)
+ Int64PcdValue = int(PcdValue, 0)
if Int64PcdValue == 0 or Int64PcdValue < -1:
return