diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-12-10 10:50:42 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-12-10 10:50:42 +0000 |
commit | c5f751fd21c87fd4b2cab4e890a495957a7d5feb (patch) | |
tree | f2a0a5b04db1267d406f2e942abbc9112f31d033 | |
parent | b514d4c9754b4434e0d5987f976e831c90b80253 (diff) | |
download | numpy-c5f751fd21c87fd4b2cab4e890a495957a7d5feb.tar.gz |
Update CAPI.txt to reflect new function pointer structure.
-rw-r--r-- | scipy/doc/CAPI.txt | 4 | ||||
-rw-r--r-- | scipy/f2py/cfuncs.py | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/scipy/doc/CAPI.txt b/scipy/doc/CAPI.txt index bcf9509f6..1142ce7e2 100644 --- a/scipy/doc/CAPI.txt +++ b/scipy/doc/CAPI.txt @@ -8,7 +8,9 @@ There are a few non-standard Numeric usages (that were not really part of the API) that will need to be changed: * If you used any of the function pointers in the PyArray_Descr - structure you will have to modify your usage of those. The + structure you will have to modify your usage of those. First, + the pointers are all under the member named f. So descr->cast is now + descr->f->cast. In addition, the casting functions have eliminated the strides argument (use PyArray_CastTo if you need strided casting). All functions have one or two PyArrayObject * arguments at the end. This allows the diff --git a/scipy/f2py/cfuncs.py b/scipy/f2py/cfuncs.py index ad905c865..aec1509ff 100644 --- a/scipy/f2py/cfuncs.py +++ b/scipy/f2py/cfuncs.py @@ -279,7 +279,7 @@ cppmacros['TRYPYARRAYTEMPLATE']="""\ /* New SciPy */ #define TRYPYARRAYTEMPLATECHAR case PyArray_STRING: *(char *)(arr->data)=*v; break; #define TRYPYARRAYTEMPLATELONG case PyArray_LONG: *(long *)(arr->data)=*v; break; -#define TRYPYARRAYTEMPLATEOBJECT case PyArray_OBJECT: (arr->descr->setitem)(pyobj_from_ ## ctype ## 1(*v),arr->data); break; +#define TRYPYARRAYTEMPLATEOBJECT case PyArray_OBJECT: (arr->descr->f->setitem)(pyobj_from_ ## ctype ## 1(*v),arr->data); break; #define TRYPYARRAYTEMPLATE(ctype,typecode) \\ PyArrayObject *arr = NULL;\\ @@ -305,7 +305,7 @@ cppmacros['TRYPYARRAYTEMPLATE']="""\ case PyArray_ULONGLONG: *(ulonglong *)(arr->data)=*v; break;\\ case PyArray_LONGDOUBLE: *(longdouble *)(arr->data)=*v; break;\\ case PyArray_CLONGDOUBLE: *(longdouble *)(arr->data)=*v; break;\\ - case PyArray_OBJECT: (arr->descr->setitem)(pyobj_from_ ## ctype ## 1(*v),arr->data, arr); break;\\ + case PyArray_OBJECT: (arr->descr->f->setitem)(pyobj_from_ ## ctype ## 1(*v),arr->data, arr); break;\\ default: return -2;\\ };\\ return 1 @@ -313,7 +313,7 @@ cppmacros['TRYPYARRAYTEMPLATE']="""\ needs['TRYCOMPLEXPYARRAYTEMPLATE']=['PRINTPYOBJERR'] cppmacros['TRYCOMPLEXPYARRAYTEMPLATE']="""\ -#define TRYCOMPLEXPYARRAYTEMPLATEOBJECT case PyArray_OBJECT: (arr->descr->setitem)(pyobj_from_complex_ ## ctype ## 1((*v)),arr->data, arr); break; +#define TRYCOMPLEXPYARRAYTEMPLATEOBJECT case PyArray_OBJECT: (arr->descr->f->setitem)(pyobj_from_complex_ ## ctype ## 1((*v)),arr->data, arr); break; #define TRYCOMPLEXPYARRAYTEMPLATE(ctype,typecode)\\ PyArrayObject *arr = NULL;\\ if (!obj) return -2;\\ @@ -345,7 +345,7 @@ cppmacros['TRYCOMPLEXPYARRAYTEMPLATE']="""\ case PyArray_ULONGLONG: *(ulonglong *)(arr->data)=(*v).r; break;\\ case PyArray_LONGDOUBLE: *(longdouble *)(arr->data)=(*v).r; break;\\ case PyArray_CLONGDOUBLE: *(longdouble *)(arr->data)=(*v).r;*(longdouble *)(arr->data+sizeof(longdouble))=(*v).i;break;\\ - case PyArray_OBJECT: (arr->descr->setitem)(pyobj_from_complex_ ## ctype ## 1((*v)),arr->data, arr); break;\\ + case PyArray_OBJECT: (arr->descr->f->setitem)(pyobj_from_complex_ ## ctype ## 1((*v)),arr->data, arr); break;\\ default: return -2;\\ };\\ return -1; |