Rip out 'long' and 'L'-suffixed integer literals.

(Rough first cut.)
This commit is contained in:
Guido van Rossum 2007-01-15 16:59:06 +00:00
parent fc7bb8c786
commit e2a383d062
146 changed files with 1446 additions and 1477 deletions

View File

@ -331,12 +331,12 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
""" """
try: try:
short, long = self.responses[code] shortmsg, longmsg = self.responses[code]
except KeyError: except KeyError:
short, long = '???', '???' shortmsg, longmsg = '???', '???'
if message is None: if message is None:
message = short message = shortmsg
explain = long explain = longmsg
self.log_error("code %d, message %s", code, message) self.log_error("code %d, message %s", code, message)
# using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201) # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201)
content = (self.error_message_format % content = (self.error_message_format %

View File

@ -20,7 +20,7 @@ class UserString:
def __str__(self): return str(self.data) def __str__(self): return str(self.data)
def __repr__(self): return repr(self.data) def __repr__(self): return repr(self.data)
def __int__(self): return int(self.data) def __int__(self): return int(self.data)
def __long__(self): return long(self.data) def __long__(self): return int(self.data)
def __float__(self): return float(self.data) def __float__(self): return float(self.data)
def __complex__(self): return complex(self.data) def __complex__(self): return complex(self.data)
def __hash__(self): return hash(self.data) def __hash__(self): return hash(self.data)

View File

@ -142,7 +142,7 @@ __all__ = ["Error","open","openfp"]
class Error(Exception): class Error(Exception):
pass pass
_AIFC_version = 0xA2805140L # Version 1 of AIFF-C _AIFC_version = 0xA2805140 # Version 1 of AIFF-C
_skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \ _skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \
'APPL', 'NAME', 'AUTH', '(c) ', 'ANNO' 'APPL', 'NAME', 'AUTH', '(c) ', 'ANNO'
@ -191,7 +191,7 @@ def _read_float(f): # 10 bytes
f = _HUGE_VAL f = _HUGE_VAL
else: else:
expon = expon - 16383 expon = expon - 16383
f = (himant * 0x100000000L + lomant) * pow(2.0, expon - 63) f = (himant * 0x100000000 + lomant) * pow(2.0, expon - 63)
return sign * f return sign * f
def _write_short(f, x): def _write_short(f, x):
@ -233,10 +233,10 @@ def _write_float(f, x):
expon = expon | sign expon = expon | sign
fmant = math.ldexp(fmant, 32) fmant = math.ldexp(fmant, 32)
fsmant = math.floor(fmant) fsmant = math.floor(fmant)
himant = long(fsmant) himant = int(fsmant)
fmant = math.ldexp(fmant - fsmant, 32) fmant = math.ldexp(fmant - fsmant, 32)
fsmant = math.floor(fmant) fsmant = math.floor(fmant)
lomant = long(fsmant) lomant = int(fsmant)
_write_short(f, expon) _write_short(f, expon)
_write_long(f, himant) _write_long(f, himant)
_write_long(f, lomant) _write_long(f, lomant)

View File

@ -105,7 +105,7 @@ class async_chat (asyncore.dispatcher):
# no terminator, collect it all # no terminator, collect it all
self.collect_incoming_data (self.ac_in_buffer) self.collect_incoming_data (self.ac_in_buffer)
self.ac_in_buffer = '' self.ac_in_buffer = ''
elif isinstance(terminator, int) or isinstance(terminator, long): elif isinstance(terminator, int) or isinstance(terminator, int):
# numeric terminator # numeric terminator
n = terminator n = terminator
if lb < n: if lb < n:

View File

@ -129,7 +129,7 @@ _b32alphabet = {
_b32tab = _b32alphabet.items() _b32tab = _b32alphabet.items()
_b32tab.sort() _b32tab.sort()
_b32tab = [v for k, v in _b32tab] _b32tab = [v for k, v in _b32tab]
_b32rev = dict([(v, long(k)) for k, v in _b32alphabet.items()]) _b32rev = dict([(v, int(k)) for k, v in _b32alphabet.items()])
def b32encode(s): def b32encode(s):

View File

@ -99,7 +99,7 @@ _copy_dispatch = d = {}
def _copy_immutable(x): def _copy_immutable(x):
return x return x
for t in (type(None), int, long, float, bool, str, tuple, for t in (type(None), int, int, float, bool, str, tuple,
frozenset, type, xrange, types.ClassType, frozenset, type, xrange, types.ClassType,
types.BuiltinFunctionType, types.BuiltinFunctionType,
types.FunctionType): types.FunctionType):
@ -178,7 +178,7 @@ def _deepcopy_atomic(x, memo):
return x return x
d[type(None)] = _deepcopy_atomic d[type(None)] = _deepcopy_atomic
d[int] = _deepcopy_atomic d[int] = _deepcopy_atomic
d[long] = _deepcopy_atomic d[int] = _deepcopy_atomic
d[float] = _deepcopy_atomic d[float] = _deepcopy_atomic
d[bool] = _deepcopy_atomic d[bool] = _deepcopy_atomic
try: try:
@ -315,7 +315,7 @@ class _EmptyClass:
pass pass
def _test(): def _test():
l = [None, 1, 2L, 3.14, 'xyzzy', (1, 2L), [3.14, 'abc'], l = [None, 1, 2, 3.14, 'xyzzy', (1, 2), [3.14, 'abc'],
{'abc': 'ABC'}, (), [], {}] {'abc': 'ABC'}, (), [], {}]
l1 = copy(l) l1 = copy(l)
print l1==l print l1==l

View File

@ -369,7 +369,7 @@ class Sniffer:
for col in columnTypes.keys(): for col in columnTypes.keys():
for thisType in [int, long, float, complex]: for thisType in [int, int, float, complex]:
try: try:
thisType(row[col]) thisType(row[col])
break break
@ -380,7 +380,7 @@ class Sniffer:
thisType = len(row[col]) thisType = len(row[col])
# treat longs as ints # treat longs as ints
if thisType == long: if thisType == int:
thisType = int thisType = int
if thisType != columnTypes[col]: if thisType != columnTypes[col]:

View File

@ -66,7 +66,7 @@ def create_string_buffer(init, size=None):
buf = buftype() buf = buftype()
buf.value = init buf.value = init
return buf return buf
elif isinstance(init, (int, long)): elif isinstance(init, (int, int)):
buftype = c_char * init buftype = c_char * init
buf = buftype() buf = buftype()
return buf return buf
@ -285,7 +285,7 @@ else:
buf = buftype() buf = buftype()
buf.value = init buf.value = init
return buf return buf
elif isinstance(init, (int, long)): elif isinstance(init, (int, int)):
buftype = c_wchar * init buftype = c_wchar * init
buf = buftype() buf = buftype()
return buf return buf
@ -356,7 +356,7 @@ class CDLL(object):
def __getitem__(self, name_or_ordinal): def __getitem__(self, name_or_ordinal):
func = self._FuncPtr((name_or_ordinal, self)) func = self._FuncPtr((name_or_ordinal, self))
if not isinstance(name_or_ordinal, (int, long)): if not isinstance(name_or_ordinal, (int, int)):
func.__name__ = name_or_ordinal func.__name__ = name_or_ordinal
return func return func

View File

@ -133,7 +133,7 @@ class BasicWrapTestCase(unittest.TestCase):
f.argtypes = [c_longlong, MyCallback] f.argtypes = [c_longlong, MyCallback]
def callback(value): def callback(value):
self.failUnless(isinstance(value, (int, long))) self.failUnless(isinstance(value, (int, int)))
return value & 0x7FFFFFFF return value & 0x7FFFFFFF
cb = MyCallback(callback) cb = MyCallback(callback)

View File

@ -291,7 +291,7 @@ class FunctionTestCase(unittest.TestCase):
f.argtypes = [c_longlong, MyCallback] f.argtypes = [c_longlong, MyCallback]
def callback(value): def callback(value):
self.failUnless(isinstance(value, (int, long))) self.failUnless(isinstance(value, (int, int)))
return value & 0x7FFFFFFF return value & 0x7FFFFFFF
cb = MyCallback(callback) cb = MyCallback(callback)

View File

@ -93,7 +93,7 @@ class NumberTestCase(unittest.TestCase):
for t in float_types: for t in float_types:
self.failUnlessEqual(t(2.0).value, 2.0) self.failUnlessEqual(t(2.0).value, 2.0)
self.failUnlessEqual(t(2).value, 2.0) self.failUnlessEqual(t(2).value, 2.0)
self.failUnlessEqual(t(2L).value, 2.0) self.failUnlessEqual(t(2).value, 2.0)
def test_integers(self): def test_integers(self):
# integers cannot be constructed from floats # integers cannot be constructed from floats

View File

@ -5,8 +5,8 @@ import _ctypes_test
ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint,
c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float]
python_types = [int, int, int, int, int, long, python_types = [int, int, int, int, int, int,
int, long, long, long, float, float] int, int, int, int, float, float]
class PointersTestCase(unittest.TestCase): class PointersTestCase(unittest.TestCase):
@ -160,16 +160,16 @@ class PointersTestCase(unittest.TestCase):
def test_c_void_p(self): def test_c_void_p(self):
# http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470 # http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470
if sizeof(c_void_p) == 4: if sizeof(c_void_p) == 4:
self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, self.failUnlessEqual(c_void_p(0xFFFFFFFF).value,
c_void_p(-1).value) c_void_p(-1).value)
self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value,
c_void_p(-1).value) c_void_p(-1).value)
elif sizeof(c_void_p) == 8: elif sizeof(c_void_p) == 8:
self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, self.failUnlessEqual(c_void_p(0xFFFFFFFF).value,
0xFFFFFFFFL) 0xFFFFFFFF)
self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value,
c_void_p(-1).value) c_void_p(-1).value)
self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFFL).value, self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFF).value,
c_void_p(-1).value) c_void_p(-1).value)
self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted

View File

@ -33,7 +33,7 @@ def positive_address(a):
# View the bits in `a` as unsigned instead. # View the bits in `a` as unsigned instead.
import struct import struct
num_bits = struct.calcsize("P") * 8 # num bits in native machine address num_bits = struct.calcsize("P") * 8 # num bits in native machine address
a += 1L << num_bits a += 1 << num_bits
assert a >= 0 assert a >= 0
return a return a

View File

@ -545,7 +545,7 @@ class Decimal(object):
return self return self
# From an integer # From an integer
if isinstance(value, (int,long)): if isinstance(value, (int,int)):
if value >= 0: if value >= 0:
self._sign = 0 self._sign = 0
else: else:
@ -561,7 +561,7 @@ class Decimal(object):
if value[0] not in (0,1): if value[0] not in (0,1):
raise ValueError, 'Invalid sign' raise ValueError, 'Invalid sign'
for digit in value[1]: for digit in value[1]:
if not isinstance(digit, (int,long)) or digit < 0: if not isinstance(digit, (int,int)) or digit < 0:
raise ValueError, "The second value in the tuple must be composed of non negative integer elements." raise ValueError, "The second value in the tuple must be composed of non negative integer elements."
self._sign = value[0] self._sign = value[0]
@ -740,32 +740,32 @@ class Decimal(object):
return 1 return 1
def __eq__(self, other): def __eq__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) == 0 return self.__cmp__(other) == 0
def __ne__(self, other): def __ne__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) != 0 return self.__cmp__(other) != 0
def __lt__(self, other): def __lt__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) < 0 return self.__cmp__(other) < 0
def __le__(self, other): def __le__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) <= 0 return self.__cmp__(other) <= 0
def __gt__(self, other): def __gt__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) > 0 return self.__cmp__(other) > 0
def __ge__(self, other): def __ge__(self, other):
if not isinstance(other, (Decimal, int, long)): if not isinstance(other, (Decimal, int, int)):
return NotImplemented return NotImplemented
return self.__cmp__(other) >= 0 return self.__cmp__(other) >= 0
@ -1529,7 +1529,7 @@ class Decimal(object):
Equivalent to long(int(self)) Equivalent to long(int(self))
""" """
return long(self.__int__()) return int(self.__int__())
def _fix(self, context): def _fix(self, context):
"""Round if it is necessary to keep self within prec precision. """Round if it is necessary to keep self within prec precision.
@ -2986,7 +2986,7 @@ def _convert_other(other):
""" """
if isinstance(other, Decimal): if isinstance(other, Decimal):
return other return other
if isinstance(other, (int, long)): if isinstance(other, (int, int)):
return Decimal(other) return Decimal(other)
return NotImplemented return NotImplemented

View File

@ -86,7 +86,7 @@ def disassemble(co, lasti=-1):
extended_arg = 0 extended_arg = 0
i = i+2 i = i+2
if op == EXTENDED_ARG: if op == EXTENDED_ARG:
extended_arg = oparg*65536L extended_arg = oparg*65536
print repr(oparg).rjust(5), print repr(oparg).rjust(5),
if op in hasconst: if op in hasconst:
print '(' + repr(co.co_consts[oparg]) + ')', print '(' + repr(co.co_consts[oparg]) + ')',

View File

@ -41,8 +41,8 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
[('Hello World!', None), [('Hello World!', None),
('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'),
('Gr\xfc\xdf Gott!', 'iso-8859-1')]) ('Gr\xfc\xdf Gott!', 'iso-8859-1')])
long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' int = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9'
h = Header(long, j, header_name="Subject") h = Header(int, j, header_name="Subject")
# test a very long header # test a very long header
enc = h.encode() enc = h.encode()
# TK: splitting point may differ by codec design and/or Header encoding # TK: splitting point may differ by codec design and/or Header encoding
@ -50,7 +50,7 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= =?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?=
=?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""")
# TK: full decode comparison # TK: full decode comparison
eq(h.__unicode__().encode('euc-jp'), long) eq(h.__unicode__().encode('euc-jp'), int)
def test_payload_encoding(self): def test_payload_encoding(self):
jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa'

View File

@ -41,8 +41,8 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
[('Hello World!', None), [('Hello World!', None),
('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'),
('Gr\xfc\xdf Gott!', 'iso-8859-1')]) ('Gr\xfc\xdf Gott!', 'iso-8859-1')])
long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' int = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9'
h = Header(long, j, header_name="Subject") h = Header(int, j, header_name="Subject")
# test a very long header # test a very long header
enc = h.encode() enc = h.encode()
# TK: splitting point may differ by codec design and/or Header encoding # TK: splitting point may differ by codec design and/or Header encoding
@ -50,7 +50,7 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=
=?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= =?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?=
=?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""")
# TK: full decode comparison # TK: full decode comparison
eq(h.__unicode__().encode('euc-jp'), long) eq(h.__unicode__().encode('euc-jp'), int)
def test_payload_encoding(self): def test_payload_encoding(self):
jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa'

View File

@ -514,7 +514,7 @@ class FTP:
try: try:
return int(s) return int(s)
except (OverflowError, ValueError): except (OverflowError, ValueError):
return long(s) return int(s)
def mkd(self, dirname): def mkd(self, dirname):
'''Make a directory, return its full pathname.''' '''Make a directory, return its full pathname.'''
@ -564,7 +564,7 @@ def parse150(resp):
try: try:
return int(s) return int(s)
except (OverflowError, ValueError): except (OverflowError, ValueError):
return long(s) return int(s)
_227_re = None _227_re = None

View File

@ -256,8 +256,8 @@ class NullTranslations:
class GNUTranslations(NullTranslations): class GNUTranslations(NullTranslations):
# Magic number of .mo files # Magic number of .mo files
LE_MAGIC = 0x950412deL LE_MAGIC = 0x950412de
BE_MAGIC = 0xde120495L BE_MAGIC = 0xde120495
def _parse(self, fp): def _parse(self, fp):
"""Override this method to support alternative .mo formats.""" """Override this method to support alternative .mo formats."""

View File

@ -21,12 +21,12 @@ def U32(i):
If it's >= 2GB when viewed as a 32-bit unsigned int, return a long. If it's >= 2GB when viewed as a 32-bit unsigned int, return a long.
""" """
if i < 0: if i < 0:
i += 1L << 32 i += 1 << 32
return i return i
def LOWU32(i): def LOWU32(i):
"""Return the low-order 32 bits of an int, as a non-negative int.""" """Return the low-order 32 bits of an int, as a non-negative int."""
return i & 0xFFFFFFFFL return i & 0xFFFFFFFF
def write32(output, value): def write32(output, value):
output.write(struct.pack("<l", value)) output.write(struct.pack("<l", value))
@ -148,7 +148,7 @@ class GzipFile:
if fname: if fname:
flags = FNAME flags = FNAME
self.fileobj.write(chr(flags)) self.fileobj.write(chr(flags))
write32u(self.fileobj, long(time.time())) write32u(self.fileobj, int(time.time()))
self.fileobj.write('\002') self.fileobj.write('\002')
self.fileobj.write('\377') self.fileobj.write('\377')
if fname: if fname:

View File

@ -500,7 +500,7 @@ def _timestamp(pathname):
s = _os_stat(pathname) s = _os_stat(pathname)
except OSError: except OSError:
return None return None
return long(s.st_mtime) return int(s.st_mtime)
###################################################################### ######################################################################
@ -583,7 +583,7 @@ class _FilesystemImporter(Importer):
def py_suffix_importer(filename, finfo, fqname): def py_suffix_importer(filename, finfo, fqname):
file = filename[:-3] + _suffix file = filename[:-3] + _suffix
t_py = long(finfo[8]) t_py = int(finfo[8])
t_pyc = _timestamp(file) t_pyc = _timestamp(file)
code = None code = None

View File

@ -251,7 +251,7 @@ class LogRecord:
self.lineno = lineno self.lineno = lineno
self.funcName = func self.funcName = func
self.created = ct self.created = ct
self.msecs = (ct - long(ct)) * 1000 self.msecs = (ct - int(ct)) * 1000
self.relativeCreated = (self.created - _startTime) * 1000 self.relativeCreated = (self.created - _startTime) * 1000
if logThreads and thread: if logThreads and thread:
self.thread = thread.get_ident() self.thread = thread.get_ident()

View File

@ -2043,7 +2043,7 @@ class MHMailbox:
# list = map(long, filter(pat.match, os.listdir(self.dirname))) # list = map(long, filter(pat.match, os.listdir(self.dirname)))
list = os.listdir(self.dirname) list = os.listdir(self.dirname)
list = filter(pat.match, list) list = filter(pat.match, list)
list = map(long, list) list = map(int, list)
list.sort() list.sort()
# This only works in Python 1.6 or later; # This only works in Python 1.6 or later;
# before that str() added 'L': # before that str() added 'L':

View File

@ -99,7 +99,7 @@ def add_data(db, table, values):
assert len(value) == count, value assert len(value) == count, value
for i in range(count): for i in range(count):
field = value[i] field = value[i]
if isinstance(field, (int, long)): if isinstance(field, (int, int)):
r.SetInteger(i+1,field) r.SetInteger(i+1,field)
elif isinstance(field, basestring): elif isinstance(field, basestring):
r.SetString(i+1,field) r.SetString(i+1,field)

View File

@ -407,7 +407,7 @@ def _parse_int(val):
return _parse_num(val, int) return _parse_num(val, int)
def _parse_long(val): def _parse_long(val):
return _parse_num(val, long) return _parse_num(val, int)
_builtin_cvt = { "int" : (_parse_int, _("integer")), _builtin_cvt = { "int" : (_parse_int, _("integer")),
"long" : (_parse_long, _("long integer")), "long" : (_parse_long, _("long integer")),

View File

@ -898,7 +898,7 @@ class Unpickler:
try: try:
val = int(data) val = int(data)
except ValueError: except ValueError:
val = long(data) val = int(data)
self.append(val) self.append(val)
dispatch[INT] = load_int dispatch[INT] = load_int
@ -915,7 +915,7 @@ class Unpickler:
dispatch[BININT2] = load_binint2 dispatch[BININT2] = load_binint2
def load_long(self): def load_long(self):
self.append(long(self.readline()[:-1], 0)) self.append(int(self.readline()[:-1], 0))
dispatch[LONG] = load_long dispatch[LONG] = load_long
def load_long1(self): def load_long1(self):
@ -1239,22 +1239,22 @@ import binascii as _binascii
def encode_long(x): def encode_long(x):
r"""Encode a long to a two's complement little-endian binary string. r"""Encode a long to a two's complement little-endian binary string.
Note that 0L is a special case, returning an empty string, to save a Note that 0 is a special case, returning an empty string, to save a
byte in the LONG1 pickling context. byte in the LONG1 pickling context.
>>> encode_long(0L) >>> encode_long(0)
'' ''
>>> encode_long(255L) >>> encode_long(255)
'\xff\x00' '\xff\x00'
>>> encode_long(32767L) >>> encode_long(32767)
'\xff\x7f' '\xff\x7f'
>>> encode_long(-256L) >>> encode_long(-256)
'\x00\xff' '\x00\xff'
>>> encode_long(-32768L) >>> encode_long(-32768)
'\x00\x80' '\x00\x80'
>>> encode_long(-128L) >>> encode_long(-128)
'\x80' '\x80'
>>> encode_long(127L) >>> encode_long(127)
'\x7f' '\x7f'
>>> >>>
""" """
@ -1284,7 +1284,7 @@ def encode_long(x):
# Extend to a full byte. # Extend to a full byte.
nibbles += 1 nibbles += 1
nbits = nibbles * 4 nbits = nibbles * 4
x += 1L << nbits x += 1 << nbits
assert x > 0 assert x > 0
ashex = hex(x) ashex = hex(x)
njunkchars = 2 + ashex.endswith('L') njunkchars = 2 + ashex.endswith('L')
@ -1324,11 +1324,11 @@ def decode_long(data):
nbytes = len(data) nbytes = len(data)
if nbytes == 0: if nbytes == 0:
return 0L return 0
ashex = _binascii.hexlify(data[::-1]) ashex = _binascii.hexlify(data[::-1])
n = long(ashex, 16) # quadratic time before Python 2.3; linear now n = int(ashex, 16) # quadratic time before Python 2.3; linear now
if data[-1] >= '\x80': if data[-1] >= '\x80':
n -= 1L << (nbytes * 8) n -= 1 << (nbytes * 8)
return n return n
# Shorthands # Shorthands

View File

@ -511,7 +511,7 @@ def read_decimalnl_short(f):
try: try:
return int(s) return int(s)
except OverflowError: except OverflowError:
return long(s) return int(s)
def read_decimalnl_long(f): def read_decimalnl_long(f):
r""" r"""
@ -525,7 +525,7 @@ def read_decimalnl_long(f):
""" """
s = read_stringnl(f, decode=False, stripquotes=False) s = read_stringnl(f, decode=False, stripquotes=False)
return long(s) return int(s)
decimalnl_short = ArgumentDescriptor( decimalnl_short = ArgumentDescriptor(
@ -676,7 +676,7 @@ long4 = ArgumentDescriptor(
This first reads four bytes as a signed size (but requires the This first reads four bytes as a signed size (but requires the
size to be >= 0), then reads that many bytes and interprets them size to be >= 0), then reads that many bytes and interprets them
as a little-endian 2's-complement long. If the size is 0, that's taken as a little-endian 2's-complement long. If the size is 0, that's taken
as a shortcut for the long 0L, although LONG1 should really be used as a shortcut for the int 0, although LONG1 should really be used
then instead (and in any case where # of bytes < 256). then instead (and in any case where # of bytes < 256).
""") """)
@ -724,12 +724,12 @@ pyint = StackObject(
pylong = StackObject( pylong = StackObject(
name='long', name='long',
obtype=long, obtype=int,
doc="A long (as opposed to short) Python integer object.") doc="A long (as opposed to short) Python integer object.")
pyinteger_or_bool = StackObject( pyinteger_or_bool = StackObject(
name='int_or_bool', name='int_or_bool',
obtype=(int, long, bool), obtype=(int, int, bool),
doc="A Python integer object (short or long), or " doc="A Python integer object (short or long), or "
"a Python bool.") "a Python bool.")

View File

@ -86,30 +86,30 @@ IPPROTO_MAX = 256
IPPORT_RESERVED = 1024 IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000 IPPORT_USERRESERVED = 5000
IPPORT_TIMESERVER = 37 IPPORT_TIMESERVER = 37
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_LOOPBACK = 0x7f000001 INADDR_LOOPBACK = 0x7f000001

View File

@ -111,24 +111,24 @@ IPPROTO_MAX = 256
IPPORT_RESERVED = 1024 IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000 IPPORT_USERRESERVED = 5000
IPPORT_TIMESERVER = 37 IPPORT_TIMESERVER = 37
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
@ -138,9 +138,9 @@ IN_CLASSD_HOST = 0x0fffffff
INADDR_UNSPEC_GROUP = 0xe0000000 INADDR_UNSPEC_GROUP = 0xe0000000
INADDR_ALLHOSTS_GROUP = 0xe0000001 INADDR_ALLHOSTS_GROUP = 0xe0000001
INADDR_MAX_LOCAL_GROUP = 0xe00000ff INADDR_MAX_LOCAL_GROUP = 0xe00000ff
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_BROADCAST = 0xffffffff INADDR_BROADCAST = 0xffffffff

View File

@ -7,7 +7,7 @@ __USE_ANSI = 1
__FAVOR_BSD = 1 __FAVOR_BSD = 1
_ISOC9X_SOURCE = 1 _ISOC9X_SOURCE = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 500 _XOPEN_SOURCE = 500
_XOPEN_SOURCE_EXTENDED = 1 _XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1 _LARGEFILE64_SOURCE = 1
@ -18,7 +18,7 @@ _SVID_SOURCE = 1
__USE_ISOC9X = 1 __USE_ISOC9X = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
__USE_POSIX = 1 __USE_POSIX = 1
__USE_POSIX2 = 1 __USE_POSIX2 = 1
__USE_POSIX199309 = 1 __USE_POSIX199309 = 1
@ -110,8 +110,8 @@ CHAR_MAX = 127
CHAR_MIN = (-128) CHAR_MIN = (-128)
INT_MAX = 2147483647 INT_MAX = 2147483647
INT_MIN = (-2147483647-1) INT_MIN = (-2147483647-1)
LONG_MAX = 2147483647L LONG_MAX = 2147483647
LONG_MIN = (-2147483647L-1L) LONG_MIN = (-2147483647-1)
SCHAR_MAX = 127 SCHAR_MAX = 127
SCHAR_MIN = (-128) SCHAR_MIN = (-128)
SHRT_MAX = 32767 SHRT_MAX = 32767
@ -206,10 +206,10 @@ USHRT_MAX = 65535
INT_MIN = (-INT_MAX - 1) INT_MIN = (-INT_MAX - 1)
INT_MAX = 2147483647 INT_MAX = 2147483647
UINT_MAX = 4294967295 UINT_MAX = 4294967295
LONG_MAX = 9223372036854775807L LONG_MAX = 9223372036854775807
LONG_MAX = 2147483647L LONG_MAX = 2147483647
LONG_MIN = (-LONG_MAX - 1L) LONG_MIN = (-LONG_MAX - 1)
ULONG_MAX = 4294967295L ULONG_MAX = 4294967295
# Included from stdint.h # Included from stdint.h
_STDINT_H = 1 _STDINT_H = 1
@ -243,27 +243,27 @@ INT_LEAST32_MAX = (2147483647)
INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) INT_LEAST64_MAX = (__INT64_C(9223372036854775807))
UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615))
INT_FAST8_MIN = (-128) INT_FAST8_MIN = (-128)
INT_FAST16_MIN = (-9223372036854775807L-1) INT_FAST16_MIN = (-9223372036854775807-1)
INT_FAST32_MIN = (-9223372036854775807L-1) INT_FAST32_MIN = (-9223372036854775807-1)
INT_FAST16_MIN = (-2147483647-1) INT_FAST16_MIN = (-2147483647-1)
INT_FAST32_MIN = (-2147483647-1) INT_FAST32_MIN = (-2147483647-1)
INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1)
INT_FAST8_MAX = (127) INT_FAST8_MAX = (127)
INT_FAST16_MAX = (9223372036854775807L) INT_FAST16_MAX = (9223372036854775807)
INT_FAST32_MAX = (9223372036854775807L) INT_FAST32_MAX = (9223372036854775807)
INT_FAST16_MAX = (2147483647) INT_FAST16_MAX = (2147483647)
INT_FAST32_MAX = (2147483647) INT_FAST32_MAX = (2147483647)
INT_FAST64_MAX = (__INT64_C(9223372036854775807)) INT_FAST64_MAX = (__INT64_C(9223372036854775807))
UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) UINT_FAST64_MAX = (__UINT64_C(18446744073709551615))
INTPTR_MIN = (-9223372036854775807L-1) INTPTR_MIN = (-9223372036854775807-1)
INTPTR_MAX = (9223372036854775807L) INTPTR_MAX = (9223372036854775807)
INTPTR_MIN = (-2147483647-1) INTPTR_MIN = (-2147483647-1)
INTPTR_MAX = (2147483647) INTPTR_MAX = (2147483647)
INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) INTMAX_MIN = (-__INT64_C(9223372036854775807)-1)
INTMAX_MAX = (__INT64_C(9223372036854775807)) INTMAX_MAX = (__INT64_C(9223372036854775807))
UINTMAX_MAX = (__UINT64_C(18446744073709551615)) UINTMAX_MAX = (__UINT64_C(18446744073709551615))
PTRDIFF_MIN = (-9223372036854775807L-1) PTRDIFF_MIN = (-9223372036854775807-1)
PTRDIFF_MAX = (9223372036854775807L) PTRDIFF_MAX = (9223372036854775807)
PTRDIFF_MIN = (-2147483647-1) PTRDIFF_MIN = (-2147483647-1)
PTRDIFF_MAX = (2147483647) PTRDIFF_MAX = (2147483647)
SIG_ATOMIC_MIN = (-2147483647-1) SIG_ATOMIC_MIN = (-2147483647-1)
@ -684,7 +684,7 @@ IP_ADR_LEN = 4
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_BROADCAST = 0xffffffff INADDR_BROADCAST = 0xffffffff
INADDR_LOOPBACK = 0x7f000001 INADDR_LOOPBACK = 0x7f000001
def CMSG_ALIGN(len): return ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) def CMSG_ALIGN(len): return ( ((len)+sizeof(int)-1) & ~(sizeof(int)-1) )
PROT_SOCK = 1024 PROT_SOCK = 1024
SHUTDOWN_MASK = 3 SHUTDOWN_MASK = 3

View File

@ -7,7 +7,7 @@ __USE_ANSI = 1
__FAVOR_BSD = 1 __FAVOR_BSD = 1
_ISOC9X_SOURCE = 1 _ISOC9X_SOURCE = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 500 _XOPEN_SOURCE = 500
_XOPEN_SOURCE_EXTENDED = 1 _XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1 _LARGEFILE64_SOURCE = 1
@ -18,7 +18,7 @@ _SVID_SOURCE = 1
__USE_ISOC9X = 1 __USE_ISOC9X = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
__USE_POSIX = 1 __USE_POSIX = 1
__USE_POSIX2 = 1 __USE_POSIX2 = 1
__USE_POSIX199309 = 1 __USE_POSIX199309 = 1

View File

@ -34,7 +34,7 @@ __GLIBC_MINOR__ = 1
# Included from null.h # Included from null.h
NULL = (0) NULL = (0)
NULL = 0L NULL = 0
# Included from size_t.h # Included from size_t.h
@ -100,8 +100,8 @@ CHAR_MAX = SCHAR_MAX
MB_LEN_MAX = (1) MB_LEN_MAX = (1)
SHRT_MIN = (-32767-1) SHRT_MIN = (-32767-1)
SHRT_MAX = (32767) SHRT_MAX = (32767)
LONG_MIN = (-2147483647L-1) LONG_MIN = (-2147483647-1)
LONG_MAX = (2147483647L) LONG_MAX = (2147483647)
INT_MIN = LONG_MIN INT_MIN = LONG_MIN
INT_MAX = LONG_MAX INT_MAX = LONG_MAX
ARG_MAX = (32768) ARG_MAX = (32768)
@ -118,7 +118,7 @@ NGROUPS_MAX = (32)
OPEN_MAX = (128) OPEN_MAX = (128)
PATH_MAX = (1024) PATH_MAX = (1024)
PIPE_MAX = (512) PIPE_MAX = (512)
SSIZE_MAX = (2147483647L) SSIZE_MAX = (2147483647)
TTY_NAME_MAX = (256) TTY_NAME_MAX = (256)
TZNAME_MAX = (32) TZNAME_MAX = (32)
SYMLINKS_MAX = (16) SYMLINKS_MAX = (16)
@ -133,7 +133,7 @@ _POSIX_NGROUPS_MAX = (0)
_POSIX_OPEN_MAX = (128) _POSIX_OPEN_MAX = (128)
_POSIX_PATH_MAX = (1024) _POSIX_PATH_MAX = (1024)
_POSIX_PIPE_BUF = (512) _POSIX_PIPE_BUF = (512)
_POSIX_SSIZE_MAX = (2147483647L) _POSIX_SSIZE_MAX = (2147483647)
_POSIX_STREAM_MAX = (8) _POSIX_STREAM_MAX = (8)
_POSIX_TTY_NAME_MAX = (256) _POSIX_TTY_NAME_MAX = (256)
_POSIX_TZNAME_MAX = (3) _POSIX_TZNAME_MAX = (3)

View File

@ -101,33 +101,33 @@ IPPORT_USERRESERVED = 5000
IPPORT_HIFIRSTAUTO = 40000 IPPORT_HIFIRSTAUTO = 40000
IPPORT_HILASTAUTO = 44999 IPPORT_HILASTAUTO = 44999
IPPORT_RESERVEDSTART = 600 IPPORT_RESERVEDSTART = 600
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28 IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_BROADCAST = 0xffffffff INADDR_BROADCAST = 0xffffffff

View File

@ -101,33 +101,33 @@ IPPORT_USERRESERVED = 5000
IPPORT_HIFIRSTAUTO = 49152 IPPORT_HIFIRSTAUTO = 49152
IPPORT_HILASTAUTO = 65535 IPPORT_HILASTAUTO = 65535
IPPORT_RESERVEDSTART = 600 IPPORT_RESERVEDSTART = 600
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28 IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_LOOPBACK = 0x7f000001 INADDR_LOOPBACK = 0x7f000001

View File

@ -61,33 +61,33 @@ IPPROTO_MAX = 256
IPPORT_RESERVED = 1024 IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000 IPPORT_USERRESERVED = 5000
IPPORT_MAXPORT = 65535 IPPORT_MAXPORT = 65535
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28 IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_BROADCAST = 0xffffffff INADDR_BROADCAST = 0xffffffff

View File

@ -43,7 +43,7 @@ FD_SETSIZE = 1024
__NBBY = 8 __NBBY = 8
# Included from string.h # Included from string.h
NULL = 0L NULL = 0
NBBY = 8 NBBY = 8
# Included from sys/cpumask.h # Included from sys/cpumask.h
@ -332,9 +332,9 @@ CTX_FS5 = 30
SV_ONSTACK = 0x0001 SV_ONSTACK = 0x0001
SV_INTERRUPT = 0x0002 SV_INTERRUPT = 0x0002
NUMBSDSIGS = (32) NUMBSDSIGS = (32)
def sigmask(sig): return (1L << ((sig)-1)) def sigmask(sig): return (1 << ((sig)-1))
def sigmask(sig): return (1L << ((sig)-1)) def sigmask(sig): return (1 << ((sig)-1))
SIG_ERR = (-1) SIG_ERR = (-1)
SIG_IGN = (1) SIG_IGN = (1)
@ -356,7 +356,7 @@ BRK_PSEUDO_OP_BIT = 0x80
BRK_PSEUDO_OP_MAX = 0x3 BRK_PSEUDO_OP_MAX = 0x3
BRK_CACHE_SYNC = 0x80 BRK_CACHE_SYNC = 0x80
BRK_MULOVF = 1023 BRK_MULOVF = 1023
_POSIX_VERSION = 199506L _POSIX_VERSION = 199506
_POSIX_VERSION = 199506 _POSIX_VERSION = 199506
_POSIX_VDISABLE = 0 _POSIX_VDISABLE = 0
MAX_INPUT = 512 MAX_INPUT = 512
@ -414,7 +414,7 @@ BPCSHIFT = 14
CPSSHIFT = 12 CPSSHIFT = 12
CPSSHIFT = 11 CPSSHIFT = 11
BPSSHIFT = (BPCSHIFT+CPSSHIFT) BPSSHIFT = (BPCSHIFT+CPSSHIFT)
NULL = 0L NULL = 0
CMASK = 022 CMASK = 022
NODEV = (-1) NODEV = (-1)
NOPAGE = (-1) NOPAGE = (-1)
@ -464,7 +464,7 @@ def DELAY(n): return us_delay(n)
def DELAYBUS(n): return us_delaybus(n) def DELAYBUS(n): return us_delaybus(n)
TIMEPOKE_NOW = -100L TIMEPOKE_NOW = -100
MUTEX_DEFAULT = 0x0 MUTEX_DEFAULT = 0x0
METER_NAMSZ = 16 METER_NAMSZ = 16
METER_NO_SEQ = -1 METER_NO_SEQ = -1

View File

@ -37,7 +37,7 @@ FD_SETSIZE = 1024
__NBBY = 8 __NBBY = 8
# Included from string.h # Included from string.h
NULL = 0L NULL = 0
NBBY = 8 NBBY = 8
# Included from sys/endian.h # Included from sys/endian.h

View File

@ -68,7 +68,7 @@ FD_SETSIZE = 1024
__NBBY = 8 __NBBY = 8
# Included from string.h # Included from string.h
NULL = 0L NULL = 0
NBBY = 8 NBBY = 8
# Included from sys/procset.h # Included from sys/procset.h
@ -286,9 +286,9 @@ CXT_SR = CTX_SR
SV_ONSTACK = 0x0001 SV_ONSTACK = 0x0001
SV_INTERRUPT = 0x0002 SV_INTERRUPT = 0x0002
NUMBSDSIGS = (32) NUMBSDSIGS = (32)
def sigmask(sig): return (1L << ((sig)-1)) def sigmask(sig): return (1 << ((sig)-1))
def sigmask(sig): return (1L << ((sig)-1)) def sigmask(sig): return (1 << ((sig)-1))
SIG_ERR = (-1) SIG_ERR = (-1)
SIG_IGN = (1) SIG_IGN = (1)

View File

@ -7,7 +7,7 @@ __USE_ANSI = 1
__FAVOR_BSD = 1 __FAVOR_BSD = 1
_ISOC99_SOURCE = 1 _ISOC99_SOURCE = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600 _XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1 _XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1 _LARGEFILE64_SOURCE = 1
@ -18,7 +18,7 @@ _SVID_SOURCE = 1
__USE_ISOC99 = 1 __USE_ISOC99 = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
__USE_POSIX = 1 __USE_POSIX = 1
__USE_POSIX2 = 1 __USE_POSIX2 = 1
__USE_POSIX199309 = 1 __USE_POSIX199309 = 1
@ -40,7 +40,7 @@ __USE_GNU = 1
__USE_REENTRANT = 1 __USE_REENTRANT = 1
__STDC_IEC_559__ = 1 __STDC_IEC_559__ = 1
__STDC_IEC_559_COMPLEX__ = 1 __STDC_IEC_559_COMPLEX__ = 1
__STDC_ISO_10646__ = 200009L __STDC_ISO_10646__ = 200009
__GNU_LIBRARY__ = 6 __GNU_LIBRARY__ = 6
__GLIBC__ = 2 __GLIBC__ = 2
__GLIBC_MINOR__ = 2 __GLIBC_MINOR__ = 2

View File

@ -7,7 +7,7 @@ __USE_ANSI = 1
__FAVOR_BSD = 1 __FAVOR_BSD = 1
_ISOC99_SOURCE = 1 _ISOC99_SOURCE = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600 _XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1 _XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1 _LARGEFILE64_SOURCE = 1
@ -18,7 +18,7 @@ _SVID_SOURCE = 1
__USE_ISOC99 = 1 __USE_ISOC99 = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
__USE_POSIX = 1 __USE_POSIX = 1
__USE_POSIX2 = 1 __USE_POSIX2 = 1
__USE_POSIX199309 = 1 __USE_POSIX199309 = 1
@ -40,7 +40,7 @@ __USE_GNU = 1
__USE_REENTRANT = 1 __USE_REENTRANT = 1
__STDC_IEC_559__ = 1 __STDC_IEC_559__ = 1
__STDC_IEC_559_COMPLEX__ = 1 __STDC_IEC_559_COMPLEX__ = 1
__STDC_ISO_10646__ = 200009L __STDC_ISO_10646__ = 200009
__GNU_LIBRARY__ = 6 __GNU_LIBRARY__ = 6
__GLIBC__ = 2 __GLIBC__ = 2
__GLIBC_MINOR__ = 2 __GLIBC_MINOR__ = 2
@ -78,8 +78,8 @@ _STDINT_H = 1
# Included from bits/wchar.h # Included from bits/wchar.h
_BITS_WCHAR_H = 1 _BITS_WCHAR_H = 1
__WCHAR_MIN = (-2147483647l - 1l) __WCHAR_MIN = (-2147483647 - 1)
__WCHAR_MAX = (2147483647l) __WCHAR_MAX = (2147483647)
# Included from bits/wordsize.h # Included from bits/wordsize.h
__WORDSIZE = 32 __WORDSIZE = 32
@ -114,28 +114,28 @@ UINT_LEAST8_MAX = (255)
UINT_LEAST16_MAX = (65535) UINT_LEAST16_MAX = (65535)
UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615))
INT_FAST8_MIN = (-128) INT_FAST8_MIN = (-128)
INT_FAST16_MIN = (-9223372036854775807L-1) INT_FAST16_MIN = (-9223372036854775807-1)
INT_FAST32_MIN = (-9223372036854775807L-1) INT_FAST32_MIN = (-9223372036854775807-1)
INT_FAST16_MIN = (-2147483647-1) INT_FAST16_MIN = (-2147483647-1)
INT_FAST32_MIN = (-2147483647-1) INT_FAST32_MIN = (-2147483647-1)
INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1)
INT_FAST8_MAX = (127) INT_FAST8_MAX = (127)
INT_FAST16_MAX = (9223372036854775807L) INT_FAST16_MAX = (9223372036854775807)
INT_FAST32_MAX = (9223372036854775807L) INT_FAST32_MAX = (9223372036854775807)
INT_FAST16_MAX = (2147483647) INT_FAST16_MAX = (2147483647)
INT_FAST32_MAX = (2147483647) INT_FAST32_MAX = (2147483647)
INT_FAST64_MAX = (__INT64_C(9223372036854775807)) INT_FAST64_MAX = (__INT64_C(9223372036854775807))
UINT_FAST8_MAX = (255) UINT_FAST8_MAX = (255)
UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) UINT_FAST64_MAX = (__UINT64_C(18446744073709551615))
INTPTR_MIN = (-9223372036854775807L-1) INTPTR_MIN = (-9223372036854775807-1)
INTPTR_MAX = (9223372036854775807L) INTPTR_MAX = (9223372036854775807)
INTPTR_MIN = (-2147483647-1) INTPTR_MIN = (-2147483647-1)
INTPTR_MAX = (2147483647) INTPTR_MAX = (2147483647)
INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) INTMAX_MIN = (-__INT64_C(9223372036854775807)-1)
INTMAX_MAX = (__INT64_C(9223372036854775807)) INTMAX_MAX = (__INT64_C(9223372036854775807))
UINTMAX_MAX = (__UINT64_C(18446744073709551615)) UINTMAX_MAX = (__UINT64_C(18446744073709551615))
PTRDIFF_MIN = (-9223372036854775807L-1) PTRDIFF_MIN = (-9223372036854775807-1)
PTRDIFF_MAX = (9223372036854775807L) PTRDIFF_MAX = (9223372036854775807)
PTRDIFF_MIN = (-2147483647-1) PTRDIFF_MIN = (-2147483647-1)
PTRDIFF_MAX = (2147483647) PTRDIFF_MAX = (2147483647)
SIG_ATOMIC_MIN = (-2147483647-1) SIG_ATOMIC_MIN = (-2147483647-1)
@ -238,9 +238,9 @@ SHRT_MIN = (-32768)
SHRT_MAX = 32767 SHRT_MAX = 32767
USHRT_MAX = 65535 USHRT_MAX = 65535
INT_MAX = 2147483647 INT_MAX = 2147483647
LONG_MAX = 9223372036854775807L LONG_MAX = 9223372036854775807
LONG_MAX = 2147483647L LONG_MAX = 2147483647
LONG_MIN = (-LONG_MAX - 1L) LONG_MIN = (-LONG_MAX - 1)
# Included from bits/posix1_lim.h # Included from bits/posix1_lim.h
_BITS_POSIX1_LIM_H = 1 _BITS_POSIX1_LIM_H = 1

View File

@ -7,7 +7,7 @@ __USE_ANSI = 1
__FAVOR_BSD = 1 __FAVOR_BSD = 1
_ISOC99_SOURCE = 1 _ISOC99_SOURCE = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600 _XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1 _XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1 _LARGEFILE64_SOURCE = 1
@ -18,7 +18,7 @@ _SVID_SOURCE = 1
__USE_ISOC99 = 1 __USE_ISOC99 = 1
_POSIX_SOURCE = 1 _POSIX_SOURCE = 1
_POSIX_C_SOURCE = 2 _POSIX_C_SOURCE = 2
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
__USE_POSIX = 1 __USE_POSIX = 1
__USE_POSIX2 = 1 __USE_POSIX2 = 1
__USE_POSIX199309 = 1 __USE_POSIX199309 = 1
@ -40,7 +40,7 @@ __USE_GNU = 1
__USE_REENTRANT = 1 __USE_REENTRANT = 1
__STDC_IEC_559__ = 1 __STDC_IEC_559__ = 1
__STDC_IEC_559_COMPLEX__ = 1 __STDC_IEC_559_COMPLEX__ = 1
__STDC_ISO_10646__ = 200009L __STDC_ISO_10646__ = 200009
__GNU_LIBRARY__ = 6 __GNU_LIBRARY__ = 6
__GLIBC__ = 2 __GLIBC__ = 2
__GLIBC_MINOR__ = 2 __GLIBC_MINOR__ = 2
@ -99,7 +99,7 @@ _TIME_H = 1
# Included from bits/time.h # Included from bits/time.h
_BITS_TIME_H = 1 _BITS_TIME_H = 1
CLOCKS_PER_SEC = 1000000l CLOCKS_PER_SEC = 1000000
CLOCK_REALTIME = 0 CLOCK_REALTIME = 0
CLOCK_PROCESS_CPUTIME_ID = 2 CLOCK_PROCESS_CPUTIME_ID = 2
CLOCK_THREAD_CPUTIME_ID = 3 CLOCK_THREAD_CPUTIME_ID = 3

View File

@ -74,8 +74,8 @@ kEventHotKeyPressed = 5
kEventHotKeyReleased = 6 kEventHotKeyReleased = 6
kEventKeyModifierNumLockBit = 16 kEventKeyModifierNumLockBit = 16
kEventKeyModifierFnBit = 17 kEventKeyModifierFnBit = 17
kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit kEventKeyModifierNumLockMask = 1 << kEventKeyModifierNumLockBit
kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit kEventKeyModifierFnMask = 1 << kEventKeyModifierFnBit
kEventAppActivated = 1 kEventAppActivated = 1
kEventAppDeactivated = 2 kEventAppDeactivated = 2
kEventAppQuit = 3 kEventAppQuit = 3
@ -221,9 +221,9 @@ kHICommandRevert = FOUR_CHAR_CODE('rvrt')
kHICommandPrint = FOUR_CHAR_CODE('prnt') kHICommandPrint = FOUR_CHAR_CODE('prnt')
kHICommandPageSetup = FOUR_CHAR_CODE('page') kHICommandPageSetup = FOUR_CHAR_CODE('page')
kHICommandAppHelp = FOUR_CHAR_CODE('ahlp') kHICommandAppHelp = FOUR_CHAR_CODE('ahlp')
kHICommandFromMenu = (1L << 0) kHICommandFromMenu = (1 << 0)
kHICommandFromControl = (1L << 1) kHICommandFromControl = (1 << 1)
kHICommandFromWindow = (1L << 2) kHICommandFromWindow = (1 << 2)
kEventControlInitialize = 1000 kEventControlInitialize = 1000
kEventControlDispose = 1001 kEventControlDispose = 1001
kEventControlGetOptimalBounds = 1003 kEventControlGetOptimalBounds = 1003

View File

@ -8,8 +8,8 @@ kAnyComponentType = 0
kAnyComponentSubType = 0 kAnyComponentSubType = 0
kAnyComponentManufacturer = 0 kAnyComponentManufacturer = 0
kAnyComponentFlagsMask = 0 kAnyComponentFlagsMask = 0
cmpIsMissing = 1L << 29 cmpIsMissing = 1 << 29
cmpWantsRegisterMessage = 1L << 31 cmpWantsRegisterMessage = 1 << 31
kComponentOpenSelect = -1 kComponentOpenSelect = -1
kComponentCloseSelect = -2 kComponentCloseSelect = -2
kComponentCanDoSelect = -3 kComponentCanDoSelect = -3

View File

@ -18,7 +18,7 @@ controlNotifyNothing = FOUR_CHAR_CODE('nada')
controlNotifyClick = FOUR_CHAR_CODE('clik') controlNotifyClick = FOUR_CHAR_CODE('clik')
controlNotifyFocus = FOUR_CHAR_CODE('focu') controlNotifyFocus = FOUR_CHAR_CODE('focu')
controlNotifyKey = FOUR_CHAR_CODE('key ') controlNotifyKey = FOUR_CHAR_CODE('key ')
kControlCanAutoInvalidate = 1L << 0 kControlCanAutoInvalidate = 1 << 0
staticTextProc = 256 staticTextProc = 256
editTextProc = 272 editTextProc = 272
iconProc = 288 iconProc = 288
@ -529,7 +529,7 @@ kDataBrowserNeverEmptySelectionSet = 1 << 6
kDataBrowserOrderUndefined = 0 kDataBrowserOrderUndefined = 0
kDataBrowserOrderIncreasing = 1 kDataBrowserOrderIncreasing = 1
kDataBrowserOrderDecreasing = 2 kDataBrowserOrderDecreasing = 2
kDataBrowserNoItem = 0L kDataBrowserNoItem = 0
kDataBrowserItemNoState = 0 kDataBrowserItemNoState = 0
# kDataBrowserItemAnyState = (unsigned long)(-1) # kDataBrowserItemAnyState = (unsigned long)(-1)
kDataBrowserItemIsSelected = 1 << 0 kDataBrowserItemIsSelected = 1 << 0
@ -569,18 +569,18 @@ kDataBrowserUserToggledContainer = 16
kDataBrowserTargetChanged = 15 kDataBrowserTargetChanged = 15
kDataBrowserUserStateChanged = 13 kDataBrowserUserStateChanged = 13
kDataBrowserSelectionSetChanged = 14 kDataBrowserSelectionSetChanged = 14
kDataBrowserItemNoProperty = 0L kDataBrowserItemNoProperty = 0
kDataBrowserItemIsActiveProperty = 1L kDataBrowserItemIsActiveProperty = 1
kDataBrowserItemIsSelectableProperty = 2L kDataBrowserItemIsSelectableProperty = 2
kDataBrowserItemIsEditableProperty = 3L kDataBrowserItemIsEditableProperty = 3
kDataBrowserItemIsContainerProperty = 4L kDataBrowserItemIsContainerProperty = 4
kDataBrowserContainerIsOpenableProperty = 5L kDataBrowserContainerIsOpenableProperty = 5
kDataBrowserContainerIsClosableProperty = 6L kDataBrowserContainerIsClosableProperty = 6
kDataBrowserContainerIsSortableProperty = 7L kDataBrowserContainerIsSortableProperty = 7
kDataBrowserItemSelfIdentityProperty = 8L kDataBrowserItemSelfIdentityProperty = 8
kDataBrowserContainerAliasIDProperty = 9L kDataBrowserContainerAliasIDProperty = 9
kDataBrowserColumnViewPreviewProperty = 10L kDataBrowserColumnViewPreviewProperty = 10
kDataBrowserItemParentContainerProperty = 11L kDataBrowserItemParentContainerProperty = 11
kDataBrowserCustomType = 0x3F3F3F3F kDataBrowserCustomType = 0x3F3F3F3F
kDataBrowserIconType = FOUR_CHAR_CODE('icnr') kDataBrowserIconType = FOUR_CHAR_CODE('icnr')
kDataBrowserTextType = FOUR_CHAR_CODE('text') kDataBrowserTextType = FOUR_CHAR_CODE('text')
@ -591,7 +591,7 @@ kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog')
kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank') kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank')
kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu') kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu')
kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn')
kDataBrowserPropertyEnclosingPart = 0L kDataBrowserPropertyEnclosingPart = 0
kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----') kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----')
kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc') kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc')
kDataBrowserPropertyTextPart = kDataBrowserTextType kDataBrowserPropertyTextPart = kDataBrowserTextType

View File

@ -14,16 +14,16 @@ flavorSenderOnly = (1 << 0)
flavorSenderTranslated = (1 << 1) flavorSenderTranslated = (1 << 1)
flavorNotSaved = (1 << 2) flavorNotSaved = (1 << 2)
flavorSystemTranslated = (1 << 8) flavorSystemTranslated = (1 << 8)
kDragHasLeftSenderWindow = (1L << 0) kDragHasLeftSenderWindow = (1 << 0)
kDragInsideSenderApplication = (1L << 1) kDragInsideSenderApplication = (1 << 1)
kDragInsideSenderWindow = (1L << 2) kDragInsideSenderWindow = (1 << 2)
kDragBehaviorNone = 0 kDragBehaviorNone = 0
kDragBehaviorZoomBackAnimation = (1L << 0) kDragBehaviorZoomBackAnimation = (1 << 0)
kDragRegionAndImage = (1L << 4) kDragRegionAndImage = (1 << 4)
kDragStandardTranslucency = 0L kDragStandardTranslucency = 0
kDragDarkTranslucency = 1L kDragDarkTranslucency = 1
kDragDarkerTranslucency = 2L kDragDarkerTranslucency = 2
kDragOpaqueTranslucency = 3L kDragOpaqueTranslucency = 3
kDragRegionBegin = 1 kDragRegionBegin = 1
kDragRegionDraw = 2 kDragRegionDraw = 2
kDragRegionHide = 3 kDragRegionHide = 3
@ -56,13 +56,13 @@ kDragTrackingEnterWindow = 2
kDragTrackingInWindow = 3 kDragTrackingInWindow = 3
kDragTrackingLeaveWindow = 4 kDragTrackingLeaveWindow = 4
kDragTrackingLeaveHandler = 5 kDragTrackingLeaveHandler = 5
kDragActionNothing = 0L kDragActionNothing = 0
kDragActionCopy = 1L kDragActionCopy = 1
kDragActionAlias = (1L << 1) kDragActionAlias = (1 << 1)
kDragActionGeneric = (1L << 2) kDragActionGeneric = (1 << 2)
kDragActionPrivate = (1L << 3) kDragActionPrivate = (1 << 3)
kDragActionMove = (1L << 4) kDragActionMove = (1 << 4)
kDragActionDelete = (1L << 5) kDragActionDelete = (1 << 5)
# kDragActionAll = (long)0xFFFFFFFF # kDragActionAll = (long)0xFFFFFFFF
dragHasLeftSenderWindow = kDragHasLeftSenderWindow dragHasLeftSenderWindow = kDragHasLeftSenderWindow
dragInsideSenderApplication = kDragInsideSenderApplication dragInsideSenderApplication = kDragInsideSenderApplication

View File

@ -3,7 +3,7 @@
def FOUR_CHAR_CODE(x): return x def FOUR_CHAR_CODE(x): return x
true = True true = True
false = False false = False
kOnSystemDisk = -32768L kOnSystemDisk = -32768
kOnAppropriateDisk = -32767 kOnAppropriateDisk = -32767
kSystemDomain = -32766 kSystemDomain = -32766
kLocalDomain = -32765 kLocalDomain = -32765

View File

@ -17,15 +17,15 @@ commandMark = 17
checkMark = 18 checkMark = 18
diamondMark = 19 diamondMark = 19
appleMark = 20 appleMark = 20
propFont = 36864L propFont = 36864
prpFntH = 36865L prpFntH = 36865
prpFntW = 36866L prpFntW = 36866
prpFntHW = 36867L prpFntHW = 36867
fixedFont = 45056L fixedFont = 45056
fxdFntH = 45057L fxdFntH = 45057
fxdFntW = 45058L fxdFntW = 45058
fxdFntHW = 45059L fxdFntHW = 45059
fontWid = 44208L fontWid = 44208
kFMUseGlobalScopeOption = 0x00000001 kFMUseGlobalScopeOption = 0x00000001
kFontIDNewYork = 2 kFontIDNewYork = 2
kFontIDGeneva = 3 kFontIDGeneva = 3

View File

@ -375,7 +375,7 @@ kBurningIcon = FOUR_CHAR_CODE('burn')
kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar') kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar')
kIconServicesNormalUsageFlag = 0 kIconServicesNormalUsageFlag = 0
kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess) kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess)
kPlotIconRefNormalFlags = 0L kPlotIconRefNormalFlags = 0
kPlotIconRefNoImage = (1 << 1) kPlotIconRefNoImage = (1 << 1)
kPlotIconRefNoMask = (1 << 2) kPlotIconRefNoMask = (1 << 2)
kIconFamilyType = FOUR_CHAR_CODE('icns') kIconFamilyType = FOUR_CHAR_CODE('icns')

View File

@ -17,18 +17,18 @@ kTXNFontSizeAttributeSize = 4
normal = 0 normal = 0
kTXNWillDefaultToATSUIBit = 0 kTXNWillDefaultToATSUIBit = 0
kTXNWillDefaultToCarbonEventBit = 1 kTXNWillDefaultToCarbonEventBit = 1
kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit kTXNWillDefaultToATSUIMask = 1 << kTXNWillDefaultToATSUIBit
kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit kTXNWillDefaultToCarbonEventMask = 1 << kTXNWillDefaultToCarbonEventBit
kTXNWantMoviesBit = 0 kTXNWantMoviesBit = 0
kTXNWantSoundBit = 1 kTXNWantSoundBit = 1
kTXNWantGraphicsBit = 2 kTXNWantGraphicsBit = 2
kTXNAlwaysUseQuickDrawTextBit = 3 kTXNAlwaysUseQuickDrawTextBit = 3
kTXNUseTemporaryMemoryBit = 4 kTXNUseTemporaryMemoryBit = 4
kTXNWantMoviesMask = 1L << kTXNWantMoviesBit kTXNWantMoviesMask = 1 << kTXNWantMoviesBit
kTXNWantSoundMask = 1L << kTXNWantSoundBit kTXNWantSoundMask = 1 << kTXNWantSoundBit
kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit kTXNWantGraphicsMask = 1 << kTXNWantGraphicsBit
kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit kTXNAlwaysUseQuickDrawTextMask = 1 << kTXNAlwaysUseQuickDrawTextBit
kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit kTXNUseTemporaryMemoryMask = 1 << kTXNUseTemporaryMemoryBit
kTXNDrawGrowIconBit = 0 kTXNDrawGrowIconBit = 0
kTXNShowWindowBit = 1 kTXNShowWindowBit = 1
kTXNWantHScrollBarBit = 2 kTXNWantHScrollBarBit = 2
@ -46,23 +46,23 @@ kTXNDontDrawSelectionWhenInactiveBit = 13
kTXNSingleLineOnlyBit = 14 kTXNSingleLineOnlyBit = 14
kTXNDisableDragAndDropBit = 15 kTXNDisableDragAndDropBit = 15
kTXNUseQDforImagingBit = 16 kTXNUseQDforImagingBit = 16
kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit kTXNDrawGrowIconMask = 1 << kTXNDrawGrowIconBit
kTXNShowWindowMask = 1L << kTXNShowWindowBit kTXNShowWindowMask = 1 << kTXNShowWindowBit
kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit kTXNWantHScrollBarMask = 1 << kTXNWantHScrollBarBit
kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit kTXNWantVScrollBarMask = 1 << kTXNWantVScrollBarBit
kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit kTXNNoTSMEverMask = 1 << kTXNNoTSMEverBit
kTXNReadOnlyMask = 1L << kTXNReadOnlyBit kTXNReadOnlyMask = 1 << kTXNReadOnlyBit
kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit kTXNNoKeyboardSyncMask = 1 << kTXNNoKeyboardSyncBit
kTXNNoSelectionMask = 1L << kTXNNoSelectionBit kTXNNoSelectionMask = 1 << kTXNNoSelectionBit
kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit kTXNSaveStylesAsSTYLResourceMask = 1 << kTXNSaveStylesAsSTYLResourceBit
kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit kOutputTextInUnicodeEncodingMask = 1 << kOutputTextInUnicodeEncodingBit
kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit kTXNDoNotInstallDragProcsMask = 1 << kTXNDoNotInstallDragProcsBit
kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit kTXNAlwaysWrapAtViewEdgeMask = 1 << kTXNAlwaysWrapAtViewEdgeBit
kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit kTXNDontDrawCaretWhenInactiveMask = 1 << kTXNDontDrawCaretWhenInactiveBit
kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit kTXNDontDrawSelectionWhenInactiveMask = 1 << kTXNDontDrawSelectionWhenInactiveBit
kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit kTXNSingleLineOnlyMask = 1 << kTXNSingleLineOnlyBit
kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit kTXNDisableDragAndDropMask = 1 << kTXNDisableDragAndDropBit
kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit kTXNUseQDforImagingMask = 1 << kTXNUseQDforImagingBit
kTXNSetFlushnessBit = 0 kTXNSetFlushnessBit = 0
kTXNSetJustificationBit = 1 kTXNSetJustificationBit = 1
kTXNUseFontFallBackBit = 2 kTXNUseFontFallBackBit = 2
@ -73,29 +73,29 @@ kTXNDontDrawTextBit = 6
kTXNUseCGContextRefBit = 7 kTXNUseCGContextRefBit = 7
kTXNImageWithQDBit = 8 kTXNImageWithQDBit = 8
kTXNDontWrapTextBit = 9 kTXNDontWrapTextBit = 9
kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit kTXNSetFlushnessMask = 1 << kTXNSetFlushnessBit
kTXNSetJustificationMask = 1L << kTXNSetJustificationBit kTXNSetJustificationMask = 1 << kTXNSetJustificationBit
kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit kTXNUseFontFallBackMask = 1 << kTXNUseFontFallBackBit
kTXNRotateTextMask = 1L << kTXNRotateTextBit kTXNRotateTextMask = 1 << kTXNRotateTextBit
kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit kTXNUseVerticalTextMask = 1 << kTXNUseVerticalTextBit
kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit kTXNDontUpdateBoxRectMask = 1 << kTXNDontUpdateBoxRectBit
kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit kTXNDontDrawTextMask = 1 << kTXNDontDrawTextBit
kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit kTXNUseCGContextRefMask = 1 << kTXNUseCGContextRefBit
kTXNImageWithQDMask = 1L << kTXNImageWithQDBit kTXNImageWithQDMask = 1 << kTXNImageWithQDBit
kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit kTXNDontWrapTextMask = 1 << kTXNDontWrapTextBit
kTXNFontContinuousBit = 0 kTXNFontContinuousBit = 0
kTXNSizeContinuousBit = 1 kTXNSizeContinuousBit = 1
kTXNStyleContinuousBit = 2 kTXNStyleContinuousBit = 2
kTXNColorContinuousBit = 3 kTXNColorContinuousBit = 3
kTXNFontContinuousMask = 1L << kTXNFontContinuousBit kTXNFontContinuousMask = 1 << kTXNFontContinuousBit
kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit kTXNSizeContinuousMask = 1 << kTXNSizeContinuousBit
kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit kTXNStyleContinuousMask = 1 << kTXNStyleContinuousBit
kTXNColorContinuousMask = 1L << kTXNColorContinuousBit kTXNColorContinuousMask = 1 << kTXNColorContinuousBit
kTXNIgnoreCaseBit = 0 kTXNIgnoreCaseBit = 0
kTXNEntireWordBit = 1 kTXNEntireWordBit = 1
kTXNUseEncodingWordRulesBit = 31 kTXNUseEncodingWordRulesBit = 31
kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit kTXNIgnoreCaseMask = 1 << kTXNIgnoreCaseBit
kTXNEntireWordMask = 1L << kTXNEntireWordBit kTXNEntireWordMask = 1 << kTXNEntireWordBit
# kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit) # kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit)
kTXNTextensionFile = FOUR_CHAR_CODE('txtn') kTXNTextensionFile = FOUR_CHAR_CODE('txtn')
kTXNTextFile = FOUR_CHAR_CODE('TEXT') kTXNTextFile = FOUR_CHAR_CODE('TEXT')
@ -216,8 +216,8 @@ kTXNUnicodeEncoding = 2
kTXNBackgroundTypeRGB = 1 kTXNBackgroundTypeRGB = 1
kTXNTextInputCountBit = 0 kTXNTextInputCountBit = 0
kTXNRunCountBit = 1 kTXNRunCountBit = 1
kTXNTextInputCountMask = 1L << kTXNTextInputCountBit kTXNTextInputCountMask = 1 << kTXNTextInputCountBit
kTXNRunCountMask = 1L << kTXNRunCountBit kTXNRunCountMask = 1 << kTXNRunCountBit
kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask
kTXNNoAppleEventHandlersBit = 0 kTXNNoAppleEventHandlersBit = 0
kTXNRestartAppleEventHandlersBit = 1 kTXNRestartAppleEventHandlersBit = 1

View File

@ -19,7 +19,7 @@ keyOSADialectName = FOUR_CHAR_CODE('dnam')
keyOSADialectCode = FOUR_CHAR_CODE('dcod') keyOSADialectCode = FOUR_CHAR_CODE('dcod')
keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd') keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd')
keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd') keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd')
kOSANullScript = 0L kOSANullScript = 0
kOSANullMode = 0 kOSANullMode = 0
kOSAModeNull = 0 kOSAModeNull = 0
kOSASupportsCompiling = 0x0002 kOSASupportsCompiling = 0x0002

View File

@ -18,30 +18,30 @@ clipPixBit = 28
stretchPixBit = 29 stretchPixBit = 29
ditherPixBit = 30 ditherPixBit = 30
gwFlagErrBit = 31 gwFlagErrBit = 31
pixPurge = 1L << pixPurgeBit pixPurge = 1 << pixPurgeBit
noNewDevice = 1L << noNewDeviceBit noNewDevice = 1 << noNewDeviceBit
useTempMem = 1L << useTempMemBit useTempMem = 1 << useTempMemBit
keepLocal = 1L << keepLocalBit keepLocal = 1 << keepLocalBit
useDistantHdwrMem = 1L << useDistantHdwrMemBit useDistantHdwrMem = 1 << useDistantHdwrMemBit
useLocalHdwrMem = 1L << useLocalHdwrMemBit useLocalHdwrMem = 1 << useLocalHdwrMemBit
pixelsPurgeable = 1L << pixelsPurgeableBit pixelsPurgeable = 1 << pixelsPurgeableBit
pixelsLocked = 1L << pixelsLockedBit pixelsLocked = 1 << pixelsLockedBit
kAllocDirectDrawSurface = 1L << 14 kAllocDirectDrawSurface = 1 << 14
mapPix = 1L << mapPixBit mapPix = 1 << mapPixBit
newDepth = 1L << newDepthBit newDepth = 1 << newDepthBit
alignPix = 1L << alignPixBit alignPix = 1 << alignPixBit
newRowBytes = 1L << newRowBytesBit newRowBytes = 1 << newRowBytesBit
reallocPix = 1L << reallocPixBit reallocPix = 1 << reallocPixBit
clipPix = 1L << clipPixBit clipPix = 1 << clipPixBit
stretchPix = 1L << stretchPixBit stretchPix = 1 << stretchPixBit
ditherPix = 1L << ditherPixBit ditherPix = 1 << ditherPixBit
gwFlagErr = 1L << gwFlagErrBit gwFlagErr = 1 << gwFlagErrBit
deviceIsIndirect = (1L << 0) deviceIsIndirect = (1 << 0)
deviceNeedsLock = (1L << 1) deviceNeedsLock = (1 << 1)
deviceIsStatic = (1L << 2) deviceIsStatic = (1 << 2)
deviceIsExternalBuffer = (1L << 3) deviceIsExternalBuffer = (1 << 3)
deviceIsDDSurface = (1L << 4) deviceIsDDSurface = (1 << 4)
deviceIsDCISurface = (1L << 5) deviceIsDCISurface = (1 << 5)
deviceIsGDISurface = (1L << 6) deviceIsGDISurface = (1 << 6)
deviceIsAScreen = (1L << 7) deviceIsAScreen = (1 << 7)
deviceIsOverlaySurface = (1L << 8) deviceIsOverlaySurface = (1 << 8)

View File

@ -160,11 +160,11 @@ kXFer1PixelAtATime = 0x00000001
kXFerConvertPixelToRGB32 = 0x00000002 kXFerConvertPixelToRGB32 = 0x00000002
kCursorComponentsVersion = 0x00010001 kCursorComponentsVersion = 0x00010001
kCursorComponentType = FOUR_CHAR_CODE('curs') kCursorComponentType = FOUR_CHAR_CODE('curs')
cursorDoesAnimate = 1L << 0 cursorDoesAnimate = 1 << 0
cursorDoesHardware = 1L << 1 cursorDoesHardware = 1 << 1
cursorDoesUnreadableScreenBits = 1L << 2 cursorDoesUnreadableScreenBits = 1 << 2
kRenderCursorInHardware = 1L << 0 kRenderCursorInHardware = 1 << 0
kRenderCursorInSoftware = 1L << 1 kRenderCursorInSoftware = 1 << 1
kCursorComponentInit = 0x0001 kCursorComponentInit = 0x0001
kCursorComponentGetInfo = 0x0002 kCursorComponentGetInfo = 0x0002
kCursorComponentSetOutputMode = 0x0003 kCursorComponentSetOutputMode = 0x0003

View File

@ -94,14 +94,14 @@ kUserDataTextWarning = FOUR_CHAR_CODE('\xa9wrn')
kUserDataTextWriter = FOUR_CHAR_CODE('\xa9wrt') kUserDataTextWriter = FOUR_CHAR_CODE('\xa9wrt')
kUserDataTextURLLink = FOUR_CHAR_CODE('\xa9url') kUserDataTextURLLink = FOUR_CHAR_CODE('\xa9url')
kUserDataTextEditDate1 = FOUR_CHAR_CODE('\xa9ed1') kUserDataTextEditDate1 = FOUR_CHAR_CODE('\xa9ed1')
kUserDataUnicodeBit = 1L << 7 kUserDataUnicodeBit = 1 << 7
DoTheRightThing = 0 DoTheRightThing = 0
kQTNetworkStatusNoNetwork = -2 kQTNetworkStatusNoNetwork = -2
kQTNetworkStatusUncertain = -1 kQTNetworkStatusUncertain = -1
kQTNetworkStatusNotConnected = 0 kQTNetworkStatusNotConnected = 0
kQTNetworkStatusConnected = 1 kQTNetworkStatusConnected = 1
kMusicFlagDontPlay2Soft = 1L << 0 kMusicFlagDontPlay2Soft = 1 << 0
kMusicFlagDontSlaveToMovie = 1L << 1 kMusicFlagDontSlaveToMovie = 1 << 1
dfDontDisplay = 1 << 0 dfDontDisplay = 1 << 0
dfDontAutoScale = 1 << 1 dfDontAutoScale = 1 << 1
dfClipToTextBox = 1 << 2 dfClipToTextBox = 1 << 2
@ -119,10 +119,10 @@ dfAntiAlias = 1 << 13
dfKeyedText = 1 << 14 dfKeyedText = 1 << 14
dfInverseHilite = 1 << 15 dfInverseHilite = 1 << 15
dfTextColorHilite = 1 << 16 dfTextColorHilite = 1 << 16
searchTextDontGoToFoundTime = 1L << 16 searchTextDontGoToFoundTime = 1 << 16
searchTextDontHiliteFoundText = 1L << 17 searchTextDontHiliteFoundText = 1 << 17
searchTextOneTrackOnly = 1L << 18 searchTextOneTrackOnly = 1 << 18
searchTextEnabledTracksOnly = 1L << 19 searchTextEnabledTracksOnly = 1 << 19
kTextTextHandle = 1 kTextTextHandle = 1
kTextTextPtr = 2 kTextTextPtr = 2
kTextTEStyle = 3 kTextTEStyle = 3
@ -167,7 +167,7 @@ mediaQualityDraft = 0x0000
mediaQualityNormal = 0x0040 mediaQualityNormal = 0x0040
mediaQualityBetter = 0x0080 mediaQualityBetter = 0x0080
mediaQualityBest = 0x00C0 mediaQualityBest = 0x00C0
kQTEventPayloadIsQTList = 1L << 0 kQTEventPayloadIsQTList = 1 << 0
kActionMovieSetVolume = 1024 kActionMovieSetVolume = 1024
kActionMovieSetRate = 1025 kActionMovieSetRate = 1025
kActionMovieSetLoopingFlags = 1026 kActionMovieSetLoopingFlags = 1026
@ -509,19 +509,19 @@ kQTEventMovieLoaded = FOUR_CHAR_CODE('load')
kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm')
kQTEventListReceived = FOUR_CHAR_CODE('list') kQTEventListReceived = FOUR_CHAR_CODE('list')
kQTEventKeyUp = FOUR_CHAR_CODE('keyU') kQTEventKeyUp = FOUR_CHAR_CODE('keyU')
kActionFlagActionIsDelta = 1L << 1 kActionFlagActionIsDelta = 1 << 1
kActionFlagParameterWrapsAround = 1L << 2 kActionFlagParameterWrapsAround = 1 << 2
kActionFlagActionIsToggle = 1L << 3 kActionFlagActionIsToggle = 1 << 3
kStatusStringIsURLLink = 1L << 1 kStatusStringIsURLLink = 1 << 1
kStatusStringIsStreamingStatus = 1L << 2 kStatusStringIsStreamingStatus = 1 << 2
kStatusHasCodeNumber = 1L << 3 kStatusHasCodeNumber = 1 << 3
kStatusIsError = 1L << 4 kStatusIsError = 1 << 4
kScriptIsUnknownType = 1L << 0 kScriptIsUnknownType = 1 << 0
kScriptIsJavaScript = 1L << 1 kScriptIsJavaScript = 1 << 1
kScriptIsLingoEvent = 1L << 2 kScriptIsLingoEvent = 1 << 2
kScriptIsVBEvent = 1L << 3 kScriptIsVBEvent = 1 << 3
kScriptIsProjectorCommand = 1L << 4 kScriptIsProjectorCommand = 1 << 4
kScriptIsAppleScript = 1L << 5 kScriptIsAppleScript = 1 << 5
kQTRegistrationDialogTimeOutFlag = 1 << 0 kQTRegistrationDialogTimeOutFlag = 1 << 0
kQTRegistrationDialogShowDialog = 1 << 1 kQTRegistrationDialogShowDialog = 1 << 1
kQTRegistrationDialogForceDialog = 1 << 2 kQTRegistrationDialogForceDialog = 1 << 2
@ -605,16 +605,16 @@ nextTimeSyncSample = 1 << 3
nextTimeStep = 1 << 4 nextTimeStep = 1 << 4
nextTimeEdgeOK = 1 << 14 nextTimeEdgeOK = 1 << 14
nextTimeIgnoreActiveSegment = 1 << 15 nextTimeIgnoreActiveSegment = 1 << 15
createMovieFileDeleteCurFile = 1L << 31 createMovieFileDeleteCurFile = 1 << 31
createMovieFileDontCreateMovie = 1L << 30 createMovieFileDontCreateMovie = 1 << 30
createMovieFileDontOpenFile = 1L << 29 createMovieFileDontOpenFile = 1 << 29
createMovieFileDontCreateResFile = 1L << 28 createMovieFileDontCreateResFile = 1 << 28
flattenAddMovieToDataFork = 1L << 0 flattenAddMovieToDataFork = 1 << 0
flattenActiveTracksOnly = 1L << 2 flattenActiveTracksOnly = 1 << 2
flattenDontInterleaveFlatten = 1L << 3 flattenDontInterleaveFlatten = 1 << 3
flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 flattenFSSpecPtrIsDataRefRecordPtr = 1 << 4
flattenCompressMovieResource = 1L << 5 flattenCompressMovieResource = 1 << 5
flattenForceMovieResourceBeforeMovieData = 1L << 6 flattenForceMovieResourceBeforeMovieData = 1 << 6
movieInDataForkResID = -1 movieInDataForkResID = -1
mcTopLeftMovie = 1 << 0 mcTopLeftMovie = 1 << 0
mcScaleMovieToFit = 1 << 1 mcScaleMovieToFit = 1 << 1
@ -645,17 +645,17 @@ hintsAllowDynamicResize = 1 << 19
hintsSingleField = 1 << 20 hintsSingleField = 1 << 20
hintsNoRenderingTimeOut = 1 << 21 hintsNoRenderingTimeOut = 1 << 21
hintsFlushVideoInsteadOfDirtying = 1 << 22 hintsFlushVideoInsteadOfDirtying = 1 << 22
hintsEnableSubPixelPositioning = 1L << 23 hintsEnableSubPixelPositioning = 1 << 23
mediaHandlerFlagBaseClient = 1 mediaHandlerFlagBaseClient = 1
movieTrackMediaType = 1 << 0 movieTrackMediaType = 1 << 0
movieTrackCharacteristic = 1 << 1 movieTrackCharacteristic = 1 << 1
movieTrackEnabledOnly = 1 << 2 movieTrackEnabledOnly = 1 << 2
kMovieControlOptionHideController = (1L << 0) kMovieControlOptionHideController = (1 << 0)
kMovieControlOptionLocateTopLeft = (1L << 1) kMovieControlOptionLocateTopLeft = (1 << 1)
kMovieControlOptionEnableEditing = (1L << 2) kMovieControlOptionEnableEditing = (1 << 2)
kMovieControlOptionHandleEditingHI = (1L << 3) kMovieControlOptionHandleEditingHI = (1 << 3)
kMovieControlOptionSetKeysEnabled = (1L << 4) kMovieControlOptionSetKeysEnabled = (1 << 4)
kMovieControlOptionManuallyIdled = (1L << 5) kMovieControlOptionManuallyIdled = (1 << 5)
kMovieControlDataMovieController = FOUR_CHAR_CODE('mc ') kMovieControlDataMovieController = FOUR_CHAR_CODE('mc ')
kMovieControlDataMovie = FOUR_CHAR_CODE('moov') kMovieControlDataMovie = FOUR_CHAR_CODE('moov')
kMovieControlDataManualIdling = FOUR_CHAR_CODE('manu') kMovieControlDataManualIdling = FOUR_CHAR_CODE('manu')
@ -663,33 +663,33 @@ movieDrawingCallWhenChanged = 0
movieDrawingCallAlways = 1 movieDrawingCallAlways = 1
kQTCloneShareSamples = 1 << 0 kQTCloneShareSamples = 1 << 0
kQTCloneDontCopyEdits = 1 << 1 kQTCloneDontCopyEdits = 1 << 1
kGetMovieImporterValidateToFind = 1L << 0 kGetMovieImporterValidateToFind = 1 << 0
kGetMovieImporterAllowNewFile = 1L << 1 kGetMovieImporterAllowNewFile = 1 << 1
kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 kGetMovieImporterDontConsiderGraphicsImporters = 1 << 2
kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 kGetMovieImporterDontConsiderFileOnlyImporters = 1 << 6
kGetMovieImporterAutoImportOnly = 1L << 10 kGetMovieImporterAutoImportOnly = 1 << 10
kQTGetMIMETypeInfoIsQuickTimeMovieType = FOUR_CHAR_CODE('moov') kQTGetMIMETypeInfoIsQuickTimeMovieType = FOUR_CHAR_CODE('moov')
kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb') kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb')
kQTCopyUserDataReplace = FOUR_CHAR_CODE('rplc') kQTCopyUserDataReplace = FOUR_CHAR_CODE('rplc')
kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg') kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg')
kMovieLoadStateError = -1L kMovieLoadStateError = -1
kMovieLoadStateLoading = 1000 kMovieLoadStateLoading = 1000
kMovieLoadStateLoaded = 2000 kMovieLoadStateLoaded = 2000
kMovieLoadStatePlayable = 10000 kMovieLoadStatePlayable = 10000
kMovieLoadStatePlaythroughOK = 20000 kMovieLoadStatePlaythroughOK = 20000
kMovieLoadStateComplete = 100000L kMovieLoadStateComplete = 100000
kQTDontUseDataToFindImporter = 1L << 0 kQTDontUseDataToFindImporter = 1 << 0
kQTDontLookForMovieImporterIfGraphicsImporterFound = 1L << 1 kQTDontLookForMovieImporterIfGraphicsImporterFound = 1 << 1
kQTAllowOpeningStillImagesAsMovies = 1L << 2 kQTAllowOpeningStillImagesAsMovies = 1 << 2
kQTAllowImportersThatWouldCreateNewFile = 1L << 3 kQTAllowImportersThatWouldCreateNewFile = 1 << 3
kQTAllowAggressiveImporters = 1L << 4 kQTAllowAggressiveImporters = 1 << 4
preloadAlways = 1L << 0 preloadAlways = 1 << 0
preloadOnlyIfEnabled = 1L << 1 preloadOnlyIfEnabled = 1 << 1
fullScreenHideCursor = 1L << 0 fullScreenHideCursor = 1 << 0
fullScreenAllowEvents = 1L << 1 fullScreenAllowEvents = 1 << 1
fullScreenDontChangeMenuBar = 1L << 2 fullScreenDontChangeMenuBar = 1 << 2
fullScreenPreflightSize = 1L << 3 fullScreenPreflightSize = 1 << 3
movieExecuteWiredActionDontExecute = 1L << 0 movieExecuteWiredActionDontExecute = 1 << 0
kRefConNavigationNext = 0 kRefConNavigationNext = 0
kRefConNavigationPrevious = 1 kRefConNavigationPrevious = 1
kRefConPropertyCanHaveFocus = 1 kRefConPropertyCanHaveFocus = 1
@ -728,19 +728,19 @@ kSpriteHitTestUseSpritesOwnPropertiesMode = 0
kSpriteHitTestTreatAllSpritesAsHitTestableMode = 1 kSpriteHitTestTreatAllSpritesAsHitTestableMode = 1
kSpriteHitTestTreatAllSpritesAsNotHitTestableMode = 2 kSpriteHitTestTreatAllSpritesAsNotHitTestableMode = 2
kNoQTIdleEvents = -1 kNoQTIdleEvents = -1
kGetSpriteWorldInvalidRegionAndLeaveIntact = -1L kGetSpriteWorldInvalidRegionAndLeaveIntact = -1
kGetSpriteWorldInvalidRegionAndThenSetEmpty = -2L kGetSpriteWorldInvalidRegionAndThenSetEmpty = -2
kOnlyDrawToSpriteWorld = 1L << 0 kOnlyDrawToSpriteWorld = 1 << 0
kSpriteWorldPreflight = 1L << 1 kSpriteWorldPreflight = 1 << 1
kSpriteWorldDidDraw = 1L << 0 kSpriteWorldDidDraw = 1 << 0
kSpriteWorldNeedsToDraw = 1L << 1 kSpriteWorldNeedsToDraw = 1 << 1
kKeyFrameAndSingleOverride = 1L << 1 kKeyFrameAndSingleOverride = 1 << 1
kKeyFrameAndAllOverrides = 1L << 2 kKeyFrameAndAllOverrides = 1 << 2
kScaleSpritesToScaleWorld = 1L << 1 kScaleSpritesToScaleWorld = 1 << 1
kSpriteWorldHighQuality = 1L << 2 kSpriteWorldHighQuality = 1 << 2
kSpriteWorldDontAutoInvalidate = 1L << 3 kSpriteWorldDontAutoInvalidate = 1 << 3
kSpriteWorldInvisible = 1L << 4 kSpriteWorldInvisible = 1 << 4
kSpriteWorldDirtyInsteadOfFlush = 1L << 5 kSpriteWorldDirtyInsteadOfFlush = 1 << 5
kParentAtomIsContainer = 0 kParentAtomIsContainer = 0
kTweenRecordNoFlags = 0 kTweenRecordNoFlags = 0
kTweenRecordIsAtInterruptTime = 0x00000001 kTweenRecordIsAtInterruptTime = 0x00000001
@ -796,19 +796,19 @@ pdOptionsEditCurrentEffectOnly = 0x00000008
pdOptionsHidePreview = 0x00000010 pdOptionsHidePreview = 0x00000010
effectIsRealtime = 0 effectIsRealtime = 0
kAccessKeyAtomType = FOUR_CHAR_CODE('acky') kAccessKeyAtomType = FOUR_CHAR_CODE('acky')
kAccessKeySystemFlag = 1L << 0 kAccessKeySystemFlag = 1 << 0
ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd')
BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg') BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg')
kQTIdlePriority = 10 kQTIdlePriority = 10
kQTNonRealTimePriority = 20 kQTNonRealTimePriority = 20
kQTRealTimeSharedPriority = 25 kQTRealTimeSharedPriority = 25
kQTRealTimePriority = 30 kQTRealTimePriority = 30
kQTBandwidthNotifyNeedToStop = 1L << 0 kQTBandwidthNotifyNeedToStop = 1 << 0
kQTBandwidthNotifyGoodToGo = 1L << 1 kQTBandwidthNotifyGoodToGo = 1 << 1
kQTBandwidthChangeRequest = 1L << 2 kQTBandwidthChangeRequest = 1 << 2
kQTBandwidthQueueRequest = 1L << 3 kQTBandwidthQueueRequest = 1 << 3
kQTBandwidthScheduledRequest = 1L << 4 kQTBandwidthScheduledRequest = 1 << 4
kQTBandwidthVoluntaryRelease = 1L << 5 kQTBandwidthVoluntaryRelease = 1 << 5
kITextRemoveEverythingBut = 0 << 1 kITextRemoveEverythingBut = 0 << 1
kITextRemoveLeaveSuggestedAlternate = 1 << 1 kITextRemoveLeaveSuggestedAlternate = 1 << 1
kITextAtomType = FOUR_CHAR_CODE('itxt') kITextAtomType = FOUR_CHAR_CODE('itxt')
@ -908,20 +908,20 @@ kListElementDataType = FOUR_CHAR_CODE('daty')
kNameAtom = FOUR_CHAR_CODE('name') kNameAtom = FOUR_CHAR_CODE('name')
kInitialRotationAtom = FOUR_CHAR_CODE('inro') kInitialRotationAtom = FOUR_CHAR_CODE('inro')
kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth') kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth')
kTweenReturnDelta = 1L << 0 kTweenReturnDelta = 1 << 0
kQTRestrictionClassSave = FOUR_CHAR_CODE('save') kQTRestrictionClassSave = FOUR_CHAR_CODE('save')
kQTRestrictionSaveDontAddMovieResource = (1L << 0) kQTRestrictionSaveDontAddMovieResource = (1 << 0)
kQTRestrictionSaveDontFlatten = (1L << 1) kQTRestrictionSaveDontFlatten = (1 << 1)
kQTRestrictionSaveDontExport = (1L << 2) kQTRestrictionSaveDontExport = (1 << 2)
kQTRestrictionSaveDontExtract = (1L << 3) kQTRestrictionSaveDontExtract = (1 << 3)
kQTRestrictionClassEdit = FOUR_CHAR_CODE('edit') kQTRestrictionClassEdit = FOUR_CHAR_CODE('edit')
kQTRestrictionEditDontCopy = (1L << 0) kQTRestrictionEditDontCopy = (1 << 0)
kQTRestrictionEditDontCut = (1L << 1) kQTRestrictionEditDontCut = (1 << 1)
kQTRestrictionEditDontPaste = (1L << 2) kQTRestrictionEditDontPaste = (1 << 2)
kQTRestrictionEditDontClear = (1L << 3) kQTRestrictionEditDontClear = (1 << 3)
kQTRestrictionEditDontModify = (1L << 4) kQTRestrictionEditDontModify = (1 << 4)
kQTRestrictionEditDontExtract = (1L << 5) kQTRestrictionEditDontExtract = (1 << 5)
videoFlagDontLeanAhead = 1L << 0 videoFlagDontLeanAhead = 1 << 0
txtProcDefaultDisplay = 0 txtProcDefaultDisplay = 0
txtProcDontDisplay = 1 txtProcDontDisplay = 1
txtProcDoDisplay = 2 txtProcDoDisplay = 2
@ -932,12 +932,12 @@ findTextWrapAround = 1 << 3
findTextUseOffset = 1 << 4 findTextUseOffset = 1 << 4
dropShadowOffsetType = FOUR_CHAR_CODE('drpo') dropShadowOffsetType = FOUR_CHAR_CODE('drpo')
dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt')
spriteHitTestBounds = 1L << 0 spriteHitTestBounds = 1 << 0
spriteHitTestImage = 1L << 1 spriteHitTestImage = 1 << 1
spriteHitTestInvisibleSprites = 1L << 2 spriteHitTestInvisibleSprites = 1 << 2
spriteHitTestIsClick = 1L << 3 spriteHitTestIsClick = 1 << 3
spriteHitTestLocInDisplayCoordinates = 1L << 4 spriteHitTestLocInDisplayCoordinates = 1 << 4
spriteHitTestTreatAllSpritesAsHitTestable = 1L << 5 spriteHitTestTreatAllSpritesAsHitTestable = 1 << 5
kSpriteAtomType = FOUR_CHAR_CODE('sprt') kSpriteAtomType = FOUR_CHAR_CODE('sprt')
kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct')
kSpriteImageAtomType = FOUR_CHAR_CODE('imag') kSpriteImageAtomType = FOUR_CHAR_CODE('imag')
@ -1363,68 +1363,68 @@ k422YpCbCr8PixelFormat = FOUR_CHAR_CODE('2vuy')
k4444YpCbCrA8PixelFormat = FOUR_CHAR_CODE('v408') k4444YpCbCrA8PixelFormat = FOUR_CHAR_CODE('v408')
k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408') k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408')
kYUV420PixelFormat = FOUR_CHAR_CODE('y420') kYUV420PixelFormat = FOUR_CHAR_CODE('y420')
codecInfoDoes1 = (1L << 0) codecInfoDoes1 = (1 << 0)
codecInfoDoes2 = (1L << 1) codecInfoDoes2 = (1 << 1)
codecInfoDoes4 = (1L << 2) codecInfoDoes4 = (1 << 2)
codecInfoDoes8 = (1L << 3) codecInfoDoes8 = (1 << 3)
codecInfoDoes16 = (1L << 4) codecInfoDoes16 = (1 << 4)
codecInfoDoes32 = (1L << 5) codecInfoDoes32 = (1 << 5)
codecInfoDoesDither = (1L << 6) codecInfoDoesDither = (1 << 6)
codecInfoDoesStretch = (1L << 7) codecInfoDoesStretch = (1 << 7)
codecInfoDoesShrink = (1L << 8) codecInfoDoesShrink = (1 << 8)
codecInfoDoesMask = (1L << 9) codecInfoDoesMask = (1 << 9)
codecInfoDoesTemporal = (1L << 10) codecInfoDoesTemporal = (1 << 10)
codecInfoDoesDouble = (1L << 11) codecInfoDoesDouble = (1 << 11)
codecInfoDoesQuad = (1L << 12) codecInfoDoesQuad = (1 << 12)
codecInfoDoesHalf = (1L << 13) codecInfoDoesHalf = (1 << 13)
codecInfoDoesQuarter = (1L << 14) codecInfoDoesQuarter = (1 << 14)
codecInfoDoesRotate = (1L << 15) codecInfoDoesRotate = (1 << 15)
codecInfoDoesHorizFlip = (1L << 16) codecInfoDoesHorizFlip = (1 << 16)
codecInfoDoesVertFlip = (1L << 17) codecInfoDoesVertFlip = (1 << 17)
codecInfoHasEffectParameterList = (1L << 18) codecInfoHasEffectParameterList = (1 << 18)
codecInfoDoesBlend = (1L << 19) codecInfoDoesBlend = (1 << 19)
codecInfoDoesWarp = (1L << 20) codecInfoDoesWarp = (1 << 20)
codecInfoDoesRecompress = (1L << 21) codecInfoDoesRecompress = (1 << 21)
codecInfoDoesSpool = (1L << 22) codecInfoDoesSpool = (1 << 22)
codecInfoDoesRateConstrain = (1L << 23) codecInfoDoesRateConstrain = (1 << 23)
codecInfoDepth1 = (1L << 0) codecInfoDepth1 = (1 << 0)
codecInfoDepth2 = (1L << 1) codecInfoDepth2 = (1 << 1)
codecInfoDepth4 = (1L << 2) codecInfoDepth4 = (1 << 2)
codecInfoDepth8 = (1L << 3) codecInfoDepth8 = (1 << 3)
codecInfoDepth16 = (1L << 4) codecInfoDepth16 = (1 << 4)
codecInfoDepth32 = (1L << 5) codecInfoDepth32 = (1 << 5)
codecInfoDepth24 = (1L << 6) codecInfoDepth24 = (1 << 6)
codecInfoDepth33 = (1L << 7) codecInfoDepth33 = (1 << 7)
codecInfoDepth34 = (1L << 8) codecInfoDepth34 = (1 << 8)
codecInfoDepth36 = (1L << 9) codecInfoDepth36 = (1 << 9)
codecInfoDepth40 = (1L << 10) codecInfoDepth40 = (1 << 10)
codecInfoStoresClut = (1L << 11) codecInfoStoresClut = (1 << 11)
codecInfoDoesLossless = (1L << 12) codecInfoDoesLossless = (1 << 12)
codecInfoSequenceSensitive = (1L << 13) codecInfoSequenceSensitive = (1 << 13)
codecFlagUseImageBuffer = (1L << 0) codecFlagUseImageBuffer = (1 << 0)
codecFlagUseScreenBuffer = (1L << 1) codecFlagUseScreenBuffer = (1 << 1)
codecFlagUpdatePrevious = (1L << 2) codecFlagUpdatePrevious = (1 << 2)
codecFlagNoScreenUpdate = (1L << 3) codecFlagNoScreenUpdate = (1 << 3)
codecFlagWasCompressed = (1L << 4) codecFlagWasCompressed = (1 << 4)
codecFlagDontOffscreen = (1L << 5) codecFlagDontOffscreen = (1 << 5)
codecFlagUpdatePreviousComp = (1L << 6) codecFlagUpdatePreviousComp = (1 << 6)
codecFlagForceKeyFrame = (1L << 7) codecFlagForceKeyFrame = (1 << 7)
codecFlagOnlyScreenUpdate = (1L << 8) codecFlagOnlyScreenUpdate = (1 << 8)
codecFlagLiveGrab = (1L << 9) codecFlagLiveGrab = (1 << 9)
codecFlagDiffFrame = (1L << 9) codecFlagDiffFrame = (1 << 9)
codecFlagDontUseNewImageBuffer = (1L << 10) codecFlagDontUseNewImageBuffer = (1 << 10)
codecFlagInterlaceUpdate = (1L << 11) codecFlagInterlaceUpdate = (1 << 11)
codecFlagCatchUpDiff = (1L << 12) codecFlagCatchUpDiff = (1 << 12)
codecFlagSupportDisable = (1L << 13) codecFlagSupportDisable = (1 << 13)
codecFlagReenable = (1L << 14) codecFlagReenable = (1 << 14)
codecFlagOutUpdateOnNextIdle = (1L << 9) codecFlagOutUpdateOnNextIdle = (1 << 9)
codecFlagOutUpdateOnDataSourceChange = (1L << 10) codecFlagOutUpdateOnDataSourceChange = (1 << 10)
codecFlagSequenceSensitive = (1L << 11) codecFlagSequenceSensitive = (1 << 11)
codecFlagOutUpdateOnTimeChange = (1L << 12) codecFlagOutUpdateOnTimeChange = (1 << 12)
codecFlagImageBufferNotSourceImage = (1L << 13) codecFlagImageBufferNotSourceImage = (1 << 13)
codecFlagUsedNewImageBuffer = (1L << 14) codecFlagUsedNewImageBuffer = (1 << 14)
codecFlagUsedImageBuffer = (1L << 15) codecFlagUsedImageBuffer = (1 << 15)
codecMinimumDataSize = 32768L codecMinimumDataSize = 32768
compressorComponentType = FOUR_CHAR_CODE('imco') compressorComponentType = FOUR_CHAR_CODE('imco')
decompressorComponentType = FOUR_CHAR_CODE('imdc') decompressorComponentType = FOUR_CHAR_CODE('imdc')
codecLosslessQuality = 0x00000400 codecLosslessQuality = 0x00000400
@ -1466,11 +1466,11 @@ evenField2ToOddFieldOut = 1 << 5
oddField2ToEvenFieldOut = 1 << 6 oddField2ToEvenFieldOut = 1 << 6
oddField2ToOddFieldOut = 1 << 7 oddField2ToOddFieldOut = 1 << 7
icmFrameTimeHasVirtualStartTimeAndDuration = 1 << 0 icmFrameTimeHasVirtualStartTimeAndDuration = 1 << 0
codecDSequenceDisableOverlaySurface = (1L << 5) codecDSequenceDisableOverlaySurface = (1 << 5)
codecDSequenceSingleField = (1L << 6) codecDSequenceSingleField = (1 << 6)
codecDSequenceBidirectionalPrediction = (1L << 7) codecDSequenceBidirectionalPrediction = (1 << 7)
codecDSequenceFlushInsteadOfDirtying = (1L << 8) codecDSequenceFlushInsteadOfDirtying = (1 << 8)
codecDSequenceEnableSubPixelPositioning = (1L << 9) codecDSequenceEnableSubPixelPositioning = (1 << 9)
kICMSequenceTaskWeight = FOUR_CHAR_CODE('twei') kICMSequenceTaskWeight = FOUR_CHAR_CODE('twei')
kICMSequenceTaskName = FOUR_CHAR_CODE('tnam') kICMSequenceTaskName = FOUR_CHAR_CODE('tnam')
kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt') kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt')
@ -1487,19 +1487,19 @@ sfpItemPreviewDividerUser = 13
sfpItemCreatePreviewButton = 14 sfpItemCreatePreviewButton = 14
sfpItemShowPreviewButton = 15 sfpItemShowPreviewButton = 15
kICMPixelFormatIsPlanarMask = 0x0F kICMPixelFormatIsPlanarMask = 0x0F
kICMPixelFormatIsIndexed = (1L << 4) kICMPixelFormatIsIndexed = (1 << 4)
kICMPixelFormatIsSupportedByQD = (1L << 5) kICMPixelFormatIsSupportedByQD = (1 << 5)
kICMPixelFormatIsMonochrome = (1L << 6) kICMPixelFormatIsMonochrome = (1 << 6)
kICMPixelFormatHasAlphaChannel = (1L << 7) kICMPixelFormatHasAlphaChannel = (1 << 7)
kICMGetChainUltimateParent = 0 kICMGetChainUltimateParent = 0
kICMGetChainParent = 1 kICMGetChainParent = 1
kICMGetChainChild = 2 kICMGetChainChild = 2
kICMGetChainUltimateChild = 3 kICMGetChainUltimateChild = 3
kDontUseValidateToFindGraphicsImporter = 1L << 0 kDontUseValidateToFindGraphicsImporter = 1 << 0
kICMTempThenAppMemory = 1L << 12 kICMTempThenAppMemory = 1 << 12
kICMAppThenTempMemory = 1L << 13 kICMAppThenTempMemory = 1 << 13
kQTUsePlatformDefaultGammaLevel = 0 kQTUsePlatformDefaultGammaLevel = 0
kQTUseSourceGammaLevel = -1L kQTUseSourceGammaLevel = -1
kQTCCIR601VideoGammaLevel = 0x00023333 kQTCCIR601VideoGammaLevel = 0x00023333
identityMatrixType = 0x00 identityMatrixType = 0x00
translateMatrixType = 0x01 translateMatrixType = 0x01
@ -1509,7 +1509,7 @@ linearMatrixType = 0x04
linearTranslateMatrixType = 0x05 linearTranslateMatrixType = 0x05
perspectiveMatrixType = 0x06 perspectiveMatrixType = 0x06
GraphicsImporterComponentType = FOUR_CHAR_CODE('grip') GraphicsImporterComponentType = FOUR_CHAR_CODE('grip')
graphicsImporterUsesImageDecompressor = 1L << 23 graphicsImporterUsesImageDecompressor = 1 << 23
quickTimeImageFileImageDescriptionAtom = FOUR_CHAR_CODE('idsc') quickTimeImageFileImageDescriptionAtom = FOUR_CHAR_CODE('idsc')
quickTimeImageFileImageDataAtom = FOUR_CHAR_CODE('idat') quickTimeImageFileImageDataAtom = FOUR_CHAR_CODE('idat')
quickTimeImageFileMetaDataAtom = FOUR_CHAR_CODE('meta') quickTimeImageFileMetaDataAtom = FOUR_CHAR_CODE('meta')
@ -1517,9 +1517,9 @@ quickTimeImageFileColorSyncProfileAtom = FOUR_CHAR_CODE('iicc')
graphicsImporterDrawsAllPixels = 0 graphicsImporterDrawsAllPixels = 0
graphicsImporterDoesntDrawAllPixels = 1 graphicsImporterDoesntDrawAllPixels = 1
graphicsImporterDontKnowIfDrawAllPixels = 2 graphicsImporterDontKnowIfDrawAllPixels = 2
kGraphicsImporterDontDoGammaCorrection = 1L << 0 kGraphicsImporterDontDoGammaCorrection = 1 << 0
kGraphicsImporterTrustResolutionFromFile = 1L << 1 kGraphicsImporterTrustResolutionFromFile = 1 << 1
kGraphicsImporterEnableSubPixelPositioning = 1L << 2 kGraphicsImporterEnableSubPixelPositioning = 1 << 2
kGraphicsExportGroup = FOUR_CHAR_CODE('expo') kGraphicsExportGroup = FOUR_CHAR_CODE('expo')
kGraphicsExportFileType = FOUR_CHAR_CODE('ftyp') kGraphicsExportFileType = FOUR_CHAR_CODE('ftyp')
kGraphicsExportMIMEType = FOUR_CHAR_CODE('mime') kGraphicsExportMIMEType = FOUR_CHAR_CODE('mime')
@ -1624,9 +1624,9 @@ kQTExifUserDataGPSDestDistanceRef = 0x06770019
kQTExifUserDataGPSDestDistance = 0x0677001A kQTExifUserDataGPSDestDistance = 0x0677001A
GraphicsExporterComponentType = FOUR_CHAR_CODE('grex') GraphicsExporterComponentType = FOUR_CHAR_CODE('grex')
kBaseGraphicsExporterSubType = FOUR_CHAR_CODE('base') kBaseGraphicsExporterSubType = FOUR_CHAR_CODE('base')
graphicsExporterIsBaseExporter = 1L << 0 graphicsExporterIsBaseExporter = 1 << 0
graphicsExporterCanTranscode = 1L << 1 graphicsExporterCanTranscode = 1 << 1
graphicsExporterUsesImageCompressor = 1L << 2 graphicsExporterUsesImageCompressor = 1 << 2
kQTResolutionSettings = FOUR_CHAR_CODE('reso') kQTResolutionSettings = FOUR_CHAR_CODE('reso')
kQTTargetDataSize = FOUR_CHAR_CODE('dasz') kQTTargetDataSize = FOUR_CHAR_CODE('dasz')
kQTDontRecompress = FOUR_CHAR_CODE('dntr') kQTDontRecompress = FOUR_CHAR_CODE('dntr')
@ -1637,7 +1637,7 @@ kQTEnableExif = FOUR_CHAR_CODE('exif')
kQTMetaData = FOUR_CHAR_CODE('meta') kQTMetaData = FOUR_CHAR_CODE('meta')
kQTTIFFCompressionMethod = FOUR_CHAR_CODE('tifc') kQTTIFFCompressionMethod = FOUR_CHAR_CODE('tifc')
kQTTIFFCompression_None = 1 kQTTIFFCompression_None = 1
kQTTIFFCompression_PackBits = 32773L kQTTIFFCompression_PackBits = 32773
kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife') kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife')
kQTPNGFilterPreference = FOUR_CHAR_CODE('pngf') kQTPNGFilterPreference = FOUR_CHAR_CODE('pngf')
kQTPNGFilterBestForColorType = FOUR_CHAR_CODE('bflt') kQTPNGFilterBestForColorType = FOUR_CHAR_CODE('bflt')
@ -1802,13 +1802,13 @@ kClockCanHandleIntermittentSound = 4
StandardCompressionType = FOUR_CHAR_CODE('scdi') StandardCompressionType = FOUR_CHAR_CODE('scdi')
StandardCompressionSubType = FOUR_CHAR_CODE('imag') StandardCompressionSubType = FOUR_CHAR_CODE('imag')
StandardCompressionSubTypeSound = FOUR_CHAR_CODE('soun') StandardCompressionSubTypeSound = FOUR_CHAR_CODE('soun')
scListEveryCodec = 1L << 1 scListEveryCodec = 1 << 1
scAllowZeroFrameRate = 1L << 2 scAllowZeroFrameRate = 1 << 2
scAllowZeroKeyFrameRate = 1L << 3 scAllowZeroKeyFrameRate = 1 << 3
scShowBestDepth = 1L << 4 scShowBestDepth = 1 << 4
scUseMovableModal = 1L << 5 scUseMovableModal = 1 << 5
scDisableFrameRateItem = 1L << 6 scDisableFrameRateItem = 1 << 6
scShowDataRateAsKilobits = 1L << 7 scShowDataRateAsKilobits = 1 << 7
scPreferCropping = 1 << 0 scPreferCropping = 1 << 0
scPreferScaling = 1 << 1 scPreferScaling = 1 << 1
scPreferScalingAndCropping = scPreferScaling | scPreferCropping scPreferScalingAndCropping = scPreferScaling | scPreferCropping
@ -1863,7 +1863,7 @@ scSoundInputSampleRateType = FOUR_CHAR_CODE('ssir')
scSoundSampleRateChangeOK = FOUR_CHAR_CODE('rcok') scSoundSampleRateChangeOK = FOUR_CHAR_CODE('rcok')
scAvailableCompressionListType = FOUR_CHAR_CODE('avai') scAvailableCompressionListType = FOUR_CHAR_CODE('avai')
scGetCompression = 1 scGetCompression = 1
scShowMotionSettings = 1L << 0 scShowMotionSettings = 1 << 0
scSettingsChangedItem = -1 scSettingsChangedItem = -1
scCompressFlagIgnoreIdenticalFrames = 1 scCompressFlagIgnoreIdenticalFrames = 1
kQTSettingsVideo = FOUR_CHAR_CODE('vide') kQTSettingsVideo = FOUR_CHAR_CODE('vide')
@ -1897,14 +1897,14 @@ canMovieImportPartial = 1 << 13
hasMovieImportMIMEList = 1 << 14 hasMovieImportMIMEList = 1 << 14
canMovieImportAvoidBlocking = 1 << 15 canMovieImportAvoidBlocking = 1 << 15
canMovieExportFromProcedures = 1 << 15 canMovieExportFromProcedures = 1 << 15
canMovieExportValidateMovie = 1L << 16 canMovieExportValidateMovie = 1 << 16
movieImportMustGetDestinationMediaType = 1L << 16 movieImportMustGetDestinationMediaType = 1 << 16
movieExportNeedsResourceFork = 1L << 17 movieExportNeedsResourceFork = 1 << 17
canMovieImportDataReferences = 1L << 18 canMovieImportDataReferences = 1 << 18
movieExportMustGetSourceMediaType = 1L << 19 movieExportMustGetSourceMediaType = 1 << 19
canMovieImportWithIdle = 1L << 20 canMovieImportWithIdle = 1 << 20
canMovieImportValidateDataReferences = 1L << 21 canMovieImportValidateDataReferences = 1 << 21
reservedForUseByGraphicsImporters = 1L << 23 reservedForUseByGraphicsImporters = 1 << 23
movieImportCreateTrack = 1 movieImportCreateTrack = 1
movieImportInParallel = 2 movieImportInParallel = 2
movieImportMustUseTrack = 4 movieImportMustUseTrack = 4
@ -1925,20 +1925,20 @@ kQTMediaGroupResourceType = FOUR_CHAR_CODE('mgrp')
kQTMediaGroupResourceVersion = 1 kQTMediaGroupResourceVersion = 1
kQTBrowserInfoResourceType = FOUR_CHAR_CODE('brws') kQTBrowserInfoResourceType = FOUR_CHAR_CODE('brws')
kQTBrowserInfoResourceVersion = 1 kQTBrowserInfoResourceVersion = 1
kQTMediaMIMEInfoHasChanged = (1L << 1) kQTMediaMIMEInfoHasChanged = (1 << 1)
kQTMediaFileInfoHasChanged = (1L << 2) kQTMediaFileInfoHasChanged = (1 << 2)
kQTMediaConfigCanUseApp = (1L << 18) kQTMediaConfigCanUseApp = (1 << 18)
kQTMediaConfigCanUsePlugin = (1L << 19) kQTMediaConfigCanUsePlugin = (1 << 19)
kQTMediaConfigUNUSED = (1L << 20) kQTMediaConfigUNUSED = (1 << 20)
kQTMediaConfigBinaryFile = (1L << 23) kQTMediaConfigBinaryFile = (1 << 23)
kQTMediaConfigTextFile = 0 kQTMediaConfigTextFile = 0
kQTMediaConfigMacintoshFile = (1L << 24) kQTMediaConfigMacintoshFile = (1 << 24)
kQTMediaConfigAssociateByDefault = (1L << 27) kQTMediaConfigAssociateByDefault = (1 << 27)
kQTMediaConfigUseAppByDefault = (1L << 28) kQTMediaConfigUseAppByDefault = (1 << 28)
kQTMediaConfigUsePluginByDefault = (1L << 29) kQTMediaConfigUsePluginByDefault = (1 << 29)
kQTMediaConfigDefaultsMask = (kQTMediaConfigUseAppByDefault | kQTMediaConfigUsePluginByDefault) kQTMediaConfigDefaultsMask = (kQTMediaConfigUseAppByDefault | kQTMediaConfigUsePluginByDefault)
kQTMediaConfigDefaultsShift = 12 kQTMediaConfigDefaultsShift = 12
kQTMediaConfigHasFileHasQTAtoms = (1L << 30) kQTMediaConfigHasFileHasQTAtoms = (1 << 30)
kQTMediaConfigStreamGroupID = FOUR_CHAR_CODE('strm') kQTMediaConfigStreamGroupID = FOUR_CHAR_CODE('strm')
kQTMediaConfigInteractiveGroupID = FOUR_CHAR_CODE('intr') kQTMediaConfigInteractiveGroupID = FOUR_CHAR_CODE('intr')
kQTMediaConfigVideoGroupID = FOUR_CHAR_CODE('eyes') kQTMediaConfigVideoGroupID = FOUR_CHAR_CODE('eyes')
@ -2013,17 +2013,17 @@ kQTPresetsListResourceType = FOUR_CHAR_CODE('stg#')
kQTPresetsPlatformListResourceType = FOUR_CHAR_CODE('stgp') kQTPresetsPlatformListResourceType = FOUR_CHAR_CODE('stgp')
kQTPresetInfoIsDivider = 1 kQTPresetInfoIsDivider = 1
kQTMovieExportSourceInfoResourceType = FOUR_CHAR_CODE('src#') kQTMovieExportSourceInfoResourceType = FOUR_CHAR_CODE('src#')
kQTMovieExportSourceInfoIsMediaType = 1L << 0 kQTMovieExportSourceInfoIsMediaType = 1 << 0
kQTMovieExportSourceInfoIsMediaCharacteristic = 1L << 1 kQTMovieExportSourceInfoIsMediaCharacteristic = 1 << 1
kQTMovieExportSourceInfoIsSourceType = 1L << 2 kQTMovieExportSourceInfoIsSourceType = 1 << 2
movieExportUseConfiguredSettings = FOUR_CHAR_CODE('ucfg') movieExportUseConfiguredSettings = FOUR_CHAR_CODE('ucfg')
movieExportWidth = FOUR_CHAR_CODE('wdth') movieExportWidth = FOUR_CHAR_CODE('wdth')
movieExportHeight = FOUR_CHAR_CODE('hegt') movieExportHeight = FOUR_CHAR_CODE('hegt')
movieExportDuration = FOUR_CHAR_CODE('dura') movieExportDuration = FOUR_CHAR_CODE('dura')
movieExportVideoFilter = FOUR_CHAR_CODE('iflt') movieExportVideoFilter = FOUR_CHAR_CODE('iflt')
movieExportTimeScale = FOUR_CHAR_CODE('tmsc') movieExportTimeScale = FOUR_CHAR_CODE('tmsc')
kQTBrowserInfoCanUseSystemFolderPlugin = (1L << 0) kQTBrowserInfoCanUseSystemFolderPlugin = (1 << 0)
kQTPreFlightOpenComponent = (1L << 1) kQTPreFlightOpenComponent = (1 << 1)
pnotComponentWantsEvents = 1 pnotComponentWantsEvents = 1
pnotComponentNeedsNoCache = 2 pnotComponentNeedsNoCache = 2
ShowFilePreviewComponentType = FOUR_CHAR_CODE('pnot') ShowFilePreviewComponentType = FOUR_CHAR_CODE('pnot')
@ -2032,10 +2032,10 @@ DataCompressorComponentType = FOUR_CHAR_CODE('dcom')
DataDecompressorComponentType = FOUR_CHAR_CODE('ddec') DataDecompressorComponentType = FOUR_CHAR_CODE('ddec')
AppleDataCompressorSubType = FOUR_CHAR_CODE('adec') AppleDataCompressorSubType = FOUR_CHAR_CODE('adec')
zlibDataCompressorSubType = FOUR_CHAR_CODE('zlib') zlibDataCompressorSubType = FOUR_CHAR_CODE('zlib')
kDataHCanRead = 1L << 0 kDataHCanRead = 1 << 0
kDataHSpecialRead = 1L << 1 kDataHSpecialRead = 1 << 1
kDataHSpecialReadFile = 1L << 2 kDataHSpecialReadFile = 1 << 2
kDataHCanWrite = 1L << 3 kDataHCanWrite = 1 << 3
kDataHSpecialWrite = 1 << 4 kDataHSpecialWrite = 1 << 4
kDataHSpecialWriteFile = 1 << 5 kDataHSpecialWriteFile = 1 << 5
kDataHCanStreamingWrite = 1 << 6 kDataHCanStreamingWrite = 1 << 6
@ -2055,12 +2055,12 @@ kDataHInfoFlagNeedsNetworkBandwidth = 1 << 2
kDataHFileTypeMacOSFileType = FOUR_CHAR_CODE('ftyp') kDataHFileTypeMacOSFileType = FOUR_CHAR_CODE('ftyp')
kDataHFileTypeExtension = FOUR_CHAR_CODE('fext') kDataHFileTypeExtension = FOUR_CHAR_CODE('fext')
kDataHFileTypeMIME = FOUR_CHAR_CODE('mime') kDataHFileTypeMIME = FOUR_CHAR_CODE('mime')
kDataHCreateFileButDontCreateResFile = (1L << 0) kDataHCreateFileButDontCreateResFile = (1 << 0)
kDataHMovieUsageDoAppendMDAT = 1L << 0 kDataHMovieUsageDoAppendMDAT = 1 << 0
kDataHTempUseSameDirectory = 1L << 0 kDataHTempUseSameDirectory = 1 << 0
kDataHTempUseSameVolume = 1L << 1 kDataHTempUseSameVolume = 1 << 1
kDataHTempCreateFile = 1L << 2 kDataHTempCreateFile = 1 << 2
kDataHTempOpenFile = 1L << 3 kDataHTempOpenFile = 1 << 3
kDataHGetDataRateInfiniteRate = 0x7FFFFFFF kDataHGetDataRateInfiniteRate = 0x7FFFFFFF
kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0 kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0
videoDigitizerComponentType = FOUR_CHAR_CODE('vdig') videoDigitizerComponentType = FOUR_CHAR_CODE('vdig')
@ -2091,48 +2091,48 @@ vdTypeBasic = 0
vdTypeAlpha = 1 vdTypeAlpha = 1
vdTypeMask = 2 vdTypeMask = 2
vdTypeKey = 3 vdTypeKey = 3
digiInDoesNTSC = 1L << 0 digiInDoesNTSC = 1 << 0
digiInDoesPAL = 1L << 1 digiInDoesPAL = 1 << 1
digiInDoesSECAM = 1L << 2 digiInDoesSECAM = 1 << 2
digiInDoesGenLock = 1L << 7 digiInDoesGenLock = 1 << 7
digiInDoesComposite = 1L << 8 digiInDoesComposite = 1 << 8
digiInDoesSVideo = 1L << 9 digiInDoesSVideo = 1 << 9
digiInDoesComponent = 1L << 10 digiInDoesComponent = 1 << 10
digiInVTR_Broadcast = 1L << 11 digiInVTR_Broadcast = 1 << 11
digiInDoesColor = 1L << 12 digiInDoesColor = 1 << 12
digiInDoesBW = 1L << 13 digiInDoesBW = 1 << 13
digiInSignalLock = 1L << 31 digiInSignalLock = 1 << 31
digiOutDoes1 = 1L << 0 digiOutDoes1 = 1 << 0
digiOutDoes2 = 1L << 1 digiOutDoes2 = 1 << 1
digiOutDoes4 = 1L << 2 digiOutDoes4 = 1 << 2
digiOutDoes8 = 1L << 3 digiOutDoes8 = 1 << 3
digiOutDoes16 = 1L << 4 digiOutDoes16 = 1 << 4
digiOutDoes32 = 1L << 5 digiOutDoes32 = 1 << 5
digiOutDoesDither = 1L << 6 digiOutDoesDither = 1 << 6
digiOutDoesStretch = 1L << 7 digiOutDoesStretch = 1 << 7
digiOutDoesShrink = 1L << 8 digiOutDoesShrink = 1 << 8
digiOutDoesMask = 1L << 9 digiOutDoesMask = 1 << 9
digiOutDoesDouble = 1L << 11 digiOutDoesDouble = 1 << 11
digiOutDoesQuad = 1L << 12 digiOutDoesQuad = 1 << 12
digiOutDoesQuarter = 1L << 13 digiOutDoesQuarter = 1 << 13
digiOutDoesSixteenth = 1L << 14 digiOutDoesSixteenth = 1 << 14
digiOutDoesRotate = 1L << 15 digiOutDoesRotate = 1 << 15
digiOutDoesHorizFlip = 1L << 16 digiOutDoesHorizFlip = 1 << 16
digiOutDoesVertFlip = 1L << 17 digiOutDoesVertFlip = 1 << 17
digiOutDoesSkew = 1L << 18 digiOutDoesSkew = 1 << 18
digiOutDoesBlend = 1L << 19 digiOutDoesBlend = 1 << 19
digiOutDoesWarp = 1L << 20 digiOutDoesWarp = 1 << 20
digiOutDoesHW_DMA = 1L << 21 digiOutDoesHW_DMA = 1 << 21
digiOutDoesHWPlayThru = 1L << 22 digiOutDoesHWPlayThru = 1 << 22
digiOutDoesILUT = 1L << 23 digiOutDoesILUT = 1 << 23
digiOutDoesKeyColor = 1L << 24 digiOutDoesKeyColor = 1 << 24
digiOutDoesAsyncGrabs = 1L << 25 digiOutDoesAsyncGrabs = 1 << 25
digiOutDoesUnreadableScreenBits = 1L << 26 digiOutDoesUnreadableScreenBits = 1 << 26
digiOutDoesCompress = 1L << 27 digiOutDoesCompress = 1 << 27
digiOutDoesCompressOnly = 1L << 28 digiOutDoesCompressOnly = 1 << 28
digiOutDoesPlayThruDuringCompress = 1L << 29 digiOutDoesPlayThruDuringCompress = 1 << 29
digiOutDoesCompressPartiallyVisible = 1L << 30 digiOutDoesCompressPartiallyVisible = 1 << 30
digiOutDoesNotNeedCopyOfCompressData = 1L << 31 digiOutDoesNotNeedCopyOfCompressData = 1 << 31
dmaDepth1 = 1 dmaDepth1 = 1
dmaDepth2 = 2 dmaDepth2 = 2
dmaDepth4 = 4 dmaDepth4 = 4
@ -2160,19 +2160,19 @@ xmlIdentifierInvalid = 0
xmlContentTypeInvalid = 0 xmlContentTypeInvalid = 0
xmlContentTypeElement = 1 xmlContentTypeElement = 1
xmlContentTypeCharData = 2 xmlContentTypeCharData = 2
elementFlagAlwaysSelfContained = 1L << 0 elementFlagAlwaysSelfContained = 1 << 0
elementFlagPreserveWhiteSpace = 1L << 1 elementFlagPreserveWhiteSpace = 1 << 1
xmlParseFlagAllowUppercase = 1L << 0 xmlParseFlagAllowUppercase = 1 << 0
xmlParseFlagAllowUnquotedAttributeValues = 1L << 1 xmlParseFlagAllowUnquotedAttributeValues = 1 << 1
xmlParseFlagEventParseOnly = 1L << 2 xmlParseFlagEventParseOnly = 1 << 2
attributeValueKindCharString = 0 attributeValueKindCharString = 0
attributeValueKindInteger = 1L << 0 attributeValueKindInteger = 1 << 0
attributeValueKindPercent = 1L << 1 attributeValueKindPercent = 1 << 1
attributeValueKindBoolean = 1L << 2 attributeValueKindBoolean = 1 << 2
attributeValueKindOnOff = 1L << 3 attributeValueKindOnOff = 1 << 3
attributeValueKindColor = 1L << 4 attributeValueKindColor = 1 << 4
attributeValueKindEnum = 1L << 5 attributeValueKindEnum = 1 << 5
attributeValueKindCaseSensEnum = 1L << 6 attributeValueKindCaseSensEnum = 1 << 6
MAX_ATTRIBUTE_VALUE_KIND = attributeValueKindCaseSensEnum MAX_ATTRIBUTE_VALUE_KIND = attributeValueKindCaseSensEnum
nameSpaceIDNone = 0 nameSpaceIDNone = 0
element_xml = 1 element_xml = 1
@ -2267,7 +2267,7 @@ sgcVideoRectType = FOUR_CHAR_CODE('vrct')
sgcVideoDigitizerType = FOUR_CHAR_CODE('vdig') sgcVideoDigitizerType = FOUR_CHAR_CODE('vdig')
QTVideoOutputComponentType = FOUR_CHAR_CODE('vout') QTVideoOutputComponentType = FOUR_CHAR_CODE('vout')
QTVideoOutputComponentBaseSubType = FOUR_CHAR_CODE('base') QTVideoOutputComponentBaseSubType = FOUR_CHAR_CODE('base')
kQTVideoOutputDontDisplayToUser = 1L << 0 kQTVideoOutputDontDisplayToUser = 1 << 0
kQTVODisplayModeItem = FOUR_CHAR_CODE('qdmi') kQTVODisplayModeItem = FOUR_CHAR_CODE('qdmi')
kQTVODimensions = FOUR_CHAR_CODE('dimn') kQTVODimensions = FOUR_CHAR_CODE('dimn')
kQTVOResolution = FOUR_CHAR_CODE('resl') kQTVOResolution = FOUR_CHAR_CODE('resl')
@ -2801,12 +2801,12 @@ mPartialDraw = 1 << 4
mWantIdleActions = 1 << 5 mWantIdleActions = 1 << 5
forceUpdateRedraw = 1 << 0 forceUpdateRedraw = 1 << 0
forceUpdateNewBuffer = 1 << 1 forceUpdateNewBuffer = 1 << 1
mHitTestBounds = 1L << 0 mHitTestBounds = 1 << 0
mHitTestImage = 1L << 1 mHitTestImage = 1 << 1
mHitTestInvisible = 1L << 2 mHitTestInvisible = 1 << 2
mHitTestIsClick = 1L << 3 mHitTestIsClick = 1 << 3
mOpaque = 1L << 0 mOpaque = 1 << 0
mInvisible = 1L << 1 mInvisible = 1 << 1
kMediaQTIdleFrequencySelector = FOUR_CHAR_CODE('idfq') kMediaQTIdleFrequencySelector = FOUR_CHAR_CODE('idfq')
kMediaVideoParamBrightness = 1 kMediaVideoParamBrightness = 1
kMediaVideoParamContrast = 2 kMediaVideoParamContrast = 2
@ -3244,8 +3244,8 @@ kUndefined4EventType = 0x0000000E
kGeneralEventType = 0x0000000F kGeneralEventType = 0x0000000F
kXEventLengthBits = 0x00000002 kXEventLengthBits = 0x00000002
kGeneralEventLengthBits = 0x00000003 kGeneralEventLengthBits = 0x00000003
kEventLen = 1L kEventLen = 1
kXEventLen = 2L kXEventLen = 2
kRestEventLen = kEventLen kRestEventLen = kEventLen
kNoteEventLen = kEventLen kNoteEventLen = kEventLen
kControlEventLen = kEventLen kControlEventLen = kEventLen
@ -3265,7 +3265,7 @@ kXEventPartFieldPos = 16
kXEventPartFieldWidth = 12 kXEventPartFieldWidth = 12
kRestEventDurationFieldPos = 0 kRestEventDurationFieldPos = 0
kRestEventDurationFieldWidth = 24 kRestEventDurationFieldWidth = 24
kRestEventDurationMax = ((1L << kRestEventDurationFieldWidth) - 1) kRestEventDurationMax = ((1 << kRestEventDurationFieldWidth) - 1)
kNoteEventPitchFieldPos = 18 kNoteEventPitchFieldPos = 18
kNoteEventPitchFieldWidth = 6 kNoteEventPitchFieldWidth = 6
kNoteEventPitchOffset = 32 kNoteEventPitchOffset = 32
@ -3274,12 +3274,12 @@ kNoteEventVolumeFieldWidth = 7
kNoteEventVolumeOffset = 0 kNoteEventVolumeOffset = 0
kNoteEventDurationFieldPos = 0 kNoteEventDurationFieldPos = 0
kNoteEventDurationFieldWidth = 11 kNoteEventDurationFieldWidth = 11
kNoteEventDurationMax = ((1L << kNoteEventDurationFieldWidth) - 1) kNoteEventDurationMax = ((1 << kNoteEventDurationFieldWidth) - 1)
kXNoteEventPitchFieldPos = 0 kXNoteEventPitchFieldPos = 0
kXNoteEventPitchFieldWidth = 16 kXNoteEventPitchFieldWidth = 16
kXNoteEventDurationFieldPos = 0 kXNoteEventDurationFieldPos = 0
kXNoteEventDurationFieldWidth = 22 kXNoteEventDurationFieldWidth = 22
kXNoteEventDurationMax = ((1L << kXNoteEventDurationFieldWidth) - 1) kXNoteEventDurationMax = ((1 << kXNoteEventDurationFieldWidth) - 1)
kXNoteEventVolumeFieldPos = 22 kXNoteEventVolumeFieldPos = 22
kXNoteEventVolumeFieldWidth = 7 kXNoteEventVolumeFieldWidth = 7
kControlEventControllerFieldPos = 16 kControlEventControllerFieldPos = 16

View File

@ -300,15 +300,15 @@ k8BitRawOut = (1 << 8)
k8BitTwosOut = (1 << 9) k8BitTwosOut = (1 << 9)
k16BitOut = (1 << 10) k16BitOut = (1 << 10)
kStereoOut = (1 << 11) kStereoOut = (1 << 11)
kReverse = (1L << 16) kReverse = (1 << 16)
kRateConvert = (1L << 17) kRateConvert = (1 << 17)
kCreateSoundSource = (1L << 18) kCreateSoundSource = (1 << 18)
kVMAwareness = (1L << 21) kVMAwareness = (1 << 21)
kHighQuality = (1L << 22) kHighQuality = (1 << 22)
kNonRealTime = (1L << 23) kNonRealTime = (1 << 23)
kSourcePaused = (1 << 0) kSourcePaused = (1 << 0)
kPassThrough = (1L << 16) kPassThrough = (1 << 16)
kNoSoundComponentChain = (1L << 17) kNoSoundComponentChain = (1 << 17)
kNoMixing = (1 << 0) kNoMixing = (1 << 0)
kNoSampleRateConversion = (1 << 1) kNoSampleRateConversion = (1 << 1)
kNoSampleSizeConversion = (1 << 2) kNoSampleSizeConversion = (1 << 2)
@ -343,9 +343,9 @@ audioLeftChannel = 1
audioRightChannel = 2 audioRightChannel = 2
audioUnmuted = 0 audioUnmuted = 0
audioMuted = 1 audioMuted = 1
audioDoesMono = (1L << 0) audioDoesMono = (1 << 0)
audioDoesStereo = (1L << 1) audioDoesStereo = (1 << 1)
audioDoesIndependentChannels = (1L << 2) audioDoesIndependentChannels = (1 << 2)
siCDQuality = FOUR_CHAR_CODE('cd ') siCDQuality = FOUR_CHAR_CODE('cd ')
siBestQuality = FOUR_CHAR_CODE('best') siBestQuality = FOUR_CHAR_CODE('best')
siBetterQuality = FOUR_CHAR_CODE('betr') siBetterQuality = FOUR_CHAR_CODE('betr')
@ -358,8 +358,8 @@ siReadPermission = 0
siWritePermission = 1 siWritePermission = 1
kSoundConverterDidntFillBuffer = (1 << 0) kSoundConverterDidntFillBuffer = (1 << 0)
kSoundConverterHasLeftOverData = (1 << 1) kSoundConverterHasLeftOverData = (1 << 1)
kExtendedSoundSampleCountNotValid = 1L << 0 kExtendedSoundSampleCountNotValid = 1 << 0
kExtendedSoundBufferSizeValid = 1L << 1 kExtendedSoundBufferSizeValid = 1 << 1
kScheduledSoundDoScheduled = 1 << 0 kScheduledSoundDoScheduled = 1 << 0
kScheduledSoundDoCallBack = 1 << 1 kScheduledSoundDoCallBack = 1 << 1
kScheduledSoundExtendedHdr = 1 << 2 kScheduledSoundExtendedHdr = 1 << 2

View File

@ -20,24 +20,24 @@ kSheetAlertWindowClass = 15
kAltPlainWindowClass = 16 kAltPlainWindowClass = 16
kDrawerWindowClass = 20 kDrawerWindowClass = 20
# kAllWindowClasses = (unsigned long)0xFFFFFFFF # kAllWindowClasses = (unsigned long)0xFFFFFFFF
kWindowNoAttributes = 0L kWindowNoAttributes = 0
kWindowCloseBoxAttribute = (1L << 0) kWindowCloseBoxAttribute = (1 << 0)
kWindowHorizontalZoomAttribute = (1L << 1) kWindowHorizontalZoomAttribute = (1 << 1)
kWindowVerticalZoomAttribute = (1L << 2) kWindowVerticalZoomAttribute = (1 << 2)
kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute) kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute)
kWindowCollapseBoxAttribute = (1L << 3) kWindowCollapseBoxAttribute = (1 << 3)
kWindowResizableAttribute = (1L << 4) kWindowResizableAttribute = (1 << 4)
kWindowSideTitlebarAttribute = (1L << 5) kWindowSideTitlebarAttribute = (1 << 5)
kWindowToolbarButtonAttribute = (1L << 6) kWindowToolbarButtonAttribute = (1 << 6)
kWindowNoUpdatesAttribute = (1L << 16) kWindowNoUpdatesAttribute = (1 << 16)
kWindowNoActivatesAttribute = (1L << 17) kWindowNoActivatesAttribute = (1 << 17)
kWindowOpaqueForEventsAttribute = (1L << 18) kWindowOpaqueForEventsAttribute = (1 << 18)
kWindowNoShadowAttribute = (1L << 21) kWindowNoShadowAttribute = (1 << 21)
kWindowHideOnSuspendAttribute = (1L << 24) kWindowHideOnSuspendAttribute = (1 << 24)
kWindowStandardHandlerAttribute = (1L << 25) kWindowStandardHandlerAttribute = (1 << 25)
kWindowHideOnFullScreenAttribute = (1L << 26) kWindowHideOnFullScreenAttribute = (1 << 26)
kWindowInWindowMenuAttribute = (1L << 27) kWindowInWindowMenuAttribute = (1 << 27)
kWindowLiveResizeAttribute = (1L << 28) kWindowLiveResizeAttribute = (1 << 28)
# kWindowNoConstrainAttribute = (unsigned long)((1L << 31)) # kWindowNoConstrainAttribute = (unsigned long)((1L << 31))
kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute) kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute)
kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute) kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
@ -225,7 +225,7 @@ wTitleBarColor = 4
# kMouseUpOutOfSlop = (long)0x80008000 # kMouseUpOutOfSlop = (long)0x80008000
kWindowDefinitionVersionOne = 1 kWindowDefinitionVersionOne = 1
kWindowDefinitionVersionTwo = 2 kWindowDefinitionVersionTwo = 2
kWindowIsCollapsedState = (1 << 0L) kWindowIsCollapsedState = (1 << 0)
kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') kStoredWindowSystemTag = FOUR_CHAR_CODE('appl')
kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas')
kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255')
@ -251,8 +251,8 @@ kWindowGroupContentsRecurse = 1 << 1
kWindowGroupContentsVisible = 1 << 2 kWindowGroupContentsVisible = 1 << 2
kWindowPaintProcOptionsNone = 0 kWindowPaintProcOptionsNone = 0
kScrollWindowNoOptions = 0 kScrollWindowNoOptions = 0
kScrollWindowInvalidate = (1L << 0) kScrollWindowInvalidate = (1 << 0)
kScrollWindowEraseToPortBackground = (1L << 1) kScrollWindowEraseToPortBackground = (1 << 1)
kWindowMenuIncludeRotate = 1 << 0 kWindowMenuIncludeRotate = 1 << 0
kWindowZoomTransitionEffect = 1 kWindowZoomTransitionEffect = 1
kWindowSheetTransitionEffect = 2 kWindowSheetTransitionEffect = 2
@ -261,11 +261,11 @@ kWindowShowTransitionAction = 1
kWindowHideTransitionAction = 2 kWindowHideTransitionAction = 2
kWindowMoveTransitionAction = 3 kWindowMoveTransitionAction = 3
kWindowResizeTransitionAction = 4 kWindowResizeTransitionAction = 4
kWindowConstrainMayResize = (1L << 0) kWindowConstrainMayResize = (1 << 0)
kWindowConstrainMoveRegardlessOfFit = (1L << 1) kWindowConstrainMoveRegardlessOfFit = (1 << 1)
kWindowConstrainAllowPartial = (1L << 2) kWindowConstrainAllowPartial = (1 << 2)
kWindowConstrainCalcOnly = (1L << 3) kWindowConstrainCalcOnly = (1 << 3)
kWindowConstrainUseTransitionWindow = (1L << 4) kWindowConstrainUseTransitionWindow = (1 << 4)
kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
kWindowLatentVisibleFloater = 1 << 0 kWindowLatentVisibleFloater = 1 << 0
kWindowLatentVisibleSuspend = 1 << 1 kWindowLatentVisibleSuspend = 1 << 1

View File

@ -189,13 +189,13 @@ def unpack(desc, formodulename=""):
return struct.unpack('l', desc.data)[0] return struct.unpack('l', desc.data)[0]
if t == typeLongDateTime: if t == typeLongDateTime:
a, b = struct.unpack('lL', desc.data) a, b = struct.unpack('lL', desc.data)
return (long(a) << 32) + b return (int(a) << 32) + b
if t == typeNull: if t == typeNull:
return None return None
if t == typeMagnitude: if t == typeMagnitude:
v = struct.unpack('l', desc.data) v = struct.unpack('l', desc.data)
if v < 0: if v < 0:
v = 0x100000000L + v v = 0x100000000 + v
return v return v
if t == typeObjectSpecifier: if t == typeObjectSpecifier:
record = desc.AECoerceDesc('reco') record = desc.AECoerceDesc('reco')

View File

@ -28,24 +28,24 @@ smAllScripts = -3
# Find the epoch conversion for file dates in a way that works on OS9 and OSX # Find the epoch conversion for file dates in a way that works on OS9 and OSX
import time import time
if time.gmtime(0)[0] == 1970: if time.gmtime(0)[0] == 1970:
_EPOCHCONVERT = -((1970-1904)*365 + 17) * (24*60*60) + 0x100000000L _EPOCHCONVERT = -((1970-1904)*365 + 17) * (24*60*60) + 0x100000000
def _utc2time(utc): def _utc2time(utc):
t = utc[1] + _EPOCHCONVERT t = utc[1] + _EPOCHCONVERT
return int(t) return int(t)
def _time2utc(t): def _time2utc(t):
t = int(t) - _EPOCHCONVERT t = int(t) - _EPOCHCONVERT
if t < -0x7fffffff: if t < -0x7fffffff:
t = t + 0x10000000L t = t + 0x10000000
return (0, int(t), 0) return (0, int(t), 0)
else: else:
def _utc2time(utc): def _utc2time(utc):
t = utc[1] t = utc[1]
if t < 0: if t < 0:
t = t + 0x100000000L t = t + 0x100000000
return t return t
def _time2utc(t): def _time2utc(t):
if t > 0x7fffffff: if t > 0x7fffffff:
t = t - 0x100000000L t = t - 0x100000000
return (0, int(t), 0) return (0, int(t), 0)
# The old name of the error object: # The old name of the error object:

View File

@ -148,7 +148,7 @@ class PimpUrllibDownloader(PimpDownloader):
keepgoing = True keepgoing = True
download = urllib2.urlopen(url) download = urllib2.urlopen(url)
if "content-length" in download.headers: if "content-length" in download.headers:
length = long(download.headers['content-length']) length = int(download.headers['content-length'])
else: else:
length = -1 length = -1

View File

@ -28,33 +28,33 @@ IPPROTO_RAW = 255
IPPROTO_MAX = 256 IPPROTO_MAX = 256
IPPORT_RESERVED = 1024 IPPORT_RESERVED = 1024
IPPORT_USERRESERVED = 5000 IPPORT_USERRESERVED = 5000
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28 IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_LOOPBACK = 0x7f000001 INADDR_LOOPBACK = 0x7f000001

View File

@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1
_LARGEFILE_SOURCE = 1 _LARGEFILE_SOURCE = 1
_FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 64
_FILE_OFFSET_BITS = 32 _FILE_OFFSET_BITS = 32
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_POSIX_PTHREAD_SEMANTICS = 1 _POSIX_PTHREAD_SEMANTICS = 1
_XOPEN_VERSION = 500 _XOPEN_VERSION = 500
_XOPEN_VERSION = 4 _XOPEN_VERSION = 4
@ -95,10 +95,10 @@ NGROUPS_UMIN = 0
NGROUPS_UMAX = 32 NGROUPS_UMAX = 32
NGROUPS_MAX_DEFAULT = 16 NGROUPS_MAX_DEFAULT = 16
NZERO = 20 NZERO = 20
NULL = 0L NULL = 0
NULL = 0 NULL = 0
CMASK = 022 CMASK = 022
CDLIMIT = (1L<<11) CDLIMIT = (1<<11)
NBPS = 0x20000 NBPS = 0x20000
NBPSCTR = 512 NBPSCTR = 512
UBSIZE = 512 UBSIZE = 512
@ -117,9 +117,9 @@ DEV_BSIZE = 512
DEV_BSHIFT = 9 DEV_BSHIFT = 9
MAXFRAG = 8 MAXFRAG = 8
MAXOFF32_T = 0x7fffffff MAXOFF32_T = 0x7fffffff
MAXOFF_T = 0x7fffffffffffffffl MAXOFF_T = 0x7fffffffffffffff
MAXOFFSET_T = 0x7fffffffffffffffl MAXOFFSET_T = 0x7fffffffffffffff
MAXOFF_T = 0x7fffffffl MAXOFF_T = 0x7fffffff
MAXOFFSET_T = 0x7fffffff MAXOFFSET_T = 0x7fffffff
def btodb(bytes): return \ def btodb(bytes): return \
@ -312,9 +312,9 @@ _PC_PRIO_IO = 11
_PC_SYNC_IO = 12 _PC_SYNC_IO = 12
_PC_FILESIZEBITS = 67 _PC_FILESIZEBITS = 67
_PC_LAST = 67 _PC_LAST = 67
_POSIX_VERSION = 199506L _POSIX_VERSION = 199506
_POSIX2_VERSION = 199209L _POSIX2_VERSION = 199209
_POSIX2_C_VERSION = 199209L _POSIX2_C_VERSION = 199209
_XOPEN_XCU_VERSION = 4 _XOPEN_XCU_VERSION = 4
_XOPEN_REALTIME = 1 _XOPEN_REALTIME = 1
_XOPEN_ENH_I18N = 1 _XOPEN_ENH_I18N = 1
@ -431,7 +431,7 @@ def TIMESTRUC_TO_TICK(tsp): return \
from TYPES import * from TYPES import *
# Included from iso/time_iso.h # Included from iso/time_iso.h
NULL = 0L NULL = 0
NULL = 0 NULL = 0
CLOCKS_PER_SEC = 1000000 CLOCKS_PER_SEC = 1000000
@ -869,9 +869,9 @@ RLIMIT_NOFILE = 5
RLIMIT_VMEM = 6 RLIMIT_VMEM = 6
RLIMIT_AS = RLIMIT_VMEM RLIMIT_AS = RLIMIT_VMEM
RLIM_NLIMITS = 7 RLIM_NLIMITS = 7
RLIM_INFINITY = (-3l) RLIM_INFINITY = (-3)
RLIM_SAVED_MAX = (-2l) RLIM_SAVED_MAX = (-2)
RLIM_SAVED_CUR = (-1l) RLIM_SAVED_CUR = (-1)
RLIM_INFINITY = 0x7fffffff RLIM_INFINITY = 0x7fffffff
RLIM_SAVED_MAX = 0x7ffffffe RLIM_SAVED_MAX = 0x7ffffffe
RLIM_SAVED_CUR = 0x7ffffffd RLIM_SAVED_CUR = 0x7ffffffd
@ -1063,7 +1063,7 @@ POLLNOERR = 0x0400
POLLCLOSED = 0x8000 POLLCLOSED = 0x8000
# Included from sys/strmdep.h # Included from sys/strmdep.h
def str_aligned(X): return (((ulong_t)(X) & (sizeof (long) - 1)) == 0) def str_aligned(X): return (((ulong_t)(X) & (sizeof (int) - 1)) == 0)
# Included from sys/strft.h # Included from sys/strft.h

View File

@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1
_LARGEFILE_SOURCE = 1 _LARGEFILE_SOURCE = 1
_FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 64
_FILE_OFFSET_BITS = 32 _FILE_OFFSET_BITS = 32
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_POSIX_PTHREAD_SEMANTICS = 1 _POSIX_PTHREAD_SEMANTICS = 1
_XOPEN_VERSION = 500 _XOPEN_VERSION = 500
_XOPEN_VERSION = 4 _XOPEN_VERSION = 4
@ -92,10 +92,10 @@ NGROUPS_UMIN = 0
NGROUPS_UMAX = 32 NGROUPS_UMAX = 32
NGROUPS_MAX_DEFAULT = 16 NGROUPS_MAX_DEFAULT = 16
NZERO = 20 NZERO = 20
NULL = 0L NULL = 0
NULL = 0 NULL = 0
CMASK = 022 CMASK = 022
CDLIMIT = (1L<<11) CDLIMIT = (1<<11)
NBPS = 0x20000 NBPS = 0x20000
NBPSCTR = 512 NBPSCTR = 512
UBSIZE = 512 UBSIZE = 512
@ -114,9 +114,9 @@ DEV_BSIZE = 512
DEV_BSHIFT = 9 DEV_BSHIFT = 9
MAXFRAG = 8 MAXFRAG = 8
MAXOFF32_T = 0x7fffffff MAXOFF32_T = 0x7fffffff
MAXOFF_T = 0x7fffffffffffffffl MAXOFF_T = 0x7fffffffffffffff
MAXOFFSET_T = 0x7fffffffffffffffl MAXOFFSET_T = 0x7fffffffffffffff
MAXOFF_T = 0x7fffffffl MAXOFF_T = 0x7fffffff
MAXOFFSET_T = 0x7fffffff MAXOFFSET_T = 0x7fffffff
def btodb(bytes): return \ def btodb(bytes): return \
@ -309,9 +309,9 @@ _PC_PRIO_IO = 11
_PC_SYNC_IO = 12 _PC_SYNC_IO = 12
_PC_FILESIZEBITS = 67 _PC_FILESIZEBITS = 67
_PC_LAST = 67 _PC_LAST = 67
_POSIX_VERSION = 199506L _POSIX_VERSION = 199506
_POSIX2_VERSION = 199209L _POSIX2_VERSION = 199209
_POSIX2_C_VERSION = 199209L _POSIX2_C_VERSION = 199209
_XOPEN_XCU_VERSION = 4 _XOPEN_XCU_VERSION = 4
_XOPEN_REALTIME = 1 _XOPEN_REALTIME = 1
_XOPEN_ENH_I18N = 1 _XOPEN_ENH_I18N = 1
@ -428,7 +428,7 @@ def TIMESTRUC_TO_TICK(tsp): return \
from TYPES import * from TYPES import *
# Included from iso/time_iso.h # Included from iso/time_iso.h
NULL = 0L NULL = 0
NULL = 0 NULL = 0
CLOCKS_PER_SEC = 1000000 CLOCKS_PER_SEC = 1000000
@ -872,9 +872,9 @@ RLIMIT_NOFILE = 5
RLIMIT_VMEM = 6 RLIMIT_VMEM = 6
RLIMIT_AS = RLIMIT_VMEM RLIMIT_AS = RLIMIT_VMEM
RLIM_NLIMITS = 7 RLIM_NLIMITS = 7
RLIM_INFINITY = (-3l) RLIM_INFINITY = (-3)
RLIM_SAVED_MAX = (-2l) RLIM_SAVED_MAX = (-2)
RLIM_SAVED_CUR = (-1l) RLIM_SAVED_CUR = (-1)
RLIM_INFINITY = 0x7fffffff RLIM_INFINITY = 0x7fffffff
RLIM_SAVED_MAX = 0x7ffffffe RLIM_SAVED_MAX = 0x7ffffffe
RLIM_SAVED_CUR = 0x7ffffffd RLIM_SAVED_CUR = 0x7ffffffd

View File

@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1
_LARGEFILE_SOURCE = 1 _LARGEFILE_SOURCE = 1
_FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 64
_FILE_OFFSET_BITS = 32 _FILE_OFFSET_BITS = 32
_POSIX_C_SOURCE = 199506L _POSIX_C_SOURCE = 199506
_POSIX_PTHREAD_SEMANTICS = 1 _POSIX_PTHREAD_SEMANTICS = 1
_XOPEN_VERSION = 500 _XOPEN_VERSION = 500
_XOPEN_VERSION = 4 _XOPEN_VERSION = 4
@ -216,10 +216,10 @@ SHRT_MAX = 32767
USHRT_MAX = 65535 USHRT_MAX = 65535
INT_MIN = (-2147483647-1) INT_MIN = (-2147483647-1)
INT_MAX = 2147483647 INT_MAX = 2147483647
LONG_MIN = (-9223372036854775807L-1L) LONG_MIN = (-9223372036854775807-1)
LONG_MAX = 9223372036854775807L LONG_MAX = 9223372036854775807
LONG_MIN = (-2147483647L-1L) LONG_MIN = (-2147483647-1)
LONG_MAX = 2147483647L LONG_MAX = 2147483647
P_MYID = (-1) P_MYID = (-1)
# Included from sys/select.h # Included from sys/select.h
@ -303,7 +303,7 @@ def TIMESTRUC_TO_TICK(tsp): return \
from TYPES import * from TYPES import *
# Included from iso/time_iso.h # Included from iso/time_iso.h
NULL = 0L NULL = 0
NULL = 0 NULL = 0
CLOCKS_PER_SEC = 1000000 CLOCKS_PER_SEC = 1000000
FD_SETSIZE = 65536 FD_SETSIZE = 65536

View File

@ -1,33 +1,33 @@
# Generated by h2py from /usr/include/netinet/in.h # Generated by h2py from /usr/include/netinet/in.h
# Included from netinet/in_f.h # Included from netinet/in_f.h
def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0)
IN_CLASSA_NET = 0xff000000 IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24 IN_CLASSA_NSHIFT = 24
IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128 IN_CLASSA_MAX = 128
def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000)
IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16 IN_CLASSB_NSHIFT = 16
IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536 IN_CLASSB_MAX = 65536
def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000)
IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8 IN_CLASSC_NSHIFT = 8
IN_CLASSC_HOST = 0x000000ff IN_CLASSC_HOST = 0x000000ff
def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000)
IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28 IN_CLASSD_NSHIFT = 28
IN_CLASSD_HOST = 0x0fffffff IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i) def IN_MULTICAST(i): return IN_CLASSD(i)
def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000)
def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000)
INADDR_ANY = 0x00000000 INADDR_ANY = 0x00000000
INADDR_LOOPBACK = 0x7f000001 INADDR_LOOPBACK = 0x7f000001
@ -330,7 +330,7 @@ MSG_TRUNC = 0x10
MSG_EOR = 0x30 MSG_EOR = 0x30
MSG_WAITALL = 0x20 MSG_WAITALL = 0x20
MSG_MAXIOVLEN = 16 MSG_MAXIOVLEN = 16
def OPTLEN(x): return ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) def OPTLEN(x): return ((((x) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
GIARG = 0x1 GIARG = 0x1
CONTI = 0x2 CONTI = 0x2
@ -715,7 +715,7 @@ FLUSHDATA = 0
STRHIGH = 5120 STRHIGH = 5120
STRLOW = 1024 STRLOW = 1024
MAXIOCBSZ = 1024 MAXIOCBSZ = 1024
def straln(a): return (caddr_t)((long)(a) & ~(sizeof(int)-1)) def straln(a): return (caddr_t)((int)(a) & ~(sizeof(int)-1))
IPM_ID = 200 IPM_ID = 200
ICMPM_ID = 201 ICMPM_ID = 201

View File

@ -213,7 +213,7 @@ _PC_NO_TRUNC = 7
_PC_VDISABLE = 8 _PC_VDISABLE = 8
_PC_CHOWN_RESTRICTED = 9 _PC_CHOWN_RESTRICTED = 9
_PC_FILESIZEBITS = 10 _PC_FILESIZEBITS = 10
_POSIX_VERSION = 199009L _POSIX_VERSION = 199009
_XOPEN_VERSION = 4 _XOPEN_VERSION = 4
GF_PATH = "/etc/group" GF_PATH = "/etc/group"
PF_PATH = "/etc/passwd" PF_PATH = "/etc/passwd"
@ -231,8 +231,8 @@ STDERR_FILENO = 2
_XOPEN_UNIX = 1 _XOPEN_UNIX = 1
_XOPEN_ENH_I18N = 1 _XOPEN_ENH_I18N = 1
_XOPEN_XPG4 = 1 _XOPEN_XPG4 = 1
_POSIX2_C_VERSION = 199209L _POSIX2_C_VERSION = 199209
_POSIX2_VERSION = 199209L _POSIX2_VERSION = 199209
_XOPEN_XCU_VERSION = 4 _XOPEN_XCU_VERSION = 4
_POSIX_SEMAPHORES = 1 _POSIX_SEMAPHORES = 1
_POSIX_THREADS = 1 _POSIX_THREADS = 1

View File

@ -682,7 +682,7 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
patch = (sysv & 0x000F) patch = (sysv & 0x000F)
release = '%s.%i.%i' % (_bcd2str(major),minor,patch) release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
if sysu: if sysu:
major = int((sysu & 0xFF000000L) >> 24) major = int((sysu & 0xFF000000) >> 24)
minor = (sysu & 0x00F00000) >> 20 minor = (sysu & 0x00F00000) >> 20
bugfix = (sysu & 0x000F0000) >> 16 bugfix = (sysu & 0x000F0000) >> 16
stage = (sysu & 0x0000FF00) >> 8 stage = (sysu & 0x0000FF00) >> 8

View File

@ -114,9 +114,9 @@ def compile(file, cfile=None, dfile=None, doraise=False):
""" """
f = open(file, 'U') f = open(file, 'U')
try: try:
timestamp = long(os.fstat(f.fileno()).st_mtime) timestamp = int(os.fstat(f.fileno()).st_mtime)
except AttributeError: except AttributeError:
timestamp = long(os.stat(file).st_mtime) timestamp = int(os.stat(file).st_mtime)
codestring = f.read() codestring = f.read()
f.close() f.close()
if codestring and codestring[-1] != '\n': if codestring and codestring[-1] != '\n':

View File

@ -105,10 +105,10 @@ class Random(_random.Random):
if a is None: if a is None:
try: try:
a = long(_hexlify(_urandom(16)), 16) a = int(_hexlify(_urandom(16)), 16)
except NotImplementedError: except NotImplementedError:
import time import time
a = long(time.time() * 256) # use fractional seconds a = int(time.time() * 256) # use fractional seconds
super(Random, self).seed(a) super(Random, self).seed(a)
self.gauss_next = None self.gauss_next = None
@ -145,7 +145,7 @@ class Random(_random.Random):
## -------------------- integer methods ------------------- ## -------------------- integer methods -------------------
def randrange(self, start, stop=None, step=1, int=int, default=None, def randrange(self, start, stop=None, step=1, int=int, default=None,
maxwidth=1L<<BPF): maxwidth=1<<BPF):
"""Choose a random item from range(start, stop[, step]). """Choose a random item from range(start, stop[, step]).
This fixes the problem with randint() which includes the This fixes the problem with randint() which includes the
@ -214,7 +214,7 @@ class Random(_random.Random):
return self.randrange(a, b+1) return self.randrange(a, b+1)
def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L<<BPF, def _randbelow(self, n, _log=_log, int=int, _maxwidth=1<<BPF,
_Method=_MethodType, _BuiltinMethod=_BuiltinMethodType): _Method=_MethodType, _BuiltinMethod=_BuiltinMethodType):
"""Return a random int in the range [0,n) """Return a random int in the range [0,n)
@ -626,12 +626,12 @@ class WichmannHill(Random):
if a is None: if a is None:
try: try:
a = long(_hexlify(_urandom(16)), 16) a = int(_hexlify(_urandom(16)), 16)
except NotImplementedError: except NotImplementedError:
import time import time
a = long(time.time() * 256) # use fractional seconds a = int(time.time() * 256) # use fractional seconds
if not isinstance(a, (int, long)): if not isinstance(a, (int, int)):
a = hash(a) a = hash(a)
a, x = divmod(a, 30268) a, x = divmod(a, 30268)
@ -721,7 +721,7 @@ class WichmannHill(Random):
if 0 == x == y == z: if 0 == x == y == z:
# Initialize from current time # Initialize from current time
import time import time
t = long(time.time() * 256) t = int(time.time() * 256)
t = int((t&0xffffff) ^ (t>>24)) t = int((t&0xffffff) ^ (t>>24))
t, x = divmod(t, 256) t, x = divmod(t, 256)
t, y = divmod(t, 256) t, y = divmod(t, 256)
@ -766,7 +766,7 @@ class SystemRandom(Random):
def random(self): def random(self):
"""Get the next random number in the range [0.0, 1.0).""" """Get the next random number in the range [0.0, 1.0)."""
return (long(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF return (int(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF
def getrandbits(self, k): def getrandbits(self, k):
"""getrandbits(k) -> x. Generates a long int with k random bits.""" """getrandbits(k) -> x. Generates a long int with k random bits."""
@ -775,7 +775,7 @@ class SystemRandom(Random):
if k != int(k): if k != int(k):
raise TypeError('number of bits should be an integer') raise TypeError('number of bits should be an integer')
bytes = (k + 7) // 8 # bits / 8 and rounded up bytes = (k + 7) // 8 # bits / 8 and rounded up
x = long(_hexlify(_urandom(bytes)), 16) x = int(_hexlify(_urandom(bytes)), 16)
return x >> (bytes * 8 - k) # trim excess bits return x >> (bytes * 8 - k) # trim excess bits
def _stub(self, *args, **kwds): def _stub(self, *args, **kwds):

View File

@ -19,7 +19,7 @@ assert _sre.MAGIC == MAGIC, "SRE module mismatch"
if _sre.CODESIZE == 2: if _sre.CODESIZE == 2:
MAXCODE = 65535 MAXCODE = 65535
else: else:
MAXCODE = 0xFFFFFFFFL MAXCODE = 0xFFFFFFFF
def _identityfunction(x): def _identityfunction(x):
return x return x
@ -267,7 +267,7 @@ def _mk_bitmap(bits):
if _sre.CODESIZE == 2: if _sre.CODESIZE == 2:
start = (1, 0) start = (1, 0)
else: else:
start = (1L, 0L) start = (1, 0)
m, v = start m, v = start
for c in bits: for c in bits:
if c: if c:

View File

@ -149,7 +149,7 @@ class SubPattern:
# determine the width (min, max) for this subpattern # determine the width (min, max) for this subpattern
if self.width: if self.width:
return self.width return self.width
lo = hi = 0L lo = hi = 0
UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY)
REPEATCODES = (MIN_REPEAT, MAX_REPEAT) REPEATCODES = (MIN_REPEAT, MAX_REPEAT)
for op, av in self.data: for op, av in self.data:
@ -172,8 +172,8 @@ class SubPattern:
hi = hi + j hi = hi + j
elif op in REPEATCODES: elif op in REPEATCODES:
i, j = av[2].getwidth() i, j = av[2].getwidth()
lo = lo + long(i) * av[0] lo = lo + int(i) * av[0]
hi = hi + long(j) * av[1] hi = hi + int(j) * av[1]
elif op in UNITCODES: elif op in UNITCODES:
lo = lo + 1 lo = lo + 1
hi = hi + 1 hi = hi + 1

View File

@ -374,7 +374,7 @@ def rfind(s, *args):
# for a bit of speed # for a bit of speed
_float = float _float = float
_int = int _int = int
_long = long _long = int
# Convert string to float # Convert string to float
def atof(s): def atof(s):

View File

@ -184,7 +184,7 @@ def rfind(s, *args):
# for a bit of speed # for a bit of speed
_float = float _float = float
_int = int _int = int
_long = long _long = int
_StringType = type('') _StringType = type('')
# Convert string to float # Convert string to float

View File

@ -541,7 +541,7 @@ class Popen(object):
_cleanup() _cleanup()
self._child_created = False self._child_created = False
if not isinstance(bufsize, (int, long)): if not isinstance(bufsize, (int, int)):
raise TypeError("bufsize must be an integer") raise TypeError("bufsize must be an integer")
if mswindows: if mswindows:
@ -764,7 +764,7 @@ class Popen(object):
startupinfo.wShowWindow = SW_HIDE startupinfo.wShowWindow = SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe") comspec = os.environ.get("COMSPEC", "cmd.exe")
args = comspec + " /c " + args args = comspec + " /c " + args
if (GetVersion() >= 0x80000000L or if (GetVersion() >= 0x80000000 or
os.path.basename(comspec).lower() == "command.com"): os.path.basename(comspec).lower() == "command.com"):
# Win9x, or using command.com on NT. We need to # Win9x, or using command.com on NT. We need to
# use the w9xpopen intermediate program. For more # use the w9xpopen intermediate program. For more

View File

@ -119,7 +119,7 @@ AUDIO_FILE_ENCODING_ADPCM_G723_5 = 26
AUDIO_FILE_ENCODING_ALAW_8 = 27 AUDIO_FILE_ENCODING_ALAW_8 = 27
# from <multimedia/audio_hdr.h> # from <multimedia/audio_hdr.h>
AUDIO_UNKNOWN_SIZE = 0xFFFFFFFFL # ((unsigned)(~0)) AUDIO_UNKNOWN_SIZE = 0xFFFFFFFF # ((unsigned)(~0))
_simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8, _simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8,
AUDIO_FILE_ENCODING_LINEAR_8, AUDIO_FILE_ENCODING_LINEAR_8,
@ -132,7 +132,7 @@ class Error(Exception):
pass pass
def _read_u32(file): def _read_u32(file):
x = 0L x = 0
for i in range(4): for i in range(4):
byte = file.read(1) byte = file.read(1)
if byte == '': if byte == '':

View File

@ -80,7 +80,7 @@ VERSION = "00" # version number
LENGTH_NAME = 100 # maximum length of a filename LENGTH_NAME = 100 # maximum length of a filename
LENGTH_LINK = 100 # maximum length of a linkname LENGTH_LINK = 100 # maximum length of a linkname
LENGTH_PREFIX = 155 # maximum length of the prefix field LENGTH_PREFIX = 155 # maximum length of the prefix field
MAXSIZE_MEMBER = 077777777777L # maximum size of a file (11 octal digits) MAXSIZE_MEMBER = 077777777777 # maximum size of a file (11 octal digits)
REGTYPE = "0" # regular file REGTYPE = "0" # regular file
AREGTYPE = "\0" # regular file AREGTYPE = "\0" # regular file
@ -152,7 +152,7 @@ def nti(s):
except ValueError: except ValueError:
raise HeaderError("invalid header") raise HeaderError("invalid header")
else: else:
n = 0L n = 0
for i in xrange(len(s) - 1): for i in xrange(len(s) - 1):
n <<= 8 n <<= 8
n += ord(s[i + 1]) n += ord(s[i + 1])
@ -347,7 +347,7 @@ class _Stream:
self.fileobj = fileobj self.fileobj = fileobj
self.bufsize = bufsize self.bufsize = bufsize
self.buf = "" self.buf = ""
self.pos = 0L self.pos = 0
self.closed = False self.closed = False
if comptype == "gz": if comptype == "gz":
@ -384,7 +384,7 @@ class _Stream:
-self.zlib.MAX_WBITS, -self.zlib.MAX_WBITS,
self.zlib.DEF_MEM_LEVEL, self.zlib.DEF_MEM_LEVEL,
0) 0)
timestamp = struct.pack("<L", long(time.time())) timestamp = struct.pack("<L", int(time.time()))
self.__write("\037\213\010\010%s\002\377" % timestamp) self.__write("\037\213\010\010%s\002\377" % timestamp)
if self.name.endswith(".gz"): if self.name.endswith(".gz"):
self.name = self.name[:-3] self.name = self.name[:-3]
@ -429,8 +429,8 @@ class _Stream:
# while the same crc on a 64-bit box may "look positive". # while the same crc on a 64-bit box may "look positive".
# To avoid irksome warnings from the `struct` module, force # To avoid irksome warnings from the `struct` module, force
# it to look positive on all boxes. # it to look positive on all boxes.
self.fileobj.write(struct.pack("<L", self.crc & 0xffffffffL)) self.fileobj.write(struct.pack("<L", self.crc & 0xffffffff))
self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL)) self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFF))
if not self._extfileobj: if not self._extfileobj:
self.fileobj.close() self.fileobj.close()
@ -1076,7 +1076,7 @@ class TarFile(object):
self.closed = False self.closed = False
self.members = [] # list of members as TarInfo objects self.members = [] # list of members as TarInfo objects
self._loaded = False # flag if all members have been read self._loaded = False # flag if all members have been read
self.offset = 0L # current position in the archive file self.offset = 0 # current position in the archive file
self.inodes = {} # dictionary caching the inodes of self.inodes = {} # dictionary caching the inodes of
# archive members already added # archive members already added
@ -1378,7 +1378,7 @@ class TarFile(object):
if stat.S_ISREG(stmd): if stat.S_ISREG(stmd):
tarinfo.size = statres.st_size tarinfo.size = statres.st_size
else: else:
tarinfo.size = 0L tarinfo.size = 0
tarinfo.mtime = statres.st_mtime tarinfo.mtime = statres.st_mtime
tarinfo.type = type tarinfo.type = type
tarinfo.linkname = linkname tarinfo.linkname = linkname
@ -1924,8 +1924,8 @@ class TarFile(object):
buf = tarinfo.buf buf = tarinfo.buf
sp = _ringbuffer() sp = _ringbuffer()
pos = 386 pos = 386
lastpos = 0L lastpos = 0
realpos = 0L realpos = 0
# There are 4 possible sparse structs in the # There are 4 possible sparse structs in the
# first header. # first header.
for i in xrange(4): for i in xrange(4):

View File

@ -99,16 +99,16 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(TypeError, a.__setitem__) self.assertRaises(TypeError, a.__setitem__)
a = self.type2test([0,1,2,3,4]) a = self.type2test([0,1,2,3,4])
a[0L] = 1 a[0] = 1
a[1L] = 2 a[1] = 2
a[2L] = 3 a[2] = 3
self.assertEqual(a, self.type2test([1,2,3,3,4])) self.assertEqual(a, self.type2test([1,2,3,3,4]))
a[0] = 5 a[0] = 5
a[1] = 6 a[1] = 6
a[2] = 7 a[2] = 7
self.assertEqual(a, self.type2test([5,6,7,3,4])) self.assertEqual(a, self.type2test([5,6,7,3,4]))
a[-2L] = 88 a[-2] = 88
a[-1L] = 99 a[-1] = 99
self.assertEqual(a, self.type2test([5,6,7,88,99])) self.assertEqual(a, self.type2test([5,6,7,88,99]))
a[-2] = 8 a[-2] = 8
a[-1] = 9 a[-1] = 9
@ -189,8 +189,8 @@ class CommonTest(seq_tests.CommonTest):
self.assertEqual(a, self.type2test([])) self.assertEqual(a, self.type2test([]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
del a[1L:2L] del a[1:2]
del a[0L:1L] del a[0:1]
self.assertEqual(a, self.type2test([])) self.assertEqual(a, self.type2test([]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
@ -198,7 +198,7 @@ class CommonTest(seq_tests.CommonTest):
self.assertEqual(a, self.type2test([1])) self.assertEqual(a, self.type2test([1]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
del a[-2L:-1L] del a[-2:-1]
self.assertEqual(a, self.type2test([1])) self.assertEqual(a, self.type2test([1]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
@ -207,8 +207,8 @@ class CommonTest(seq_tests.CommonTest):
self.assertEqual(a, self.type2test([])) self.assertEqual(a, self.type2test([]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
del a[1L:] del a[1:]
del a[:1L] del a[:1]
self.assertEqual(a, self.type2test([])) self.assertEqual(a, self.type2test([]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
@ -216,7 +216,7 @@ class CommonTest(seq_tests.CommonTest):
self.assertEqual(a, self.type2test([0])) self.assertEqual(a, self.type2test([0]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])
del a[-1L:] del a[-1:]
self.assertEqual(a, self.type2test([0])) self.assertEqual(a, self.type2test([0]))
a = self.type2test([0, 1]) a = self.type2test([0, 1])

View File

@ -526,7 +526,7 @@ class TestMappingProtocol(BasicTestMappingProtocol):
# verify longs/ints get same value when key > 32 bits (for 64-bit archs) # verify longs/ints get same value when key > 32 bits (for 64-bit archs)
# see SF bug #689659 # see SF bug #689659
x = 4503599627370496L x = 4503599627370496
y = 4503599627370496 y = 4503599627370496
h = self._full_mapping({x: 'anything', y: 'something else'}) h = self._full_mapping({x: 'anything', y: 'something else'})
self.assertEqual(h[x], h[y]) self.assertEqual(h[x], h[y])
@ -626,7 +626,7 @@ class TestHashMappingProtocol(TestMappingProtocol):
def test_eq(self): def test_eq(self):
self.assertEqual(self._empty_mapping(), self._empty_mapping()) self.assertEqual(self._empty_mapping(), self._empty_mapping())
self.assertEqual(self._full_mapping({1: 2}), self.assertEqual(self._full_mapping({1: 2}),
self._full_mapping({1L: 2L})) self._full_mapping({1: 2}))
class Exc(Exception): pass class Exc(Exception): pass

View File

@ -349,7 +349,7 @@ def create_data():
c = C() c = C()
c.foo = 1 c.foo = 1
c.bar = 2 c.bar = 2
x = [0, 1L, 2.0, 3.0+0j] x = [0, 1, 2.0, 3.0+0j]
# Append some integer test cases at cPickle.c's internal size # Append some integer test cases at cPickle.c's internal size
# cutoffs. # cutoffs.
uint1max = 0xff uint1max = 0xff
@ -504,7 +504,7 @@ class AbstractPickleTests(unittest.TestCase):
n = n >> 1 n = n >> 1
def test_maxint64(self): def test_maxint64(self):
maxint64 = (1L << 63) - 1 maxint64 = (1 << 63) - 1
data = 'I' + str(maxint64) + '\n.' data = 'I' + str(maxint64) + '\n.'
got = self.loads(data) got = self.loads(data)
self.assertEqual(got, maxint64) self.assertEqual(got, maxint64)
@ -517,7 +517,7 @@ class AbstractPickleTests(unittest.TestCase):
for proto in protocols: for proto in protocols:
# 256 bytes is where LONG4 begins. # 256 bytes is where LONG4 begins.
for nbits in 1, 8, 8*254, 8*255, 8*256, 8*257: for nbits in 1, 8, 8*254, 8*255, 8*256, 8*257:
nbase = 1L << nbits nbase = 1 << nbits
for npos in nbase-1, nbase, nbase+1: for npos in nbase-1, nbase, nbase+1:
for n in npos, -npos: for n in npos, -npos:
pickle = self.dumps(n, proto) pickle = self.dumps(n, proto)
@ -525,7 +525,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(n, got) self.assertEqual(n, got)
# Try a monster. This is quadratic-time in protos 0 & 1, so don't # Try a monster. This is quadratic-time in protos 0 & 1, so don't
# bother with those. # bother with those.
nbase = long("deadbeeffeedface", 16) nbase = int("deadbeeffeedface", 16)
nbase += nbase << 1000000 nbase += nbase << 1000000
for n in nbase, -nbase: for n in nbase, -nbase:
p = self.dumps(n, 2) p = self.dumps(n, 2)
@ -592,7 +592,7 @@ class AbstractPickleTests(unittest.TestCase):
self.fail("expected bad protocol number to raise ValueError") self.fail("expected bad protocol number to raise ValueError")
def test_long1(self): def test_long1(self):
x = 12345678910111213141516178920L x = 12345678910111213141516178920
for proto in protocols: for proto in protocols:
s = self.dumps(x, proto) s = self.dumps(x, proto)
y = self.loads(s) y = self.loads(s)
@ -600,7 +600,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(opcode_in_pickle(pickle.LONG1, s), proto >= 2) self.assertEqual(opcode_in_pickle(pickle.LONG1, s), proto >= 2)
def test_long4(self): def test_long4(self):
x = 12345678910111213141516178920L << (256*8) x = 12345678910111213141516178920 << (256*8)
for proto in protocols: for proto in protocols:
s = self.dumps(x, proto) s = self.dumps(x, proto)
y = self.loads(s) y = self.loads(s)
@ -864,8 +864,8 @@ class REX_three(object):
class MyInt(int): class MyInt(int):
sample = 1 sample = 1
class MyLong(long): class MyLong(int):
sample = 1L sample = 1
class MyFloat(float): class MyFloat(float):
sample = 1.0 sample = 1.0

View File

@ -1324,7 +1324,7 @@ class _ExpectedSkips:
if test_timeout.skip_expected: if test_timeout.skip_expected:
self.expected.add('test_timeout') self.expected.add('test_timeout')
if sys.maxint == 9223372036854775807L: if sys.maxint == 9223372036854775807:
self.expected.add('test_rgbimg') self.expected.add('test_rgbimg')
self.expected.add('test_imageop') self.expected.add('test_imageop')

View File

@ -138,10 +138,10 @@ class CommonTest(unittest.TestCase):
u = self.type2test([0, 1, 2, 3, 4]) u = self.type2test([0, 1, 2, 3, 4])
for i in xrange(len(u)): for i in xrange(len(u)):
self.assertEqual(u[i], i) self.assertEqual(u[i], i)
self.assertEqual(u[long(i)], i) self.assertEqual(u[int(i)], i)
for i in xrange(-len(u), -1): for i in xrange(-len(u), -1):
self.assertEqual(u[i], len(u)+i) self.assertEqual(u[i], len(u)+i)
self.assertEqual(u[long(i)], len(u)+i) self.assertEqual(u[int(i)], len(u)+i)
self.assertRaises(IndexError, u.__getitem__, -len(u)-1) self.assertRaises(IndexError, u.__getitem__, -len(u)-1)
self.assertRaises(IndexError, u.__getitem__, len(u)) self.assertRaises(IndexError, u.__getitem__, len(u))
self.assertRaises(ValueError, u.__getitem__, slice(0,10,0)) self.assertRaises(ValueError, u.__getitem__, slice(0,10,0))
@ -189,12 +189,12 @@ class CommonTest(unittest.TestCase):
self.assertEqual(u[-100:100:], u) self.assertEqual(u[-100:100:], u)
self.assertEqual(u[100:-100:-1], u[::-1]) self.assertEqual(u[100:-100:-1], u[::-1])
self.assertEqual(u[-100:100:-1], self.type2test([])) self.assertEqual(u[-100:100:-1], self.type2test([]))
self.assertEqual(u[-100L:100L:2L], self.type2test([0, 2, 4])) self.assertEqual(u[-100:100:2], self.type2test([0, 2, 4]))
# Test extreme cases with long ints # Test extreme cases with long ints
a = self.type2test([0,1,2,3,4]) a = self.type2test([0,1,2,3,4])
self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2])) self.assertEqual(a[ -pow(2,128): 3 ], self.type2test([0,1,2]))
self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4])) self.assertEqual(a[ 3: pow(2,145) ], self.type2test([3,4]))
self.assertRaises(TypeError, u.__getslice__) self.assertRaises(TypeError, u.__getslice__)
@ -254,16 +254,16 @@ class CommonTest(unittest.TestCase):
self.assertEqual(self.type2test([-1]) + u1, self.type2test([-1, 0])) self.assertEqual(self.type2test([-1]) + u1, self.type2test([-1, 0]))
self.assertEqual(self.type2test(), u2*0) self.assertEqual(self.type2test(), u2*0)
self.assertEqual(self.type2test(), 0*u2) self.assertEqual(self.type2test(), 0*u2)
self.assertEqual(self.type2test(), u2*0L) self.assertEqual(self.type2test(), u2*0)
self.assertEqual(self.type2test(), 0L*u2) self.assertEqual(self.type2test(), 0*u2)
self.assertEqual(u2, u2*1)
self.assertEqual(u2, 1*u2)
self.assertEqual(u2, u2*1) self.assertEqual(u2, u2*1)
self.assertEqual(u2, 1*u2) self.assertEqual(u2, 1*u2)
self.assertEqual(u2, u2*1L)
self.assertEqual(u2, 1L*u2)
self.assertEqual(u2+u2, u2*2) self.assertEqual(u2+u2, u2*2)
self.assertEqual(u2+u2, 2*u2) self.assertEqual(u2+u2, 2*u2)
self.assertEqual(u2+u2, u2*2L) self.assertEqual(u2+u2, u2*2)
self.assertEqual(u2+u2, 2L*u2) self.assertEqual(u2+u2, 2*u2)
self.assertEqual(u2+u2+u2, u2*3) self.assertEqual(u2+u2+u2, u2*3)
self.assertEqual(u2+u2+u2, 3*u2) self.assertEqual(u2+u2+u2, 3*u2)
@ -308,10 +308,10 @@ class CommonTest(unittest.TestCase):
def test_subscript(self): def test_subscript(self):
a = self.type2test([10, 11]) a = self.type2test([10, 11])
self.assertEqual(a.__getitem__(0L), 10) self.assertEqual(a.__getitem__(0), 10)
self.assertEqual(a.__getitem__(1L), 11) self.assertEqual(a.__getitem__(1), 11)
self.assertEqual(a.__getitem__(-2L), 10) self.assertEqual(a.__getitem__(-2), 10)
self.assertEqual(a.__getitem__(-1L), 11) self.assertEqual(a.__getitem__(-1), 11)
self.assertRaises(IndexError, a.__getitem__, -3) self.assertRaises(IndexError, a.__getitem__, -3)
self.assertRaises(IndexError, a.__getitem__, 3) self.assertRaises(IndexError, a.__getitem__, 3)
self.assertEqual(a.__getitem__(slice(0,1)), self.type2test([10])) self.assertEqual(a.__getitem__(slice(0,1)), self.type2test([10]))

View File

@ -12,7 +12,7 @@ class Sequence:
def __getitem__(self, i): return self.seq[i] def __getitem__(self, i): return self.seq[i]
class BadSeq1(Sequence): class BadSeq1(Sequence):
def __init__(self): self.seq = [7, 'hello', 123L] def __init__(self): self.seq = [7, 'hello', 123]
class BadSeq2(Sequence): class BadSeq2(Sequence):
def __init__(self): self.seq = ['a', 'b', 'c'] def __init__(self): self.seq = ['a', 'b', 'c']
@ -902,7 +902,7 @@ class MixinStrUnicodeUserStringTest:
def test_subscript(self): def test_subscript(self):
self.checkequal(u'a', 'abc', '__getitem__', 0) self.checkequal(u'a', 'abc', '__getitem__', 0)
self.checkequal(u'c', 'abc', '__getitem__', -1) self.checkequal(u'c', 'abc', '__getitem__', -1)
self.checkequal(u'a', 'abc', '__getitem__', 0L) self.checkequal(u'a', 'abc', '__getitem__', 0)
self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 3)) self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 3))
self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 1000)) self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 1000))
self.checkequal(u'a', 'abc', '__getitem__', slice(0, 1)) self.checkequal(u'a', 'abc', '__getitem__', slice(0, 1))
@ -965,7 +965,7 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(TypeError, ' ', 'join') self.checkraises(TypeError, ' ', 'join')
self.checkraises(TypeError, ' ', 'join', 7) self.checkraises(TypeError, ' ', 'join', 7)
self.checkraises(TypeError, ' ', 'join', Sequence([7, 'hello', 123L])) self.checkraises(TypeError, ' ', 'join', Sequence([7, 'hello', 123]))
try: try:
def f(): def f():
yield 4 + "" yield 4 + ""

View File

@ -61,7 +61,7 @@ class BaseTest(unittest.TestCase):
bi = a.buffer_info() bi = a.buffer_info()
self.assert_(isinstance(bi, tuple)) self.assert_(isinstance(bi, tuple))
self.assertEqual(len(bi), 2) self.assertEqual(len(bi), 2)
self.assert_(isinstance(bi[0], (int, long))) self.assert_(isinstance(bi[0], (int, int)))
self.assert_(isinstance(bi[1], int)) self.assert_(isinstance(bi[1], int))
self.assertEqual(bi[1], len(a)) self.assertEqual(bi[1], len(a))
@ -323,9 +323,9 @@ class BaseTest(unittest.TestCase):
def test_getitem(self): def test_getitem(self):
a = array.array(self.typecode, self.example) a = array.array(self.typecode, self.example)
self.assertEntryEqual(a[0], self.example[0]) self.assertEntryEqual(a[0], self.example[0])
self.assertEntryEqual(a[0L], self.example[0]) self.assertEntryEqual(a[0], self.example[0])
self.assertEntryEqual(a[-1], self.example[-1])
self.assertEntryEqual(a[-1], self.example[-1]) self.assertEntryEqual(a[-1], self.example[-1])
self.assertEntryEqual(a[-1L], self.example[-1])
self.assertEntryEqual(a[len(self.example)-1], self.example[-1]) self.assertEntryEqual(a[len(self.example)-1], self.example[-1])
self.assertEntryEqual(a[-len(self.example)], self.example[0]) self.assertEntryEqual(a[-len(self.example)], self.example[0])
self.assertRaises(TypeError, a.__getitem__) self.assertRaises(TypeError, a.__getitem__)
@ -338,7 +338,7 @@ class BaseTest(unittest.TestCase):
self.assertEntryEqual(a[0], a[-1]) self.assertEntryEqual(a[0], a[-1])
a = array.array(self.typecode, self.example) a = array.array(self.typecode, self.example)
a[0L] = a[-1] a[0] = a[-1]
self.assertEntryEqual(a[0], a[-1]) self.assertEntryEqual(a[0], a[-1])
a = array.array(self.typecode, self.example) a = array.array(self.typecode, self.example)
@ -346,7 +346,7 @@ class BaseTest(unittest.TestCase):
self.assertEntryEqual(a[0], a[-1]) self.assertEntryEqual(a[0], a[-1])
a = array.array(self.typecode, self.example) a = array.array(self.typecode, self.example)
a[-1L] = a[0] a[-1] = a[0]
self.assertEntryEqual(a[0], a[-1]) self.assertEntryEqual(a[0], a[-1])
a = array.array(self.typecode, self.example) a = array.array(self.typecode, self.example)
@ -777,7 +777,7 @@ class NumberTest(BaseTest):
self.assertEqual(a[3::-2], array.array(self.typecode, [3,1])) self.assertEqual(a[3::-2], array.array(self.typecode, [3,1]))
self.assertEqual(a[-100:100:], a) self.assertEqual(a[-100:100:], a)
self.assertEqual(a[100:-100:-1], a[::-1]) self.assertEqual(a[100:-100:-1], a[::-1])
self.assertEqual(a[-100L:100L:2L], array.array(self.typecode, [0,2,4])) self.assertEqual(a[-100:100:2], array.array(self.typecode, [0,2,4]))
self.assertEqual(a[1000:2000:2], array.array(self.typecode, [])) self.assertEqual(a[1000:2000:2], array.array(self.typecode, []))
self.assertEqual(a[-1000:-2000:-2], array.array(self.typecode, [])) self.assertEqual(a[-1000:-2000:-2], array.array(self.typecode, []))
@ -863,8 +863,8 @@ class SignedNumberTest(NumberTest):
def test_overflow(self): def test_overflow(self):
a = array.array(self.typecode) a = array.array(self.typecode)
lower = -1 * long(pow(2, a.itemsize * 8 - 1)) lower = -1 * int(pow(2, a.itemsize * 8 - 1))
upper = long(pow(2, a.itemsize * 8 - 1)) - 1L upper = int(pow(2, a.itemsize * 8 - 1)) - 1
self.check_overflow(lower, upper) self.check_overflow(lower, upper)
class UnsignedNumberTest(NumberTest): class UnsignedNumberTest(NumberTest):
@ -876,7 +876,7 @@ class UnsignedNumberTest(NumberTest):
def test_overflow(self): def test_overflow(self):
a = array.array(self.typecode) a = array.array(self.typecode)
lower = 0 lower = 0
upper = long(pow(2, a.itemsize * 8)) - 1L upper = int(pow(2, a.itemsize * 8)) - 1
self.check_overflow(lower, upper) self.check_overflow(lower, upper)

View File

@ -2,7 +2,7 @@ import sys, itertools
import _ast import _ast
def to_tuple(t): def to_tuple(t):
if t is None or isinstance(t, (basestring, int, long, complex)): if t is None or isinstance(t, (basestring, int, int, complex)):
return t return t
elif isinstance(t, list): elif isinstance(t, list):
return [to_tuple(e) for e in t] return [to_tuple(e) for e in t]
@ -93,7 +93,7 @@ eval_tests = [
# Call # Call
"f(1,2,c=3,*d,**e)", "f(1,2,c=3,*d,**e)",
# Num # Num
"10L", "10",
# Str # Str
"'string'", "'string'",
# Attribute # Attribute

View File

@ -77,7 +77,7 @@ class TestAsynchat(unittest.TestCase):
s = echo_server() s = echo_server()
s.start() s.start()
time.sleep(1) # Give server time to initialize time.sleep(1) # Give server time to initialize
c = echo_client(6L) c = echo_client(6)
c.push("hello ") c.push("hello ")
c.push("world\n") c.push("world\n")
asyncore.loop() asyncore.loop()

View File

@ -866,13 +866,13 @@ class ListTest(unittest.TestCase):
@bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5) @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
def test_index(self, size): def test_index(self, size):
l = [1L, 2L, 3L, 4L, 5L] * size l = [1, 2, 3, 4, 5] * size
size *= 5 size *= 5
self.assertEquals(l.index(1), 0) self.assertEquals(l.index(1), 0)
self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5), size - 1)
self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1)
self.assertRaises(ValueError, l.index, 1, size - 4, size) self.assertRaises(ValueError, l.index, 1, size - 4, size)
self.assertRaises(ValueError, l.index, 6L) self.assertRaises(ValueError, l.index, 6)
# This tests suffers from overallocation, just like test_append. # This tests suffers from overallocation, just like test_append.
@bigmemtest(minsize=_2G + 10, memuse=9) @bigmemtest(minsize=_2G + 10, memuse=9)

View File

@ -11,11 +11,11 @@ def gcd(a, b):
def isint(x): def isint(x):
"""Test whether an object is an instance of int or long.""" """Test whether an object is an instance of int or long."""
return isinstance(x, int) or isinstance(x, long) return isinstance(x, int) or isinstance(x, int)
def isnum(x): def isnum(x):
"""Test whether an object is an instance of a built-in numeric type.""" """Test whether an object is an instance of a built-in numeric type."""
for T in int, long, float, complex: for T in int, int, float, complex:
if isinstance(x, T): if isinstance(x, T):
return 1 return 1
return 0 return 0
@ -30,7 +30,7 @@ class Rat(object):
__slots__ = ['_Rat__num', '_Rat__den'] __slots__ = ['_Rat__num', '_Rat__den']
def __init__(self, num=0L, den=1L): def __init__(self, num=0, den=1):
"""Constructor: Rat([num[, den]]). """Constructor: Rat([num[, den]]).
The arguments must be ints or longs, and default to (0, 1).""" The arguments must be ints or longs, and default to (0, 1)."""
@ -42,8 +42,8 @@ class Rat(object):
if den == 0: if den == 0:
raise ZeroDivisionError, "zero denominator" raise ZeroDivisionError, "zero denominator"
g = gcd(den, num) g = gcd(den, num)
self.__num = long(num//g) self.__num = int(num//g)
self.__den = long(den//g) self.__den = int(den//g)
def _get_num(self): def _get_num(self):
"""Accessor function for read-only 'num' attribute of Rat.""" """Accessor function for read-only 'num' attribute of Rat."""
@ -80,7 +80,7 @@ class Rat(object):
def __long__(self): def __long__(self):
"""Convert a Rat to an long; self.den must be 1.""" """Convert a Rat to an long; self.den must be 1."""
if self.__den == 1: if self.__den == 1:
return long(self.__num) return int(self.__num)
raise ValueError, "can't convert %s to long" % repr(self) raise ValueError, "can't convert %s to long" % repr(self)
def __add__(self, other): def __add__(self, other):
@ -225,7 +225,7 @@ class RatTestCase(unittest.TestCase):
a = Rat(10, 15) a = Rat(10, 15)
self.assertEqual(a.num, 2) self.assertEqual(a.num, 2)
self.assertEqual(a.den, 3) self.assertEqual(a.den, 3)
a = Rat(10L, 15L) a = Rat(10, 15)
self.assertEqual(a.num, 2) self.assertEqual(a.num, 2)
self.assertEqual(a.den, 3) self.assertEqual(a.den, 3)
a = Rat(10, -15) a = Rat(10, -15)

View File

@ -122,9 +122,9 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(abs(3.14), 3.14) self.assertEqual(abs(3.14), 3.14)
self.assertEqual(abs(-3.14), 3.14) self.assertEqual(abs(-3.14), 3.14)
# long # long
self.assertEqual(abs(0L), 0L) self.assertEqual(abs(0), 0)
self.assertEqual(abs(1234L), 1234L) self.assertEqual(abs(1234), 1234)
self.assertEqual(abs(-1234L), 1234L) self.assertEqual(abs(-1234), 1234)
# str # str
self.assertRaises(TypeError, abs, 'a') self.assertRaises(TypeError, abs, 'a')
@ -235,15 +235,15 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(divmod(12, -7), (-2, -2)) self.assertEqual(divmod(12, -7), (-2, -2))
self.assertEqual(divmod(-12, -7), (1, -5)) self.assertEqual(divmod(-12, -7), (1, -5))
self.assertEqual(divmod(12L, 7L), (1L, 5L)) self.assertEqual(divmod(12, 7), (1, 5))
self.assertEqual(divmod(-12L, 7L), (-2L, 2L)) self.assertEqual(divmod(-12, 7), (-2, 2))
self.assertEqual(divmod(12L, -7L), (-2L, -2L)) self.assertEqual(divmod(12, -7), (-2, -2))
self.assertEqual(divmod(-12L, -7L), (1L, -5L)) self.assertEqual(divmod(-12, -7), (1, -5))
self.assertEqual(divmod(12, 7L), (1, 5L)) self.assertEqual(divmod(12, 7), (1, 5))
self.assertEqual(divmod(-12, 7L), (-2, 2L)) self.assertEqual(divmod(-12, 7), (-2, 2))
self.assertEqual(divmod(12L, -7), (-2L, -2)) self.assertEqual(divmod(12, -7), (-2, -2))
self.assertEqual(divmod(-12L, -7), (1L, -5)) self.assertEqual(divmod(-12, -7), (1, -5))
self.assertEqual(divmod(-sys.maxint-1, -1), self.assertEqual(divmod(-sys.maxint-1, -1),
(sys.maxint+1, 0)) (sys.maxint+1, 0))
@ -538,7 +538,7 @@ class BuiltinTest(unittest.TestCase):
def test_float(self): def test_float(self):
self.assertEqual(float(3.14), 3.14) self.assertEqual(float(3.14), 3.14)
self.assertEqual(float(314), 314.0) self.assertEqual(float(314), 314.0)
self.assertEqual(float(314L), 314.0) self.assertEqual(float(314), 314.0)
self.assertEqual(float(" 3.14 "), 3.14) self.assertEqual(float(" 3.14 "), 3.14)
self.assertRaises(ValueError, float, " 0x3.1 ") self.assertRaises(ValueError, float, " 0x3.1 ")
self.assertRaises(ValueError, float, " -0x3.p-1 ") self.assertRaises(ValueError, float, " -0x3.p-1 ")
@ -624,7 +624,7 @@ class BuiltinTest(unittest.TestCase):
def test_hash(self): def test_hash(self):
hash(None) hash(None)
self.assertEqual(hash(1), hash(1L)) self.assertEqual(hash(1), hash(1))
self.assertEqual(hash(1), hash(1.0)) self.assertEqual(hash(1), hash(1.0))
hash('spam') hash('spam')
if have_unicode: if have_unicode:
@ -642,22 +642,22 @@ class BuiltinTest(unittest.TestCase):
def __hash__(self): def __hash__(self):
return 2**100 return 2**100
self.assertEquals(type(hash(Y())), int) self.assertEquals(type(hash(Y())), int)
class Z(long): class Z(int):
def __hash__(self): def __hash__(self):
return self return self
self.assertEquals(hash(Z(42)), hash(42L)) self.assertEquals(hash(Z(42)), hash(42))
def test_hex(self): def test_hex(self):
self.assertEqual(hex(16), '0x10') self.assertEqual(hex(16), '0x10')
self.assertEqual(hex(16L), '0x10') self.assertEqual(hex(16), '0x10')
self.assertEqual(hex(-16), '-0x10')
self.assertEqual(hex(-16), '-0x10') self.assertEqual(hex(-16), '-0x10')
self.assertEqual(hex(-16L), '-0x10')
self.assertRaises(TypeError, hex, {}) self.assertRaises(TypeError, hex, {})
def test_id(self): def test_id(self):
id(None) id(None)
id(1) id(1)
id(1L) id(1)
id(1.0) id(1.0)
id('spam') id('spam')
id((0,1,2,3)) id((0,1,2,3))
@ -667,7 +667,7 @@ class BuiltinTest(unittest.TestCase):
def test_int(self): def test_int(self):
self.assertEqual(int(314), 314) self.assertEqual(int(314), 314)
self.assertEqual(int(3.14), 3) self.assertEqual(int(3.14), 3)
self.assertEqual(int(314L), 314) self.assertEqual(int(314), 314)
# Check that conversion from float truncates towards zero # Check that conversion from float truncates towards zero
self.assertEqual(int(-3.14), -3) self.assertEqual(int(-3.14), -3)
self.assertEqual(int(3.9), 3) self.assertEqual(int(3.9), 3)
@ -675,9 +675,9 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(int(3.5), 3) self.assertEqual(int(3.5), 3)
self.assertEqual(int(-3.5), -3) self.assertEqual(int(-3.5), -3)
# Different base: # Different base:
self.assertEqual(int("10",16), 16L) self.assertEqual(int("10",16), 16)
if have_unicode: if have_unicode:
self.assertEqual(int(unicode("10"),16), 16L) self.assertEqual(int(unicode("10"),16), 16)
# Test conversion from strings and various anomalies # Test conversion from strings and various anomalies
for s, v in L: for s, v in L:
for sign in "", "+", "-": for sign in "", "+", "-":
@ -700,9 +700,9 @@ class BuiltinTest(unittest.TestCase):
# should return long # should return long
x = int(1e100) x = int(1e100)
self.assert_(isinstance(x, long)) self.assert_(isinstance(x, int))
x = int(-1e100) x = int(-1e100)
self.assert_(isinstance(x, long)) self.assert_(isinstance(x, int))
# SF bug 434186: 0x80000000/2 != 0x80000000>>1. # SF bug 434186: 0x80000000/2 != 0x80000000>>1.
@ -720,11 +720,11 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(ValueError, int, '123\x00 245', 20) self.assertRaises(ValueError, int, '123\x00 245', 20)
x = int('1' * 600) x = int('1' * 600)
self.assert_(isinstance(x, long)) self.assert_(isinstance(x, int))
if have_unicode: if have_unicode:
x = int(unichr(0x661) * 600) x = int(unichr(0x661) * 600)
self.assert_(isinstance(x, long)) self.assert_(isinstance(x, int))
self.assertRaises(TypeError, int, 1, 12) self.assertRaises(TypeError, int, 1, 12)
@ -735,79 +735,79 @@ class BuiltinTest(unittest.TestCase):
# Various representations of 2**32 evaluated to 0 # Various representations of 2**32 evaluated to 0
# rather than 2**32 in previous versions # rather than 2**32 in previous versions
self.assertEqual(int('100000000000000000000000000000000', 2), 4294967296L) self.assertEqual(int('100000000000000000000000000000000', 2), 4294967296)
self.assertEqual(int('102002022201221111211', 3), 4294967296L) self.assertEqual(int('102002022201221111211', 3), 4294967296)
self.assertEqual(int('10000000000000000', 4), 4294967296L) self.assertEqual(int('10000000000000000', 4), 4294967296)
self.assertEqual(int('32244002423141', 5), 4294967296L) self.assertEqual(int('32244002423141', 5), 4294967296)
self.assertEqual(int('1550104015504', 6), 4294967296L) self.assertEqual(int('1550104015504', 6), 4294967296)
self.assertEqual(int('211301422354', 7), 4294967296L) self.assertEqual(int('211301422354', 7), 4294967296)
self.assertEqual(int('40000000000', 8), 4294967296L) self.assertEqual(int('40000000000', 8), 4294967296)
self.assertEqual(int('12068657454', 9), 4294967296L) self.assertEqual(int('12068657454', 9), 4294967296)
self.assertEqual(int('4294967296', 10), 4294967296L) self.assertEqual(int('4294967296', 10), 4294967296)
self.assertEqual(int('1904440554', 11), 4294967296L) self.assertEqual(int('1904440554', 11), 4294967296)
self.assertEqual(int('9ba461594', 12), 4294967296L) self.assertEqual(int('9ba461594', 12), 4294967296)
self.assertEqual(int('535a79889', 13), 4294967296L) self.assertEqual(int('535a79889', 13), 4294967296)
self.assertEqual(int('2ca5b7464', 14), 4294967296L) self.assertEqual(int('2ca5b7464', 14), 4294967296)
self.assertEqual(int('1a20dcd81', 15), 4294967296L) self.assertEqual(int('1a20dcd81', 15), 4294967296)
self.assertEqual(int('100000000', 16), 4294967296L) self.assertEqual(int('100000000', 16), 4294967296)
self.assertEqual(int('a7ffda91', 17), 4294967296L) self.assertEqual(int('a7ffda91', 17), 4294967296)
self.assertEqual(int('704he7g4', 18), 4294967296L) self.assertEqual(int('704he7g4', 18), 4294967296)
self.assertEqual(int('4f5aff66', 19), 4294967296L) self.assertEqual(int('4f5aff66', 19), 4294967296)
self.assertEqual(int('3723ai4g', 20), 4294967296L) self.assertEqual(int('3723ai4g', 20), 4294967296)
self.assertEqual(int('281d55i4', 21), 4294967296L) self.assertEqual(int('281d55i4', 21), 4294967296)
self.assertEqual(int('1fj8b184', 22), 4294967296L) self.assertEqual(int('1fj8b184', 22), 4294967296)
self.assertEqual(int('1606k7ic', 23), 4294967296L) self.assertEqual(int('1606k7ic', 23), 4294967296)
self.assertEqual(int('mb994ag', 24), 4294967296L) self.assertEqual(int('mb994ag', 24), 4294967296)
self.assertEqual(int('hek2mgl', 25), 4294967296L) self.assertEqual(int('hek2mgl', 25), 4294967296)
self.assertEqual(int('dnchbnm', 26), 4294967296L) self.assertEqual(int('dnchbnm', 26), 4294967296)
self.assertEqual(int('b28jpdm', 27), 4294967296L) self.assertEqual(int('b28jpdm', 27), 4294967296)
self.assertEqual(int('8pfgih4', 28), 4294967296L) self.assertEqual(int('8pfgih4', 28), 4294967296)
self.assertEqual(int('76beigg', 29), 4294967296L) self.assertEqual(int('76beigg', 29), 4294967296)
self.assertEqual(int('5qmcpqg', 30), 4294967296L) self.assertEqual(int('5qmcpqg', 30), 4294967296)
self.assertEqual(int('4q0jto4', 31), 4294967296L) self.assertEqual(int('4q0jto4', 31), 4294967296)
self.assertEqual(int('4000000', 32), 4294967296L) self.assertEqual(int('4000000', 32), 4294967296)
self.assertEqual(int('3aokq94', 33), 4294967296L) self.assertEqual(int('3aokq94', 33), 4294967296)
self.assertEqual(int('2qhxjli', 34), 4294967296L) self.assertEqual(int('2qhxjli', 34), 4294967296)
self.assertEqual(int('2br45qb', 35), 4294967296L) self.assertEqual(int('2br45qb', 35), 4294967296)
self.assertEqual(int('1z141z4', 36), 4294967296L) self.assertEqual(int('1z141z4', 36), 4294967296)
# SF bug 1334662: int(string, base) wrong answers # SF bug 1334662: int(string, base) wrong answers
# Checks for proper evaluation of 2**32 + 1 # Checks for proper evaluation of 2**32 + 1
self.assertEqual(int('100000000000000000000000000000001', 2), 4294967297L) self.assertEqual(int('100000000000000000000000000000001', 2), 4294967297)
self.assertEqual(int('102002022201221111212', 3), 4294967297L) self.assertEqual(int('102002022201221111212', 3), 4294967297)
self.assertEqual(int('10000000000000001', 4), 4294967297L) self.assertEqual(int('10000000000000001', 4), 4294967297)
self.assertEqual(int('32244002423142', 5), 4294967297L) self.assertEqual(int('32244002423142', 5), 4294967297)
self.assertEqual(int('1550104015505', 6), 4294967297L) self.assertEqual(int('1550104015505', 6), 4294967297)
self.assertEqual(int('211301422355', 7), 4294967297L) self.assertEqual(int('211301422355', 7), 4294967297)
self.assertEqual(int('40000000001', 8), 4294967297L) self.assertEqual(int('40000000001', 8), 4294967297)
self.assertEqual(int('12068657455', 9), 4294967297L) self.assertEqual(int('12068657455', 9), 4294967297)
self.assertEqual(int('4294967297', 10), 4294967297L) self.assertEqual(int('4294967297', 10), 4294967297)
self.assertEqual(int('1904440555', 11), 4294967297L) self.assertEqual(int('1904440555', 11), 4294967297)
self.assertEqual(int('9ba461595', 12), 4294967297L) self.assertEqual(int('9ba461595', 12), 4294967297)
self.assertEqual(int('535a7988a', 13), 4294967297L) self.assertEqual(int('535a7988a', 13), 4294967297)
self.assertEqual(int('2ca5b7465', 14), 4294967297L) self.assertEqual(int('2ca5b7465', 14), 4294967297)
self.assertEqual(int('1a20dcd82', 15), 4294967297L) self.assertEqual(int('1a20dcd82', 15), 4294967297)
self.assertEqual(int('100000001', 16), 4294967297L) self.assertEqual(int('100000001', 16), 4294967297)
self.assertEqual(int('a7ffda92', 17), 4294967297L) self.assertEqual(int('a7ffda92', 17), 4294967297)
self.assertEqual(int('704he7g5', 18), 4294967297L) self.assertEqual(int('704he7g5', 18), 4294967297)
self.assertEqual(int('4f5aff67', 19), 4294967297L) self.assertEqual(int('4f5aff67', 19), 4294967297)
self.assertEqual(int('3723ai4h', 20), 4294967297L) self.assertEqual(int('3723ai4h', 20), 4294967297)
self.assertEqual(int('281d55i5', 21), 4294967297L) self.assertEqual(int('281d55i5', 21), 4294967297)
self.assertEqual(int('1fj8b185', 22), 4294967297L) self.assertEqual(int('1fj8b185', 22), 4294967297)
self.assertEqual(int('1606k7id', 23), 4294967297L) self.assertEqual(int('1606k7id', 23), 4294967297)
self.assertEqual(int('mb994ah', 24), 4294967297L) self.assertEqual(int('mb994ah', 24), 4294967297)
self.assertEqual(int('hek2mgm', 25), 4294967297L) self.assertEqual(int('hek2mgm', 25), 4294967297)
self.assertEqual(int('dnchbnn', 26), 4294967297L) self.assertEqual(int('dnchbnn', 26), 4294967297)
self.assertEqual(int('b28jpdn', 27), 4294967297L) self.assertEqual(int('b28jpdn', 27), 4294967297)
self.assertEqual(int('8pfgih5', 28), 4294967297L) self.assertEqual(int('8pfgih5', 28), 4294967297)
self.assertEqual(int('76beigh', 29), 4294967297L) self.assertEqual(int('76beigh', 29), 4294967297)
self.assertEqual(int('5qmcpqh', 30), 4294967297L) self.assertEqual(int('5qmcpqh', 30), 4294967297)
self.assertEqual(int('4q0jto5', 31), 4294967297L) self.assertEqual(int('4q0jto5', 31), 4294967297)
self.assertEqual(int('4000001', 32), 4294967297L) self.assertEqual(int('4000001', 32), 4294967297)
self.assertEqual(int('3aokq95', 33), 4294967297L) self.assertEqual(int('3aokq95', 33), 4294967297)
self.assertEqual(int('2qhxjlj', 34), 4294967297L) self.assertEqual(int('2qhxjlj', 34), 4294967297)
self.assertEqual(int('2br45qc', 35), 4294967297L) self.assertEqual(int('2br45qc', 35), 4294967297)
self.assertEqual(int('1z141z5', 36), 4294967297L) self.assertEqual(int('1z141z5', 36), 4294967297)
def test_intconversion(self): def test_intconversion(self):
# Test __int__() # Test __int__()
@ -829,7 +829,7 @@ class BuiltinTest(unittest.TestCase):
class Foo4(int): class Foo4(int):
def __int__(self): def __int__(self):
return 42L return 42
class Foo5(int): class Foo5(int):
def __int__(self): def __int__(self):
@ -839,7 +839,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(int(Foo1()), 42) self.assertEqual(int(Foo1()), 42)
self.assertEqual(int(Foo2()), 42) self.assertEqual(int(Foo2()), 42)
self.assertEqual(int(Foo3()), 0) self.assertEqual(int(Foo3()), 0)
self.assertEqual(int(Foo4()), 42L) self.assertEqual(int(Foo4()), 42)
self.assertRaises(TypeError, int, Foo5()) self.assertRaises(TypeError, int, Foo5())
def test_iter(self): def test_iter(self):
@ -935,32 +935,32 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(x, []) self.assertEqual(x, [])
def test_long(self): def test_long(self):
self.assertEqual(long(314), 314L) self.assertEqual(int(314), 314)
self.assertEqual(long(3.14), 3L) self.assertEqual(int(3.14), 3)
self.assertEqual(long(314L), 314L) self.assertEqual(int(314), 314)
# Check that conversion from float truncates towards zero # Check that conversion from float truncates towards zero
self.assertEqual(long(-3.14), -3L) self.assertEqual(int(-3.14), -3)
self.assertEqual(long(3.9), 3L) self.assertEqual(int(3.9), 3)
self.assertEqual(long(-3.9), -3L) self.assertEqual(int(-3.9), -3)
self.assertEqual(long(3.5), 3L) self.assertEqual(int(3.5), 3)
self.assertEqual(long(-3.5), -3L) self.assertEqual(int(-3.5), -3)
self.assertEqual(long("-3"), -3L) self.assertEqual(int("-3"), -3)
if have_unicode: if have_unicode:
self.assertEqual(long(unicode("-3")), -3L) self.assertEqual(int(unicode("-3")), -3)
# Different base: # Different base:
self.assertEqual(long("10",16), 16L) self.assertEqual(int("10",16), 16)
if have_unicode: if have_unicode:
self.assertEqual(long(unicode("10"),16), 16L) self.assertEqual(int(unicode("10"),16), 16)
# Check conversions from string (same test set as for int(), and then some) # Check conversions from string (same test set as for int(), and then some)
LL = [ LL = [
('1' + '0'*20, 10L**20), ('1' + '0'*20, 10**20),
('1' + '0'*100, 10L**100) ('1' + '0'*100, 10**100)
] ]
L2 = L[:] L2 = L[:]
if have_unicode: if have_unicode:
L2 += [ L2 += [
(unicode('1') + unicode('0')*20, 10L**20), (unicode('1') + unicode('0')*20, 10**20),
(unicode('1') + unicode('0')*100, 10L**100), (unicode('1') + unicode('0')*100, 10**100),
] ]
for s, v in L2 + LL: for s, v in L2 + LL:
for sign in "", "+", "-": for sign in "", "+", "-":
@ -970,120 +970,120 @@ class BuiltinTest(unittest.TestCase):
if sign == "-" and v is not ValueError: if sign == "-" and v is not ValueError:
vv = -v vv = -v
try: try:
self.assertEqual(long(ss), long(vv)) self.assertEqual(int(ss), int(vv))
except v: except v:
pass pass
self.assertRaises(ValueError, long, '123\0') self.assertRaises(ValueError, int, '123\0')
self.assertRaises(ValueError, long, '53', 40) self.assertRaises(ValueError, int, '53', 40)
self.assertRaises(TypeError, long, 1, 12) self.assertRaises(TypeError, int, 1, 12)
self.assertEqual(long('100000000000000000000000000000000', 2), self.assertEqual(int('100000000000000000000000000000000', 2),
4294967296) 4294967296)
self.assertEqual(long('102002022201221111211', 3), 4294967296) self.assertEqual(int('102002022201221111211', 3), 4294967296)
self.assertEqual(long('10000000000000000', 4), 4294967296) self.assertEqual(int('10000000000000000', 4), 4294967296)
self.assertEqual(long('32244002423141', 5), 4294967296) self.assertEqual(int('32244002423141', 5), 4294967296)
self.assertEqual(long('1550104015504', 6), 4294967296) self.assertEqual(int('1550104015504', 6), 4294967296)
self.assertEqual(long('211301422354', 7), 4294967296) self.assertEqual(int('211301422354', 7), 4294967296)
self.assertEqual(long('40000000000', 8), 4294967296) self.assertEqual(int('40000000000', 8), 4294967296)
self.assertEqual(long('12068657454', 9), 4294967296) self.assertEqual(int('12068657454', 9), 4294967296)
self.assertEqual(long('4294967296', 10), 4294967296) self.assertEqual(int('4294967296', 10), 4294967296)
self.assertEqual(long('1904440554', 11), 4294967296) self.assertEqual(int('1904440554', 11), 4294967296)
self.assertEqual(long('9ba461594', 12), 4294967296) self.assertEqual(int('9ba461594', 12), 4294967296)
self.assertEqual(long('535a79889', 13), 4294967296) self.assertEqual(int('535a79889', 13), 4294967296)
self.assertEqual(long('2ca5b7464', 14), 4294967296) self.assertEqual(int('2ca5b7464', 14), 4294967296)
self.assertEqual(long('1a20dcd81', 15), 4294967296) self.assertEqual(int('1a20dcd81', 15), 4294967296)
self.assertEqual(long('100000000', 16), 4294967296) self.assertEqual(int('100000000', 16), 4294967296)
self.assertEqual(long('a7ffda91', 17), 4294967296) self.assertEqual(int('a7ffda91', 17), 4294967296)
self.assertEqual(long('704he7g4', 18), 4294967296) self.assertEqual(int('704he7g4', 18), 4294967296)
self.assertEqual(long('4f5aff66', 19), 4294967296) self.assertEqual(int('4f5aff66', 19), 4294967296)
self.assertEqual(long('3723ai4g', 20), 4294967296) self.assertEqual(int('3723ai4g', 20), 4294967296)
self.assertEqual(long('281d55i4', 21), 4294967296) self.assertEqual(int('281d55i4', 21), 4294967296)
self.assertEqual(long('1fj8b184', 22), 4294967296) self.assertEqual(int('1fj8b184', 22), 4294967296)
self.assertEqual(long('1606k7ic', 23), 4294967296) self.assertEqual(int('1606k7ic', 23), 4294967296)
self.assertEqual(long('mb994ag', 24), 4294967296) self.assertEqual(int('mb994ag', 24), 4294967296)
self.assertEqual(long('hek2mgl', 25), 4294967296) self.assertEqual(int('hek2mgl', 25), 4294967296)
self.assertEqual(long('dnchbnm', 26), 4294967296) self.assertEqual(int('dnchbnm', 26), 4294967296)
self.assertEqual(long('b28jpdm', 27), 4294967296) self.assertEqual(int('b28jpdm', 27), 4294967296)
self.assertEqual(long('8pfgih4', 28), 4294967296) self.assertEqual(int('8pfgih4', 28), 4294967296)
self.assertEqual(long('76beigg', 29), 4294967296) self.assertEqual(int('76beigg', 29), 4294967296)
self.assertEqual(long('5qmcpqg', 30), 4294967296) self.assertEqual(int('5qmcpqg', 30), 4294967296)
self.assertEqual(long('4q0jto4', 31), 4294967296) self.assertEqual(int('4q0jto4', 31), 4294967296)
self.assertEqual(long('4000000', 32), 4294967296) self.assertEqual(int('4000000', 32), 4294967296)
self.assertEqual(long('3aokq94', 33), 4294967296) self.assertEqual(int('3aokq94', 33), 4294967296)
self.assertEqual(long('2qhxjli', 34), 4294967296) self.assertEqual(int('2qhxjli', 34), 4294967296)
self.assertEqual(long('2br45qb', 35), 4294967296) self.assertEqual(int('2br45qb', 35), 4294967296)
self.assertEqual(long('1z141z4', 36), 4294967296) self.assertEqual(int('1z141z4', 36), 4294967296)
self.assertEqual(long('100000000000000000000000000000001', 2), self.assertEqual(int('100000000000000000000000000000001', 2),
4294967297) 4294967297)
self.assertEqual(long('102002022201221111212', 3), 4294967297) self.assertEqual(int('102002022201221111212', 3), 4294967297)
self.assertEqual(long('10000000000000001', 4), 4294967297) self.assertEqual(int('10000000000000001', 4), 4294967297)
self.assertEqual(long('32244002423142', 5), 4294967297) self.assertEqual(int('32244002423142', 5), 4294967297)
self.assertEqual(long('1550104015505', 6), 4294967297) self.assertEqual(int('1550104015505', 6), 4294967297)
self.assertEqual(long('211301422355', 7), 4294967297) self.assertEqual(int('211301422355', 7), 4294967297)
self.assertEqual(long('40000000001', 8), 4294967297) self.assertEqual(int('40000000001', 8), 4294967297)
self.assertEqual(long('12068657455', 9), 4294967297) self.assertEqual(int('12068657455', 9), 4294967297)
self.assertEqual(long('4294967297', 10), 4294967297) self.assertEqual(int('4294967297', 10), 4294967297)
self.assertEqual(long('1904440555', 11), 4294967297) self.assertEqual(int('1904440555', 11), 4294967297)
self.assertEqual(long('9ba461595', 12), 4294967297) self.assertEqual(int('9ba461595', 12), 4294967297)
self.assertEqual(long('535a7988a', 13), 4294967297) self.assertEqual(int('535a7988a', 13), 4294967297)
self.assertEqual(long('2ca5b7465', 14), 4294967297) self.assertEqual(int('2ca5b7465', 14), 4294967297)
self.assertEqual(long('1a20dcd82', 15), 4294967297) self.assertEqual(int('1a20dcd82', 15), 4294967297)
self.assertEqual(long('100000001', 16), 4294967297) self.assertEqual(int('100000001', 16), 4294967297)
self.assertEqual(long('a7ffda92', 17), 4294967297) self.assertEqual(int('a7ffda92', 17), 4294967297)
self.assertEqual(long('704he7g5', 18), 4294967297) self.assertEqual(int('704he7g5', 18), 4294967297)
self.assertEqual(long('4f5aff67', 19), 4294967297) self.assertEqual(int('4f5aff67', 19), 4294967297)
self.assertEqual(long('3723ai4h', 20), 4294967297) self.assertEqual(int('3723ai4h', 20), 4294967297)
self.assertEqual(long('281d55i5', 21), 4294967297) self.assertEqual(int('281d55i5', 21), 4294967297)
self.assertEqual(long('1fj8b185', 22), 4294967297) self.assertEqual(int('1fj8b185', 22), 4294967297)
self.assertEqual(long('1606k7id', 23), 4294967297) self.assertEqual(int('1606k7id', 23), 4294967297)
self.assertEqual(long('mb994ah', 24), 4294967297) self.assertEqual(int('mb994ah', 24), 4294967297)
self.assertEqual(long('hek2mgm', 25), 4294967297) self.assertEqual(int('hek2mgm', 25), 4294967297)
self.assertEqual(long('dnchbnn', 26), 4294967297) self.assertEqual(int('dnchbnn', 26), 4294967297)
self.assertEqual(long('b28jpdn', 27), 4294967297) self.assertEqual(int('b28jpdn', 27), 4294967297)
self.assertEqual(long('8pfgih5', 28), 4294967297) self.assertEqual(int('8pfgih5', 28), 4294967297)
self.assertEqual(long('76beigh', 29), 4294967297) self.assertEqual(int('76beigh', 29), 4294967297)
self.assertEqual(long('5qmcpqh', 30), 4294967297) self.assertEqual(int('5qmcpqh', 30), 4294967297)
self.assertEqual(long('4q0jto5', 31), 4294967297) self.assertEqual(int('4q0jto5', 31), 4294967297)
self.assertEqual(long('4000001', 32), 4294967297) self.assertEqual(int('4000001', 32), 4294967297)
self.assertEqual(long('3aokq95', 33), 4294967297) self.assertEqual(int('3aokq95', 33), 4294967297)
self.assertEqual(long('2qhxjlj', 34), 4294967297) self.assertEqual(int('2qhxjlj', 34), 4294967297)
self.assertEqual(long('2br45qc', 35), 4294967297) self.assertEqual(int('2br45qc', 35), 4294967297)
self.assertEqual(long('1z141z5', 36), 4294967297) self.assertEqual(int('1z141z5', 36), 4294967297)
def test_longconversion(self): def test_longconversion(self):
# Test __long__() # Test __long__()
class Foo0: class Foo0:
def __long__(self): def __long__(self):
return 42L return 42
class Foo1(object): class Foo1(object):
def __long__(self): def __long__(self):
return 42L return 42
class Foo2(long): class Foo2(int):
def __long__(self):
return 42L
class Foo3(long):
def __long__(self):
return self
class Foo4(long):
def __long__(self): def __long__(self):
return 42 return 42
class Foo5(long): class Foo3(int):
def __long__(self):
return self
class Foo4(int):
def __long__(self):
return 42
class Foo5(int):
def __long__(self): def __long__(self):
return 42. return 42.
self.assertEqual(long(Foo0()), 42L) self.assertEqual(int(Foo0()), 42)
self.assertEqual(long(Foo1()), 42L) self.assertEqual(int(Foo1()), 42)
# XXX invokes __int__ now # XXX invokes __int__ now
# self.assertEqual(long(Foo2()), 42L) # self.assertEqual(long(Foo2()), 42L)
self.assertEqual(long(Foo3()), 0) self.assertEqual(int(Foo3()), 0)
# XXX likewise # XXX likewise
# self.assertEqual(long(Foo4()), 42) # self.assertEqual(long(Foo4()), 42)
# self.assertRaises(TypeError, long, Foo5()) # self.assertRaises(TypeError, long, Foo5())
@ -1174,9 +1174,9 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(max((1, 2, 3, 1, 2, 3)), 3) self.assertEqual(max((1, 2, 3, 1, 2, 3)), 3)
self.assertEqual(max([1, 2, 3, 1, 2, 3]), 3) self.assertEqual(max([1, 2, 3, 1, 2, 3]), 3)
self.assertEqual(max(1, 2L, 3.0), 3.0) self.assertEqual(max(1, 2, 3.0), 3.0)
self.assertEqual(max(1L, 2.0, 3), 3) self.assertEqual(max(1, 2.0, 3), 3)
self.assertEqual(max(1.0, 2, 3L), 3L) self.assertEqual(max(1.0, 2, 3), 3)
for stmt in ( for stmt in (
"max(key=int)", # no args "max(key=int)", # no args
@ -1208,9 +1208,9 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(min((1, 2, 3, 1, 2, 3)), 1) self.assertEqual(min((1, 2, 3, 1, 2, 3)), 1)
self.assertEqual(min([1, 2, 3, 1, 2, 3]), 1) self.assertEqual(min([1, 2, 3, 1, 2, 3]), 1)
self.assertEqual(min(1, 2L, 3.0), 1) self.assertEqual(min(1, 2, 3.0), 1)
self.assertEqual(min(1L, 2.0, 3), 1L) self.assertEqual(min(1, 2.0, 3), 1)
self.assertEqual(min(1.0, 2, 3L), 1.0) self.assertEqual(min(1.0, 2, 3), 1.0)
self.assertRaises(TypeError, min) self.assertRaises(TypeError, min)
self.assertRaises(TypeError, min, 42) self.assertRaises(TypeError, min, 42)
@ -1250,9 +1250,9 @@ class BuiltinTest(unittest.TestCase):
def test_oct(self): def test_oct(self):
self.assertEqual(oct(100), '0144') self.assertEqual(oct(100), '0144')
self.assertEqual(oct(100L), '0144') self.assertEqual(oct(100), '0144')
self.assertEqual(oct(-100), '-0144')
self.assertEqual(oct(-100), '-0144') self.assertEqual(oct(-100), '-0144')
self.assertEqual(oct(-100L), '-0144')
self.assertRaises(TypeError, oct, ()) self.assertRaises(TypeError, oct, ())
def write_testfile(self): def write_testfile(self):
@ -1309,20 +1309,20 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(pow(-2,2), 4) self.assertEqual(pow(-2,2), 4)
self.assertEqual(pow(-2,3), -8) self.assertEqual(pow(-2,3), -8)
self.assertEqual(pow(0L,0), 1) self.assertEqual(pow(0,0), 1)
self.assertEqual(pow(0L,1), 0) self.assertEqual(pow(0,1), 0)
self.assertEqual(pow(1L,0), 1) self.assertEqual(pow(1,0), 1)
self.assertEqual(pow(1L,1), 1) self.assertEqual(pow(1,1), 1)
self.assertEqual(pow(2L,0), 1) self.assertEqual(pow(2,0), 1)
self.assertEqual(pow(2L,10), 1024) self.assertEqual(pow(2,10), 1024)
self.assertEqual(pow(2L,20), 1024*1024) self.assertEqual(pow(2,20), 1024*1024)
self.assertEqual(pow(2L,30), 1024*1024*1024) self.assertEqual(pow(2,30), 1024*1024*1024)
self.assertEqual(pow(-2L,0), 1) self.assertEqual(pow(-2,0), 1)
self.assertEqual(pow(-2L,1), -2) self.assertEqual(pow(-2,1), -2)
self.assertEqual(pow(-2L,2), 4) self.assertEqual(pow(-2,2), 4)
self.assertEqual(pow(-2L,3), -8) self.assertEqual(pow(-2,3), -8)
self.assertAlmostEqual(pow(0.,0), 1.) self.assertAlmostEqual(pow(0.,0), 1.)
self.assertAlmostEqual(pow(0.,1), 0.) self.assertAlmostEqual(pow(0.,1), 0.)
@ -1339,9 +1339,9 @@ class BuiltinTest(unittest.TestCase):
self.assertAlmostEqual(pow(-2.,2), 4.) self.assertAlmostEqual(pow(-2.,2), 4.)
self.assertAlmostEqual(pow(-2.,3), -8.) self.assertAlmostEqual(pow(-2.,3), -8.)
for x in 2, 2L, 2.0: for x in 2, 2, 2.0:
for y in 10, 10L, 10.0: for y in 10, 10, 10.0:
for z in 1000, 1000L, 1000.0: for z in 1000, 1000, 1000.0:
if isinstance(x, float) or \ if isinstance(x, float) or \
isinstance(y, float) or \ isinstance(y, float) or \
isinstance(z, float): isinstance(z, float):
@ -1351,8 +1351,8 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, pow, -1, -2, 3) self.assertRaises(TypeError, pow, -1, -2, 3)
self.assertRaises(ValueError, pow, 1, 2, 0) self.assertRaises(ValueError, pow, 1, 2, 0)
self.assertRaises(TypeError, pow, -1L, -2L, 3L) self.assertRaises(TypeError, pow, -1, -2, 3)
self.assertRaises(ValueError, pow, 1L, 2L, 0L) self.assertRaises(ValueError, pow, 1, 2, 0)
self.assertRaises(ValueError, pow, -342.43, 0.234) self.assertRaises(ValueError, pow, -342.43, 0.234)
self.assertRaises(TypeError, pow) self.assertRaises(TypeError, pow)
@ -1371,12 +1371,12 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(range(0, 2**100, -1), []) self.assertEqual(range(0, 2**100, -1), [])
self.assertEqual(range(0, 2**100, -1), []) self.assertEqual(range(0, 2**100, -1), [])
a = long(10 * sys.maxint) a = int(10 * sys.maxint)
b = long(100 * sys.maxint) b = int(100 * sys.maxint)
c = long(50 * sys.maxint) c = int(50 * sys.maxint)
self.assertEqual(range(a, a+2), [a, a+1]) self.assertEqual(range(a, a+2), [a, a+1])
self.assertEqual(range(a+2, a, -1L), [a+2, a+1]) self.assertEqual(range(a+2, a, -1), [a+2, a+1])
self.assertEqual(range(a+4, a, -2), [a+4, a+2]) self.assertEqual(range(a+4, a, -2), [a+4, a+2])
seq = range(a, b, c) seq = range(a, b, c)
@ -1397,7 +1397,7 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, range) self.assertRaises(TypeError, range)
self.assertRaises(TypeError, range, 1, 2, 3, 4) self.assertRaises(TypeError, range, 1, 2, 3, 4)
self.assertRaises(ValueError, range, 1, 2, 0) self.assertRaises(ValueError, range, 1, 2, 0)
self.assertRaises(ValueError, range, a, a + 1, long(0)) self.assertRaises(ValueError, range, a, a + 1, int(0))
class badzero(int): class badzero(int):
def __eq__(self, other): def __eq__(self, other):
@ -1428,7 +1428,7 @@ class BuiltinTest(unittest.TestCase):
def test_repr(self): def test_repr(self):
self.assertEqual(repr(''), '\'\'') self.assertEqual(repr(''), '\'\'')
self.assertEqual(repr(0), '0') self.assertEqual(repr(0), '0')
self.assertEqual(repr(0L), '0') self.assertEqual(repr(0), '0')
self.assertEqual(repr(()), '()') self.assertEqual(repr(()), '()')
self.assertEqual(repr([]), '[]') self.assertEqual(repr([]), '[]')
self.assertEqual(repr({}), '{}') self.assertEqual(repr({}), '{}')
@ -1484,7 +1484,7 @@ class BuiltinTest(unittest.TestCase):
def test_str(self): def test_str(self):
self.assertEqual(str(''), '') self.assertEqual(str(''), '')
self.assertEqual(str(0), '0') self.assertEqual(str(0), '0')
self.assertEqual(str(0L), '0') self.assertEqual(str(0), '0')
self.assertEqual(str(()), '()') self.assertEqual(str(()), '()')
self.assertEqual(str([]), '[]') self.assertEqual(str([]), '[]')
self.assertEqual(str({}), '{}') self.assertEqual(str({}), '{}')

View File

@ -361,9 +361,9 @@ class BytesTest(unittest.TestCase):
def test_contains(self): def test_contains(self):
b = bytes("abc") b = bytes("abc")
self.failUnless(ord('a') in b) self.failUnless(ord('a') in b)
self.failUnless(long(ord('a')) in b) self.failUnless(int(ord('a')) in b)
self.failIf(200 in b)
self.failIf(200 in b) self.failIf(200 in b)
self.failIf(200L in b)
self.assertRaises(ValueError, lambda: 300 in b) self.assertRaises(ValueError, lambda: 300 in b)
self.assertRaises(ValueError, lambda: -1 in b) self.assertRaises(ValueError, lambda: -1 in b)
self.assertRaises(TypeError, lambda: None in b) self.assertRaises(TypeError, lambda: None in b)

View File

@ -84,10 +84,6 @@ class AllTests:
print "__float__:", args print "__float__:", args
return 1.0 return 1.0
def __long__(self, *args):
print "__long__:", args
return 1L
def __oct__(self, *args): def __oct__(self, *args):
print "__oct__:", args print "__oct__:", args
return '01' return '01'
@ -238,7 +234,7 @@ else:
+testme +testme
abs(testme) abs(testme)
int(testme) int(testme)
long(testme) int(testme)
float(testme) float(testme)
oct(testme) oct(testme)
hex(testme) hex(testme)
@ -289,7 +285,6 @@ class BadTypeClass:
def __int__(self): def __int__(self):
return None return None
__float__ = __int__ __float__ = __int__
__long__ = __int__
__str__ = __int__ __str__ = __int__
__repr__ = __int__ __repr__ = __int__
__oct__ = __int__ __oct__ = __int__
@ -307,31 +302,11 @@ def check_exc(stmt, exception):
check_exc("int(BadTypeClass())", TypeError) check_exc("int(BadTypeClass())", TypeError)
check_exc("float(BadTypeClass())", TypeError) check_exc("float(BadTypeClass())", TypeError)
check_exc("long(BadTypeClass())", TypeError)
check_exc("str(BadTypeClass())", TypeError) check_exc("str(BadTypeClass())", TypeError)
check_exc("repr(BadTypeClass())", TypeError) check_exc("repr(BadTypeClass())", TypeError)
check_exc("oct(BadTypeClass())", TypeError) check_exc("oct(BadTypeClass())", TypeError)
check_exc("hex(BadTypeClass())", TypeError) check_exc("hex(BadTypeClass())", TypeError)
# mixing up ints and longs is okay
class IntLongMixClass:
def __int__(self):
return 0L
def __long__(self):
return 0
try:
int(IntLongMixClass())
except TypeError:
raise TestFailed, "TypeError should not be raised"
try:
long(IntLongMixClass())
except TypeError:
raise TestFailed, "TypeError should not be raised"
# Test correct errors from hash() on objects with comparisons but no __hash__ # Test correct errors from hash() on objects with comparisons but no __hash__
class C0: class C0:

View File

@ -70,7 +70,7 @@ consts: ('None',)
... 'doc string' ... 'doc string'
... 'not a docstring' ... 'not a docstring'
... 53 ... 53
... 53L ... 0x53
>>> dump(optimize_away.func_code) >>> dump(optimize_away.func_code)
name: optimize_away name: optimize_away

View File

@ -17,7 +17,7 @@ class Cmp:
return self.arg == other return self.arg == other
class ComparisonTest(unittest.TestCase): class ComparisonTest(unittest.TestCase):
set1 = [2, 2.0, 2L, 2+0j, Cmp(2.0)] set1 = [2, 2.0, 2, 2+0j, Cmp(2.0)]
set2 = [[1], (3,), None, Empty()] set2 = [[1], (3,), None, Empty()]
candidates = set1 + set2 candidates = set1 + set2

View File

@ -182,10 +182,8 @@ if 1:
self.assertRaises(SyntaxError, eval, arg) self.assertRaises(SyntaxError, eval, arg)
self.assertEqual(eval("0777"), 511) self.assertEqual(eval("0777"), 511)
self.assertEqual(eval("0777L"), 511)
self.assertEqual(eval("000777"), 511) self.assertEqual(eval("000777"), 511)
self.assertEqual(eval("0xff"), 255) self.assertEqual(eval("0xff"), 255)
self.assertEqual(eval("0xffL"), 255)
self.assertEqual(eval("0XfF"), 255) self.assertEqual(eval("0XfF"), 255)
self.assertEqual(eval("0777."), 777) self.assertEqual(eval("0777."), 777)
self.assertEqual(eval("0777.0"), 777) self.assertEqual(eval("0777.0"), 777)
@ -212,19 +210,19 @@ if 1:
if sys.maxint == 2147483647: if sys.maxint == 2147483647:
# 32-bit machine # 32-bit machine
all_one_bits = '0xffffffff' all_one_bits = '0xffffffff'
self.assertEqual(eval(all_one_bits), 4294967295L) self.assertEqual(eval(all_one_bits), 4294967295)
self.assertEqual(eval("-" + all_one_bits), -4294967295L) self.assertEqual(eval("-" + all_one_bits), -4294967295)
elif sys.maxint == 9223372036854775807: elif sys.maxint == 9223372036854775807:
# 64-bit machine # 64-bit machine
all_one_bits = '0xffffffffffffffff' all_one_bits = '0xffffffffffffffff'
self.assertEqual(eval(all_one_bits), 18446744073709551615L) self.assertEqual(eval(all_one_bits), 18446744073709551615)
self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L) self.assertEqual(eval("-" + all_one_bits), -18446744073709551615)
else: else:
self.fail("How many bits *does* this machine have???") self.fail("How many bits *does* this machine have???")
# Verify treatment of contant folding on -(sys.maxint+1) # Verify treatment of contant folding on -(sys.maxint+1)
# i.e. -2147483648 on 32 bit platforms. Should return int, not long. # i.e. -2147483648 on 32 bit platforms. Should return int, not long.
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int)) self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long)) self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), int))
if sys.maxint == 9223372036854775807: if sys.maxint == 9223372036854775807:
def test_32_63_bit_values(self): def test_32_63_bit_values(self):

