remove ord() calls on what are now integers rather than characters

This commit is contained in:
Bill Janssen 2007-10-30 18:12:39 +00:00
parent 316414e435
commit 8cfe3a3276
1 changed files with 7 additions and 7 deletions

View File

@ -41,27 +41,27 @@ _ICOpaqueDataType=type(ICOpaqueData(''))
def _decode_default(data, key):
if len(data) == 0:
return data
if ord(data[0]) == len(data)-1:
if data[0] == len(data)-1:
# Assume Pstring
return data[1:]
return ICOpaqueData(data)
def _decode_multistr(data, key):
numstr = ord(data[0]) << 8 | ord(data[1])
numstr = data[0] << 8 | data[1]
rv = []
ptr = 2
for i in range(numstr):
strlen = ord(data[ptr])
strlen = data[ptr]
str = data[ptr+1:ptr+strlen+1]
rv.append(str)
ptr = ptr + strlen + 1
return rv
def _decode_fontrecord(data, key):
size = ord(data[0]) << 8 | ord(data[1])
face = ord(data[2])
namelen = ord(data[4])
size = data[0] << 8 | data[1]
face = data[2]
namelen = data[4]
return size, face, data[5:5+namelen]
def _decode_boolean(data, key):
@ -74,7 +74,7 @@ def _decode_charset(data, key):
return data[:256], data[256:]
def _decode_appspec(data, key):
namelen = ord(data[4])
namelen = data[4]
return data[0:4], data[5:5+namelen]
def _code_default(data, key):