Author: Wim Lavrijsen <wlavrij...@lbl.gov>
Branch: cling-support
Changeset: r85668:979fabdcc11a
Date: 2016-07-12 09:52 -0700
http://bitbucket.org/pypy/pypy/changeset/979fabdcc11a/

Log:    from Aditi: proper type codes for instances converters

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
@@ -455,9 +455,10 @@
     uses_local = True
 
 class InstanceRefConverter(TypeConverter):
-    _immutable_fields_ = ['libffitype', 'cppclass']
+    _immutable_fields_ = ['libffitype', 'typecode', 'cppclass']
 
     libffitype  = jit_libffi.types.pointer
+    typecode    = 'V'
 
     def __init__(self, space, cppclass):
         from pypy.module.cppyy.interp_cppyy import W_CPPClass
@@ -480,7 +481,7 @@
         x[0] = rffi.cast(rffi.VOIDP, self._unwrap_object(space, w_obj))
         address = rffi.cast(capi.C_OBJECT, address)
         ba = rffi.cast(rffi.CCHARP, address)
-        ba[capi.c_function_arg_typeoffset(space)] = 'o'
+        ba[capi.c_function_arg_typeoffset(space)] = self.typecode
 
     def convert_argument_libffi(self, space, w_obj, address, call_local):
         x = rffi.cast(rffi.VOIDPP, address)
@@ -502,6 +503,7 @@
 
 
 class InstancePtrConverter(InstanceRefConverter):
+    typecode    = 'o'
 
     def _unwrap_object(self, space, w_obj):
         try:
diff --git a/pypy/module/cppyy/src/clingcwrapper.cxx 
b/pypy/module/cppyy/src/clingcwrapper.cxx
--- a/pypy/module/cppyy/src/clingcwrapper.cxx
+++ b/pypy/module/cppyy/src/clingcwrapper.cxx
@@ -377,6 +377,7 @@
       case 'D':          /* long double */
          vargs[i] = (void*)&args[i].fValue.fLongDouble;
          break;
+      case 'a':
       case 'o':
       case 'p':          /* void* */
          vargs[i] = (void*)&args[i].fValue.fVoidp;
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to