summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-03-10 00:52:59 -0800
committerMark Wiebe <mwwiebe@gmail.com>2011-03-10 18:38:56 -0800
commit0c0c49ce89f447b423c52aee795b1bf1fec4e9fe (patch)
tree335ffd7572c479857ac62f150ceab564878bd790
parent72ef8a6cd4a1491212e7fc4a581825e2267903c8 (diff)
downloadnumpy-0c0c49ce89f447b423c52aee795b1bf1fec4e9fe.tar.gz
API: Rename the iterator function pointer types to be more consistent with NumPy convention
'NpyIter_IterNext_Fn' -> 'NpyIter_IterNextFunc *' 'NpyIter_GetCoords_Fn' -> 'NpyIter_GetCoordsFunc *'
-rw-r--r--doc/source/reference/c-api.iterator.rst16
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h4
-rw-r--r--numpy/core/src/multiarray/convert.c2
-rw-r--r--numpy/core/src/multiarray/ctors.c4
-rw-r--r--numpy/core/src/multiarray/einsum.c.src2
-rw-r--r--numpy/core/src/multiarray/item_selection.c6
-rw-r--r--numpy/core/src/multiarray/new_iterator.c.src4
-rw-r--r--numpy/core/src/multiarray/new_iterator_pywrap.c4
-rw-r--r--numpy/core/src/umath/ufunc_object.c12
-rw-r--r--numpy/lib/src/_compiled_base.c6
10 files changed, 30 insertions, 30 deletions
diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api.iterator.rst
index 7812fa23d..62f179a4d 100644
--- a/doc/source/reference/c-api.iterator.rst
+++ b/doc/source/reference/c-api.iterator.rst
@@ -87,7 +87,7 @@ number of non-zero elements in an array.
PyArray_NonzeroFunc* nonzero = PyArray_DESCR(self)->f->nonzero;
NpyIter* iter;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char** dataptr;
npy_intp* strideptr,* innersizeptr;
@@ -171,7 +171,7 @@ NPY_KEEPORDER is desired.
PyObject *CopyArray(PyObject *arr, NPY_ORDER order)
{
NpyIter *iter;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
PyObject *op[2], *ret;
npy_uint32 flags;
npy_uint32 op_flags[2];
@@ -758,7 +758,7 @@ Construction and Destruction
.. code-block:: c
NpyIter *iter1, *iter1;
- NpyIter_IterNext_Fn iternext1, iternext2;
+ NpyIter_IterNextFunc *iternext1, *iternext2;
char **dataptrs1;
/*
@@ -930,7 +930,7 @@ Construction and Destruction
Functions For Iteration
-----------------------
-.. cfunction:: NpyIter_IterNext_Fn NpyIter_GetIterNext(NpyIter* iter, char** errmsg)
+.. cfunction:: NpyIter_IterNextFunc* NpyIter_GetIterNext(NpyIter* iter, char** errmsg)
Returns a function pointer for iteration. A specialized version
of the function pointer may be calculated by this function
@@ -948,7 +948,7 @@ Functions For Iteration
.. code-block:: c
- NpyIter_IterNext_Fn iternext = NpyIter_GetIterNext(iter, NULL);
+ NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL);
char** dataptr = NpyIter_GetDataPtrArray(iter);
do {
@@ -960,7 +960,7 @@ Functions For Iteration
.. code-block:: c
- NpyIter_IterNext_Fn iternext = NpyIter_GetIterNext(iter, NULL);
+ NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL);
char** dataptr = NpyIter_GetDataPtrArray(iter);
npy_intp* stride = NpyIter_GetInnerStrideArray(iter);
npy_intp* size_ptr = NpyIter_GetInnerLoopSizePtr(iter), size;
@@ -994,7 +994,7 @@ Functions For Iteration
/* The constructor should have buffersize passed as this value */
#define FIXED_BUFFER_SIZE 1024
- NpyIter_IterNext_Fn iternext = NpyIter_GetIterNext(iter, NULL);
+ NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL);
char **dataptr = NpyIter_GetDataPtrArray(iter);
npy_intp *stride = NpyIter_GetInnerStrideArray(iter);
npy_intp *size_ptr = NpyIter_GetInnerLoopSizePtr(iter), size;
@@ -1028,7 +1028,7 @@ Functions For Iteration
}
} while (iternext());
-.. cfunction:: NpyIter_GetCoords_Fn NpyIter_GetGetCoords(NpyIter* iter, char** errmsg)
+.. cfunction:: NpyIter_GetCoordsFunc *NpyIter_GetGetCoords(NpyIter* iter, char** errmsg)
Returns a function pointer for getting the coordinates
of the iterator. Returns NULL if the iterator does not
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 0fa146d79..d37f1ce38 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -867,8 +867,8 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *);
typedef struct NpyIter_InternalOnly NpyIter;
/* Iterator function pointers that may be specialized */
-typedef int (*NpyIter_IterNext_Fn )(NpyIter *iter);
-typedef void (*NpyIter_GetCoords_Fn )(NpyIter *iter,
+typedef int (NpyIter_IterNextFunc)(NpyIter *iter);
+typedef void (NpyIter_GetCoordsFunc)(NpyIter *iter,
npy_intp *outcoords);
/*** Global flags that may be passed to the iterator constructors ***/
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index b57f3314c..2c61744a7 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -366,7 +366,7 @@ PyArray_FillWithZero(PyArrayObject *a)
PyArray_Descr *dtype = PyArray_DESCR(a);
NpyIter *iter;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp stride, *countptr;
int needs_api;
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index 97a6fc915..93a26c1e9 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -2430,7 +2430,7 @@ PyArray_CopyAnyIntoOrdered(PyArrayObject *dst, PyArrayObject *src,
void *transferdata = NULL;
NpyIter *dst_iter, *src_iter;
- NpyIter_IterNext_Fn dst_iternext, src_iternext;
+ NpyIter_IterNextFunc *dst_iternext, *src_iternext;
char **dst_dataptr, **src_dataptr;
npy_intp dst_stride, src_stride;
npy_intp *dst_countptr, *src_countptr;
@@ -2693,7 +2693,7 @@ PyArray_CopyInto(PyArrayObject *dst, PyArrayObject *src)
npy_uint32 op_flags[2];
NpyIter *iter;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *stride;
npy_intp *countptr;
diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src
index 376e51c99..ddd38864f 100644
--- a/numpy/core/src/multiarray/einsum.c.src
+++ b/numpy/core/src/multiarray/einsum.c.src
@@ -3061,7 +3061,7 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
ret = NULL;
}
else if (NpyIter_GetIterSize(iter) != 0) {
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *stride;
npy_intp *countptr;
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 022f3d9c0..4d1621534 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -1698,7 +1698,7 @@ PyArray_CountNonzero(PyArrayObject *self)
npy_intp nonzero_count = 0;
NpyIter *iter;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *strideptr, *innersizeptr;
@@ -1783,8 +1783,8 @@ PyArray_Nonzero(PyArrayObject *self)
npy_intp *coords;
NpyIter *iter;
- NpyIter_IterNext_Fn iternext;
- NpyIter_GetCoords_Fn getcoords;
+ NpyIter_IterNextFunc *iternext;
+ NpyIter_GetCoordsFunc *getcoords;
char **dataptr;
npy_intp *innersizeptr;
diff --git a/numpy/core/src/multiarray/new_iterator.c.src b/numpy/core/src/multiarray/new_iterator.c.src
index 15380e28b..1a958182b 100644
--- a/numpy/core/src/multiarray/new_iterator.c.src
+++ b/numpy/core/src/multiarray/new_iterator.c.src
@@ -1910,7 +1910,7 @@ npyiter_iternext_sizeone(NpyIter *iter)
* This is so that the function can be called from code not holding
* the GIL.
*/
-NPY_NO_EXPORT NpyIter_IterNext_Fn
+NPY_NO_EXPORT NpyIter_IterNextFunc *
NpyIter_GetIterNext(NpyIter *iter, char **errmsg)
{
npy_uint32 itflags = NIT_ITFLAGS(iter);
@@ -2088,7 +2088,7 @@ npyiter_getcoord_itflags@tag_itflags@(NpyIter *iter, npy_intp *outcoord)
* This is so that the function can be called from code not holding
* the GIL.
*/
-NPY_NO_EXPORT NpyIter_GetCoords_Fn
+NPY_NO_EXPORT NpyIter_GetCoordsFunc *
NpyIter_GetGetCoords(NpyIter *iter, char **errmsg)
{
npy_uint32 itflags = NIT_ITFLAGS(iter);
diff --git a/numpy/core/src/multiarray/new_iterator_pywrap.c b/numpy/core/src/multiarray/new_iterator_pywrap.c
index c67100ece..8e3231d40 100644
--- a/numpy/core/src/multiarray/new_iterator_pywrap.c
+++ b/numpy/core/src/multiarray/new_iterator_pywrap.c
@@ -29,8 +29,8 @@ struct NewNpyArrayIterObject_tag {
/* Child to update for nested iteration */
NewNpyArrayIterObject *nested_child;
/* Cached values from the iterator */
- NpyIter_IterNext_Fn iternext;
- NpyIter_GetCoords_Fn getcoords;
+ NpyIter_IterNextFunc *iternext;
+ NpyIter_GetCoordsFunc *getcoords;
char **dataptrs;
PyArray_Descr **dtypes;
PyArrayObject **operands;
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 12c45b2e4..b35b57d86 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -1769,7 +1769,7 @@ iterator_loop(PyUFuncObject *self,
char *baseptrs[NPY_MAXARGS];
int needs_api;
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *stride;
npy_intp *count_ptr;
@@ -2396,7 +2396,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *self,
/* Do the ufunc loop */
if (NpyIter_GetIterSize(iter) != 0) {
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *count_ptr;
@@ -3061,7 +3061,7 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
char *dataptr_copy[3];
npy_intp stride_copy[3];
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *stride;
npy_intp *count_ptr;
@@ -3081,7 +3081,7 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
/* Execute the loop with two nested iterators */
if (iter_inner) {
/* Only UFUNC_REDUCE uses iter_inner */
- NpyIter_IterNext_Fn iternext_inner;
+ NpyIter_IterNextFunc *iternext_inner;
char **dataptr_inner;
npy_intp *stride_inner;
npy_intp count, *count_ptr_inner;
@@ -3214,7 +3214,7 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
/* Execute the loop with just the inner iterator */
if (iter_inner) {
/* Only UFUNC_REDUCE uses iter_inner */
- NpyIter_IterNext_Fn iternext_inner;
+ NpyIter_IterNextFunc *iternext_inner;
char **dataptr_inner;
npy_intp *stride_inner;
npy_intp count, *count_ptr_inner;
@@ -3606,7 +3606,7 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,
char *dataptr_copy[3];
npy_intp stride_copy[3];
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp count_m1;
npy_intp stride0, stride1;
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c
index bca2426e6..b44cfb471 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/lib/src/_compiled_base.c
@@ -765,7 +765,7 @@ arr_ravel_coords(PyObject *self, PyObject *args, PyObject *kwds)
}
if (NpyIter_GetIterSize(iter) != 0) {
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *strides;
npy_intp *countptr;
@@ -962,7 +962,7 @@ arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds)
if (order == NPY_CORDER) {
if (NpyIter_GetIterSize(iter) != 0) {
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *strides;
npy_intp *countptr, count;
@@ -989,7 +989,7 @@ arr_unravel_index(PyObject *self, PyObject *args, PyObject *kwds)
}
else if (order == NPY_FORTRANORDER) {
if (NpyIter_GetIterSize(iter) != 0) {
- NpyIter_IterNext_Fn iternext;
+ NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *strides;
npy_intp *countptr, count;