1. Pypy
  2. Untitled project
  3. pypy


Brian Kearns  committed 773bc2c

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

  • Participants
  • Parent commits 16b7931
  • Branches release-2.3.x

Comments (0)

Files changed (7)

File pypy/module/cppyy/capi/capi_types.py

View file
  • Ignore whitespace
 from rpython.rtyper.lltypesystem import rffi, lltype
 # shared ll definitions
-_C_OPAQUE_NULL = lltype.nullptr(rffi.ULONGP.TO)# ALT: _C_OPAQUE_PTR.TO
+_C_OPAQUE_NULL = lltype.nullptr(rffi.LONGP.TO)# ALT: _C_OPAQUE_PTR.TO

File pypy/module/cppyy/capi/cint_capi.py

View file
  • Ignore whitespace
 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))
     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
         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))

File pypy/module/cppyy/capi/loadable_capi.py

View file
  • Ignore whitespace
         # 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
     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,
 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):
     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])
 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)]

File pypy/module/cppyy/converter.py

View file
  • Ignore whitespace
                 # 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

File pypy/module/cppyy/include/capi.h

View file
  • Ignore whitespace
 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);

File pypy/module/cppyy/interp_cppyy.py

View file
  • Ignore whitespace
     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

File pypy/module/cppyy/test/test_datatypes.py

View file
  • Ignore whitespace
 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)")