[pypy-commit] pypy release-2.3.x: backout premature merge of reflex-support: doesn't translate

bdkearns noreply at buildbot.pypy.org
Sat May 3 03:54:00 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: release-2.3.x
Changeset: r71218:773bc2c8bfc5
Date: 2014-05-02 21:51 -0400
http://bitbucket.org/pypy/pypy/changeset/773bc2c8bfc5/

Log:	backout premature merge of reflex-support: doesn't translate

diff --git a/pypy/module/cppyy/capi/capi_types.py b/pypy/module/cppyy/capi/capi_types.py
--- a/pypy/module/cppyy/capi/capi_types.py
+++ b/pypy/module/cppyy/capi/capi_types.py
@@ -1,8 +1,8 @@
 from rpython.rtyper.lltypesystem import rffi, lltype
 
 # shared ll definitions
-_C_OPAQUE_PTR = rffi.ULONG
-_C_OPAQUE_NULL = lltype.nullptr(rffi.ULONGP.TO)# ALT: _C_OPAQUE_PTR.TO
+_C_OPAQUE_PTR = rffi.LONG
+_C_OPAQUE_NULL = lltype.nullptr(rffi.LONGP.TO)# ALT: _C_OPAQUE_PTR.TO
 
 C_SCOPE = _C_OPAQUE_PTR
 C_NULL_SCOPE = rffi.cast(C_SCOPE, _C_OPAQUE_NULL)
diff --git a/pypy/module/cppyy/capi/cint_capi.py b/pypy/module/cppyy/capi/cint_capi.py
--- a/pypy/module/cppyy/capi/cint_capi.py
+++ b/pypy/module/cppyy/capi/cint_capi.py
@@ -249,7 +249,7 @@
 
 def activate_branch(space, w_branch):
     w_branches = space.call_method(w_branch, "GetListOfBranches")
-    for i in range(space.r_longlong_w(space.call_method(w_branches, "GetEntriesFast"))):
+    for i in range(space.int_w(space.call_method(w_branches, "GetEntriesFast"))):
         w_b = space.call_method(w_branches, "At", space.wrap(i))
         activate_branch(space, w_b)
     space.call_method(w_branch, "SetStatus", space.wrap(1))
@@ -292,7 +292,7 @@
     activate_branch(space, w_branch)
 
     # figure out from where we're reading
-    entry = space.r_longlong_w(space.call_method(w_self, "GetReadEntry"))
+    entry = space.int_w(space.call_method(w_self, "GetReadEntry"))
     if entry == -1:
         entry = 0
 
@@ -341,7 +341,7 @@
         self.w_tree = w_tree
 
         self.current  = 0
-        self.maxentry = space.r_longlong_w(space.call_method(w_tree, "GetEntriesFast"))
+        self.maxentry = space.int_w(space.call_method(w_tree, "GetEntriesFast"))
 
         space = self.space = tree.space          # holds the class cache in State
         space.call_method(w_tree, "SetBranchStatus", space.wrap("*"), space.wrap(0))
diff --git a/pypy/module/cppyy/capi/loadable_capi.py b/pypy/module/cppyy/capi/loadable_capi.py
--- a/pypy/module/cppyy/capi/loadable_capi.py
+++ b/pypy/module/cppyy/capi/loadable_capi.py
@@ -91,7 +91,7 @@
 
         # TODO: the following need to match up with the globally defined C_XYZ low-level
         # types (see capi/__init__.py), but by using strings here, that isn't guaranteed
-        c_opaque_ptr = nt.new_primitive_type(space, 'unsigned long')
+        c_opaque_ptr = nt.new_primitive_type(space, 'long')
  
         c_scope  = c_opaque_ptr
         c_type   = c_scope
@@ -259,10 +259,10 @@
     return c_call.ctype.rcall(c_call._cdata, args)
 
 def _cdata_to_cobject(space, w_cdata):
-    return rffi.cast(C_OBJECT, space.uint_w(w_cdata))
+    return rffi.cast(C_OBJECT, space.int_w(w_cdata))
 
 def _cdata_to_size_t(space, w_cdata):
-    return rffi.cast(rffi.SIZE_T, space.uint_w(w_cdata))
+    return rffi.cast(rffi.SIZE_T, space.int_w(w_cdata))
 
 def _cdata_to_ptr(space, w_cdata): # TODO: this is both a hack and dreadfully slow
     return rffi.cast(rffi.VOIDP,
@@ -281,12 +281,12 @@
 def c_resolve_name(space, name):
     return charp2str_free(space, call_capi(space, 'resolve_name', [_Arg(s=name)]))
 def c_get_scope_opaque(space, name):
-    return rffi.cast(C_SCOPE, space.uint_w(call_capi(space, 'get_scope', [_Arg(s=name)])))
+    return rffi.cast(C_SCOPE, space.int_w(call_capi(space, 'get_scope', [_Arg(s=name)])))
 def c_get_template(space, name):
-    return rffi.cast(C_TYPE, space.uint_w(call_capi(space, 'get_template', [_Arg(s=name)])))
+    return rffi.cast(C_TYPE, space.int_w(call_capi(space, 'get_template', [_Arg(s=name)])))
 def c_actual_class(space, cppclass, cppobj):
     args = [_Arg(l=cppclass.handle), _Arg(l=cppobj)]
-    return rffi.cast(C_TYPE, space.uint_w(call_capi(space, 'actual_class', args)))
+    return rffi.cast(C_TYPE, space.int_w(call_capi(space, 'actual_class', args)))
 
 # memory management ----------------------------------------------------------
 def c_allocate(space, cppclass):
@@ -302,7 +302,7 @@
     call_capi(space, 'call_v', args)
 def c_call_b(space, cppmethod, cppobject, nargs, cargs):
     args = [_Arg(l=cppmethod), _Arg(l=cppobject), _Arg(l=nargs), _Arg(vp=cargs)]
-    return rffi.cast(rffi.UCHAR, space.c_uint_w(call_capi(space, 'call_b', args)))
+    return rffi.cast(rffi.UCHAR, space.c_int_w(call_capi(space, 'call_b', args)))
 def c_call_c(space, cppmethod, cppobject, nargs, cargs):
     args = [_Arg(l=cppmethod), _Arg(l=cppobject), _Arg(l=nargs), _Arg(vp=cargs)]
     return rffi.cast(rffi.CHAR, space.str_w(call_capi(space, 'call_c', args))[0])
@@ -452,7 +452,7 @@
 
 def c_get_method(space, cppscope, index):
     args = [_Arg(l=cppscope.handle), _Arg(l=index)]
-    return rffi.cast(C_METHOD, space.uint_w(call_capi(space, 'get_method', args)))
+    return rffi.cast(C_METHOD, space.int_w(call_capi(space, 'get_method', args)))
 def c_get_global_operator(space, nss, lc, rc, op):
     if nss is not None:
         args = [_Arg(l=nss.handle), _Arg(l=lc.handle), _Arg(l=rc.handle), _Arg(s=op)]
diff --git a/pypy/module/cppyy/converter.py b/pypy/module/cppyy/converter.py
--- a/pypy/module/cppyy/converter.py
+++ b/pypy/module/cppyy/converter.py
@@ -386,7 +386,7 @@
             try:
                 # TODO: accept a 'capsule' rather than naked int
                 # (do accept int(0), though)
-                obj = rffi.cast(rffi.VOIDP, space.uint_w(w_obj))
+                obj = rffi.cast(rffi.VOIDP, space.int_w(w_obj))
             except Exception:
                 obj = rffi.cast(rffi.VOIDP, get_rawobject(space, w_obj))
         return obj
diff --git a/pypy/module/cppyy/include/capi.h b/pypy/module/cppyy/include/capi.h
--- a/pypy/module/cppyy/include/capi.h
+++ b/pypy/module/cppyy/include/capi.h
@@ -7,10 +7,10 @@
 extern "C" {
 #endif // ifdef __cplusplus
 
-    typedef unsigned long cppyy_scope_t;
+    typedef long cppyy_scope_t;
     typedef cppyy_scope_t cppyy_type_t;
-    typedef unsigned long cppyy_object_t;
-    typedef unsigned long cppyy_method_t;
+    typedef long cppyy_object_t;
+    typedef long cppyy_method_t;
     typedef long cppyy_index_t;
     typedef void* (*cppyy_methptrgetter_t)(cppyy_object_t);
 
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -593,7 +593,7 @@
     @unwrap_spec(args_w='args_w')
     def call(self, w_cppinstance, args_w):
         w_result = W_CPPOverload.call(self, w_cppinstance, args_w)
-        newthis = rffi.cast(capi.C_OBJECT, self.space.uint_w(w_result))
+        newthis = rffi.cast(capi.C_OBJECT, self.space.int_w(w_result))
         cppinstance = self.space.interp_w(W_CPPInstance, w_cppinstance, can_be_None=True)
         if cppinstance is not None:
             cppinstance._rawobject = newthis
diff --git a/pypy/module/cppyy/test/test_datatypes.py b/pypy/module/cppyy/test/test_datatypes.py
--- a/pypy/module/cppyy/test/test_datatypes.py
+++ b/pypy/module/cppyy/test/test_datatypes.py
@@ -7,6 +7,8 @@
 def setup_module(mod):
     if sys.platform == 'win32':
         py.test.skip("win32 not supported so far")
+    if sys.maxsize < 2 ** 31:
+        py.test.skip("32 bit not supported so far")
     err = os.system("cd '%s' && make datatypesDict.so" % currpath)
     if err:
         raise OSError("'make' failed (see stderr)")


More information about the pypy-commit mailing list