]> xenbits.xensource.com Git - seabios.git/commitdiff
build: Be explicit that we want integers when dividing for python3 compat.
authorJohannes Krampf <johannes.krampf@googlemail.com>
Sun, 12 Jan 2014 16:19:22 +0000 (11:19 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 20 Jan 2014 17:42:43 +0000 (12:42 -0500)
Signed-off-by: Johannes Krampf <johannes.krampf@googlemail.com>
scripts/buildrom.py
scripts/checkrom.py
scripts/layoutrom.py

index f2228ab9c50f6309f54791c28368ff4640d1d37b..36de14ec08491a8e1c9b11b9407833b114d2f7ef 100755 (executable)
@@ -32,10 +32,10 @@ def main():
     # Check if a pci header is present
     pcidata = ord(data[24:25]) + (ord(data[25:26]) << 8)
     if pcidata != 0:
-        data = data[:pcidata + 16] + chr(count/512) + chr(0) + data[pcidata + 18:]
+        data = data[:pcidata + 16] + chr(int(count/512)) + chr(0) + data[pcidata + 18:]
 
     # Fill in size field; clear checksum field
-    data = data[:2] + chr(count/512) + data[3:6] + "\0" + data[7:]
+    data = data[:2] + chr(int(count/512)) + data[3:6] + "\0" + data[7:]
 
     # Checksum rom
     newsum = (256 - checksum(data)) & 0xff
index e724844c563913823735640f94707b7f36d4a6a3..30c9db248750fd9b47aaa6fdcc9fc86e8c736171 100755 (executable)
@@ -86,7 +86,7 @@ def main():
     print("Total size: %d  Fixed: %d  Free: %d (used %.1f%% of %dKiB rom)" % (
         datasize, runtimesize, finalsize - datasize
         , (datasize / float(finalsize)) * 100.0
-        , finalsize / 1024))
+        , int(finalsize / 1024)))
 
     # Write final file
     f = open(outfile, 'wb')
index c0b325d3f70b7af95d3a5483f26d393780a4957b..2f2b18906d4bf6cd13cd02084db4b4b87a747d6d 100755 (executable)
@@ -46,7 +46,7 @@ def setSectionsStart(sections, endaddr, minalign=1, segoffset=0):
         if section.align > minalign:
             minalign = section.align
         totspace = alignpos(totspace, section.align) + section.size
-    startaddr = (endaddr - totspace) / minalign * minalign
+    startaddr = int((endaddr - totspace) / minalign) * minalign
     curaddr = startaddr
     for section in sections:
         curaddr = alignpos(curaddr, section.align)
@@ -359,7 +359,7 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
 %s
     }
 """ % (li.zonelow_base,
-       li.zonelow_base / 16,
+       int(li.zonelow_base / 16),
        li.sec16_start - BUILD_BIOS_ADDR,
        outRelSections(li.sections16, 'code16_start', useseg=1))
     outfile = open(out16, 'wb')