Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r45610:11a4cd3dac31
Date: 2011-07-15 02:54 -0700
http://bitbucket.org/pypy/pypy/changeset/11a4cd3dac31/
Log: reflex c wrapper cleanup
diff --git a/pypy/module/cppyy/include/cppyy.h
b/pypy/module/cppyy/include/cppyy.h
--- a/pypy/module/cppyy/include/cppyy.h
+++ b/pypy/module/cppyy/include/cppyy.h
@@ -1,8 +1,6 @@
#ifndef CPPYY_CPPYY
#define CPPYY_CPPYY
-#define CPPYY_G__MAXFUNCPARA 40
-
#ifdef __cplusplus
struct CPPYY_G__DUMMY_FOR_CINT7 {
#else
@@ -63,19 +61,4 @@
} CPPYY_G__value;
#endif
-
-#ifdef __cplusplus
-struct CPPYY_G__param {
-#else
-typedef struct
-#endif
- int paran;
- long para; /* place-holder */
- /* dropped parameter as it appears unused in stub functions */
-#ifdef __cplusplus
-};
-#else
-} CPPYY_G__param;
-#endif
-
#endif // CPPYY_CPPYY
diff --git a/pypy/module/cppyy/src/reflexcwrapper.cxx
b/pypy/module/cppyy/src/reflexcwrapper.cxx
--- a/pypy/module/cppyy/src/reflexcwrapper.cxx
+++ b/pypy/module/cppyy/src/reflexcwrapper.cxx
@@ -202,16 +202,14 @@
/* handling of function argument buffer ----------------------------------- */
void* cppyy_allocate_function_args(size_t nargs) {
- CPPYY_G__param* libp = (CPPYY_G__param*)malloc(
- sizeof(int/*CPPYY_G__param.paran*/) + nargs*sizeof(CPPYY_G__value));
- libp->paran = (int)nargs;
+ CPPYY_G__value* args =
(CPPYY_G__value*)malloc(nargs*sizeof(CPPYY_G__value));
for (int i = 0; i < nargs; ++i)
- ((CPPYY_G__value*)&libp->para)[i].type = 'l';
- return (void*)&libp->para;
+ args[i].type = 'l';
+ return (void*)args;
}
void cppyy_deallocate_function_args(void* args) {
- free((char*)args - offsetof(CPPYY_G__param, para));
+ free(args);
}
size_t cppyy_function_arg_sizeof() {
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit