Author: Brian Kearns <[email protected]>
Branch: stdlib-2.7.6
Changeset: r69636:322db849e374
Date: 2014-03-03 03:20 -0500
http://bitbucket.org/pypy/pypy/changeset/322db849e374/
Log: try to fix rawffi on 32bit
diff --git a/pypy/module/_rawffi/structure.py b/pypy/module/_rawffi/structure.py
--- a/pypy/module/_rawffi/structure.py
+++ b/pypy/module/_rawffi/structure.py
@@ -5,7 +5,6 @@
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.typedef import interp_attrproperty
from pypy.interpreter.typedef import TypeDef, GetSetProperty
-from rpython.rtyper.lltypesystem import lltype, rffi
from pypy.interpreter.error import OperationError, oefmt
from pypy.module._rawffi.interp_rawffi import segfault_exception, _MS_WINDOWS
from pypy.module._rawffi.interp_rawffi import W_DataShape, W_DataInstance
@@ -17,6 +16,7 @@
from pypy.module._rawffi.interp_rawffi import read_ptr, write_ptr
from rpython.rlib import clibffi, rgc
from rpython.rlib.rarithmetic import intmask, signedtype, widen, r_uint
+from rpython.rtyper.lltypesystem import lltype, rffi
def unpack_fields(space, w_fields):
@@ -303,7 +303,7 @@
if numbits:
lowbit = LOW_BIT(bitsize)
bitmask = BIT_MASK(numbits, ll_t)
- value = widen(rffi.cast(ll_t, value))
+ value = widen(value)
value >>= lowbit
value &= bitmask
if ll_t is lltype.Bool or signedtype(ll_t._type):
diff --git a/rpython/annotator/specialize.py b/rpython/annotator/specialize.py
--- a/rpython/annotator/specialize.py
+++ b/rpython/annotator/specialize.py
@@ -269,7 +269,7 @@
elif isinstance(s, SomeBool):
values = [False, True]
else:
- raise annmodel.AnnotatorError("memo call: argument must be a class"
+ raise annmodel.AnnotatorError("memo call: argument must be a class
"
"or a frozen PBC, got %r" % (s,))
argvalues.append(values)
# the list of all possible tuples of arguments to give to the memo function
diff --git a/rpython/rlib/rarithmetic.py b/rpython/rlib/rarithmetic.py
--- a/rpython/rlib/rarithmetic.py
+++ b/rpython/rlib/rarithmetic.py
@@ -149,8 +149,7 @@
return False
r_class = rffi.platform.numbertype_to_rclass[tp]
assert issubclass(r_class, base_int)
- return r_class.BITS < LONG_BIT or (
- r_class.BITS == LONG_BIT and r_class.SIGNED)
+ return r_class.BITS < LONG_BIT
_should_widen_type._annspecialcase_ = 'specialize:memo'
# the replacement for sys.maxint
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit