struct.pack has become picky about h (short) and H (unsigned short).

This commit is contained in:
Jack Jansen 2000-10-22 21:59:23 +00:00
parent 339ecc61f8
commit 185f42d917
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ def mkpixmap(w, h, fmt, data):
"""kludge a pixmap together""" """kludge a pixmap together"""
fmtinfo = _fmt_to_mac[fmt] fmtinfo = _fmt_to_mac[fmt]
rv = struct.pack("lhhhhhhhlllhhhhlll", rv = struct.pack("lHhhhhhhlllhhhhlll",
id(data)+MacOS.string_id_to_buffer, # HACK HACK!! id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
w*2 + 0x8000, w*2 + 0x8000,
0, 0, h, w, 0, 0, h, w,

View File

@ -15,7 +15,7 @@ import imgformat
# PixMap data structure element format (as used with struct) # PixMap data structure element format (as used with struct)
_pmElemFormat = { _pmElemFormat = {
'baseAddr':'l', # address of pixel data 'baseAddr':'l', # address of pixel data
'rowBytes':'h', # bytes per row, plus 0x8000 'rowBytes':'H', # bytes per row, plus 0x8000
'bounds':'hhhh', # coordinates imposed over pixel data 'bounds':'hhhh', # coordinates imposed over pixel data
'top':'h', 'top':'h',
'left':'h', 'left':'h',