View File

@ -93,7 +93,7 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ZeroDivisionError, complex.__floordiv__, 3+0j, 0+0j) self.assertRaises(ZeroDivisionError, complex.__floordiv__, 3+0j, 0+0j)
def test_richcompare(self): def test_richcompare(self):
self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1L<<10000) self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1<<10000)
self.assertEqual(complex.__lt__(1+1j, None), NotImplemented) self.assertEqual(complex.__lt__(1+1j, None), NotImplemented)
self.assertIs(complex.__eq__(1+1j, 1+1j), True) self.assertIs(complex.__eq__(1+1j, 1+1j), True)
self.assertIs(complex.__eq__(1+1j, 2+2j), False) self.assertIs(complex.__eq__(1+1j, 2+2j), False)
@ -180,25 +180,25 @@ class ComplexTest(unittest.TestCase):
self.assertAlmostEqual(complex("1+10j"), 1+10j) self.assertAlmostEqual(complex("1+10j"), 1+10j)
self.assertAlmostEqual(complex(10), 10+0j) self.assertAlmostEqual(complex(10), 10+0j)
self.assertAlmostEqual(complex(10.0), 10+0j) self.assertAlmostEqual(complex(10.0), 10+0j)
self.assertAlmostEqual(complex(10L), 10+0j) self.assertAlmostEqual(complex(10), 10+0j)
self.assertAlmostEqual(complex(10+0j), 10+0j) self.assertAlmostEqual(complex(10+0j), 10+0j)
self.assertAlmostEqual(complex(1,10), 1+10j) self.assertAlmostEqual(complex(1,10), 1+10j)
self.assertAlmostEqual(complex(1,10L), 1+10j) self.assertAlmostEqual(complex(1,10), 1+10j)
self.assertAlmostEqual(complex(1,10.0), 1+10j)
self.assertAlmostEqual(complex(1,10), 1+10j)
self.assertAlmostEqual(complex(1,10), 1+10j)
self.assertAlmostEqual(complex(1,10.0), 1+10j) self.assertAlmostEqual(complex(1,10.0), 1+10j)
self.assertAlmostEqual(complex(1L,10), 1+10j)
self.assertAlmostEqual(complex(1L,10L), 1+10j)
self.assertAlmostEqual(complex(1L,10.0), 1+10j)
self.assertAlmostEqual(complex(1.0,10), 1+10j) self.assertAlmostEqual(complex(1.0,10), 1+10j)
self.assertAlmostEqual(complex(1.0,10L), 1+10j) self.assertAlmostEqual(complex(1.0,10), 1+10j)
self.assertAlmostEqual(complex(1.0,10.0), 1+10j) self.assertAlmostEqual(complex(1.0,10.0), 1+10j)
self.assertAlmostEqual(complex(3.14+0j), 3.14+0j) self.assertAlmostEqual(complex(3.14+0j), 3.14+0j)
self.assertAlmostEqual(complex(3.14), 3.14+0j) self.assertAlmostEqual(complex(3.14), 3.14+0j)
self.assertAlmostEqual(complex(314), 314.0+0j) self.assertAlmostEqual(complex(314), 314.0+0j)
self.assertAlmostEqual(complex(314L), 314.0+0j) self.assertAlmostEqual(complex(314), 314.0+0j)
self.assertAlmostEqual(complex(3.14+0j, 0j), 3.14+0j) self.assertAlmostEqual(complex(3.14+0j, 0j), 3.14+0j)
self.assertAlmostEqual(complex(3.14, 0.0), 3.14+0j) self.assertAlmostEqual(complex(3.14, 0.0), 3.14+0j)
self.assertAlmostEqual(complex(314, 0), 314.0+0j) self.assertAlmostEqual(complex(314, 0), 314.0+0j)
self.assertAlmostEqual(complex(314L, 0L), 314.0+0j) self.assertAlmostEqual(complex(314, 0), 314.0+0j)
self.assertAlmostEqual(complex(0j, 3.14j), -3.14+0j) self.assertAlmostEqual(complex(0j, 3.14j), -3.14+0j)
self.assertAlmostEqual(complex(0.0, 3.14j), -3.14+0j) self.assertAlmostEqual(complex(0.0, 3.14j), -3.14+0j)
self.assertAlmostEqual(complex(0j, 3.14), 3.14j) self.assertAlmostEqual(complex(0j, 3.14), 3.14j)
@ -232,7 +232,7 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, '1+1j\0j') self.assertRaises(ValueError, complex, '1+1j\0j')
self.assertRaises(TypeError, int, 5+3j) self.assertRaises(TypeError, int, 5+3j)
self.assertRaises(TypeError, long, 5+3j) self.assertRaises(TypeError, int, 5+3j)
self.assertRaises(TypeError, float, 5+3j) self.assertRaises(TypeError, float, 5+3j)
self.assertRaises(ValueError, complex, "") self.assertRaises(ValueError, complex, "")
self.assertRaises(TypeError, complex, None) self.assertRaises(TypeError, complex, None)

View File

@ -103,7 +103,7 @@ class HeaderTests(TestCase):
from cookielib import parse_ns_headers from cookielib import parse_ns_headers
# quotes should be stripped # quotes should be stripped
expected = [[('foo', 'bar'), ('expires', 2209069412L), ('version', '0')]] expected = [[('foo', 'bar'), ('expires', 2209069412), ('version', '0')]]
for hdr in [ for hdr in [
'foo=bar; expires=01 Jan 2040 22:23:32 GMT', 'foo=bar; expires=01 Jan 2040 22:23:32 GMT',
'foo=bar; expires="01 Jan 2040 22:23:32 GMT"', 'foo=bar; expires="01 Jan 2040 22:23:32 GMT"',

View File

@ -82,7 +82,7 @@ class TestCopy(unittest.TestCase):
pass pass
def f(): def f():
pass pass
tests = [None, 42, 2L**100, 3.14, True, False, 1j, tests = [None, 42, 2**100, 3.14, True, False, 1j,
"hello", u"hello\u1234", f.func_code, "hello", u"hello\u1234", f.func_code,
NewStyle, xrange(10), Classic, max] NewStyle, xrange(10), Classic, max]
for x in tests: for x in tests:
@ -255,7 +255,7 @@ class TestCopy(unittest.TestCase):
pass pass
def f(): def f():
pass pass
tests = [None, 42, 2L**100, 3.14, True, False, 1j, tests = [None, 42, 2**100, 3.14, True, False, 1j,
"hello", u"hello\u1234", f.func_code, "hello", u"hello\u1234", f.func_code,
NewStyle, xrange(10), Classic, max] NewStyle, xrange(10), Classic, max]
for x in tests: for x in tests:

View File

@ -96,7 +96,7 @@ class CopyRegTestCase(unittest.TestCase):
e.restore() e.restore()
# Ensure invalid codes blow up. # Ensure invalid codes blow up.
for code in -1, 0, 0x80000000L: for code in -1, 0, 0x80000000:
self.assertRaises(ValueError, copy_reg.add_extension, self.assertRaises(ValueError, copy_reg.add_extension,
mod, func, code) mod, func, code)

View File

@ -32,7 +32,7 @@ else:
# An arbitrary collection of objects of non-datetime types, for testing # An arbitrary collection of objects of non-datetime types, for testing
# mixed-type comparisons. # mixed-type comparisons.
OTHERSTUFF = (10, 10L, 34.5, "abc", {}, [], ()) OTHERSTUFF = (10, 10, 34.5, "abc", {}, [], ())
############################################################################# #############################################################################
@ -149,11 +149,11 @@ class HarmlessMixedComparison(unittest.TestCase):
self.failIf(() == me) self.failIf(() == me)
self.failUnless(() != me) self.failUnless(() != me)
self.failUnless(me in [1, 20L, [], me]) self.failUnless(me in [1, 20, [], me])
self.failIf(me not in [1, 20L, [], me]) self.failIf(me not in [1, 20, [], me])
self.failUnless([] in [me, 1, 20L, []]) self.failUnless([] in [me, 1, 20, []])
self.failIf([] not in [me, 1, 20L, []]) self.failIf([] not in [me, 1, 20, []])
def test_harmful_mixed_comparison(self): def test_harmful_mixed_comparison(self):
me = self.theclass(1, 1, 1) me = self.theclass(1, 1, 1)
@ -222,13 +222,13 @@ class TestTimeDelta(HarmlessMixedComparison):
eq(td(0, 0, 60*1000000), b) eq(td(0, 0, 60*1000000), b)
eq(a*10, td(70)) eq(a*10, td(70))
eq(a*10, 10*a) eq(a*10, 10*a)
eq(a*10L, 10*a) eq(a*10, 10*a)
eq(b*10, td(0, 600)) eq(b*10, td(0, 600))
eq(10*b, td(0, 600)) eq(10*b, td(0, 600))
eq(b*10L, td(0, 600)) eq(b*10, td(0, 600))
eq(c*10, td(0, 0, 10000)) eq(c*10, td(0, 0, 10000))
eq(10*c, td(0, 0, 10000)) eq(10*c, td(0, 0, 10000))
eq(c*10L, td(0, 0, 10000)) eq(c*10, td(0, 0, 10000))
eq(a*-1, -a) eq(a*-1, -a)
eq(b*-2, -b-b) eq(b*-2, -b-b)
eq(c*-2, -c+-c) eq(c*-2, -c+-c)
@ -246,7 +246,7 @@ class TestTimeDelta(HarmlessMixedComparison):
a = timedelta(42) a = timedelta(42)
# Add/sub ints, longs, floats should be illegal # Add/sub ints, longs, floats should be illegal
for i in 1, 1L, 1.0: for i in 1, 1, 1.0:
self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a) self.assertRaises(TypeError, lambda: i+a)
@ -263,7 +263,7 @@ class TestTimeDelta(HarmlessMixedComparison):
# Divison of int by timedelta doesn't make sense. # Divison of int by timedelta doesn't make sense.
# Division by zero doesn't make sense. # Division by zero doesn't make sense.
for zero in 0, 0L: for zero in 0, 0:
self.assertRaises(TypeError, lambda: zero // a) self.assertRaises(TypeError, lambda: zero // a)
self.assertRaises(ZeroDivisionError, lambda: a // zero) self.assertRaises(ZeroDivisionError, lambda: a // zero)
@ -696,7 +696,7 @@ class TestDate(HarmlessMixedComparison):
self.assertEqual(a - (a - day), day) self.assertEqual(a - (a - day), day)
# Add/sub ints, longs, floats should be illegal # Add/sub ints, longs, floats should be illegal
for i in 1, 1L, 1.0: for i in 1, 1, 1.0:
self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a) self.assertRaises(TypeError, lambda: i+a)
@ -1325,7 +1325,7 @@ class TestDateTime(TestDate):
self.assertEqual(a - (week + day + hour + millisec), self.assertEqual(a - (week + day + hour + millisec),
(((a - week) - day) - hour) - millisec) (((a - week) - day) - hour) - millisec)
# Add/sub ints, longs, floats should be illegal # Add/sub ints, longs, floats should be illegal
for i in 1, 1L, 1.0: for i in 1, 1, 1.0:
self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a) self.assertRaises(TypeError, lambda: i+a)

View File

@ -907,8 +907,8 @@ class DecimalUsabilityTest(unittest.TestCase):
self.assertEqual(int(d2), 15) self.assertEqual(int(d2), 15)
#long #long
self.assertEqual(long(d1), 66) self.assertEqual(int(d1), 66)
self.assertEqual(long(d2), 15) self.assertEqual(int(d2), 15)
#float #float
self.assertEqual(float(d1), 66) self.assertEqual(float(d1), 66)

View File

@ -191,7 +191,7 @@ def dict_constructor():
vereq(d, dict([("two", 2)], one=1)) vereq(d, dict([("two", 2)], one=1))
vereq(d, dict([("one", 100), ("two", 200)], **d)) vereq(d, dict([("one", 100), ("two", 200)], **d))
verify(d is not dict(**d)) verify(d is not dict(**d))
for badarg in 0, 0L, 0j, "0", [0], (0,): for badarg in 0, 0, 0j, "0", [0], (0,):
try: try:
dict(badarg) dict(badarg)
except TypeError: except TypeError:
@ -264,7 +264,7 @@ def test_dir():
del junk del junk
# Just make sure these don't blow up! # Just make sure these don't blow up!
for arg in 2, 2L, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, test_dir: for arg in 2, 2, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, test_dir:
dir(arg) dir(arg)
# Test dir on custom classes. Since these have object as a # Test dir on custom classes. Since these have object as a
@ -385,7 +385,6 @@ unops = {
'abs': 'abs', 'abs': 'abs',
'invert': '~', 'invert': '~',
'int': 'int', 'int': 'int',
'long': 'long',
'float': 'float', 'float': 'float',
'oct': 'oct', 'oct': 'oct',
'hex': 'hex', 'hex': 'hex',
@ -423,7 +422,7 @@ def ints():
class C(int): class C(int):
def __add__(self, other): def __add__(self, other):
return NotImplemented return NotImplemented
vereq(C(5L), 5) vereq(C(5), 5)
try: try:
C() + "" C() + ""
except TypeError: except TypeError:
@ -433,7 +432,7 @@ def ints():
def longs(): def longs():
if verbose: print "Testing long operations..." if verbose: print "Testing long operations..."
numops(100L, 3L) numops(100, 3)
def floats(): def floats():
if verbose: print "Testing float operations..." if verbose: print "Testing float operations..."
@ -1263,10 +1262,10 @@ def dynamics():
vereq(I(3)*I(2), 6) vereq(I(3)*I(2), 6)
# Test handling of long*seq and seq*long # Test handling of long*seq and seq*long
class L(long): class L(int):
pass pass
vereq("a"*L(2L), "aa") vereq("a"*L(2), "aa")
vereq(L(2L)*"a", "aa") vereq(L(2)*"a", "aa")
vereq(2*L(3), 6) vereq(2*L(3), 6)
vereq(L(3)*2, 6) vereq(L(3)*2, 6)
vereq(L(3)*L(2), 6) vereq(L(3)*L(2), 6)
@ -2041,7 +2040,7 @@ def inherits():
verify((hexint(0) << 12).__class__ is int) verify((hexint(0) << 12).__class__ is int)
verify((hexint(0) >> 12).__class__ is int) verify((hexint(0) >> 12).__class__ is int)
class octlong(long): class octlong(int):
__slots__ = [] __slots__ = []
def __str__(self): def __str__(self):
s = oct(self) s = oct(self)
@ -2056,39 +2055,39 @@ def inherits():
# because the example uses a short int left argument.) # because the example uses a short int left argument.)
vereq(str(5 + octlong(3000)), "05675") vereq(str(5 + octlong(3000)), "05675")
a = octlong(12345) a = octlong(12345)
vereq(a, 12345L) vereq(a, 12345)
vereq(long(a), 12345L) vereq(int(a), 12345)
vereq(hash(a), hash(12345L)) vereq(hash(a), hash(12345))
verify(long(a).__class__ is long) verify(int(a).__class__ is int)
verify((+a).__class__ is long) verify((+a).__class__ is int)
verify((-a).__class__ is long) verify((-a).__class__ is int)
verify((-octlong(0)).__class__ is long) verify((-octlong(0)).__class__ is int)
verify((a >> 0).__class__ is long) verify((a >> 0).__class__ is int)
verify((a << 0).__class__ is long) verify((a << 0).__class__ is int)
verify((a - 0).__class__ is long) verify((a - 0).__class__ is int)
verify((a * 1).__class__ is long) verify((a * 1).__class__ is int)
verify((a ** 1).__class__ is long) verify((a ** 1).__class__ is int)
verify((a // 1).__class__ is long) verify((a // 1).__class__ is int)
verify((1 * a).__class__ is long) verify((1 * a).__class__ is int)
verify((a | 0).__class__ is long) verify((a | 0).__class__ is int)
verify((a ^ 0).__class__ is long) verify((a ^ 0).__class__ is int)
verify((a & -1L).__class__ is long) verify((a & -1).__class__ is int)
verify((octlong(0) << 12).__class__ is long) verify((octlong(0) << 12).__class__ is int)
verify((octlong(0) >> 12).__class__ is long) verify((octlong(0) >> 12).__class__ is int)
verify(abs(octlong(0)).__class__ is long) verify(abs(octlong(0)).__class__ is int)
# Because octlong overrides __add__, we can't check the absence of +0 # Because octlong overrides __add__, we can't check the absence of +0
# optimizations using octlong. # optimizations using octlong.
class longclone(long): class longclone(int):
pass pass
a = longclone(1) a = longclone(1)
verify((a + 0).__class__ is long) verify((a + 0).__class__ is int)
verify((0 + a).__class__ is long) verify((0 + a).__class__ is int)
# Check that negative clones don't segfault # Check that negative clones don't segfault
a = longclone(-1) a = longclone(-1)
vereq(a.__dict__, {}) vereq(a.__dict__, {})
vereq(long(a), -1) # verify PyNumber_Long() copies the sign bit vereq(int(a), -1) # verify PyNumber_Long() copies the sign bit
class precfloat(float): class precfloat(float):
__slots__ = ['prec'] __slots__ = ['prec']
@ -2366,7 +2365,7 @@ def keywords():
print "Testing keyword args to basic type constructors ..." print "Testing keyword args to basic type constructors ..."
vereq(int(x=1), 1) vereq(int(x=1), 1)
vereq(float(x=2), 2.0) vereq(float(x=2), 2.0)
vereq(long(x=3), 3L) vereq(int(x=3), 3)
vereq(complex(imag=42, real=666), complex(666, 42)) vereq(complex(imag=42, real=666), complex(666, 42))
vereq(str(object=500), '500') vereq(str(object=500), '500')
vereq(unicode(string='abc', errors='strict'), u'abc') vereq(unicode(string='abc', errors='strict'), u'abc')
@ -2374,7 +2373,7 @@ def keywords():
vereq(list(sequence=(0, 1, 2)), range(3)) vereq(list(sequence=(0, 1, 2)), range(3))
# note: as of Python 2.3, dict() no longer has an "items" keyword arg # note: as of Python 2.3, dict() no longer has an "items" keyword arg
for constructor in (int, float, long, complex, str, unicode, for constructor in (int, float, int, complex, str, unicode,
tuple, list, file): tuple, list, file):
try: try:
constructor(bogus_keyword_arg=1) constructor(bogus_keyword_arg=1)
@ -2472,37 +2471,37 @@ def classic_comparisons():
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value == other.value return self.value == other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value == other return self.value == other
return NotImplemented return NotImplemented
def __ne__(self, other): def __ne__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value != other.value return self.value != other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value != other return self.value != other
return NotImplemented return NotImplemented
def __lt__(self, other): def __lt__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value < other.value return self.value < other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value < other return self.value < other
return NotImplemented return NotImplemented
def __le__(self, other): def __le__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value <= other.value return self.value <= other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value <= other return self.value <= other
return NotImplemented return NotImplemented
def __gt__(self, other): def __gt__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value > other.value return self.value > other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value > other return self.value > other
return NotImplemented return NotImplemented
def __ge__(self, other): def __ge__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value >= other.value return self.value >= other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value >= other return self.value >= other
return NotImplemented return NotImplemented
@ -2550,37 +2549,37 @@ def rich_comparisons():
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value == other.value return self.value == other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value == other return self.value == other
return NotImplemented return NotImplemented
def __ne__(self, other): def __ne__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value != other.value return self.value != other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value != other return self.value != other
return NotImplemented return NotImplemented
def __lt__(self, other): def __lt__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value < other.value return self.value < other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value < other return self.value < other
return NotImplemented return NotImplemented
def __le__(self, other): def __le__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value <= other.value return self.value <= other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value <= other return self.value <= other
return NotImplemented return NotImplemented
def __gt__(self, other): def __gt__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value > other.value return self.value > other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value > other return self.value > other
return NotImplemented return NotImplemented
def __ge__(self, other): def __ge__(self, other):
if isinstance(other, C): if isinstance(other, C):
return self.value >= other.value return self.value >= other.value
if isinstance(other, int) or isinstance(other, long): if isinstance(other, int) or isinstance(other, int):
return self.value >= other return self.value >= other
return NotImplemented return NotImplemented
c1 = C(1) c1 = C(1)
@ -3250,11 +3249,11 @@ def imulbug():
y *= 2 y *= 2
vereq(y, (x, 2)) vereq(y, (x, 2))
y = x y = x
y *= 3L y *= 3
vereq(y, (x, 3L)) vereq(y, (x, 3))
y = x y = x
y *= 1L<<100 y *= 1<<100
vereq(y, (x, 1L<<100)) vereq(y, (x, 1<<100))
y = x y = x
y *= None y *= None
vereq(y, (x, None)) vereq(y, (x, None))
@ -3444,7 +3443,7 @@ def do_this_first():
def __pow__(self, *args): def __pow__(self, *args):
pass pass
try: try:
pow(0L, UserLong(), 0L) pow(0, UserLong(), 0)
except: except:
pass pass
@ -3956,7 +3955,7 @@ def notimplemented():
else: else:
raise TestFailed("no TypeError from %r" % (expr,)) raise TestFailed("no TypeError from %r" % (expr,))
N1 = sys.maxint + 1L # might trigger OverflowErrors instead of TypeErrors N1 = sys.maxint + 1 # might trigger OverflowErrors instead of TypeErrors
N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger
# ValueErrors instead of TypeErrors # ValueErrors instead of TypeErrors
for metaclass in [type, types.ClassType]: for metaclass in [type, types.ClassType]:

View File

@ -314,7 +314,7 @@ class DictTest(unittest.TestCase):
# verify longs/ints get same value when key > 32 bits (for 64-bit archs) # verify longs/ints get same value when key > 32 bits (for 64-bit archs)
# see SF bug #689659 # see SF bug #689659
x = 4503599627370496L x = 4503599627370496
y = 4503599627370496 y = 4503599627370496
h = {x: 'anything', y: 'something else'} h = {x: 'anything', y: 'something else'}
self.assertEqual(h[x], h[y]) self.assertEqual(h[x], h[y])
@ -371,7 +371,7 @@ class DictTest(unittest.TestCase):
def test_eq(self): def test_eq(self):
self.assertEqual({}, {}) self.assertEqual({}, {})
self.assertEqual({1: 2}, {1L: 2L}) self.assertEqual({1: 2}, {1: 2})
class Exc(Exception): pass class Exc(Exception): pass

View File

@ -57,14 +57,14 @@ testboth('%12.*f', (123456, 1.0))
# Formatting of long integers. Overflow is not ok # Formatting of long integers. Overflow is not ok
overflowok = 0 overflowok = 0
testboth("%x", 10L, "a") testboth("%x", 10, "a")
testboth("%x", 100000000000L, "174876e800") testboth("%x", 100000000000, "174876e800")
testboth("%o", 10L, "12") testboth("%o", 10, "12")
testboth("%o", 100000000000L, "1351035564000") testboth("%o", 100000000000, "1351035564000")
testboth("%d", 10L, "10") testboth("%d", 10, "10")
testboth("%d", 100000000000L, "100000000000") testboth("%d", 100000000000, "100000000000")
big = 123456789012345678901234567890L big = 123456789012345678901234567890
testboth("%d", big, "123456789012345678901234567890") testboth("%d", big, "123456789012345678901234567890")
testboth("%d", -big, "-123456789012345678901234567890") testboth("%d", -big, "-123456789012345678901234567890")
testboth("%5d", -big, "-123456789012345678901234567890") testboth("%5d", -big, "-123456789012345678901234567890")
@ -83,7 +83,7 @@ testboth("%.30d", big, "123456789012345678901234567890")
testboth("%.31d", big, "0123456789012345678901234567890") testboth("%.31d", big, "0123456789012345678901234567890")
testboth("%32.31d", big, " 0123456789012345678901234567890") testboth("%32.31d", big, " 0123456789012345678901234567890")
big = 0x1234567890abcdef12345L # 21 hex digits big = 0x1234567890abcdef12345 # 21 hex digits
testboth("%x", big, "1234567890abcdef12345") testboth("%x", big, "1234567890abcdef12345")
testboth("%x", -big, "-1234567890abcdef12345") testboth("%x", -big, "-1234567890abcdef12345")
testboth("%5x", -big, "-1234567890abcdef12345") testboth("%5x", -big, "-1234567890abcdef12345")
@ -120,7 +120,7 @@ testboth("%#+027.23X", big, "+0X0001234567890ABCDEF12345")
# same, except no 0 flag # same, except no 0 flag
testboth("%#+27.23X", big, " +0X001234567890ABCDEF12345") testboth("%#+27.23X", big, " +0X001234567890ABCDEF12345")
big = 012345670123456701234567012345670L # 32 octal digits big = 012345670123456701234567012345670 # 32 octal digits
testboth("%o", big, "12345670123456701234567012345670") testboth("%o", big, "12345670123456701234567012345670")
testboth("%o", -big, "-12345670123456701234567012345670") testboth("%o", -big, "-12345670123456701234567012345670")
testboth("%5o", -big, "-12345670123456701234567012345670") testboth("%5o", -big, "-12345670123456701234567012345670")
@ -163,34 +163,34 @@ testboth("%0#34.33o", big, "0012345670123456701234567012345670")
# Some small ints, in both Python int and long flavors). # Some small ints, in both Python int and long flavors).
testboth("%d", 42, "42") testboth("%d", 42, "42")
testboth("%d", -42, "-42") testboth("%d", -42, "-42")
testboth("%d", 42L, "42") testboth("%d", 42, "42")
testboth("%d", -42L, "-42") testboth("%d", -42, "-42")
testboth("%#x", 1, "0x1")
testboth("%#x", 1, "0x1") testboth("%#x", 1, "0x1")
testboth("%#x", 1L, "0x1")
testboth("%#X", 1, "0X1") testboth("%#X", 1, "0X1")
testboth("%#X", 1L, "0X1") testboth("%#X", 1, "0X1")
testboth("%#o", 1, "01")
testboth("%#o", 1, "01") testboth("%#o", 1, "01")
testboth("%#o", 1L, "01")
testboth("%#o", 0, "0") testboth("%#o", 0, "0")
testboth("%#o", 0L, "0") testboth("%#o", 0, "0")
testboth("%o", 0, "0")
testboth("%o", 0, "0") testboth("%o", 0, "0")
testboth("%o", 0L, "0")
testboth("%d", 0, "0") testboth("%d", 0, "0")
testboth("%d", 0L, "0") testboth("%d", 0, "0")
testboth("%#x", 0, "0x0")
testboth("%#x", 0, "0x0") testboth("%#x", 0, "0x0")
testboth("%#x", 0L, "0x0")
testboth("%#X", 0, "0X0") testboth("%#X", 0, "0X0")
testboth("%#X", 0L, "0X0") testboth("%#X", 0, "0X0")
testboth("%x", 0x42, "42") testboth("%x", 0x42, "42")
testboth("%x", -0x42, "-42") testboth("%x", -0x42, "-42")
testboth("%x", 0x42L, "42") testboth("%x", 0x42, "42")
testboth("%x", -0x42L, "-42") testboth("%x", -0x42, "-42")
testboth("%o", 042, "42") testboth("%o", 042, "42")
testboth("%o", -042, "-42") testboth("%o", -042, "-42")
testboth("%o", 042L, "42") testboth("%o", 042, "42")
testboth("%o", -042L, "-42") testboth("%o", -042, "-42")
# Test exception for unknown format characters # Test exception for unknown format characters
if verbose: if verbose:
@ -230,7 +230,7 @@ test_exc(u'no format', '1', TypeError,
test_exc(u'no format', u'1', TypeError, test_exc(u'no format', u'1', TypeError,
"not all arguments converted during string formatting") "not all arguments converted during string formatting")
class Foobar(long): class Foobar(int):
def __oct__(self): def __oct__(self):
# Returning a non-string should not blow up. # Returning a non-string should not blow up.
return self + 1 return self + 1

Some files were not shown because too many files have changed in this diff Show More