summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-02-09 17:27:34 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-02-09 17:27:34 -0700
commitca258fc430fbcba6a3824dd3834f8e14259a62c8 (patch)
tree7bce260afd14ab3bfcffc140c3d56159e3777e84 /numpy
parent096b436e6e93d09057eb415e76b1f452170db3e6 (diff)
parent87214fbfb095664e70702da421bc0df4cddd26c5 (diff)
downloadnumpy-ca258fc430fbcba6a3824dd3834f8e14259a62c8.tar.gz
Merge branch 'replace-noprefix'
* replace-noprefix: (30 commits) BUG: Fix typo npydouble. UPD: Remove now redundant typedef. UPD: Fix a few more spots missing prefixes. BUG: Fix scons build script so it works with umathmodule.c. STY: Cleanup some prefixing that crept into comments. UPD: Various fixes, Remove #define NPY_NO_PREFIX from files in core. ENH: Add some needed macros to include files. UPD: Use prefixed types in scalartypes.c.src. UPD: Make multiarray *.c files use prefixed macros. UPD: Use prefixed types in arraytypes.c.src. ENH: Add a few needed macros to npy_common.h. UPD: Include ndarrayobject.h instead of arrayobject.h in boolean_ops.c.src. UPD: Use prefixed types in lowlevel_strided_loops.c.src template headers. UPD: Use explicit prefixed types in einsum.c.src template headers. UPD: Use prefixed versions of double and int in multiarray_tests.c.src. UPD: Remove includes of noprefix.h in ufunc_object.c and _compiled_base.c. BUG: Fix unprefixed reference to cdouble in ndarrayobject.h. UPD: Use prefixed macros in numpy/core/src/scalarmathmodule.c.src. UPD: Use prefixed macros in numpy/core/src/umath/funcs.inc.src. MOV: Rename umathmodule.c.src umathmodule.c since it has no templates. ...
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/SConscript2
-rw-r--r--numpy/core/blasdot/_dotblas.c2
-rw-r--r--numpy/core/bscript3
-rw-r--r--numpy/core/include/numpy/arrayobject.h5
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h6
-rw-r--r--numpy/core/include/numpy/noprefix.h11
-rw-r--r--numpy/core/include/numpy/npy_common.h14
-rw-r--r--numpy/core/include/numpy/npy_interrupt.h18
-rw-r--r--numpy/core/setup.py5
-rw-r--r--numpy/core/src/multiarray/arrayobject.c41
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src1103
-rw-r--r--numpy/core/src/multiarray/buffer.c3
-rw-r--r--numpy/core/src/multiarray/calculation.c11
-rw-r--r--numpy/core/src/multiarray/common.c37
-rw-r--r--numpy/core/src/multiarray/conversion_utils.c147
-rw-r--r--numpy/core/src/multiarray/conversion_utils.h8
-rw-r--r--numpy/core/src/multiarray/convert.c5
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c7
-rw-r--r--numpy/core/src/multiarray/ctors.c22
-rw-r--r--numpy/core/src/multiarray/ctors.h20
-rw-r--r--numpy/core/src/multiarray/descriptor.c93
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c2
-rw-r--r--numpy/core/src/multiarray/einsum.c.src252
-rw-r--r--numpy/core/src/multiarray/flagsobject.c9
-rw-r--r--numpy/core/src/multiarray/getset.c41
-rw-r--r--numpy/core/src/multiarray/hashdescr.c2
-rw-r--r--numpy/core/src/multiarray/item_selection.c173
-rw-r--r--numpy/core/src/multiarray/iterators.c39
-rw-r--r--numpy/core/src/multiarray/iterators.h6
-rw-r--r--numpy/core/src/multiarray/lowlevel_strided_loops.c.src62
-rw-r--r--numpy/core/src/multiarray/mapping.c31
-rw-r--r--numpy/core/src/multiarray/mapping.h8
-rw-r--r--numpy/core/src/multiarray/methods.c36
-rw-r--r--numpy/core/src/multiarray/multiarray_tests.c.src22
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c39
-rw-r--r--numpy/core/src/multiarray/nditer_impl.h2
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c2
-rw-r--r--numpy/core/src/multiarray/number.c3
-rw-r--r--numpy/core/src/multiarray/numpymemoryview.c1
-rw-r--r--numpy/core/src/multiarray/numpyos.c1
-rw-r--r--numpy/core/src/multiarray/refcount.c7
-rw-r--r--numpy/core/src/multiarray/scalarapi.c17
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src334
-rw-r--r--numpy/core/src/multiarray/scalartypes.h2
-rw-r--r--numpy/core/src/multiarray/sequence.c5
-rw-r--r--numpy/core/src/multiarray/shape.c17
-rw-r--r--numpy/core/src/multiarray/ucsnarrow.c39
-rw-r--r--numpy/core/src/multiarray/usertypes.c7
-rw-r--r--numpy/core/src/npymath/ieee754.c.src2
-rw-r--r--numpy/core/src/npymath/npy_math.c.src6
-rw-r--r--numpy/core/src/npymath/npy_math_complex.c.src4
-rw-r--r--numpy/core/src/scalarmathmodule.c.src780
-rw-r--r--numpy/core/src/umath/funcs.inc.src142
-rw-r--r--numpy/core/src/umath/loops.c.src654
-rw-r--r--numpy/core/src/umath/loops.h2008
-rw-r--r--numpy/core/src/umath/loops.h.src175
-rw-r--r--numpy/core/src/umath/ufunc_object.c30
-rw-r--r--numpy/core/src/umath/umath_tests.c.src52
-rw-r--r--numpy/core/src/umath/umathmodule.c (renamed from numpy/core/src/umath/umathmodule.c.src)17
-rw-r--r--numpy/f2py/doc/multiarray/array_from_pyobj.c12
-rw-r--r--numpy/lib/src/_compiled_base.c4
-rw-r--r--numpy/linalg/lapack_litemodule.c18
62 files changed, 3585 insertions, 3041 deletions
diff --git a/numpy/core/SConscript b/numpy/core/SConscript
index 918dc5b46..9967b9465 100644
--- a/numpy/core/SConscript
+++ b/numpy/core/SConscript
@@ -386,8 +386,6 @@ boolean_ops_src = env.GenerateFromTemplate(
lowlevel_strided_loops_src = env.GenerateFromTemplate(
pjoin('src', 'multiarray', 'lowlevel_strided_loops.c.src'))
einsum_src = env.GenerateFromTemplate(pjoin('src', 'multiarray', 'einsum.c.src'))
-umathmodule_src = env.GenerateFromTemplate(pjoin('src', 'umath',
- 'umathmodule.c.src'))
umath_tests_src = env.GenerateFromTemplate(pjoin('src', 'umath',
'umath_tests.c.src'))
multiarray_tests_src = env.GenerateFromTemplate(pjoin('src', 'multiarray',
diff --git a/numpy/core/blasdot/_dotblas.c b/numpy/core/blasdot/_dotblas.c
index 23eb33436..876c5b2ac 100644
--- a/numpy/core/blasdot/_dotblas.c
+++ b/numpy/core/blasdot/_dotblas.c
@@ -3,7 +3,7 @@ static char module_doc[] =
#include "Python.h"
#include "npy_config.h"
-#include "numpy/ndarrayobject.h"
+#include "numpy/arrayobject.h"
#ifndef CBLAS_HEADER
#define CBLAS_HEADER "cblas.h"
#endif
diff --git a/numpy/core/bscript b/numpy/core/bscript
index 149ac14a3..61ee3b6c3 100644
--- a/numpy/core/bscript
+++ b/numpy/core/bscript
@@ -475,7 +475,6 @@ def pbuild(context):
name="ufunc_api")
ufunc_templates = ["src/umath/loops.c.src",
- "src/umath/umathmodule.c.src",
"src/umath/funcs.inc.src"]
bld(target="ufunc_templates", source=ufunc_templates)
@@ -485,7 +484,7 @@ def pbuild(context):
includes = ["src/umath", "src/private"]
if ENABLE_SEPARATE_COMPILATION:
- sources = [pjoin("src", "umath", "umathmodule.c.src"),
+ sources = [pjoin("src", "umath", "umathmodule.c"),
pjoin("src", "umath", "ufunc_object.c"),
pjoin("src", "umath", "loops.c.src")]
else:
diff --git a/numpy/core/include/numpy/arrayobject.h b/numpy/core/include/numpy/arrayobject.h
index f64d2a6c3..a84766f63 100644
--- a/numpy/core/include/numpy/arrayobject.h
+++ b/numpy/core/include/numpy/arrayobject.h
@@ -11,11 +11,12 @@
#ifndef Py_ARRAYOBJECT_H
#define Py_ARRAYOBJECT_H
+
#include "ndarrayobject.h"
+#include "npy_interrupt.h"
+
#ifdef NPY_NO_PREFIX
#include "noprefix.h"
#endif
-#include "npy_interrupt.h"
-
#endif
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index 028827239..af09c69cd 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -919,10 +919,10 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *);
/*
* Size of internal buffers used for alignment Make BUFSIZE a multiple
- * of sizeof(cdouble) -- usually 16 so that ufunc buffers are aligned
+ * of sizeof(npy_cdouble) -- usually 16 so that ufunc buffers are aligned
*/
-#define NPY_MIN_BUFSIZE ((int)sizeof(cdouble))
-#define NPY_MAX_BUFSIZE (((int)sizeof(cdouble))*1000000)
+#define NPY_MIN_BUFSIZE ((int)sizeof(npy_cdouble))
+#define NPY_MAX_BUFSIZE (((int)sizeof(npy_cdouble))*1000000)
#define NPY_BUFSIZE 8192
/* buffer stress test size: */
/*#define NPY_BUFSIZE 17*/
diff --git a/numpy/core/include/numpy/noprefix.h b/numpy/core/include/numpy/noprefix.h
index 8bb7a6eb2..b3e57480e 100644
--- a/numpy/core/include/numpy/noprefix.h
+++ b/numpy/core/include/numpy/noprefix.h
@@ -1,12 +1,19 @@
#ifndef NPY_NOPREFIX_H
#define NPY_NOPREFIX_H
-/* You can directly include noprefix.h as a backward
-compatibility measure*/
+/*
+ * You can directly include noprefix.h as a backward
+ * compatibility measure
+ */
#ifndef NPY_NO_PREFIX
#include "ndarrayobject.h"
+#include "npy_interrupt.h"
#endif
+#define SIGSETJMP NPY_SIGSETJMP
+#define SIGLONGJMP NPY_SIGLONGJMP
+#define SIGJMP_BUF NPY_SIGJMP_BUF
+
#define MAX_DIMS NPY_MAXDIMS
#define longlong npy_longlong
diff --git a/numpy/core/include/numpy/npy_common.h b/numpy/core/include/numpy/npy_common.h
index 118850541..4f895e0a7 100644
--- a/numpy/core/include/numpy/npy_common.h
+++ b/numpy/core/include/numpy/npy_common.h
@@ -29,8 +29,13 @@ enum {
*/
typedef Py_intptr_t npy_intp;
typedef Py_uintptr_t npy_uintp;
+#define NPY_SIZEOF_CHAR 1
+#define NPY_SIZEOF_BYTE 1
#define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T
#define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T
+#define NPY_SIZEOF_CFLOAT NPY_SIZEOF_COMPLEX_FLOAT
+#define NPY_SIZEOF_CDOUBLE NPY_SIZEOF_COMPLEX_DOUBLE
+#define NPY_SIZEOF_CLONGDOUBLE NPY_SIZEOF_COMPLEX_LONGDOUBLE
#ifdef constchar
#undef constchar
@@ -77,7 +82,7 @@ typedef Py_uintptr_t npy_uintp;
#define PyIntpArrType_Type PyLongArrType_Type
#define PyUIntpArrType_Type PyULongArrType_Type
#define NPY_MAX_INTP NPY_MAX_LONG
- #define NPY_MIN_INTP MIN_LONG
+ #define NPY_MIN_INTP NPY_MIN_LONG
#define NPY_MAX_UINTP NPY_MAX_ULONG
#define NPY_INTP_FMT "ld"
#elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG)
@@ -297,16 +302,21 @@ typedef struct { npy_longdouble real, imag; } npy_clongdouble;
#define NPY_SIZEOF_DATETIME 8
#define NPY_SIZEOF_TIMEDELTA 8
-#define NPY_BITSOF_BOOL (sizeof(npy_bool)*CHAR_BIT)
+#define NPY_BITSOF_BOOL (sizeof(npy_bool) * CHAR_BIT)
#define NPY_BITSOF_CHAR CHAR_BIT
+#define NPY_BITSOF_BYTE (NPY_SIZEOF_BYTE * CHAR_BIT)
#define NPY_BITSOF_SHORT (NPY_SIZEOF_SHORT * CHAR_BIT)
#define NPY_BITSOF_INT (NPY_SIZEOF_INT * CHAR_BIT)
#define NPY_BITSOF_LONG (NPY_SIZEOF_LONG * CHAR_BIT)
#define NPY_BITSOF_LONGLONG (NPY_SIZEOF_LONGLONG * CHAR_BIT)
+#define NPY_BITSOF_INTP (NPY_SIZEOF_INTP * CHAR_BIT)
#define NPY_BITSOF_HALF (NPY_SIZEOF_HALF * CHAR_BIT)
#define NPY_BITSOF_FLOAT (NPY_SIZEOF_FLOAT * CHAR_BIT)
#define NPY_BITSOF_DOUBLE (NPY_SIZEOF_DOUBLE * CHAR_BIT)
#define NPY_BITSOF_LONGDOUBLE (NPY_SIZEOF_LONGDOUBLE * CHAR_BIT)
+#define NPY_BITSOF_CFLOAT (NPY_SIZEOF_CFLOAT * CHAR_BIT)
+#define NPY_BITSOF_CDOUBLE (NPY_SIZEOF_CDOUBLE * CHAR_BIT)
+#define NPY_BITSOF_CLONGDOUBLE (NPY_SIZEOF_CLONGDOUBLE * CHAR_BIT)
#define NPY_BITSOF_DATETIME (NPY_SIZEOF_DATETIME * CHAR_BIT)
#define NPY_BITSOF_TIMEDELTA (NPY_SIZEOF_TIMEDELTA * CHAR_BIT)
diff --git a/numpy/core/include/numpy/npy_interrupt.h b/numpy/core/include/numpy/npy_interrupt.h
index eb72fbaf0..f71fd689e 100644
--- a/numpy/core/include/numpy/npy_interrupt.h
+++ b/numpy/core/include/numpy/npy_interrupt.h
@@ -85,22 +85,22 @@ Interrupt handling does not work well with threads.
#ifndef sigsetjmp
-#define SIGSETJMP(arg1, arg2) setjmp(arg1)
-#define SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2)
-#define SIGJMP_BUF jmp_buf
+#define NPY_SIGSETJMP(arg1, arg2) setjmp(arg1)
+#define NPY_SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2)
+#define NPY_SIGJMP_BUF jmp_buf
#else
-#define SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2)
-#define SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2)
-#define SIGJMP_BUF sigjmp_buf
+#define NPY_SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2)
+#define NPY_SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2)
+#define NPY_SIGJMP_BUF sigjmp_buf
#endif
# define NPY_SIGINT_ON { \
PyOS_sighandler_t _npy_sig_save; \
_npy_sig_save = PyOS_setsig(SIGINT, _PyArray_SigintHandler); \
- if (SIGSETJMP(*((SIGJMP_BUF *)_PyArray_GetSigintBuf()), \
+ if (NPY_SIGSETJMP(*((NPY_SIGJMP_BUF *)_PyArray_GetSigintBuf()), \
1) == 0) { \
# define NPY_SIGINT_OFF } \
@@ -109,8 +109,8 @@ Interrupt handling does not work well with threads.
#else /* NPY_NO_SIGNAL */
-# define NPY_SIGINT_ON
-# define NPY_SIGINT_OFF
+#define NPY_SIGINT_ON
+#define NPY_SIGINT_OFF
#endif /* HAVE_SIGSETJMP */
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 05872a552..61dfbf694 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -829,8 +829,7 @@ def configuration(parent_package='',top_path=None):
subpath = join('src', 'umath')
# NOTE: For manual template conversion of loops.h.src, read the note
# in that file.
- sources = [join(local_dir, subpath, 'loops.c.src'),
- join(local_dir, subpath, 'umathmodule.c.src')]
+ sources = [join(local_dir, subpath, 'loops.c.src')]
# numpy.distutils generate .c from .c.src in weird directories, we have
# to add them there as they depend on the build_dir
@@ -854,7 +853,7 @@ def configuration(parent_package='',top_path=None):
return []
umath_src = [
- join('src', 'umath', 'umathmodule.c.src'),
+ join('src', 'umath', 'umathmodule.c'),
join('src', 'umath', 'funcs.inc.src'),
join('src', 'umath', 'loops.c.src'),
join('src', 'umath', 'ufunc_object.c'),
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index 202ff6813..160fd6d3d 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -27,7 +27,6 @@ maintainer email: oliphant.travis@ieee.org
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -426,7 +425,7 @@ dump_data(char **string, int *n, int *max_n, char *data, int nd,
#define CHECK_MEMORY do { if (*n >= *max_n-16) { \
*max_n *= 2; \
- *string = (char *)_pya_realloc(*string, *max_n); \
+ *string = (char *)PyArray_realloc(*string, *max_n); \
}} while (0)
if (nd == 0) {
@@ -513,17 +512,17 @@ PyArray_DebugPrint(PyArrayObject *obj)
printf(" flags :");
if (fobj->flags & NPY_ARRAY_C_CONTIGUOUS)
- printf(" C_CONTIGUOUS");
+ printf(" NPY_C_CONTIGUOUS");
if (fobj->flags & NPY_ARRAY_F_CONTIGUOUS)
- printf(" F_CONTIGUOUS");
+ printf(" NPY_F_CONTIGUOUS");
if (fobj->flags & NPY_ARRAY_OWNDATA)
- printf(" OWNDATA");
+ printf(" NPY_OWNDATA");
if (fobj->flags & NPY_ARRAY_ALIGNED)
- printf(" ALIGNED");
+ printf(" NPY_ALIGNED");
if (fobj->flags & NPY_ARRAY_WRITEABLE)
- printf(" WRITEABLE");
+ printf(" NPY_WRITEABLE");
if (fobj->flags & NPY_ARRAY_UPDATEIFCOPY)
- printf(" UPDATEIFCOPY");
+ printf(" NPY_UPDATEIFCOPY");
if (fobj->flags & NPY_ARRAY_MASKNA)
printf(" MASKNA");
if (fobj->flags & NPY_ARRAY_OWNMASKNA)
@@ -561,7 +560,7 @@ array_repr_builtin(PyArrayObject *self, int repr)
max_n = PyArray_NBYTES(self)*4*sizeof(char) + 7;
- if ((string = (char *)_pya_malloc(max_n)) == NULL) {
+ if ((string = (char *)PyArray_malloc(max_n)) == NULL) {
return PyErr_NoMemory();
}
@@ -575,7 +574,7 @@ array_repr_builtin(PyArrayObject *self, int repr)
if (dump_data(&string, &n, &max_n, PyArray_DATA(self),
PyArray_NDIM(self), PyArray_DIMS(self),
PyArray_STRIDES(self), self) < 0) {
- _pya_free(string);
+ PyArray_free(string);
return NULL;
}
@@ -595,7 +594,7 @@ array_repr_builtin(PyArrayObject *self, int repr)
ret = PyUString_FromStringAndSize(string, n);
}
- _pya_free(string);
+ PyArray_free(string);
return ret;
}
@@ -730,7 +729,7 @@ _myunincmp(npy_ucs4 *s1, npy_ucs4 *s2, int len1, int len2)
s2t = malloc(size);
memcpy(s2t, s2, size);
}
- val = PyArray_CompareUCS4(s1t, s2t, MIN(len1,len2));
+ val = PyArray_CompareUCS4(s1t, s2t, PyArray_MIN(len1,len2));
if ((val != 0) || (len1 == len2)) {
goto finish;
}
@@ -778,7 +777,7 @@ _mystrncmp(char *s1, char *s2, int len1, int len2)
int val;
int diff;
- val = memcmp(s1, s2, MIN(len1, len2));
+ val = memcmp(s1, s2, PyArray_MIN(len1, len2));
if ((val != 0) || (len1 == len2)) {
return val;
}
@@ -927,7 +926,7 @@ _compare_strings(PyArrayObject *result, PyArrayMultiIterObject *multi,
int cmp_op, void *func, int rstrip)
{
PyArrayIterObject *iself, *iother;
- Bool *dptr;
+ npy_bool *dptr;
npy_intp size;
int val;
int N1, N2;
@@ -936,7 +935,7 @@ _compare_strings(PyArrayObject *result, PyArrayMultiIterObject *multi,
char* (*stripfunc)(char *, char *, int);
compfunc = func;
- dptr = (Bool *)PyArray_DATA(result);
+ dptr = (npy_bool *)PyArray_DATA(result);
iself = multi->iters[0];
iother = multi->iters[1];
size = multi->size;
@@ -1163,7 +1162,7 @@ _void_compare(PyArrayObject *self, PyArrayObject *other, int cmp_op)
newdims.ptr = dimensions;
newdims.len = result_ndim+1;
memcpy(dimensions, PyArray_DIMS((PyArrayObject *)temp),
- sizeof(intp)*result_ndim);
+ sizeof(npy_intp)*result_ndim);
dimensions[result_ndim] = -1;
temp2 = PyArray_Newshape((PyArrayObject *)temp,
&newdims, NPY_ANYORDER);
@@ -1415,7 +1414,7 @@ PyArray_ElementStrides(PyObject *obj)
*/
/*NUMPY_API*/
-NPY_NO_EXPORT Bool
+NPY_NO_EXPORT npy_bool
PyArray_CheckStrides(int elsize, int nd, npy_intp numbytes, npy_intp offset,
npy_intp *dims, npy_intp *newstrides)
{
@@ -1432,10 +1431,10 @@ PyArray_CheckStrides(int elsize, int nd, npy_intp numbytes, npy_intp offset,
for (i = 0; i < nd; i++) {
byte_begin = newstrides[i]*(dims[i] - 1);
if ((byte_begin < begin) || (byte_begin > end)) {
- return FALSE;
+ return NPY_FALSE;
}
}
- return TRUE;
+ return NPY_TRUE;
}
@@ -1449,7 +1448,7 @@ array_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
PyArray_Dims dims = {NULL, 0};
PyArray_Dims strides = {NULL, 0};
PyArray_Chunk buffer;
- longlong offset = 0;
+ npy_longlong offset = 0;
NPY_ORDER order = NPY_CORDER;
int is_f_order = 0;
PyArrayObject *ret;
@@ -1608,7 +1607,7 @@ array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems))
{
PyObject *obj;
/* nitems will always be 0 */
- obj = (PyObject *)_pya_malloc(NPY_SIZEOF_PYARRAYOBJECT);
+ obj = (PyObject *)PyArray_malloc(NPY_SIZEOF_PYARRAYOBJECT);
PyObject_Init(obj, type);
return obj;
}
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index 1d81be8a8..1199463a2 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -5,7 +5,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "numpy/npy_3kcompat.h"
@@ -61,8 +60,9 @@ MyPyFloat_FromHalf(npy_half h)
/**begin repeat
- * #type = long, longlong#
+ *
* #Type = Long, LongLong#
+ * #type = npy_long, npy_longlong#
*/
static @type@
MyPyLong_As@Type@ (PyObject *obj)
@@ -78,10 +78,17 @@ MyPyLong_As@Type@ (PyObject *obj)
return ret;
}
-static u@type@
+/**end repeat**/
+
+/**begin repeat
+ *
+ * #Type = Long, LongLong#
+ * #type = npy_ulong, npy_ulonglong#
+ */
+static @type@
MyPyLong_AsUnsigned@Type@ (PyObject *obj)
{
- u@type@ ret;
+ @type@ ret;
PyObject *num = PyNumber_Long(obj);
if (num == NULL) {
@@ -116,9 +123,12 @@ MyPyLong_AsUnsigned@Type@ (PyObject *obj)
* #func2 = PyObject_IsTrue, MyPyLong_AsLong*6, MyPyLong_AsUnsignedLong*2,
* MyPyLong_AsLongLong, MyPyLong_AsUnsignedLongLong,
* MyPyFloat_AsHalf, MyPyFloat_AsDouble*2#
- * #type = Bool, byte, ubyte, short, ushort, int, long, uint, ulong,
- * longlong, ulonglong, npy_half, float, double#
- * #type1 = long*7, ulong*2, longlong, ulonglong, npy_half, float, double#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int,
+ * npy_long, npy_uint, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double#
+ * #type1 = long*7, npy_ulong*2, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double#
* #kind = Bool, Byte, UByte, Short, UShort, Int, Long, UInt, ULong,
* LongLong, ULongLong, Half, Float, Double#
*/
@@ -145,8 +155,7 @@ static int
}
else if (NpyNA_Check(op) || NpyNA_IsZeroDimArrayNA(op)) {
PyErr_SetString(PyExc_ValueError,
- "Cannot assign NA to an array which "
- "does not support NAs");
+ "Cannot assign NA to an array which does not support NAs");
return -1;
}
else {
@@ -174,7 +183,7 @@ static int
/**begin repeat
*
* #TYPE = CFLOAT, CDOUBLE#
- * #type = float, double#
+ * #type = npy_float, npy_double#
*/
static PyObject *
@TYPE@_getitem(char *ip, PyArrayObject *ap) {
@@ -186,7 +195,8 @@ static PyObject *
}
else {
int size = sizeof(@type@);
- Bool swap = !PyArray_ISNOTSWAPPED(ap);
+
+ npy_bool swap = !PyArray_ISNOTSWAPPED(ap);
copy_and_swap(&t1, ip, size, 1, 0, swap);
copy_and_swap(&t2, ip + size, size, 1, 0, swap);
return PyComplex_FromDoubles((double)t1, (double)t2);
@@ -199,16 +209,17 @@ static PyObject *
/**begin repeat
*
- * #TYPE = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #type = float, double, longdouble#
+ * #NAME = CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #ftype = npy_float, npy_double, npy_longdouble#
* #kind = CFloat, CDouble, CLongDouble#
*/
static int
-@TYPE@_setitem(PyObject *op, char *ov, PyArrayObject *ap)
+@NAME@_setitem(PyObject *op, char *ov, PyArrayObject *ap)
{
Py_complex oop;
PyObject *op2;
- c@type@ temp;
+ @type@ temp;
int rsize;
if (PyArray_IsScalar(op, @kind@)){
@@ -216,8 +227,7 @@ static int
}
else if (NpyNA_Check(op) || NpyNA_IsZeroDimArrayNA(op)) {
PyErr_SetString(PyExc_ValueError,
- "Cannot assign NA to an array which "
- "does not support NAs");
+ "Cannot assign NA to an array which does not support NAs");
return -1;
}
else {
@@ -227,7 +237,8 @@ static int
(PyArrayObject *)op);
}
else {
- op2 = op; Py_INCREF(op);
+ op2 = op;
+ Py_INCREF(op);
}
if (op2 == Py_None) {
oop.real = NPY_NAN;
@@ -240,15 +251,15 @@ static int
if (PyErr_Occurred()) {
return -1;
}
- temp.real = (@type@) oop.real;
- temp.imag = (@type@) oop.imag;
+ temp.real = (@ftype@) oop.real;
+ temp.imag = (@ftype@) oop.imag;
}
memcpy(ov, &temp, PyArray_DESCR(ap)->elsize);
if (!PyArray_ISNOTSWAPPED(ap)) {
- byte_swap_vector(ov, 2, sizeof(@type@));
+ byte_swap_vector(ov, 2, sizeof(@ftype@));
}
- rsize = sizeof(@type@);
+ rsize = sizeof(@ftype@);
copy_and_swap(ov, &temp, rsize, 2, rsize, !PyArray_ISNOTSWAPPED(ap));
return 0;
}
@@ -268,25 +279,24 @@ LONGDOUBLE_getitem(char *ip, PyArrayObject *ap)
static int
LONGDOUBLE_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
/* ensure alignment */
- longdouble temp;
+ npy_longdouble temp;
if (PyArray_IsScalar(op, LongDouble)) {
temp = ((PyLongDoubleScalarObject *)op)->obval;
}
else if (NpyNA_Check(op) || NpyNA_IsZeroDimArrayNA(op)) {
PyErr_SetString(PyExc_ValueError,
- "Cannot assign NA to an array which "
- "does not support NAs");
+ "Cannot assign NA to an array which does not support NAs");
return -1;
}
else {
- temp = (longdouble) MyPyFloat_AsDouble(op);
+ temp = (npy_longdouble) MyPyFloat_AsDouble(op);
}
if (PyErr_Occurred()) {
return -1;
}
if (ap == NULL || PyArray_ISBEHAVED(ap)) {
- *((longdouble *)ov) = temp;
+ *((npy_longdouble *)ov) = temp;
}
else {
copy_and_swap(ov, &temp, PyArray_DESCR(ap)->elsize, 1, 0,
@@ -305,12 +315,12 @@ CLONGDOUBLE_getitem(char *ip, PyArrayObject *ap)
static PyObject *
UNICODE_getitem(char *ip, PyArrayObject *ap)
{
- intp elsize = PyArray_DESCR(ap)->elsize;
- intp mysize = elsize/sizeof(npy_ucs4);
+ npy_intp elsize = PyArray_DESCR(ap)->elsize;
+ npy_intp mysize = elsize/sizeof(npy_ucs4);
int alloc = 0;
npy_ucs4 *buffer = NULL;
PyUnicodeObject *obj;
- intp i;
+ npy_intp i;
if (!PyArray_ISBEHAVED_RO(ap)) {
buffer = malloc(elsize);
@@ -375,8 +385,7 @@ UNICODE_setitem(PyObject *op, char *ov, PyArrayObject *ap)
}
if (NpyNA_Check(op) || NpyNA_IsZeroDimArrayNA(op)) {
PyErr_SetString(PyExc_ValueError,
- "Cannot assign NA to an array which "
- "does not support NAs");
+ "Cannot assign NA to an array which does not support NAs");
return -1;
}
/* Sequence_Size might have returned an error */
@@ -405,7 +414,7 @@ UNICODE_setitem(PyObject *op, char *ov, PyArrayObject *ap)
datalen = PyUnicode_GET_DATA_SIZE(temp);
#ifdef Py_UNICODE_WIDE
- memcpy(ov, ptr, MIN(PyArray_DESCR(ap)->elsize, datalen));
+ memcpy(ov, ptr, PyArray_MIN(PyArray_DESCR(ap)->elsize, datalen));
#else
if (!PyArray_ISALIGNED(ap)) {
buffer = PyArray_malloc(PyArray_DESCR(ap)->elsize);
@@ -493,7 +502,9 @@ STRING_setitem(PyObject *op, char *ov, PyArrayObject *ap)
if (PyUnicode_Check(op)) {
/* Assume ASCII codec -- function similarly as Python 2 */
temp = PyUnicode_AsASCIIString(op);
- if (temp == NULL) return -1;
+ if (temp == NULL) {
+ return -1;
+ }
}
else if (PyBytes_Check(op) || PyMemoryView_Check(op)) {
temp = PyObject_Bytes(op);
@@ -523,7 +534,7 @@ STRING_setitem(PyObject *op, char *ov, PyArrayObject *ap)
Py_DECREF(temp);
return -1;
}
- memcpy(ov, ptr, MIN(PyArray_DESCR(ap)->elsize,len));
+ memcpy(ov, ptr, PyArray_MIN(PyArray_DESCR(ap)->elsize,len));
/*
* If string lenth is smaller than room in array
* Then fill the rest of the element size with NULL
@@ -609,7 +620,7 @@ VOID_getitem(char *ip, PyArrayObject *ap)
((PyArrayObject_fields *)ap)->descr = new;
/* update alignment based on offset */
if ((new->alignment > 1)
- && ((((intp)(ip+offset)) % new->alignment) != 0)) {
+ && ((((npy_intp)(ip+offset)) % new->alignment) != 0)) {
PyArray_CLEARFLAGS(ap, NPY_ARRAY_ALIGNED);
}
else {
@@ -657,12 +668,13 @@ VOID_getitem(char *ip, PyArrayObject *ap)
return NULL;
}
itemsize = PyArray_DESCR(ap)->elsize;
+
#if defined(NPY_PY3K)
/*
* Return a byte array; there are no plain buffer objects on Py3
*/
{
- intp dims[1], strides[1];
+ npy_intp dims[1], strides[1];
dims[0] = itemsize;
strides[0] = 1;
descr = PyArray_DescrNewFromType(NPY_BYTE);
@@ -688,6 +700,7 @@ VOID_getitem(char *ip, PyArrayObject *ap)
u = (PyArrayObject *)PyBuffer_FromMemory(ip, itemsize);
}
#endif
+
if (u == NULL) {
return NULL;
}
@@ -738,7 +751,7 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)
((PyArrayObject_fields *)ap)->descr = new;
/* remember to update alignment flags */
if ((new->alignment > 1)
- && ((((intp)(ip+offset)) % new->alignment) != 0)) {
+ && ((((npy_intp)(ip+offset)) % new->alignment) != 0)) {
PyArray_CLEARFLAGS(ap, NPY_ARRAY_ALIGNED);
}
else {
@@ -785,8 +798,7 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)
if (NpyNA_Check(op) || NpyNA_IsZeroDimArrayNA(op)) {
PyErr_SetString(PyExc_ValueError,
- "Cannot assign NA to an array which "
- "does not support NAs");
+ "Cannot assign NA to an array which does not support NAs");
return -1;
}
@@ -881,7 +893,8 @@ DATETIME_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
*((npy_datetime *)ov)=temp;
}
else {
- PyArray_DESCR(ap)->f->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), ap);
+ PyArray_DESCR(ap)->f->copyswap(ov, &temp,
+ !PyArray_ISNOTSWAPPED(ap), ap);
}
return 0;
@@ -932,9 +945,10 @@ TIMEDELTA_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
* #TOTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
* LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME,
* TIMEDELTA#
- * #totype = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble, datetime,
- * timedelta#
+ * #totype = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
/**begin repeat1
@@ -942,13 +956,14 @@ TIMEDELTA_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
* #FROMTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
* LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME,
* TIMEDELTA#
- * #fromtype = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble, datetime,
- * timedelta#
+ * #fromtype = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@totype@)*ip++;
@@ -959,11 +974,11 @@ static void
/**begin repeat1
*
* #FROMTYPE = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #fromtype = float, double, longdouble#
+ * #fromtype = npy_float, npy_double, npy_longdouble#
*/
static void
-@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@totype@)*ip;
@@ -980,14 +995,15 @@ static void
* #TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
* LONGLONG, ULONGLONG, LONGDOUBLE, DATETIME,
* TIMEDELTA#
- * #type = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, longdouble, datetime,
- * timedelta#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@TYPE@_to_HALF(@type@ *ip, npy_half *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@TYPE@_to_HALF(@type@ *ip, npy_half *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = npy_float_to_half((float)(*ip++));
@@ -995,8 +1011,8 @@ static void
}
static void
-HALF_to_@TYPE@(npy_half *ip, @type@ *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+HALF_to_@TYPE@(npy_half *ip, @type@ *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = (@type@)npy_half_to_float(*ip++);
@@ -1013,17 +1029,17 @@ HALF_to_@TYPE@(npy_half *ip, @type@ *op, intp n,
/**begin repeat
*
* #TYPE = FLOAT, DOUBLE, CFLOAT, CDOUBLE#
- * #type = float, double, float, double#
+ * #name = float, double, float, double#
* #itype = npy_uint32, npy_uint64, npy_uint32, npy_uint64#
* #iscomplex = 0, 0, 1, 1#
*/
static void
-@TYPE@_to_HALF(@itype@ *ip, npy_half *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@TYPE@_to_HALF(@itype@ *ip, npy_half *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op++ = npy_@type@bits_to_halfbits(*ip);
+ *op++ = npy_@name@bits_to_halfbits(*ip);
#if @iscomplex@
ip += 2;
#else
@@ -1033,11 +1049,11 @@ static void
}
static void
-HALF_to_@TYPE@(npy_half *ip, @itype@ *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+HALF_to_@TYPE@(npy_half *ip, @itype@ *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op++ = npy_halfbits_to_@type@bits(*ip++);
+ *op++ = npy_halfbits_to_@name@bits(*ip++);
#if @iscomplex@
*op++ = 0;
#endif
@@ -1047,8 +1063,8 @@ HALF_to_@TYPE@(npy_half *ip, @itype@ *op, intp n,
/**end repeat**/
static void
-CLONGDOUBLE_to_HALF(longdouble *ip, npy_half *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+CLONGDOUBLE_to_HALF(npy_longdouble *ip, npy_half *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = npy_double_to_half((double) (*ip++));
@@ -1057,8 +1073,8 @@ CLONGDOUBLE_to_HALF(longdouble *ip, npy_half *op, intp n,
}
static void
-HALF_to_CLONGDOUBLE(npy_half *ip, longdouble *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+HALF_to_CLONGDOUBLE(npy_half *ip, npy_longdouble *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
*op++ = npy_half_to_double(*ip++);
@@ -1068,43 +1084,48 @@ HALF_to_CLONGDOUBLE(npy_half *ip, longdouble *op, intp n,
/**begin repeat
*
- * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME,
- * TIMEDELTA#
- * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble, datetime,
- * timedelta#
-*/
+ * #FROMTYPE = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * FLOAT, DOUBLE, LONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #fromtype = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
+ */
static void
-@FROMTYPE@_to_BOOL(@fromtype@ *ip, Bool *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@FROMTYPE@_to_BOOL(@fromtype@ *ip, npy_bool *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op++ = (Bool)(*ip++ != FALSE);
+ *op++ = (npy_bool)(*ip++ != NPY_FALSE);
}
}
/**end repeat**/
static void
-HALF_to_BOOL(npy_half *ip, Bool *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+HALF_to_BOOL(npy_half *ip, npy_bool *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op++ = (Bool)(!npy_half_iszero(*ip++));
+ *op++ = (npy_bool)(!npy_half_iszero(*ip++));
}
}
/**begin repeat
*
* #FROMTYPE = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #fromtype = cfloat, cdouble, clongdouble#
+ * #fromtype = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@FROMTYPE@_to_BOOL(@fromtype@ *ip, Bool *op, intp n,
- PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
+@FROMTYPE@_to_BOOL(@fromtype@ *ip, npy_bool *op, npy_intp n,
+ PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE));
+ *op = (npy_bool)(((*ip).real != NPY_FALSE) ||
+ ((*ip).imag != NPY_FALSE));
op++;
ip++;
}
@@ -1112,41 +1133,47 @@ static void
/**end repeat**/
/**begin repeat
- * #TOTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, DATETIME,
- * TIMEDELTA#
- * #totype = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble, datetime,
- * timedelta#
+ * #TOTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #totype = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
* #one = 1*10, NPY_HALF_ONE, 1*5#
* #zero = 0*10, NPY_HALF_ZERO, 0*5#
*/
static void
-BOOL_to_@TOTYPE@(Bool *ip, @totype@ *op, intp n,
+BOOL_to_@TOTYPE@(npy_bool *ip, @totype@ *op, npy_intp n,
PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
- *op++ = (@totype@)((*ip++ != FALSE) ? @one@ : @zero@);
+ *op++ = (@totype@)((*ip++ != NPY_FALSE) ? @one@ : @zero@);
}
}
/**end repeat**/
/**begin repeat
*
- * #TOTYPE = CFLOAT,CDOUBLE,CLONGDOUBLE#
- * #totype = float, double, longdouble#
+ * #TOTYPE = CFLOAT, CDOUBLE,CLONGDOUBLE#
+ * #totype = npy_float, npy_double, npy_longdouble#
*/
/**begin repeat1
- * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME,
- * TIMEDELTA#
- * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble, datetime,
- * timedelta#
+ * #FROMTYPE = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * FLOAT, DOUBLE, LONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #fromtype = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n,
+@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, npy_intp n,
PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
while (n--) {
@@ -1161,15 +1188,15 @@ static void
/**begin repeat
*
* #TOTYPE = CFLOAT,CDOUBLE,CLONGDOUBLE#
- * #totype = float, double, longdouble#
+ * #totype = npy_float, npy_double, npy_longdouble#
*/
/**begin repeat1
* #FROMTYPE = CFLOAT,CDOUBLE,CLONGDOUBLE#
- * #fromtype = float, double, longdouble#
+ * #fromtype = npy_float, npy_double, npy_longdouble#
*/
static void
-@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n,
+@FROMTYPE@_to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, npy_intp n,
PyArrayObject *NPY_UNUSED(aip), PyArrayObject *NPY_UNUSED(aop))
{
n <<= 1;
@@ -1183,21 +1210,27 @@ static void
/**begin repeat
*
- * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, OBJECT,
+ * #FROMTYPE = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * STRING, UNICODE, VOID, OBJECT,
* DATETIME, TIMEDELTA#
- * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, char, char, char, PyObject *,
- * datetime, timedelta#
+ * #fromtype = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_char, npy_char, npy_char, PyObject *,
+ * npy_datetime, npy_timedelta#
* #skip = 1*18, PyArray_DESCR(aip)->elsize*3, 1*3#
*/
static void
-@FROMTYPE@_to_OBJECT(@fromtype@ *ip, PyObject **op, intp n, PyArrayObject *aip,
- PyArrayObject *NPY_UNUSED(aop))
+@FROMTYPE@_to_OBJECT(@fromtype@ *ip, PyObject **op, npy_intp n,
+ PyArrayObject *aip, PyArrayObject *NPY_UNUSED(aop))
{
- intp i;
+ npy_intp i;
int skip = @skip@;
for (i = 0; i < n; i++, ip +=skip, op++) {
Py_XDECREF(*op);
@@ -1233,21 +1266,27 @@ static void
/**begin repeat
*
- * #TOTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, DATETIME,
- * TIMEDELTA#
- * #totype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, char, char, char, datetime,
- * timedelta#
+ * #TOTYPE = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * STRING, UNICODE, VOID,
+ * DATETIME, TIMEDELTA#
+ * #totype = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_char, npy_char, npy_char,
+ * npy_datetime, npy_timedelta#
* #skip = 1*18, PyArray_DESCR(aop)->elsize*3, 1*2#
*/
static void
-OBJECT_to_@TOTYPE@(PyObject **ip, @totype@ *op, intp n,
+OBJECT_to_@TOTYPE@(PyObject **ip, @totype@ *op, npy_intp n,
PyArrayObject *_NPY_UNUSED@TOTYPE@(aip), PyArrayObject *aop)
{
- intp i;
+ npy_intp i;
int skip = @skip@;
for (i = 0; i < n; i++, ip++, op += skip) {
@@ -1265,20 +1304,34 @@ OBJECT_to_@TOTYPE@(PyObject **ip, @totype@ *op, intp n,
/**begin repeat
*
* #from = STRING*23, UNICODE*23, VOID*23#
- * #fromtyp = char*69#
- * #to = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, DATETIME, TIMEDELTA)*3#
- * #totyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, npy_half, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char, datetime, timedelta)*3#
+ * #fromtyp = npy_char*69#
+ * #to = (BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * STRING, UNICODE, VOID,
+ * DATETIME, TIMEDELTA)*3#
+ * #totyp = (npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_char, npy_char, npy_char,
+ * npy_datetime, npy_timedelta)*3#
* #oskip = 1*18,(PyArray_DESCR(aop)->elsize)*3,1*2,
* 1*18,(PyArray_DESCR(aop)->elsize)*3,1*2,
* 1*18,(PyArray_DESCR(aop)->elsize)*3,1*2#
- * #convert = 1*18, 0*3, 1*2, 1*18, 0*3, 1*2, 0*23#
+ * #convert = 1*18, 0*3, 1*2,
+ * 1*18, 0*3, 1*2,
+ * 0*23#
* #convstr = (Int*9, Long*2, Float*4, Complex*3, Tuple*3, Long*2)*3#
*/
static void
-@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,
+@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, npy_intp n, PyArrayObject *aip,
PyArrayObject *aop)
{
- intp i;
+ npy_intp i;
PyObject *temp = NULL;
int skip = PyArray_DESCR(aip)->elsize;
int oskip = @oskip@;
@@ -1321,19 +1374,25 @@ static void
/**begin repeat
*
* #to = STRING*20, UNICODE*20, VOID*20#
- * #totyp = char*20, char*20, char*20#
- * #from = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA)*3#
- * #fromtyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, datetime, timedelta)*3#
+ * #totyp = npy_char*20, npy_char*20, npy_char*20#
+ * #from = (BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * DATETIME, TIMEDELTA)*3#
+ * #fromtyp = (npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_datetime, npy_timedelta)*3#
*/
static void
-@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip,
+@from@_to_@to@(@fromtyp@ *ip, @totyp@ *op, npy_intp n, PyArrayObject *aip,
PyArrayObject *aop)
{
- intp i;
+ npy_intp i;
PyObject *temp = NULL;
int skip = 1;
int oskip = PyArray_DESCR(aop)->elsize;
@@ -1367,12 +1426,16 @@ static void
*/
/**begin repeat
- * #fname = SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG#
- * #type = short, ushort, int, uint, long, ulong, longlong, ulonglong#
- * #format = "hd", "hu", "d", "u", "ld", "lu", LONGLONG_FMT, ULONGLONG_FMT#
+ * #fname = SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG#
+ * #type = npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ * #format = "hd", "hu", "d", "u",
+ * "ld", "lu", NPY_LONGLONG_FMT, NPY_ULONGLONG_FMT#
*/
static int
-@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored))
+@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore),
+ PyArray_Descr *NPY_UNUSED(ignored))
{
return fscanf(fp, "%"@format@, ip);
}
@@ -1380,10 +1443,11 @@ static int
/**begin repeat
* #fname = FLOAT, DOUBLE, LONGDOUBLE#
- * #type = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
static int
-@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored))
+@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore),
+ PyArray_Descr *NPY_UNUSED(ignored))
{
double result;
int ret;
@@ -1395,7 +1459,8 @@ static int
/**end repeat**/
static int
-HALF_scan(FILE *fp, npy_half *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignored))
+HALF_scan(FILE *fp, npy_half *ip, void *NPY_UNUSED(ignore),
+ PyArray_Descr *NPY_UNUSED(ignored))
{
double result;
int ret;
@@ -1407,12 +1472,13 @@ HALF_scan(FILE *fp, npy_half *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_U
/**begin repeat
* #fname = BYTE, UBYTE#
- * #type = byte, ubyte#
- * #btype = int, uint#
+ * #type = npy_byte, npy_ubyte#
+ * #btype = npy_int, npy_uint#
* #format = "d", "u"#
*/
static int
-@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
+@fname@_scan(FILE *fp, @type@ *ip, void *NPY_UNUSED(ignore),
+ PyArray_Descr *NPY_UNUSED(ignore2))
{
@btype@ temp;
int num;
@@ -1424,21 +1490,25 @@ static int
/**end repeat**/
static int
-BOOL_scan(FILE *fp, Bool *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSED(ignore2))
+BOOL_scan(FILE *fp, npy_bool *ip, void *NPY_UNUSED(ignore),
+ PyArray_Descr *NPY_UNUSED(ignore2))
{
double result;
int ret;
ret = NumPyOS_ascii_ftolf(fp, &result);
- *ip = (Bool) (result != 0.0);
+ *ip = (npy_bool) (result != 0.0);
return ret;
}
/**begin repeat
- * #fname = CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID,
+ * #fname = CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, STRING, UNICODE, VOID,
* DATETIME, TIMEDELTA#
*/
+
#define @fname@_scan NULL
+
/**end repeat**/
@@ -1450,15 +1520,18 @@ BOOL_scan(FILE *fp, Bool *ip, void *NPY_UNUSED(ignore), PyArray_Descr *NPY_UNUSE
/**begin repeat
- * #fname = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG,
- * ULONGLONG, DATETIME, TIMEDELTA#
- * #type = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, datetime, timedelta#
+ * #fname = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_datetime, npy_timedelta#
* #func = (l, ul)*5, l, l#
- * #btype = (long, ulong)*5, long, long#
+ * #btype = (npy_long, npy_ulong)*5, npy_long, npy_long#
*/
static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
+@fname@_fromstr(char *str, @type@ *ip, char **endptr,
+ PyArray_Descr *NPY_UNUSED(ignore))
{
@btype@ result;
@@ -1470,11 +1543,12 @@ static int
/**begin repeat
*
- * #fname=FLOAT,DOUBLE,LONGDOUBLE#
- * #type=float,double,longdouble#
+ * #fname = FLOAT, DOUBLE, LONGDOUBLE#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
static int
-@fname@_fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
+@fname@_fromstr(char *str, @type@ *ip, char **endptr,
+ PyArray_Descr *NPY_UNUSED(ignore))
{
double result;
@@ -1485,7 +1559,8 @@ static int
/**end repeat**/
static int
-HALF_fromstr(char *str, npy_half *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
+HALF_fromstr(char *str, npy_half *ip, char **endptr,
+ PyArray_Descr *NPY_UNUSED(ignore))
{
double result;
@@ -1495,19 +1570,23 @@ HALF_fromstr(char *str, npy_half *ip, char **endptr, PyArray_Descr *NPY_UNUSED(i
}
static int
-BOOL_fromstr(char *str, Bool *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore))
+BOOL_fromstr(char *str, npy_bool *ip, char **endptr,
+ PyArray_Descr *NPY_UNUSED(ignore))
{
double result;
result = NumPyOS_ascii_strtod(str, endptr);
- *ip = (Bool) (result != 0.0);
+ *ip = (npy_bool) (result != 0.0);
return 0;
}
/**begin repeat
- * #fname = CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID#
+ * #fname = CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, STRING, UNICODE, VOID#
*/
+
#define @fname@_fromstr NULL
+
/**end repeat**/
@@ -1520,16 +1599,22 @@ BOOL_fromstr(char *str, Bool *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignor
/**begin repeat
*
- * #fname = SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT,
- * DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA#
- * #fsize = SHORT, SHORT, INT, INT, LONG, LONG, LONGLONG, LONGLONG, HALF, FLOAT,
- * DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA#
- * #type = short, ushort, int, uint, long, ulong, longlong, ulonglong, npy_half, float,
- * double, longdouble, datetime, timedelta#
+ * #fname = SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #fsize = SHORT, SHORT, INT, INT,
+ * LONG, LONG, LONGLONG, LONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride,
- intp n, int swap, void *NPY_UNUSED(arr))
+@fname@_copyswapn (void *dst, npy_intp dstride, void *src, npy_intp sstride,
+ npy_intp n, int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) {
if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -1599,8 +1684,8 @@ static void
{
int i, nn;
- b = a + (SIZEOF_@fsize@-1);
- nn = SIZEOF_@fsize@ / 2;
+ b = a + (NPY_SIZEOF_@fsize@-1);
+ nn = NPY_SIZEOF_@fsize@ / 2;
for (i = 0; i < nn; i++) {
c = *a;
*a++ = *b;
@@ -1615,12 +1700,14 @@ static void
/**begin repeat
*
- * #fname = BOOL, BYTE, UBYTE#
- * #type = Bool, byte, ubyte#
+ * #fname = BOOL,
+ * BYTE, UBYTE#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte#
*/
static void
-@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
- int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
+@fname@_copyswapn (void *dst, npy_intp dstride, void *src, npy_intp sstride,
+ npy_intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
{
if (src != NULL) {
if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) {
@@ -1635,7 +1722,8 @@ static void
}
static void
-@fname@_copyswap (void *dst, void *src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
+@fname@_copyswap (void *dst, void *src, int NPY_UNUSED(swap),
+ void *NPY_UNUSED(arr))
{
if (src != NULL) {
/* copy first if needed */
@@ -1651,12 +1739,12 @@ static void
/**begin repeat
*
* #fname = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #type = cfloat, cdouble, clongdouble#
* #fsize = FLOAT, DOUBLE, LONGDOUBLE#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@fname@_copyswapn (void *dst, intp dstride, void *src, intp sstride, intp n,
- int swap, void *NPY_UNUSED(arr))
+@fname@_copyswapn (void *dst, npy_intp dstride, void *src, npy_intp sstride,
+ npy_intp n, int swap, void *NPY_UNUSED(arr))
{
if (src != NULL) {
@@ -1671,9 +1759,9 @@ static void
}
if (swap) {
- _strided_byte_swap(dst, dstride, n, SIZEOF_@fsize@);
- _strided_byte_swap(((char *)dst + SIZEOF_@fsize@), dstride,
- n, SIZEOF_@fsize@);
+ _strided_byte_swap(dst, dstride, n, NPY_SIZEOF_@fsize@);
+ _strided_byte_swap(((char *)dst + NPY_SIZEOF_@fsize@), dstride,
+ n, NPY_SIZEOF_@fsize@);
}
}
@@ -1760,16 +1848,16 @@ static void
{
int i, nn;
- b = a + (SIZEOF_@fsize@ - 1);
- nn = SIZEOF_@fsize@ / 2;
+ b = a + (NPY_SIZEOF_@fsize@ - 1);
+ nn = NPY_SIZEOF_@fsize@ / 2;
for (i = 0; i < nn; i++) {
c = *a;
*a++ = *b;
*b-- = c;
}
a += nn / 2;
- b = a + (SIZEOF_@fsize@ - 1);
- nn = SIZEOF_@fsize@ / 2;
+ b = a + (NPY_SIZEOF_@fsize@ - 1);
+ nn = NPY_SIZEOF_@fsize@ / 2;
for (i = 0; i < nn; i++) {
c = *a;
*a++ = *b;
@@ -1783,10 +1871,11 @@ static void
/**end repeat**/
static void
-OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride,
- intp n, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
+OBJECT_copyswapn(PyObject **dst, npy_intp dstride, PyObject **src,
+ npy_intp sstride, npy_intp n, int NPY_UNUSED(swap),
+ void *NPY_UNUSED(arr))
{
- intp i;
+ npy_intp i;
if (src != NULL) {
if (__ALIGNED(dst, sizeof(PyObject **))
&& __ALIGNED(src, sizeof(PyObject **))
@@ -1823,11 +1912,13 @@ OBJECT_copyswapn (PyObject **dst, intp dstride, PyObject **src, intp sstride,
}
static void
-OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), void *NPY_UNUSED(arr))
+OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap),
+ void *NPY_UNUSED(arr))
{
if (src != NULL) {
- if (__ALIGNED(dst,sizeof(PyObject **)) && __ALIGNED(src,sizeof(PyObject **))) {
+ if (__ALIGNED(dst,sizeof(PyObject **)) &&
+ __ALIGNED(src,sizeof(PyObject **))) {
Py_XINCREF(*src);
Py_XDECREF(*dst);
*dst = *src;
@@ -1845,8 +1936,8 @@ OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), void *NPY_
/* ignore swap */
static void
-STRING_copyswapn (char *dst, intp dstride, char *src, intp sstride,
- intp n, int NPY_UNUSED(swap), PyArrayObject *arr)
+STRING_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
+ npy_intp n, int NPY_UNUSED(swap), PyArrayObject *arr)
{
if (src != NULL && arr != NULL) {
int itemsize = PyArray_DESCR(arr)->elsize;
@@ -1864,8 +1955,8 @@ STRING_copyswapn (char *dst, intp dstride, char *src, intp sstride,
/* */
static void
-VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride,
- intp n, int swap, PyArrayObject *arr)
+VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
+ npy_intp n, int swap, PyArrayObject *arr)
{
if (arr == NULL) {
return;
@@ -1992,8 +2083,8 @@ VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
static void
-UNICODE_copyswapn (char *dst, intp dstride, char *src, intp sstride,
- intp n, int swap, PyArrayObject *arr)
+UNICODE_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
+ npy_intp n, int swap, PyArrayObject *arr)
{
int itemsize;
@@ -2079,21 +2170,25 @@ UNICODE_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
/**begin repeat
*
- * #fname = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * #fname = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
* DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * datetime, timedelta#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
* #isfloat = 0*11, 1*4, 0*2#
* #nonzero = _NONZERO*11, !npy_half_iszero, _NONZERO*5#
*/
-static Bool
+static npy_bool
@fname@_nonzero (char *ip, PyArrayObject *ap)
{
if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) {
@type@ *ptmp = (@type@ *)ip;
- return (Bool) @nonzero@(*ptmp);
+ return (npy_bool) @nonzero@(*ptmp);
}
else {
/*
@@ -2107,27 +2202,27 @@ static Bool
#else
memcpy(&tmp, ip, sizeof(@type@));
#endif
- return (Bool) @nonzero@(tmp);
+ return (npy_bool) @nonzero@(tmp);
}
}
/**end repeat**/
/**begin repeat
*
- * #fname=CFLOAT,CDOUBLE,CLONGDOUBLE#
- * #type=cfloat, cdouble, clongdouble#
+ * #fname = CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
-static Bool
+static npy_bool
@fname@_nonzero (char *ip, PyArrayObject *ap)
{
if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) {
@type@ *ptmp = (@type@ *)ip;
- return (Bool) ((ptmp->real != 0) || (ptmp->imag != 0));
+ return (npy_bool) ((ptmp->real != 0) || (ptmp->imag != 0));
}
else {
@type@ tmp;
PyArray_DESCR(ap)->f->copyswap(&tmp, ip, !PyArray_ISNOTSWAPPED(ap), ap);
- return (Bool) ((tmp.real != 0) || (tmp.imag != 0));
+ return (npy_bool) ((tmp.real != 0) || (tmp.imag != 0));
}
}
/**end repeat**/
@@ -2136,32 +2231,32 @@ static Bool
#define WHITESPACE " \t\n\r\v\f"
#define WHITELEN 6
-static Bool
+static npy_bool
Py_STRING_ISSPACE(char ch)
{
char white[] = WHITESPACE;
int j;
- Bool space = FALSE;
+ npy_bool space = NPY_FALSE;
for (j = 0; j < WHITELEN; j++) {
if (ch == white[j]) {
- space = TRUE;
+ space = NPY_TRUE;
break;
}
}
return space;
}
-static Bool
+static npy_bool
STRING_nonzero (char *ip, PyArrayObject *ap)
{
int len = PyArray_DESCR(ap)->elsize;
int i;
- Bool nonz = FALSE;
+ npy_bool nonz = NPY_FALSE;
for (i = 0; i < len; i++) {
if (!Py_STRING_ISSPACE(*ip)) {
- nonz = TRUE;
+ nonz = NPY_TRUE;
break;
}
ip++;
@@ -2175,12 +2270,12 @@ STRING_nonzero (char *ip, PyArrayObject *ap)
#define PyArray_UCS4_ISSPACE(ch) Py_STRING_ISSPACE((char)ch)
#endif
-static Bool
+static npy_bool
UNICODE_nonzero (npy_ucs4 *ip, PyArrayObject *ap)
{
int len = PyArray_DESCR(ap)->elsize >> 2;
int i;
- Bool nonz = FALSE;
+ npy_bool nonz = NPY_FALSE;
char *buffer = NULL;
if ((!PyArray_ISNOTSWAPPED(ap)) || (!PyArray_ISALIGNED(ap))) {
@@ -2197,7 +2292,7 @@ UNICODE_nonzero (npy_ucs4 *ip, PyArrayObject *ap)
for (i = 0; i < len; i++) {
if (!PyArray_UCS4_ISSPACE(*ip)) {
- nonz = TRUE;
+ nonz = NPY_TRUE;
break;
}
ip++;
@@ -2206,35 +2301,35 @@ UNICODE_nonzero (npy_ucs4 *ip, PyArrayObject *ap)
return nonz;
}
-static Bool
+static npy_bool
OBJECT_nonzero (PyObject **ip, PyArrayObject *ap)
{
if (PyArray_ISALIGNED(ap)) {
if (*ip == NULL) {
- return FALSE;
+ return NPY_FALSE;
}
- return (Bool) PyObject_IsTrue(*ip);
+ return (npy_bool) PyObject_IsTrue(*ip);
}
else {
PyObject *obj;
NPY_COPY_PYOBJECT_PTR(&obj, ip);
if (obj == NULL) {
- return FALSE;
+ return NPY_FALSE;
}
- return (Bool) PyObject_IsTrue(obj);
+ return (npy_bool) PyObject_IsTrue(obj);
}
}
/*
* if we have fields, then nonzero only if all sub-fields are nonzero.
*/
-static Bool
+static npy_bool
VOID_nonzero (char *ip, PyArrayObject *ap)
{
int i;
int len;
- Bool nonz = FALSE;
+ npy_bool nonz = NPY_FALSE;
if (PyArray_HASFIELDS(ap)) {
PyArray_Descr *descr, *new;
@@ -2259,14 +2354,15 @@ VOID_nonzero (char *ip, PyArrayObject *ap)
*/
((PyArrayObject_fields *)ap)->descr = descr;
((PyArrayObject_fields *)ap)->flags = savedflags;
- if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) {
+ if ((new->alignment > 1) && !__ALIGNED(ip + offset,
+ new->alignment)) {
PyArray_CLEARFLAGS(ap, NPY_ARRAY_ALIGNED);
}
else {
PyArray_ENABLEFLAGS(ap, NPY_ARRAY_ALIGNED);
}
if (new->f->nonzero(ip+offset, ap)) {
- nonz = TRUE;
+ nonz = NPY_TRUE;
break;
}
}
@@ -2277,7 +2373,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap)
len = PyArray_DESCR(ap)->elsize;
for (i = 0; i < len; i++) {
if (*ip != '\0') {
- nonz = TRUE;
+ nonz = NPY_TRUE;
break;
}
ip++;
@@ -2298,7 +2394,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap)
/* boolean type */
static int
-BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *NPY_UNUSED(ap))
+BOOL_compare(npy_bool *ip1, npy_bool *ip2, PyArrayObject *NPY_UNUSED(ap))
{
return (*ip1 ? (*ip2 ? 0 : 1) : (*ip2 ? -1 : 0));
}
@@ -2307,10 +2403,12 @@ BOOL_compare(Bool *ip1, Bool *ip2, PyArrayObject *NPY_UNUSED(ap))
/* integer types */
/**begin repeat
- * #TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, DATETIME, TIMEDELTA#
- * #type = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, datetime, timedelta#
+ * #TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_datetime, npy_timedelta#
*/
static int
@@ -2346,7 +2444,7 @@ static int
/**begin repeat
*
* #TYPE = FLOAT, DOUBLE, LONGDOUBLE#
- * #type = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
#define LT(a,b) ((a) < (b) || ((b) != (b) && (a) ==(a)))
@@ -2425,7 +2523,7 @@ static int
HALF_compare (npy_half *pa, npy_half *pb, PyArrayObject *NPY_UNUSED(ap))
{
npy_half a = *pa, b = *pb;
- Bool a_isnan, b_isnan;
+ npy_bool a_isnan, b_isnan;
int ret;
a_isnan = npy_half_isnan(a);
@@ -2433,13 +2531,17 @@ HALF_compare (npy_half *pa, npy_half *pb, PyArrayObject *NPY_UNUSED(ap))
if (a_isnan) {
ret = b_isnan ? 0 : -1;
- } else if (b_isnan) {
+ }
+ else if (b_isnan) {
ret = 1;
- } else if(npy_half_lt_nonan(a, b)) {
+ }
+ else if(npy_half_lt_nonan(a, b)) {
ret = -1;
- } else if(npy_half_lt_nonan(b, a)) {
+ }
+ else if(npy_half_lt_nonan(b, a)) {
ret = 1;
- } else {
+ }
+ else {
ret = 0;
}
@@ -2563,10 +2665,10 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
*/
((PyArrayObject_fields *)ap)->descr = new;
swap = PyArray_ISBYTESWAPPED(ap);
- nip1 = ip1+offset;
- nip2 = ip2+offset;
+ nip1 = ip1 + offset;
+ nip2 = ip2 + offset;
if ((swap) || (new->alignment > 1)) {
- if ((swap) || (((intp)(nip1) % new->alignment) != 0)) {
+ if ((swap) || (((npy_intp)(nip1) % new->alignment) != 0)) {
/* create buffer and copy */
nip1 = PyArray_malloc(new->elsize);
if (nip1 == NULL) {
@@ -2576,26 +2678,26 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
if (swap)
new->f->copyswap(nip1, NULL, swap, ap);
}
- if ((swap) || (((intp)(nip2) % new->alignment) != 0)) {
+ if ((swap) || (((npy_intp)(nip2) % new->alignment) != 0)) {
/* copy data to a buffer */
nip2 = PyArray_malloc(new->elsize);
if (nip2 == NULL) {
- if (nip1 != ip1+offset) {
+ if (nip1 != ip1 + offset) {
PyArray_free(nip1);
}
goto finish;
}
- memcpy(nip2, ip2+offset, new->elsize);
+ memcpy(nip2, ip2 + offset, new->elsize);
if (swap)
new->f->copyswap(nip2, NULL, swap, ap);
}
}
res = new->f->compare(nip1, nip2, ap);
if ((swap) || (new->alignment > 1)) {
- if (nip1 != ip1+offset) {
+ if (nip1 != ip1 + offset) {
PyArray_free(nip1);
}
- if (nip2 != ip2+offset) {
+ if (nip2 != ip2 + offset) {
PyArray_free(nip2);
}
}
@@ -2620,12 +2722,18 @@ finish:
/**begin repeat
*
- * #fname = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * float, double, longdouble, datetime, timedelta#
+ * #fname = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
* #isfloat = 0*11, 1*7, 0*2#
* #isnan = nop*11, npy_half_isnan, npy_isnan*6, nop*2#
* #le = _LESS_THAN_OR_EQUAL*11, npy_half_le, _LESS_THAN_OR_EQUAL*8#
@@ -2633,9 +2741,10 @@ finish:
* #incr = ip++*15, ip+=2*3, ip++*2#
*/
static int
-@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
+@fname@_argmax(@type@ *ip, npy_intp n, npy_intp *max_ind,
+ PyArrayObject *NPY_UNUSED(aip))
{
- intp i;
+ npy_intp i;
@type@ mp = *ip;
#if @iscomplex@
@type@ mp_im = ip[1];
@@ -2693,12 +2802,18 @@ static int
/**begin repeat
*
- * #fname = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * float, double, longdouble, datetime, timedelta#
+ * #fname = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
* #isfloat = 0*11, 1*7, 0*2#
* #isnan = nop*11, npy_half_isnan, npy_isnan*6, nop*2#
* #le = _LESS_THAN_OR_EQUAL*11, npy_half_le, _LESS_THAN_OR_EQUAL*8#
@@ -2706,9 +2821,10 @@ static int
* #incr = ip++*15, ip+=2*3, ip++*2#
*/
static int
-@fname@_argmin(@type@ *ip, intp n, intp *min_ind, PyArrayObject *NPY_UNUSED(aip))
+@fname@_argmin(@type@ *ip, npy_intp n, npy_intp *min_ind,
+ PyArrayObject *NPY_UNUSED(aip))
{
- intp i;
+ npy_intp i;
@type@ mp = *ip;
#if @iscomplex@
@type@ mp_im = ip[1];
@@ -2767,9 +2883,10 @@ static int
#undef _LESS_THAN_OR_EQUAL
static int
-OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip))
+OBJECT_argmax(PyObject **ip, npy_intp n, npy_intp *max_ind,
+ PyArrayObject *NPY_UNUSED(aip))
{
- intp i;
+ npy_intp i;
PyObject *mp = ip[0];
*max_ind = 0;
@@ -2795,23 +2912,25 @@ OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(ai
/**begin repeat
*
* #fname = STRING, UNICODE#
- * #type = char, npy_ucs4#
+ * #type = npy_char, npy_ucs4#
*/
static int
-@fname@_argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip)
+@fname@_argmax(@type@ *ip, npy_intp n, npy_intp *max_ind, PyArrayObject *aip)
{
- intp i;
+ npy_intp i;
int elsize = PyArray_DESCR(aip)->elsize;
@type@ *mp = (@type@ *)PyArray_malloc(elsize);
- if (mp==NULL) return 0;
+ if (mp == NULL) {
+ return 0;
+ }
memcpy(mp, ip, elsize);
*max_ind = 0;
- for(i=1; i<n; i++) {
+ for (i = 1; i < n; i++) {
ip += elsize;
- if (@fname@_compare(ip,mp,aip) > 0) {
+ if (@fname@_compare(ip, mp, aip) > 0) {
memcpy(mp, ip, elsize);
- *max_ind=i;
+ *max_ind = i;
}
}
PyArray_free(mp);
@@ -2823,9 +2942,10 @@ static int
#define VOID_argmax NULL
static int
-OBJECT_argmin(PyObject **ip, intp n, intp *min_ind, PyArrayObject *NPY_UNUSED(aip))
+OBJECT_argmin(PyObject **ip, npy_intp n, npy_intp *min_ind,
+ PyArrayObject *NPY_UNUSED(aip))
{
- intp i;
+ npy_intp i;
PyObject *mp = ip[0];
*min_ind = 0;
@@ -2851,12 +2971,12 @@ OBJECT_argmin(PyObject **ip, intp n, intp *min_ind, PyArrayObject *NPY_UNUSED(ai
/**begin repeat
*
* #fname = STRING, UNICODE#
- * #type = char, npy_ucs4#
+ * #type = npy_char, npy_ucs4#
*/
static int
-@fname@_argmin(@type@ *ip, intp n, intp *min_ind, PyArrayObject *aip)
+@fname@_argmin(@type@ *ip, npy_intp n, npy_intp *min_ind, PyArrayObject *aip)
{
- intp i;
+ npy_intp i;
int elsize = PyArray_DESCR(aip)->elsize;
@type@ *mp = (@type@ *)PyArray_malloc(elsize);
@@ -2891,39 +3011,42 @@ static int
*/
static void
-BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
+BOOL_dot(char *ip1, npy_intp is1, char *ip2, npy_intp is2, char *op, npy_intp n,
void *NPY_UNUSED(ignore))
{
- Bool tmp = FALSE;
- intp i;
+ npy_bool tmp = NPY_FALSE;
+ npy_intp i;
for (i = 0; i < n; i++, ip1 += is1, ip2 += is2) {
- if ((*((Bool *)ip1) != 0) && (*((Bool *)ip2) != 0)) {
- tmp = TRUE;
+ if ((*((npy_bool *)ip1) != 0) && (*((npy_bool *)ip2) != 0)) {
+ tmp = NPY_TRUE;
break;
}
}
- *((Bool *)op) = tmp;
+ *((npy_bool *)op) = tmp;
}
/**begin repeat
*
- * #name = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,
+ * #name = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * FLOAT, DOUBLE, LONGDOUBLE,
* DATETIME, TIMEDELTA#
- * #type = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble,
- * datetime, timedelta#
- * #out = long, ulong, long, ulong, long, ulong, long, ulong,
- * longlong, ulonglong, float, double, longdouble,
- * datetime, timedelta#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
+ * #out = npy_long, npy_ulong, npy_long, npy_ulong, npy_long, npy_ulong,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@name@_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
+@name@_dot(char *ip1, npy_intp is1, char *ip2, npy_intp is2, char *op, npy_intp n,
void *NPY_UNUSED(ignore))
{
@out@ tmp = (@out@)0;
- intp i;
+ npy_intp i;
for (i = 0; i < n; i++, ip1 += is1, ip2 += is2) {
tmp += (@out@)(*((@type@ *)ip1)) *
@@ -2950,13 +3073,13 @@ HALF_dot(char *ip1, npy_intp is1, char *ip2, npy_intp is2, char *op, npy_intp n,
/**begin repeat
*
* #name = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #type = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
-static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,
- char *op, intp n, void *NPY_UNUSED(ignore))
+static void @name@_dot(char *ip1, npy_intp is1, char *ip2, npy_intp is2,
+ char *op, npy_intp n, void *NPY_UNUSED(ignore))
{
@type@ tmpr = (@type@)0.0, tmpi=(@type@)0.0;
- intp i;
+ npy_intp i;
for (i = 0; i < n; i++, ip1 += is1, ip2 += is2) {
tmpr += ((@type@ *)ip1)[0] * ((@type@ *)ip2)[0]
@@ -2970,7 +3093,7 @@ static void @name@_dot(char *ip1, intp is1, char *ip2, intp is2,
/**end repeat**/
static void
-OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
+OBJECT_dot(char *ip1, npy_intp is1, char *ip2, npy_intp is2, char *op, npy_intp n,
void *NPY_UNUSED(ignore))
{
/*
@@ -2978,7 +3101,7 @@ OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
* BEHAVED before getting to this point, so unaligned pointers aren't
* handled here.
*/
- intp i;
+ npy_intp i;
PyObject *tmp1, *tmp2, *tmp = NULL;
PyObject **tmp3;
for (i = 0; i < n; i++, ip1 += is1, ip2 += is2) {
@@ -3024,9 +3147,9 @@ OBJECT_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n,
/* this requires buffer to be filled with objects or NULL */
static void
-OBJECT_fill(PyObject **buffer, intp length, void *NPY_UNUSED(ignored))
+OBJECT_fill(PyObject **buffer, npy_intp length, void *NPY_UNUSED(ignored))
{
- intp i;
+ npy_intp i;
PyObject *start = buffer[0];
PyObject *delta = buffer[1];
PyObject *second;
@@ -3058,19 +3181,21 @@ finish:
/**begin repeat
*
- * #NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,
+ * #NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * FLOAT, DOUBLE, LONGDOUBLE,
* DATETIME, TIMEDELTA#
- * #typ = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, float, double, longdouble,
- * datetime, timedelta#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored))
+@NAME@_fill(@type@ *buffer, npy_intp length, void *NPY_UNUSED(ignored))
{
- intp i;
- @typ@ start = buffer[0];
- @typ@ delta = buffer[1];
+ npy_intp i;
+ @type@ start = buffer[0];
+ @type@ delta = buffer[1];
delta -= start;
for (i = 2; i < length; ++i) {
@@ -3095,14 +3220,14 @@ HALF_fill(npy_half *buffer, npy_intp length, void *NPY_UNUSED(ignored))
/**begin repeat
*
* #NAME = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #typ = cfloat, cdouble, clongdouble#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@NAME@_fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignore))
+@NAME@_fill(@type@ *buffer, npy_intp length, void *NPY_UNUSED(ignore))
{
- intp i;
- @typ@ start;
- @typ@ delta;
+ npy_intp i;
+ @type@ start;
+ @type@ delta;
start.real = buffer->real;
start.imag = buffer->imag;
@@ -3121,9 +3246,10 @@ static void
/* this requires buffer to be filled with objects or NULL */
static void
-OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *NPY_UNUSED(ignored))
+OBJECT_fillwithscalar(PyObject **buffer, npy_intp length, PyObject **value,
+ void *NPY_UNUSED(ignored))
{
- intp i;
+ npy_intp i;
PyObject *val = *value;
for (i = 0; i < length; i++) {
Py_XDECREF(buffer[i]);
@@ -3134,10 +3260,11 @@ OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *NP
/**begin repeat
*
* #NAME = BOOL, BYTE, UBYTE#
- * #typ = Bool, byte, ubyte#
+ * #type = npy_bool, npy_byte, npy_ubyte#
*/
static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
+@NAME@_fillwithscalar(@type@ *buffer, npy_intp length, @type@ *value,
+ void *NPY_UNUSED(ignored))
{
memset(buffer, *value, length);
}
@@ -3145,18 +3272,23 @@ static void
/**begin repeat
*
- * #NAME = SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG,
- * HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * #NAME = SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
* DATETIME, TIMEDELTA#
- * #typ = short, ushort, int, uint, long, ulong, longlong, ulonglong,
- * npy_half, float, double, longdouble, cfloat, cdouble, clongdouble,
- * datetime, timedelta#
+ * #type = npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@NAME@_fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored))
+@NAME@_fillwithscalar(@type@ *buffer, npy_intp length, @type@ *value,
+ void *NPY_UNUSED(ignored))
{
- intp i;
- @typ@ val = *value;
+ npy_intp i;
+ @type@ val = *value;
for (i = 0; i < length; ++i) {
buffer[i] = val;
@@ -3173,28 +3305,34 @@ static void
#define _LESS_THAN(a, b) ((a) < (b))
#define _GREATER_THAN(a, b) ((a) > (b))
+
/*
* In fastclip, 'b' was already checked for NaN, so the half comparison
* only needs to check 'a' for NaN.
*/
+
#define _HALF_LESS_THAN(a, b) (!npy_half_isnan(a) && npy_half_lt_nonan(a, b))
#define _HALF_GREATER_THAN(a, b) (!npy_half_isnan(a) && npy_half_lt_nonan(b, a))
/**begin repeat
*
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
* DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * datetime, timedelta#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_datetime, npy_timedelta#
* #isfloat = 0*11, 1*4, 0*2#
* #isnan = nop*11, npy_half_isnan, npy_isnan*3, nop*2#
* #lt = _LESS_THAN*11, _HALF_LESS_THAN, _LESS_THAN*5#
* #gt = _GREATER_THAN*11, _HALF_GREATER_THAN, _GREATER_THAN*5#
*/
static void
-@name@_fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out)
+@name@_fastclip(@type@ *in, npy_intp ni, @type@ *min, @type@ *max, @type@ *out)
{
npy_intp i;
@type@ max_val = 0, min_val = 0;
@@ -3257,10 +3395,10 @@ static void
/**begin repeat
*
* #name = CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #type = cfloat, cdouble, clongdouble#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@name@_fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out)
+@name@_fastclip(@type@ *in, npy_intp ni, @type@ *min, @type@ *max, @type@ *out)
{
npy_intp i;
@type@ max_val, min_val;
@@ -3313,15 +3451,21 @@ static void
/**begin repeat
*
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, datetime, timedelta#
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_bool, npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_datetime, npy_timedelta#
*/
static void
-@name@_fastputmask(@type@ *in, Bool *mask, intp ni, @type@ *vals, intp nv)
+@name@_fastputmask(@type@ *in, npy_bool *mask, npy_intp ni, @type@ *vals,
+ npy_intp nv)
{
npy_intp i;
@type@ s_val;
@@ -3357,20 +3501,26 @@ static void
/**begin repeat
*
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, datetime, timedelta#
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * DATETIME, TIMEDELTA#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble,
+ * npy_datetime, npy_timedelta#
*/
static int
-@name@_fasttake(@type@ *dest, @type@ *src, intp *indarray,
- intp nindarray, intp n_outer,
- intp m_middle, intp nelem,
+@name@_fasttake(@type@ *dest, @type@ *src, npy_intp *indarray,
+ npy_intp nindarray, npy_intp n_outer,
+ npy_intp m_middle, npy_intp nelem,
NPY_CLIPMODE clipmode)
{
- intp i, j, k, tmp;
+ npy_intp i, j, k, tmp;
switch(clipmode) {
case NPY_RAISE:
@@ -3378,15 +3528,15 @@ static int
for (j = 0; j < m_middle; j++) {
tmp = indarray[j];
if (tmp < 0) {
- tmp = tmp+nindarray;
+ tmp = tmp + nindarray;
}
if ((tmp < 0) || (tmp >= nindarray)) {
PyErr_SetString(PyExc_IndexError,
- "index out of range for array");
+ "index out of range for array");
return 1;
}
if (nelem == 1) {
- *dest++ = *(src+tmp);
+ *dest++ = *(src + tmp);
}
else {
for (k = 0; k < nelem; k++) {
@@ -3434,7 +3584,7 @@ static int
tmp = nindarray - 1;
}
if (nelem == 1) {
- *dest++ = *(src+tmp);
+ *dest++ = *(src + tmp);
}
else {
for (k = 0; k < nelem; k++) {
@@ -3478,7 +3628,7 @@ static int
* #align = char, char, npy_ucs4#
* #NAME = Void, String, Unicode#
* #endian = |, |, =#
-*/
+ */
static PyArray_ArrFuncs _Py@NAME@_ArrFuncs = {
{
(PyArray_VectorUnaryFunc*)@from@_to_BOOL,
@@ -3568,26 +3718,42 @@ static PyArray_Descr @from@_Descr = {
/**begin repeat
*
- * #from = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, DATETIME, TIMEDELTA#
- * #suff = bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, half, float, double, longdouble,
- * cfloat, cdouble, clongdouble, object, datetime, timedelta#
+ * #from = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, DATETIME, TIMEDELTA#
+ * #suff = bool,
+ * byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble,
+ * object, datetime, timedelta#
* #sort = 1*18, 0*3#
* #num = 1*15, 2*3, 1*3#
- * #fromtyp = Bool, byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, npy_half, float, double, longdouble,
- * float, double, longdouble, PyObject *, datetime, timedelta#
- * #NAME = Bool, Byte, UByte, Short, UShort, Int, UInt, Long, ULong,
- * LongLong, ULongLong, Half, Float, Double, LongDouble,
- * CFloat, CDouble, CLongDouble, Object, Datetime, Timedelta#
- * #kind = GENBOOL, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED,
- * SIGNED, UNSIGNED, FLOATING, FLOATING, FLOATING, FLOATING,
- * COMPLEX, COMPLEX, COMPLEX, OBJECT, DATETIME, TIMEDELTA#
+ * #fromtype = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble,
+ * PyObject *, npy_datetime, npy_timedelta#
+ * #NAME = Bool,
+ * Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble,
+ * Object, Datetime, Timedelta#
+ * #kind = GENBOOL,
+ * SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED,
+ * SIGNED, UNSIGNED, SIGNED, UNSIGNED,
+ * FLOATING, FLOATING, FLOATING, FLOATING,
+ * COMPLEX, COMPLEX, COMPLEX,
+ * OBJECT, DATETIME, TIMEDELTA#
* #endian = |*3, =*15, |, =*2#
* #isobject= 0*18,NPY_OBJECT_DTYPE_FLAGS,0*2#
*/
+
static PyArray_ArrFuncs _Py@NAME@_ArrFuncs = {
{
(PyArray_VectorUnaryFunc*)@from@_to_BOOL,
@@ -3664,8 +3830,8 @@ NPY_NO_EXPORT PyArray_Descr @from@_Descr = {
'@endian@',
@isobject@,
NPY_@from@,
- @num@*sizeof(@fromtyp@),
- _ALIGN(@fromtyp@),
+ @num@*sizeof(@fromtype@),
+ _ALIGN(@fromtype@),
NULL,
NULL,
NULL,
@@ -3804,18 +3970,26 @@ set_typeinfo(PyObject *dict)
PyArray_Descr *dtype;
PyObject *cobj, *key;
- /* Add cast functions for the new types */
-/**begin repeat
- *
- * #name1 = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT,
- * LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID,
- * DATETIME,TIMEDELTA#
- */
-/**begin repeat1
- *
- * #name2 = HALF, DATETIME, TIMEDELTA#
- */
+ /*
+ * Add cast functions for the new types
+ */
+
+ /**begin repeat
+ *
+ * #name1 = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, STRING, UNICODE, VOID,
+ * DATETIME,TIMEDELTA#
+ */
+
+ /**begin repeat1
+ *
+ * #name2 = HALF, DATETIME, TIMEDELTA#
+ */
+
dtype = _builtin_descrs[NPY_@name1@];
if (dtype->f->castdict == NULL) {
dtype->f->castdict = PyDict_New();
@@ -3839,32 +4013,46 @@ set_typeinfo(PyObject *dict)
}
Py_DECREF(key);
Py_DECREF(cobj);
-/**end repeat1**/
-/**end repeat**/
+
+ /**end repeat1**/
+
+ /**end repeat**/
for (i = 0; i < _MAX_LETTER; i++) {
_letter_to_num[i] = NPY_NTYPES;
}
-/**begin repeat
- *
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, INTP, UINTP,
- * LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID,
- * DATETIME,TIMEDELTA#
- */
+ /**begin repeat
+ *
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * INTP, UINTP,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, STRING, UNICODE, VOID,
+ * DATETIME,TIMEDELTA#
+ */
+
_letter_to_num[NPY_@name@LTR] = NPY_@name@;
-/**end repeat**/
+
+ /**end repeat**/
+
_letter_to_num[NPY_STRINGLTR2] = NPY_STRING;
-/**begin repeat
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT,
- * LONG, ULONG, LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE, OBJECT, STRING, UNICODE, VOID,
- * DATETIME, TIMEDELTA#
-*/
+ /**begin repeat
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE,
+ * OBJECT, STRING, UNICODE, VOID,
+ * DATETIME, TIMEDELTA#
+ */
+
@name@_Descr.fields = Py_None;
-/**end repeat**/
+
+ /**end repeat**/
/* Set a dictionary with type information */
infodict = PyDict_New();
@@ -3873,27 +4061,41 @@ set_typeinfo(PyObject *dict)
#define BITSOF_INTP CHAR_BIT*SIZEOF_PY_INTPTR_T
#define BITSOF_BYTE CHAR_BIT
-/**begin repeat
- *
- * #name = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, INTP, UINTP,
- * LONG, ULONG, LONGLONG, ULONGLONG#
- * #uname = BOOL, BYTE*2, SHORT*2, INT*2, INTP*2, LONG*2, LONGLONG*2#
- * #Name = Bool, Byte, UByte, Short, UShort, Int, UInt, Intp, UIntp,
- * Long, ULong, LongLong, ULongLong#
- * #type = Bool, byte, ubyte, short, ushort, int, uint, intp, uintp,
- * long, ulong, longlong, ulonglong#
- * #max= 1, MAX_BYTE, MAX_UBYTE, MAX_SHORT, MAX_USHORT, MAX_INT,
- * PyLong_FromUnsignedLong(MAX_UINT), PyLong_FromLongLong((longlong) MAX_INTP),
- * PyLong_FromUnsignedLongLong((ulonglong) MAX_UINTP), MAX_LONG,
- * PyLong_FromUnsignedLong((unsigned long) MAX_ULONG),
- * PyLong_FromLongLong((longlong) MAX_LONGLONG),
- * PyLong_FromUnsignedLongLong((ulonglong) MAX_ULONGLONG)#
- * #min = 0, MIN_BYTE, 0, MIN_SHORT, 0, MIN_INT, 0,
- * PyLong_FromLongLong((longlong) MIN_INTP), 0, MIN_LONG, 0,
- * PyLong_FromLongLong((longlong) MIN_LONGLONG),0#
- * #cx = i*6, N, N, N, l, N, N, N#
- * #cn = i*7, N, i, l, i, N, i#
-*/
+ /**begin repeat
+ *
+ * #name = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * INTP, UINTP,
+ * LONG, ULONG, LONGLONG, ULONGLONG#
+ * #uname = BOOL,
+ * BYTE*2, SHORT*2, INT*2,
+ * INTP*2,
+ * LONG*2, LONGLONG*2#
+ * #Name = Bool,
+ * Byte, UByte, Short, UShort, Int, UInt,
+ * Intp, UIntp,
+ * Long, ULong, LongLong, ULongLong#
+ * #type = npy_bool,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_intp, npy_uintp,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ * #max= 1,
+ * NPY_MAX_BYTE, NPY_MAX_UBYTE, NPY_MAX_SHORT,
+ * NPY_MAX_USHORT, NPY_MAX_INT, PyLong_FromUnsignedLong(NPY_MAX_UINT),
+ * PyLong_FromLongLong((npy_longlong) NPY_MAX_INTP),
+ * PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_UINTP),
+ * NPY_MAX_LONG,
+ * PyLong_FromUnsignedLong((npy_ulong) NPY_MAX_ULONG),
+ * PyLong_FromLongLong((npy_longlong) NPY_MAX_LONGLONG),
+ * PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_ULONGLONG)#
+ * #min = 0, NPY_MIN_BYTE, 0, NPY_MIN_SHORT, 0, NPY_MIN_INT, 0,
+ * PyLong_FromLongLong((npy_longlong) NPY_MIN_INTP),
+ * 0, NPY_MIN_LONG, 0,
+ * PyLong_FromLongLong((npy_longlong) NPY_MIN_LONGLONG), 0#
+ * #cx = i*6, N, N, N, l, N, N, N#
+ * #cn = i*7, N, i, l, i, N, i#
+ */
+
PyDict_SetItemString(infodict, "@name@",
#if defined(NPY_PY3K)
s = Py_BuildValue("Ciii@cx@@cn@O",
@@ -3902,24 +4104,26 @@ set_typeinfo(PyObject *dict)
#endif
NPY_@name@LTR,
NPY_@name@,
- BITSOF_@uname@,
+ NPY_BITSOF_@uname@,
_ALIGN(@type@),
@max@,
@min@,
(PyObject *) &Py@Name@ArrType_Type));
Py_DECREF(s);
-/**end repeat**/
-#define BITSOF_CFLOAT 2*BITSOF_FLOAT
-#define BITSOF_CDOUBLE 2*BITSOF_DOUBLE
-#define BITSOF_CLONGDOUBLE 2*BITSOF_LONGDOUBLE
+ /**end repeat**/
+
+
+ /**begin repeat
+ *
+ * #type = npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #name = HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #Name = Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ */
-/**begin repeat
- *
- * #type = npy_half, float, double, longdouble, cfloat, cdouble, clongdouble#
- * #name = HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #Name = Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#
- */
PyDict_SetItemString(infodict, "@name@",
#if defined(NPY_PY3K)
s = Py_BuildValue("CiiiO", NPY_@name@LTR,
@@ -3927,11 +4131,12 @@ set_typeinfo(PyObject *dict)
s = Py_BuildValue("ciiiO", NPY_@name@LTR,
#endif
NPY_@name@,
- BITSOF_@name@,
+ NPY_BITSOF_@name@,
_ALIGN(@type@),
(PyObject *) &Py@Name@ArrType_Type));
Py_DECREF(s);
-/**end repeat**/
+
+ /**end repeat**/
PyDict_SetItemString(infodict, "OBJECT",
#if defined(NPY_PY3K)
@@ -3986,8 +4191,8 @@ set_typeinfo(PyObject *dict)
NPY_DATETIME,
sizeof(npy_datetime) * CHAR_BIT,
_ALIGN(npy_datetime),
- MyPyLong_FromInt64(MAX_DATETIME),
- MyPyLong_FromInt64(MIN_DATETIME),
+ MyPyLong_FromInt64(NPY_MAX_DATETIME),
+ MyPyLong_FromInt64(NPY_MIN_DATETIME),
(PyObject *) &PyDatetimeArrType_Type));
Py_DECREF(s);
PyDict_SetItemString(infodict, "TIMEDELTA",
@@ -3999,8 +4204,8 @@ set_typeinfo(PyObject *dict)
NPY_TIMEDELTA,
sizeof(npy_timedelta) * CHAR_BIT,
_ALIGN(npy_timedelta),
- MyPyLong_FromInt64(MAX_TIMEDELTA),
- MyPyLong_FromInt64(MIN_TIMEDELTA),
+ MyPyLong_FromInt64(NPY_MAX_TIMEDELTA),
+ MyPyLong_FromInt64(NPY_MIN_TIMEDELTA),
(PyObject *)&PyTimedeltaArrType_Type));
Py_DECREF(s);
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index 11bf711f1..7f526b380 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -338,7 +337,7 @@ _buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str,
if (is_native_only_type) {
/* It's not possible to express native-only data types
- in non-native byte orders */
+ in non-native npy_byte orders */
PyErr_Format(PyExc_ValueError,
"cannot expose native-only dtype '%c' in "
"non-native byte order '%c' via buffer interface",
diff --git a/numpy/core/src/multiarray/calculation.c b/numpy/core/src/multiarray/calculation.c
index b993ea3ec..2b6697661 100644
--- a/numpy/core/src/multiarray/calculation.c
+++ b/numpy/core/src/multiarray/calculation.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_config.h"
@@ -56,7 +55,7 @@ PyArray_ArgMax(PyArrayObject *op, int axis, PyArrayObject *out)
*/
if (axis != PyArray_NDIM(ap)-1) {
PyArray_Dims newaxes;
- npy_intp dims[MAX_DIMS];
+ npy_intp dims[NPY_MAXDIMS];
int j;
newaxes.ptr = dims;
@@ -155,8 +154,8 @@ PyArray_ArgMin(PyArrayObject *op, int axis, PyArrayObject *out)
PyArrayObject *ap = NULL, *rp = NULL;
PyArray_ArgFunc* arg_func;
char *ip;
- intp *rptr;
- intp i, n, m;
+ npy_intp *rptr;
+ npy_intp i, n, m;
int elsize;
NPY_BEGIN_THREADS_DEF;
@@ -169,7 +168,7 @@ PyArray_ArgMin(PyArrayObject *op, int axis, PyArrayObject *out)
*/
if (axis != PyArray_NDIM(ap)-1) {
PyArray_Dims newaxes;
- intp dims[MAX_DIMS];
+ npy_intp dims[NPY_MAXDIMS];
int i;
newaxes.ptr = dims;
@@ -237,7 +236,7 @@ PyArray_ArgMin(PyArrayObject *op, int axis, PyArrayObject *out)
NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap));
n = PyArray_SIZE(ap)/m;
- rptr = (intp *)PyArray_DATA(rp);
+ rptr = (npy_intp *)PyArray_DATA(rp);
for (ip = PyArray_DATA(ap), i = 0; i < n; i++, ip += elsize*m) {
arg_func(ip, m, rptr, ap);
rptr += 1;
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index 1d3948bf6..5015a575f 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -3,7 +3,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_config.h"
@@ -372,7 +371,7 @@ _array_typedescr_fromstr(char *str)
size = atoi(str + 1);
switch (typechar) {
case 'b':
- if (size == sizeof(Bool)) {
+ if (size == sizeof(npy_bool)) {
type_num = NPY_BOOL;
}
else {
@@ -381,7 +380,7 @@ _array_typedescr_fromstr(char *str)
}
break;
case 'u':
- if (size == sizeof(uintp)) {
+ if (size == sizeof(npy_uintp)) {
type_num = NPY_UINTP;
}
else if (size == sizeof(char)) {
@@ -390,13 +389,13 @@ _array_typedescr_fromstr(char *str)
else if (size == sizeof(short)) {
type_num = NPY_USHORT;
}
- else if (size == sizeof(ulong)) {
+ else if (size == sizeof(npy_ulong)) {
type_num = NPY_ULONG;
}
else if (size == sizeof(int)) {
type_num = NPY_UINT;
}
- else if (size == sizeof(ulonglong)) {
+ else if (size == sizeof(npy_ulonglong)) {
type_num = NPY_ULONGLONG;
}
else {
@@ -405,7 +404,7 @@ _array_typedescr_fromstr(char *str)
}
break;
case 'i':
- if (size == sizeof(intp)) {
+ if (size == sizeof(npy_intp)) {
type_num = NPY_INTP;
}
else if (size == sizeof(char)) {
@@ -420,7 +419,7 @@ _array_typedescr_fromstr(char *str)
else if (size == sizeof(int)) {
type_num = NPY_INT;
}
- else if (size == sizeof(longlong)) {
+ else if (size == sizeof(npy_longlong)) {
type_num = NPY_LONGLONG;
}
else {
@@ -435,7 +434,7 @@ _array_typedescr_fromstr(char *str)
else if (size == sizeof(double)) {
type_num = NPY_DOUBLE;
}
- else if (size == sizeof(longdouble)) {
+ else if (size == sizeof(npy_longdouble)) {
type_num = NPY_LONGDOUBLE;
}
else {
@@ -450,7 +449,7 @@ _array_typedescr_fromstr(char *str)
else if (size == sizeof(double)*2) {
type_num = NPY_CDOUBLE;
}
- else if (size == sizeof(longdouble)*2) {
+ else if (size == sizeof(npy_longdouble)*2) {
type_num = NPY_CLONGDOUBLE;
}
else {
@@ -504,9 +503,9 @@ _array_typedescr_fromstr(char *str)
}
NPY_NO_EXPORT char *
-index2ptr(PyArrayObject *mp, intp i)
+index2ptr(PyArrayObject *mp, npy_intp i)
{
- intp dim0;
+ npy_intp dim0;
if (PyArray_NDIM(mp) == 0) {
PyErr_SetString(PyExc_IndexError, "0-d arrays can't be indexed");
@@ -539,7 +538,7 @@ _zerofill(PyArrayObject *ret)
}
}
else {
- intp n = PyArray_NBYTES(ret);
+ npy_intp n = PyArray_NBYTES(ret);
memset(PyArray_DATA(ret), 0, n);
}
return 0;
@@ -549,7 +548,7 @@ NPY_NO_EXPORT int
_IsAligned(PyArrayObject *ap)
{
int i, alignment, aligned = 1;
- intp ptr;
+ npy_intp ptr;
/* The special casing for STRING and VOID types was removed
* in accordance with http://projects.scipy.org/numpy/ticket/1227
@@ -562,7 +561,7 @@ _IsAligned(PyArrayObject *ap)
if (alignment == 1) {
return 1;
}
- ptr = (intp) PyArray_DATA(ap);
+ ptr = (npy_intp) PyArray_DATA(ap);
aligned = (ptr % alignment) == 0;
for (i = 0; i < PyArray_NDIM(ap); i++) {
aligned &= ((PyArray_STRIDES(ap)[i] % alignment) == 0);
@@ -570,7 +569,7 @@ _IsAligned(PyArrayObject *ap)
return aligned != 0;
}
-NPY_NO_EXPORT Bool
+NPY_NO_EXPORT npy_bool
_IsWriteable(PyArrayObject *ap)
{
PyObject *base=PyArray_BASE(ap);
@@ -579,7 +578,7 @@ _IsWriteable(PyArrayObject *ap)
/* If we own our own data, then no-problem */
if ((base == NULL) || (PyArray_FLAGS(ap) & NPY_ARRAY_OWNDATA)) {
- return TRUE;
+ return NPY_TRUE;
}
/*
* Get to the final base object
@@ -607,10 +606,10 @@ _IsWriteable(PyArrayObject *ap)
* -- could be abused --
*/
if (PyString_Check(base)) {
- return TRUE;
+ return NPY_TRUE;
}
if (PyObject_AsWriteBuffer(base, &dummy, &n) < 0) {
- return FALSE;
+ return NPY_FALSE;
}
- return TRUE;
+ return NPY_TRUE;
}
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index 35595005c..232dacbb4 100644
--- a/numpy/core/src/multiarray/conversion_utils.c
+++ b/numpy/core/src/multiarray/conversion_utils.c
@@ -4,10 +4,9 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
-#include "numpy/ndarrayobject.h"
+#include "numpy/arrayobject.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
@@ -41,15 +40,15 @@ PyArray_Converter(PyObject *object, PyObject **address)
if (PyArray_Check(object) && !PyArray_HASMASKNA((PyArrayObject *)object)) {
*address = object;
Py_INCREF(object);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
*address = PyArray_FromAny(object, NULL, 0, 0,
NPY_ARRAY_CARRAY, NULL);
if (*address == NULL) {
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
}
@@ -72,15 +71,15 @@ PyArray_AllowNAConverter(PyObject *object, PyObject **address)
if (PyArray_Check(object)) {
*address = object;
Py_INCREF(object);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
*address = PyArray_FromAny(object, NULL, 0, 0,
NPY_ARRAY_CARRAY | NPY_ARRAY_ALLOWNA, NULL);
if (*address == NULL) {
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
}
@@ -93,7 +92,7 @@ PyArray_OutputConverter(PyObject *object, PyArrayObject **address)
{
if (object == NULL || object == Py_None) {
*address = NULL;
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyArray_Check(object)) {
if (PyArray_HASMASKNA((PyArrayObject *)object)) {
@@ -101,16 +100,16 @@ PyArray_OutputConverter(PyObject *object, PyArrayObject **address)
"this operation does not yet support output "
"arrays with NA support");
*address = NULL;
- return PY_FAIL;
+ return NPY_FAIL;
}
*address = (PyArrayObject *)object;
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
PyErr_SetString(PyExc_TypeError,
"output must be an array");
*address = NULL;
- return PY_FAIL;
+ return NPY_FAIL;
}
}
@@ -123,17 +122,17 @@ PyArray_OutputAllowNAConverter(PyObject *object, PyArrayObject **address)
{
if (object == NULL || object == Py_None) {
*address = NULL;
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyArray_Check(object)) {
*address = (PyArrayObject *)object;
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
PyErr_SetString(PyExc_TypeError,
"output must be an array");
*address = NULL;
- return PY_FAIL;
+ return NPY_FAIL;
}
}
@@ -155,7 +154,7 @@ PyArray_IntpConverter(PyObject *obj, PyArray_Dims *seq)
seq->ptr = NULL;
seq->len = 0;
if (obj == Py_None) {
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
len = PySequence_Size(obj);
if (len == -1) {
@@ -167,18 +166,18 @@ PyArray_IntpConverter(PyObject *obj, PyArray_Dims *seq)
if (len < 0) {
PyErr_SetString(PyExc_TypeError,
"expected sequence object with len >= 0");
- return PY_FAIL;
+ return NPY_FAIL;
}
if (len > NPY_MAXDIMS) {
PyErr_Format(PyExc_ValueError, "sequence too large; "
"must be smaller than %d", NPY_MAXDIMS);
- return PY_FAIL;
+ return NPY_FAIL;
}
if (len > 0) {
seq->ptr = PyDimMem_NEW(len);
if (seq->ptr == NULL) {
PyErr_NoMemory();
- return PY_FAIL;
+ return NPY_FAIL;
}
}
seq->len = len;
@@ -186,9 +185,9 @@ PyArray_IntpConverter(PyObject *obj, PyArray_Dims *seq)
if (nd == -1 || nd != len) {
PyDimMem_FREE(seq->ptr);
seq->ptr = NULL;
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -212,14 +211,14 @@ PyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)
buf->flags = NPY_ARRAY_BEHAVED;
buf->base = NULL;
if (obj == Py_None) {
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyObject_AsWriteBuffer(obj, &(buf->ptr), &buflen) < 0) {
PyErr_Clear();
buf->flags &= ~NPY_ARRAY_WRITEABLE;
if (PyObject_AsReadBuffer(obj, (const void **)&(buf->ptr),
&buflen) < 0) {
- return PY_FAIL;
+ return NPY_FAIL;
}
}
buf->len = (npy_intp) buflen;
@@ -237,7 +236,7 @@ PyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf)
if (buf->base == NULL) {
buf->base = obj;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -254,10 +253,10 @@ PyArray_AxisConverter(PyObject *obj, int *axis)
else {
*axis = (int) PyInt_AsLong(obj);
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*
@@ -352,18 +351,18 @@ PyArray_ConvertMultiAxis(PyObject *axis_in, int ndim, npy_bool *out_axis_flags)
* Convert an object to true / false
*/
NPY_NO_EXPORT int
-PyArray_BoolConverter(PyObject *object, Bool *val)
+PyArray_BoolConverter(PyObject *object, npy_bool *val)
{
if (PyObject_IsTrue(object)) {
- *val = TRUE;
+ *val = NPY_TRUE;
}
else {
- *val = FALSE;
+ *val = NPY_FALSE;
}
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -383,13 +382,13 @@ PyArray_ByteorderConverter(PyObject *obj, char *endian)
str = PyBytes_AsString(obj);
if (!str) {
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
if (strlen(str) < 1) {
PyErr_SetString(PyExc_ValueError,
"Byteorder string must be at least length 1");
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
*endian = str[0];
if (str[0] != NPY_BIG && str[0] != NPY_LITTLE
@@ -414,11 +413,11 @@ PyArray_ByteorderConverter(PyObject *obj, char *endian)
"%s is an unrecognized byteorder",
str);
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
}
Py_XDECREF(tmp);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -438,13 +437,13 @@ PyArray_SortkindConverter(PyObject *obj, NPY_SORTKIND *sortkind)
str = PyBytes_AsString(obj);
if (!str) {
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
if (strlen(str) < 1) {
PyErr_SetString(PyExc_ValueError,
"Sort kind string must be at least length 1");
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
if (str[0] == 'q' || str[0] == 'Q') {
*sortkind = NPY_QUICKSORT;
@@ -460,10 +459,10 @@ PyArray_SortkindConverter(PyObject *obj, NPY_SORTKIND *sortkind)
"%s is an unrecognized kind of sort",
str);
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
Py_XDECREF(tmp);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -485,7 +484,7 @@ PyArray_SearchsideConverter(PyObject *obj, void *addr)
PyErr_SetString(PyExc_ValueError,
"expected nonempty string for keyword 'side'");
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
if (str[0] == 'l' || str[0] == 'L') {
@@ -498,10 +497,10 @@ PyArray_SearchsideConverter(PyObject *obj, void *addr)
PyErr_Format(PyExc_ValueError,
"'%s' is an invalid value for keyword 'side'", str);
Py_XDECREF(tmp);
- return PY_FAIL;
+ return NPY_FAIL;
}
Py_XDECREF(tmp);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -513,7 +512,7 @@ PyArray_OrderConverter(PyObject *object, NPY_ORDER *val)
char *str;
/* Leave the desired default from the caller for NULL/Py_None */
if (object == NULL || object == Py_None) {
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else if (PyUnicode_Check(object)) {
PyObject *tmp;
@@ -531,9 +530,9 @@ PyArray_OrderConverter(PyObject *object, NPY_ORDER *val)
*val = NPY_CORDER;
}
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
str = PyBytes_AS_STRING(object);
@@ -552,10 +551,10 @@ PyArray_OrderConverter(PyObject *object, NPY_ORDER *val)
else {
PyErr_SetString(PyExc_TypeError,
"order not understood");
- return PY_FAIL;
+ return NPY_FAIL;
}
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -582,7 +581,7 @@ PyArray_ClipmodeConverter(PyObject *object, NPY_CLIPMODE *val)
else {
PyErr_SetString(PyExc_TypeError,
"clipmode not understood");
- return PY_FAIL;
+ return NPY_FAIL;
}
}
else if (PyUnicode_Check(object)) {
@@ -606,12 +605,12 @@ PyArray_ClipmodeConverter(PyObject *object, NPY_CLIPMODE *val)
goto fail;
}
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
fail:
PyErr_SetString(PyExc_TypeError,
"clipmode not understood");
- return PY_FAIL;
+ return NPY_FAIL;
}
/*NUMPY_API
@@ -629,32 +628,32 @@ PyArray_ConvertClipmodeSequence(PyObject *object, NPY_CLIPMODE *modes, int n)
PyErr_Format(PyExc_ValueError,
"list of clipmodes has wrong length (%d instead of %d)",
(int)PySequence_Size(object), n);
- return PY_FAIL;
+ return NPY_FAIL;
}
for (i = 0; i < n; ++i) {
PyObject *item = PySequence_GetItem(object, i);
if(item == NULL) {
- return PY_FAIL;
+ return NPY_FAIL;
}
- if(PyArray_ClipmodeConverter(item, &modes[i]) != PY_SUCCEED) {
+ if(PyArray_ClipmodeConverter(item, &modes[i]) != NPY_SUCCEED) {
Py_DECREF(item);
- return PY_FAIL;
+ return NPY_FAIL;
}
Py_DECREF(item);
}
}
- else if (PyArray_ClipmodeConverter(object, &modes[0]) == PY_SUCCEED) {
+ else if (PyArray_ClipmodeConverter(object, &modes[0]) == NPY_SUCCEED) {
for (i = 1; i < n; ++i) {
modes[i] = modes[0];
}
}
else {
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -773,7 +772,7 @@ PyArray_PyIntAsInt(PyObject *o)
#if (PY_VERSION_HEX >= 0x02050000)
if (PyIndex_Check(o)) {
PyObject* value = PyNumber_Index(o);
- long_value = (longlong) PyInt_AsSsize_t(value);
+ long_value = (npy_longlong) PyInt_AsSsize_t(value);
goto finish;
}
#endif
@@ -820,7 +819,7 @@ PyArray_PyIntAsInt(PyObject *o)
NPY_NO_EXPORT npy_intp
PyArray_PyIntAsIntp(PyObject *o)
{
- longlong long_value = -1;
+ npy_longlong long_value = -1;
PyObject *obj;
static char *msg = "an integer is required";
PyArrayObject *arr;
@@ -832,16 +831,16 @@ PyArray_PyIntAsIntp(PyObject *o)
return -1;
}
if (PyInt_Check(o)) {
- long_value = (longlong) PyInt_AS_LONG(o);
+ long_value = (npy_longlong) PyInt_AS_LONG(o);
goto finish;
} else if (PyLong_Check(o)) {
- long_value = (longlong) PyLong_AsLongLong(o);
+ long_value = (npy_longlong) PyLong_AsLongLong(o);
goto finish;
}
-#if SIZEOF_INTP == SIZEOF_LONG
+#if NPY_SIZEOF_INTP == SIZEOF_LONG
descr = &LONG_Descr;
-#elif SIZEOF_INTP == SIZEOF_INT
+#elif NPY_SIZEOF_INTP == SIZEOF_INT
descr = &INT_Descr;
#else
descr = &LONGLONG_Descr;
@@ -874,7 +873,7 @@ PyArray_PyIntAsIntp(PyObject *o)
if (value == NULL) {
return -1;
}
- long_value = (longlong) PyInt_AsSsize_t(value);
+ long_value = (npy_longlong) PyInt_AsSsize_t(value);
goto finish;
}
#endif
@@ -883,7 +882,7 @@ PyArray_PyIntAsIntp(PyObject *o)
Py_TYPE(o)->tp_as_number->nb_long != NULL) {
obj = Py_TYPE(o)->tp_as_number->nb_long(o);
if (obj != NULL) {
- long_value = (longlong) PyLong_AsLongLong(obj);
+ long_value = (npy_longlong) PyLong_AsLongLong(obj);
Py_DECREF(obj);
}
}
@@ -893,7 +892,7 @@ PyArray_PyIntAsIntp(PyObject *o)
Py_TYPE(o)->tp_as_number->nb_int != NULL) {
obj = Py_TYPE(o)->tp_as_number->nb_int(o);
if (obj != NULL) {
- long_value = (longlong) PyLong_AsLongLong(obj);
+ long_value = (npy_longlong) PyLong_AsLongLong(obj);
Py_DECREF(obj);
}
}
@@ -907,8 +906,8 @@ PyArray_PyIntAsIntp(PyObject *o)
return -1;
}
-#if (SIZEOF_LONGLONG > SIZEOF_INTP)
- if ((long_value < MIN_INTP) || (long_value > MAX_INTP)) {
+#if (NPY_SIZEOF_LONGLONG > NPY_SIZEOF_INTP)
+ if ((long_value < NPY_MIN_INTP) || (long_value > NPY_MAX_INTP)) {
PyErr_SetString(PyExc_ValueError,
"integer won't fit into a C intp");
return -1;
@@ -934,7 +933,7 @@ PyArray_IntpFromSequence(PyObject *seq, npy_intp *vals, int maxvals)
*/
if ((nd=PySequence_Length(seq)) == -1) {
if (PyErr_Occurred()) PyErr_Clear();
-#if SIZEOF_LONG >= SIZEOF_INTP && !defined(NPY_PY3K)
+#if SIZEOF_LONG >= NPY_SIZEOF_INTP && !defined(NPY_PY3K)
if (!(op = PyNumber_Int(seq))) {
return -1;
}
@@ -944,7 +943,7 @@ PyArray_IntpFromSequence(PyObject *seq, npy_intp *vals, int maxvals)
}
#endif
nd = 1;
-#if SIZEOF_LONG >= SIZEOF_INTP
+#if SIZEOF_LONG >= NPY_SIZEOF_INTP
vals[0] = (npy_intp ) PyInt_AsLong(op);
#else
vals[0] = (npy_intp ) PyLong_AsLongLong(op);
@@ -968,12 +967,12 @@ PyArray_IntpFromSequence(PyObject *seq, npy_intp *vals, int maxvals)
}
}
else {
- for (i = 0; i < MIN(nd,maxvals); i++) {
+ for (i = 0; i < PyArray_MIN(nd,maxvals); i++) {
op = PySequence_GetItem(seq, i);
if (op == NULL) {
return -1;
}
-#if SIZEOF_LONG >= SIZEOF_INTP
+#if SIZEOF_LONG >= NPY_SIZEOF_INTP
vals[i]=(npy_intp )PyInt_AsLong(op);
#else
vals[i]=(npy_intp )PyLong_AsLongLong(op);
@@ -1189,10 +1188,10 @@ PyArray_IntTupleFromIntp(int len, npy_intp *vals)
goto fail;
}
for (i = 0; i < len; i++) {
-#if SIZEOF_INTP <= SIZEOF_LONG
+#if NPY_SIZEOF_INTP <= SIZEOF_LONG
PyObject *o = PyInt_FromLong((long) vals[i]);
#else
- PyObject *o = PyLong_FromLongLong((longlong) vals[i]);
+ PyObject *o = PyLong_FromLongLong((npy_longlong) vals[i]);
#endif
if (!o) {
Py_DECREF(intTuple);
diff --git a/numpy/core/src/multiarray/conversion_utils.h b/numpy/core/src/multiarray/conversion_utils.h
index 3ecc46a12..baa110e90 100644
--- a/numpy/core/src/multiarray/conversion_utils.h
+++ b/numpy/core/src/multiarray/conversion_utils.h
@@ -8,7 +8,7 @@ NPY_NO_EXPORT int
PyArray_BufferConverter(PyObject *obj, PyArray_Chunk *buf);
NPY_NO_EXPORT int
-PyArray_BoolConverter(PyObject *object, Bool *val);
+PyArray_BoolConverter(PyObject *object, npy_bool *val);
NPY_NO_EXPORT int
PyArray_ByteorderConverter(PyObject *obj, char *endian);
@@ -22,17 +22,17 @@ PyArray_SearchsideConverter(PyObject *obj, void *addr);
NPY_NO_EXPORT int
PyArray_PyIntAsInt(PyObject *o);
-NPY_NO_EXPORT intp
+NPY_NO_EXPORT npy_intp
PyArray_PyIntAsIntp(PyObject *o);
NPY_NO_EXPORT int
-PyArray_IntpFromSequence(PyObject *seq, intp *vals, int maxvals);
+PyArray_IntpFromSequence(PyObject *seq, npy_intp *vals, int maxvals);
NPY_NO_EXPORT int
PyArray_TypestrConvert(int itemsize, int gentype);
NPY_NO_EXPORT PyObject *
-PyArray_IntTupleFromIntp(int len, intp *vals);
+PyArray_IntTupleFromIntp(int len, npy_intp *vals);
/*
* Converts an axis parameter into an ndim-length C-array of
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index e55f33140..07b052653 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -144,7 +143,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
NPY_END_THREADS;
PyErr_Format(PyExc_IOError,
"problem writing element"\
- " %"INTP_FMT" to file",
+ " %"NPY_INTP_FMT" to file",
it->index);
Py_DECREF(it);
return -1;
@@ -218,7 +217,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
#endif
if (n < n2) {
PyErr_Format(PyExc_IOError,
- "problem writing element %"INTP_FMT\
+ "problem writing element %"NPY_INTP_FMT\
" to file", it->index);
Py_DECREF(strobj);
Py_DECREF(it);
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 88463c6b5..708814e5b 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -735,7 +734,7 @@ PyArray_CanCastScalar(PyTypeObject *from, PyTypeObject *to)
fromtype = _typenum_fromtypeobj((PyObject *)from, 0);
totype = _typenum_fromtypeobj((PyObject *)to, 0);
if (fromtype == NPY_NOTYPE || totype == NPY_NOTYPE) {
- return FALSE;
+ return NPY_FALSE;
}
return (npy_bool) PyArray_CanCastSafely(fromtype, totype);
}
@@ -1620,11 +1619,11 @@ NPY_NO_EXPORT int
PyArray_ValidType(int type)
{
PyArray_Descr *descr;
- int res=TRUE;
+ int res=NPY_TRUE;
descr = PyArray_DescrFromType(type);
if (descr == NULL) {
- res = FALSE;
+ res = NPY_FALSE;
}
Py_DECREF(descr);
return res;
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index fec6e63c1..ebc916feb 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -556,7 +555,7 @@ discover_itemsize(PyObject *s, int nd, int *itemsize)
int n, r, i;
if (PyArray_Check(s)) {
- *itemsize = MAX(*itemsize, PyArray_ITEMSIZE((PyArrayObject *)s));
+ *itemsize = PyArray_MAX(*itemsize, PyArray_ITEMSIZE((PyArrayObject *)s));
return 0;
}
@@ -574,7 +573,7 @@ discover_itemsize(PyObject *s, int nd, int *itemsize)
PyErr_Clear();
}
else {
- *itemsize = MAX(*itemsize, n);
+ *itemsize = PyArray_MAX(*itemsize, n);
}
return 0;
}
@@ -2161,8 +2160,8 @@ PyArray_FromStructInterface(PyObject *input)
inter->flags &= ~NPY_ARRAY_NOTSWAPPED;
}
- if (inter->flags & ARR_HAS_DESCR) {
- if (PyArray_DescrConverter(inter->descr, &thetype) == PY_FAIL) {
+ if (inter->flags & NPY_ARR_HAS_DESCR) {
+ if (PyArray_DescrConverter(inter->descr, &thetype) == NPY_FAIL) {
thetype = NULL;
PyErr_Clear();
}
@@ -2211,7 +2210,7 @@ PyArray_FromInterface(PyObject *input)
char *data;
Py_ssize_t buffer_len;
int res, i, n;
- intp dims[NPY_MAXDIMS], strides[NPY_MAXDIMS];
+ npy_intp dims[NPY_MAXDIMS], strides[NPY_MAXDIMS];
int dataflags = NPY_ARRAY_BEHAVED;
/* Get the memory from __array_data__ and __array_offset__ */
@@ -2266,7 +2265,7 @@ PyArray_FromInterface(PyObject *input)
}
attr = PyDict_GetItemString(inter, "offset");
if (attr) {
- longlong num = PyLong_AsLongLong(attr);
+ npy_longlong num = PyLong_AsLongLong(attr);
if (error_converting(num)) {
PyErr_SetString(PyExc_TypeError,
"__array_interface__ offset must be an integer");
@@ -3107,7 +3106,8 @@ PyArray_Arange(double start, double stop, double step, int type_num)
return (PyObject *)range;
}
if (!funcs->fill) {
- PyErr_SetString(PyExc_ValueError, "no fill-function for data-type.");
+ PyErr_SetString(PyExc_ValueError,
+ "no fill-function for data-type.");
Py_DECREF(range);
return NULL;
}
@@ -3170,7 +3170,7 @@ _calc_length(PyObject *start, PyObject *stop, PyObject *step, PyObject **next, i
"arange: overflow while computing length");
return -1;
}
- len = MIN(len, tmp);
+ len = PyArray_MIN(len, tmp);
}
else {
value = PyFloat_AsDouble(val);
@@ -3621,7 +3621,7 @@ PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type,
if ((offset < 0) || (offset > ts)) {
PyErr_Format(PyExc_ValueError,
"offset must be non-negative and no greater than buffer "\
- "length (%" INTP_FMT ")", (npy_intp)ts);
+ "length (%" NPY_INTP_FMT ")", (npy_intp)ts);
Py_DECREF(buf);
Py_DECREF(type);
return NULL;
@@ -3702,7 +3702,7 @@ PyArray_FromString(char *data, npy_intp slen, PyArray_Descr *dtype,
{
int itemsize;
PyArrayObject *ret;
- Bool binary;
+ npy_bool binary;
if (dtype == NULL) {
dtype=PyArray_DescrFromType(NPY_DEFAULT_TYPE);
diff --git a/numpy/core/src/multiarray/ctors.h b/numpy/core/src/multiarray/ctors.h
index e12d153ca..116435d9a 100644
--- a/numpy/core/src/multiarray/ctors.h
+++ b/numpy/core/src/multiarray/ctors.h
@@ -3,11 +3,11 @@
NPY_NO_EXPORT PyObject *
PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, int nd,
- intp *dims, intp *strides, void *data,
+ npy_intp *dims, npy_intp *strides, void *data,
int flags, PyObject *obj);
-NPY_NO_EXPORT PyObject *PyArray_New(PyTypeObject *, int nd, intp *,
- int, intp *, void *, int, int, PyObject *);
+NPY_NO_EXPORT PyObject *PyArray_New(PyTypeObject *, int nd, npy_intp *,
+ int, npy_intp *, void *, int, int, PyObject *);
NPY_NO_EXPORT PyObject *
PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth,
@@ -52,22 +52,22 @@ PyArray_CopyAsFlat(PyArrayObject *dst, PyArrayObject *src,
/* FIXME: remove those from here */
NPY_NO_EXPORT size_t
-_array_fill_strides(intp *strides, intp *dims, int nd, size_t itemsize,
+_array_fill_strides(npy_intp *strides, npy_intp *dims, int nd, size_t itemsize,
int inflag, int *objflags);
NPY_NO_EXPORT void
-_unaligned_strided_byte_copy(char *dst, intp outstrides, char *src,
- intp instrides, intp N, int elsize);
+_unaligned_strided_byte_copy(char *dst, npy_intp outstrides, char *src,
+ npy_intp instrides, npy_intp N, int elsize);
NPY_NO_EXPORT void
-_strided_byte_swap(void *p, intp stride, intp n, int size);
+_strided_byte_swap(void *p, npy_intp stride, npy_intp n, int size);
NPY_NO_EXPORT void
-copy_and_swap(void *dst, void *src, int itemsize, intp numitems,
- intp srcstrides, int swap);
+copy_and_swap(void *dst, void *src, int itemsize, npy_intp numitems,
+ npy_intp srcstrides, int swap);
NPY_NO_EXPORT void
-byte_swap_vector(void *p, intp n, int size);
+byte_swap_vector(void *p, npy_intp n, int size);
NPY_NO_EXPORT int
PyArray_AssignFromSequence(PyArrayObject *self, PyObject *v);
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index f9a41c45e..3f2da284d 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -6,7 +6,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -47,7 +46,7 @@ _arraydescr_fromobj(PyObject *obj)
if (dtypedescr) {
ret = PyArray_DescrConverter(dtypedescr, &new);
Py_DECREF(dtypedescr);
- if (ret == PY_SUCCEED) {
+ if (ret == NPY_SUCCEED) {
return new;
}
PyErr_Clear();
@@ -58,7 +57,7 @@ _arraydescr_fromobj(PyObject *obj)
if (dtypedescr) {
ret = PyArray_DescrConverter(dtypedescr, &new);
Py_DECREF(dtypedescr);
- if (ret == PY_SUCCEED) {
+ if (ret == NPY_SUCCEED) {
PyObject *length;
length = PyObject_GetAttrString(obj, "_length_");
PyErr_Clear();
@@ -69,7 +68,7 @@ _arraydescr_fromobj(PyObject *obj)
newtup = Py_BuildValue("NO", new, length);
ret = PyArray_DescrConverter(newtup, &derived);
Py_DECREF(newtup);
- if (ret == PY_SUCCEED) {
+ if (ret == NPY_SUCCEED) {
return derived;
}
PyErr_Clear();
@@ -88,7 +87,7 @@ _arraydescr_fromobj(PyObject *obj)
if (dtypedescr) {
ret = PyArray_DescrAlignConverter(dtypedescr, &new);
Py_DECREF(dtypedescr);
- if (ret == PY_SUCCEED) {
+ if (ret == NPY_SUCCEED) {
return new;
}
PyErr_Clear();
@@ -250,7 +249,7 @@ _convert_from_tuple(PyObject *obj)
PyArray_Dims shape = {NULL, -1};
PyArray_Descr *newdescr;
- if (!(PyArray_IntpConverter(val, &shape)) || (shape.len > MAX_DIMS)) {
+ if (!(PyArray_IntpConverter(val, &shape)) || (shape.len > NPY_MAXDIMS)) {
PyDimMem_FREE(shape.ptr);
PyErr_SetString(PyExc_ValueError,
"invalid shape in fixed-type tuple.");
@@ -393,7 +392,7 @@ _convert_from_array_descr(PyObject *obj, int align)
else {
ret = PyArray_DescrConverter(PyTuple_GET_ITEM(item, 1), &conv);
}
- if (ret == PY_FAIL) {
+ if (ret == NPY_FAIL) {
PyObject_Print(PyTuple_GET_ITEM(item, 1), stderr, 0);
}
}
@@ -410,7 +409,7 @@ _convert_from_array_descr(PyObject *obj, int align)
else {
goto fail;
}
- if (ret == PY_FAIL) {
+ if (ret == NPY_FAIL) {
goto fail;
}
if ((PyDict_GetItem(fields, name) != NULL)
@@ -435,7 +434,7 @@ _convert_from_array_descr(PyObject *obj, int align)
if (_align > 1) {
totalsize = NPY_NEXT_ALIGNED_OFFSET(totalsize, _align);
}
- maxalign = MAX(maxalign, _align);
+ maxalign = PyArray_MAX(maxalign, _align);
}
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong((long) totalsize));
@@ -543,7 +542,7 @@ _convert_from_list(PyObject *obj, int align)
else {
ret = PyArray_DescrConverter(PyList_GET_ITEM(obj, i), &conv);
}
- if (ret == PY_FAIL) {
+ if (ret == NPY_FAIL) {
Py_DECREF(tup);
Py_DECREF(key);
goto fail;
@@ -557,7 +556,7 @@ _convert_from_list(PyObject *obj, int align)
if (_align > 1) {
totalsize = NPY_NEXT_ALIGNED_OFFSET(totalsize, _align);
}
- maxalign = MAX(maxalign, _align);
+ maxalign = PyArray_MAX(maxalign, _align);
}
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong((long) totalsize));
PyDict_SetItem(fields, key, tup);
@@ -919,7 +918,7 @@ _convert_from_dict(PyObject *obj, int align)
ret = PyArray_DescrConverter(descr, &newdescr);
}
Py_DECREF(descr);
- if (ret == PY_FAIL) {
+ if (ret == NPY_FAIL) {
Py_DECREF(tup);
Py_DECREF(ind);
goto fail;
@@ -927,7 +926,7 @@ _convert_from_dict(PyObject *obj, int align)
PyTuple_SET_ITEM(tup, 0, (PyObject *)newdescr);
if (align) {
_align = newdescr->alignment;
- maxalign = MAX(maxalign,_align);
+ maxalign = PyArray_MAX(maxalign,_align);
}
if (offsets) {
long offset;
@@ -948,7 +947,7 @@ _convert_from_dict(PyObject *obj, int align)
"not divisible by the field alignment %d "
"with align=True",
(int)offset, (int)newdescr->alignment);
- ret = PY_FAIL;
+ ret = NPY_FAIL;
}
else if (offset + newdescr->elsize > totalsize) {
totalsize = offset + newdescr->elsize;
@@ -976,14 +975,14 @@ _convert_from_dict(PyObject *obj, int align)
#endif
PyErr_SetString(PyExc_ValueError,
"field names must be strings");
- ret = PY_FAIL;
+ ret = NPY_FAIL;
}
/* Insert into dictionary */
if (PyDict_GetItem(fields, name) != NULL) {
PyErr_SetString(PyExc_ValueError,
"name already used as a name or title");
- ret = PY_FAIL;
+ ret = NPY_FAIL;
}
PyDict_SetItem(fields, name, tup);
Py_DECREF(name);
@@ -996,13 +995,13 @@ _convert_from_dict(PyObject *obj, int align)
if (PyDict_GetItem(fields, title) != NULL) {
PyErr_SetString(PyExc_ValueError,
"title already used as a name or title.");
- ret=PY_FAIL;
+ ret=NPY_FAIL;
}
PyDict_SetItem(fields, title, tup);
}
}
Py_DECREF(tup);
- if ((ret == PY_FAIL) || (newdescr->elsize == 0)) {
+ if ((ret == NPY_FAIL) || (newdescr->elsize == 0)) {
goto fail;
}
dtypeflags |= (newdescr->flags & NPY_FROM_FIELDS);
@@ -1117,7 +1116,7 @@ PyArray_DescrConverter2(PyObject *obj, PyArray_Descr **at)
{
if (obj == Py_None) {
*at = NULL;
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else {
return PyArray_DescrConverter(obj, at);
@@ -1152,19 +1151,19 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
/* default */
if (obj == Py_None) {
*at = PyArray_DescrFromType(NPY_DEFAULT_TYPE);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyArray_DescrCheck(obj)) {
*at = (PyArray_Descr *)obj;
Py_INCREF(*at);
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyType_Check(obj)) {
if (PyType_IsSubtype((PyTypeObject *)obj, &PyGenericArrType_Type)) {
*at = PyArray_DescrFromTypeObject(obj);
- return (*at) ? PY_SUCCEED : PY_FAIL;
+ return (*at) ? NPY_SUCCEED : NPY_FAIL;
}
check_num = NPY_OBJECT;
#if !defined(NPY_PY3K)
@@ -1204,7 +1203,7 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
else {
*at = _arraydescr_fromobj(obj);
if (*at) {
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
}
goto finish;
@@ -1218,7 +1217,7 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
PyObject *obj2;
obj2 = PyUnicode_AsASCIIString(obj);
if (obj2 == NULL) {
- return PY_FAIL;
+ return NPY_FAIL;
}
retval = PyArray_DescrConverter(obj2, at);
Py_DECREF(obj2);
@@ -1242,7 +1241,7 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
/* check for commas present or first (or second) element a digit */
if (_check_for_commastring(type, len)) {
*at = _convert_from_commastring(obj, 0);
- return (*at) ? PY_SUCCEED : PY_FAIL;
+ return (*at) ? NPY_SUCCEED : NPY_FAIL;
}
/* Process the endian character */
@@ -1270,7 +1269,7 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
/* Check for datetime format */
if (is_datetime_typestr(type, len)) {
*at = parse_dtype_from_datetime_typestr(type, len);
- return (*at) ? PY_SUCCEED : PY_FAIL;
+ return (*at) ? NPY_SUCCEED : NPY_FAIL;
}
/* A typecode like 'd' */
@@ -1330,33 +1329,33 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
*at = _convert_from_tuple(obj);
if (*at == NULL){
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
goto fail;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else if (PyList_Check(obj)) {
/* or a list */
*at = _convert_from_array_descr(obj,0);
if (*at == NULL) {
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
goto fail;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else if (PyDict_Check(obj)) {
/* or a dictionary */
*at = _convert_from_dict(obj,0);
if (*at == NULL) {
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
goto fail;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
else if (PyArray_Check(obj)) {
goto fail;
@@ -1364,10 +1363,10 @@ PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at)
else {
*at = _arraydescr_fromobj(obj);
if (*at) {
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
if (PyErr_Occurred()) {
- return PY_FAIL;
+ return NPY_FAIL;
}
goto fail;
}
@@ -1411,7 +1410,7 @@ finish:
PyArray_DESCR_REPLACE(*at);
(*at)->byteorder = endian;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
fail:
if (PyBytes_Check(obj)) {
@@ -1424,7 +1423,7 @@ fail:
error:
*at = NULL;
- return PY_FAIL;
+ return NPY_FAIL;
}
/** Array Descr Objects for dynamic types **/
@@ -1951,9 +1950,9 @@ arraydescr_new(PyTypeObject *NPY_UNUSED(subtype),
{
PyObject *odescr, *metadata=NULL;
PyArray_Descr *descr, *conv;
- npy_bool align = FALSE;
- npy_bool copy = FALSE;
- npy_bool copied = FALSE;
+ npy_bool align = NPY_FALSE;
+ npy_bool copy = NPY_FALSE;
+ npy_bool copied = NPY_FALSE;
static char *kwlist[] = {"dtype", "align", "copy", "metadata", NULL};
@@ -1983,7 +1982,7 @@ arraydescr_new(PyTypeObject *NPY_UNUSED(subtype),
descr = PyArray_DescrNew(conv);
Py_DECREF(conv);
conv = descr;
- copied = TRUE;
+ copied = NPY_TRUE;
}
if ((metadata != NULL)) {
@@ -1992,7 +1991,7 @@ arraydescr_new(PyTypeObject *NPY_UNUSED(subtype),
* underlying dictionary
*/
if (!copied) {
- copied = TRUE;
+ copied = NPY_TRUE;
descr = PyArray_DescrNew(conv);
Py_DECREF(conv);
conv = descr;
@@ -2518,9 +2517,9 @@ PyArray_DescrAlignConverter(PyObject *obj, PyArray_Descr **at)
PyErr_SetString(PyExc_ValueError,
"data-type-descriptor not understood");
}
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
/*NUMPY_API
@@ -2554,9 +2553,9 @@ PyArray_DescrAlignConverter2(PyObject *obj, PyArray_Descr **at)
PyErr_SetString(PyExc_ValueError,
"data-type-descriptor not understood");
}
- return PY_FAIL;
+ return NPY_FAIL;
}
- return PY_SUCCEED;
+ return NPY_SUCCEED;
}
@@ -3161,7 +3160,7 @@ arraydescr_richcompare(PyArray_Descr *self, PyObject *other, int cmp_op)
PyArray_Descr *new = NULL;
PyObject *result = Py_NotImplemented;
if (!PyArray_DescrCheck(other)) {
- if (PyArray_DescrConverter(other, &new) == PY_FAIL) {
+ if (PyArray_DescrConverter(other, &new) == NPY_FAIL) {
return NULL;
}
}
@@ -3249,7 +3248,7 @@ descr_repeat(PyObject *self, Py_ssize_t length)
PyArray_Descr *new;
if (length < 0) {
return PyErr_Format(PyExc_ValueError,
- "Array length must be >= 0, not %"INTP_FMT, length);
+ "Array length must be >= 0, not %"NPY_INTP_FMT, length);
}
tup = Py_BuildValue("O" NPY_SSIZE_T_PYFMT, self, length);
if (tup == NULL) {
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 8bc6c42a6..47c487338 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -16,7 +16,7 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include <numpy/npy_cpu.h>
#include "numpy/npy_3kcompat.h"
diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src
index 59e98cd6b..f5c61022c 100644
--- a/numpy/core/src/multiarray/einsum.c.src
+++ b/numpy/core/src/multiarray/einsum.c.src
@@ -14,7 +14,7 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include <numpy/halffloat.h>
#include <numpy/npy_3kcompat.h>
@@ -75,10 +75,14 @@ typedef enum {
* ubyte, ushort, uint, ulong, ulonglong,
* half, float, double, longdouble,
* cfloat, cdouble, clongdouble#
- * #temp = byte, short, int, long, longlong,
- * ubyte, ushort, uint, ulong, ulonglong,
- * float, float, double, longdouble,
- * float, double, longdouble#
+ * #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #temptype = npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_float, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble#
* #to = ,,,,,
* ,,,,,
* npy_float_to_half,,,,
@@ -131,44 +135,44 @@ static void
while (count--) {
#if !@complex@
# if @nop@ == 1
- *(npy_@name@ *)data_out = @to@(@from@(*(npy_@name@ *)data0) +
- @from@(*(npy_@name@ *)data_out));
+ *(@type@ *)data_out = @to@(@from@(*(@type@ *)data0) +
+ @from@(*(@type@ *)data_out));
data0 += stride0;
data_out += stride_out;
# elif @nop@ == 2
- *(npy_@name@ *)data_out = @to@(@from@(*(npy_@name@ *)data0) *
- @from@(*(npy_@name@ *)data1) +
- @from@(*(npy_@name@ *)data_out));
+ *(@type@ *)data_out = @to@(@from@(*(@type@ *)data0) *
+ @from@(*(@type@ *)data1) +
+ @from@(*(@type@ *)data_out));
data0 += stride0;
data1 += stride1;
data_out += stride_out;
# elif @nop@ == 3
- *(npy_@name@ *)data_out = @to@(@from@(*(npy_@name@ *)data0) *
- @from@(*(npy_@name@ *)data1) *
- @from@(*(npy_@name@ *)data2) +
- @from@(*(npy_@name@ *)data_out));
+ *(@type@ *)data_out = @to@(@from@(*(@type@ *)data0) *
+ @from@(*(@type@ *)data1) *
+ @from@(*(@type@ *)data2) +
+ @from@(*(@type@ *)data_out));
data0 += stride0;
data1 += stride1;
data2 += stride2;
data_out += stride_out;
# else
- npy_@temp@ temp = @from@(*(npy_@name@ *)dataptr[0]);
+ @temptype@ temp = @from@(*(@type@ *)dataptr[0]);
int i;
for (i = 1; i < nop; ++i) {
- temp *= @from@(*(npy_@name@ *)dataptr[i]);
+ temp *= @from@(*(@type@ *)dataptr[i]);
}
- *(npy_@name@ *)dataptr[nop] = @to@(temp +
- @from@(*(npy_@name@ *)dataptr[i]));
+ *(@type@ *)dataptr[nop] = @to@(temp +
+ @from@(*(@type@ *)dataptr[i]));
for (i = 0; i <= nop; ++i) {
dataptr[i] += strides[i];
}
# endif
#else /* complex */
# if @nop@ == 1
- ((npy_@temp@ *)data_out)[0] = ((npy_@temp@ *)data0)[0] +
- ((npy_@temp@ *)data_out)[0];
- ((npy_@temp@ *)data_out)[1] = ((npy_@temp@ *)data0)[1] +
- ((npy_@temp@ *)data_out)[1];
+ ((@temptype@ *)data_out)[0] = ((@temptype@ *)data0)[0] +
+ ((@temptype@ *)data_out)[0];
+ ((@temptype@ *)data_out)[1] = ((@temptype@ *)data0)[1] +
+ ((@temptype@ *)data_out)[1];
data0 += stride0;
data_out += stride_out;
# else
@@ -177,21 +181,21 @@ static void
# else
#define _SUMPROD_NOP nop
# endif
- npy_@temp@ re, im, tmp;
+ @temptype@ re, im, tmp;
int i;
- re = ((npy_@temp@ *)dataptr[0])[0];
- im = ((npy_@temp@ *)dataptr[0])[1];
+ re = ((@temptype@ *)dataptr[0])[0];
+ im = ((@temptype@ *)dataptr[0])[1];
for (i = 1; i < _SUMPROD_NOP; ++i) {
- tmp = re * ((npy_@temp@ *)dataptr[i])[0] -
- im * ((npy_@temp@ *)dataptr[i])[1];
- im = re * ((npy_@temp@ *)dataptr[i])[1] +
- im * ((npy_@temp@ *)dataptr[i])[0];
+ tmp = re * ((@temptype@ *)dataptr[i])[0] -
+ im * ((@temptype@ *)dataptr[i])[1];
+ im = re * ((@temptype@ *)dataptr[i])[1] +
+ im * ((@temptype@ *)dataptr[i])[0];
re = tmp;
}
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[0] = re +
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[0];
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[1] = im +
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[1];
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[0] = re +
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[0];
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[1] = im +
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[1];
for (i = 0; i <= _SUMPROD_NOP; ++i) {
dataptr[i] += strides[i];
@@ -208,8 +212,8 @@ static void
@name@_sum_of_products_contig_one(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@name@ *data_out = (npy_@name@ *)dataptr[1];
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @type@ *data_out = (@type@ *)dataptr[1];
NPY_EINSUM_DBG_PRINT1("@name@_sum_of_products_contig_one (%d)\n",
(int)count);
@@ -225,12 +229,12 @@ finish_after_unrolled_loop:
data_out[@i@] = @to@(@from@(data0[@i@]) +
@from@(data_out[@i@]));
#else
- ((npy_@temp@ *)data_out + 2*@i@)[0] =
- ((npy_@temp@ *)data0 + 2*@i@)[0] +
- ((npy_@temp@ *)data_out + 2*@i@)[0];
- ((npy_@temp@ *)data_out + 2*@i@)[1] =
- ((npy_@temp@ *)data0 + 2*@i@)[1] +
- ((npy_@temp@ *)data_out + 2*@i@)[1];
+ ((@temptype@ *)data_out + 2*@i@)[0] =
+ ((@temptype@ *)data0 + 2*@i@)[0] +
+ ((@temptype@ *)data_out + 2*@i@)[0];
+ ((@temptype@ *)data_out + 2*@i@)[1] =
+ ((@temptype@ *)data0 + 2*@i@)[1] +
+ ((@temptype@ *)data_out + 2*@i@)[1];
#endif
/**end repeat2**/
case 0:
@@ -248,12 +252,12 @@ finish_after_unrolled_loop:
data_out[@i@] = @to@(@from@(data0[@i@]) +
@from@(data_out[@i@]));
#else /* complex */
- ((npy_@temp@ *)data_out + 2*@i@)[0] =
- ((npy_@temp@ *)data0 + 2*@i@)[0] +
- ((npy_@temp@ *)data_out + 2*@i@)[0];
- ((npy_@temp@ *)data_out + 2*@i@)[1] =
- ((npy_@temp@ *)data0 + 2*@i@)[1] +
- ((npy_@temp@ *)data_out + 2*@i@)[1];
+ ((@temptype@ *)data_out + 2*@i@)[0] =
+ ((@temptype@ *)data0 + 2*@i@)[0] +
+ ((@temptype@ *)data_out + 2*@i@)[0];
+ ((@temptype@ *)data_out + 2*@i@)[1] =
+ ((@temptype@ *)data0 + 2*@i@)[1] +
+ ((@temptype@ *)data_out + 2*@i@)[1];
#endif
/**end repeat2**/
data0 += 8;
@@ -270,9 +274,9 @@ static void
@name@_sum_of_products_contig_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@name@ *data1 = (npy_@name@ *)dataptr[1];
- npy_@name@ *data_out = (npy_@name@ *)dataptr[2];
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @type@ *data1 = (@type@ *)dataptr[1];
+ @type@ *data_out = (@type@ *)dataptr[2];
#if EINSUM_USE_SSE1 && @float32@
__m128 a, b;
@@ -356,9 +360,9 @@ static void
@name@_sum_of_products_stride0_contig_outcontig_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@temp@ value0 = @from@(*(npy_@name@ *)dataptr[0]);
- npy_@name@ *data1 = (npy_@name@ *)dataptr[1];
- npy_@name@ *data_out = (npy_@name@ *)dataptr[2];
+ @temptype@ value0 = @from@(*(@type@ *)dataptr[0]);
+ @type@ *data1 = (@type@ *)dataptr[1];
+ @type@ *data_out = (@type@ *)dataptr[2];
#if EINSUM_USE_SSE1 && @float32@
__m128 a, b, value0_sse;
@@ -485,9 +489,9 @@ static void
@name@_sum_of_products_contig_stride0_outcontig_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@temp@ value1 = @from@(*(npy_@name@ *)dataptr[1]);
- npy_@name@ *data_out = (npy_@name@ *)dataptr[2];
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @temptype@ value1 = @from@(*(@type@ *)dataptr[1]);
+ @type@ *data_out = (@type@ *)dataptr[2];
#if EINSUM_USE_SSE1 && @float32@
__m128 a, b, value1_sse;
@@ -569,9 +573,9 @@ static void
@name@_sum_of_products_contig_contig_outstride0_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@name@ *data1 = (npy_@name@ *)dataptr[1];
- npy_@temp@ accum = 0;
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @type@ *data1 = (@type@ *)dataptr[1];
+ @temptype@ accum = 0;
#if EINSUM_USE_SSE1 && @float32@
__m128 a, accum_sse = _mm_setzero_ps();
@@ -592,7 +596,7 @@ finish_after_unrolled_loop:
accum += @from@(data0[@i@]) * @from@(data1[@i@]);
/**end repeat2**/
case 0:
- *(npy_@name@ *)dataptr[2] += @to@(accum);
+ *(@type@ *)dataptr[2] += @to@(accum);
return;
}
@@ -729,9 +733,9 @@ static void
@name@_sum_of_products_stride0_contig_outstride0_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@temp@ value0 = @from@(*(npy_@name@ *)dataptr[0]);
- npy_@name@ *data1 = (npy_@name@ *)dataptr[1];
- npy_@temp@ accum = 0;
+ @temptype@ value0 = @from@(*(@type@ *)dataptr[0]);
+ @type@ *data1 = (@type@ *)dataptr[1];
+ @temptype@ accum = 0;
#if EINSUM_USE_SSE1 && @float32@
__m128 a, accum_sse = _mm_setzero_ps();
@@ -750,7 +754,7 @@ finish_after_unrolled_loop:
accum += @from@(data1[@i@]);
/**end repeat2**/
case 0:
- *(npy_@name@ *)dataptr[2] += @to@(value0 * accum);
+ *(@type@ *)dataptr[2] += @to@(value0 * accum);
return;
}
@@ -828,9 +832,9 @@ static void
@name@_sum_of_products_contig_stride0_outstride0_two(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@temp@ value1 = @from@(*(npy_@name@ *)dataptr[1]);
- npy_@temp@ accum = 0;
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @temptype@ value1 = @from@(*(@type@ *)dataptr[1]);
+ @temptype@ accum = 0;
#if EINSUM_USE_SSE1 && @float32@
__m128 a, accum_sse = _mm_setzero_ps();
@@ -849,7 +853,7 @@ finish_after_unrolled_loop:
accum += @from@(data0[@i@]);
/**end repeat2**/
case 0:
- *(npy_@name@ *)dataptr[2] += @to@(accum * value1);
+ *(@type@ *)dataptr[2] += @to@(accum * value1);
return;
}
@@ -929,10 +933,10 @@ static void
@name@_sum_of_products_contig_three(int nop, char **dataptr,
npy_intp *NPY_UNUSED(strides), npy_intp count)
{
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
- npy_@name@ *data1 = (npy_@name@ *)dataptr[1];
- npy_@name@ *data2 = (npy_@name@ *)dataptr[2];
- npy_@name@ *data_out = (npy_@name@ *)dataptr[3];
+ @type@ *data0 = (@type@ *)dataptr[0];
+ @type@ *data1 = (@type@ *)dataptr[1];
+ @type@ *data2 = (@type@ *)dataptr[2];
+ @type@ *data_out = (@type@ *)dataptr[3];
/* Unroll the loop by 8 */
while (count >= 8) {
@@ -978,15 +982,15 @@ static void
while (count--) {
#if !@complex@
- npy_@temp@ temp = @from@(*(npy_@name@ *)dataptr[0]);
+ @temptype@ temp = @from@(*(@type@ *)dataptr[0]);
int i;
for (i = 1; i < nop; ++i) {
- temp *= @from@(*(npy_@name@ *)dataptr[i]);
+ temp *= @from@(*(@type@ *)dataptr[i]);
}
- *(npy_@name@ *)dataptr[nop] = @to@(temp +
- @from@(*(npy_@name@ *)dataptr[i]));
+ *(@type@ *)dataptr[nop] = @to@(temp +
+ @from@(*(@type@ *)dataptr[i]));
for (i = 0; i <= nop; ++i) {
- dataptr[i] += sizeof(npy_@name@);
+ dataptr[i] += sizeof(@type@);
}
#else /* complex */
# if @nop@ <= 3
@@ -994,24 +998,24 @@ static void
# else
# define _SUMPROD_NOP nop
# endif
- npy_@temp@ re, im, tmp;
+ @temptype@ re, im, tmp;
int i;
- re = ((npy_@temp@ *)dataptr[0])[0];
- im = ((npy_@temp@ *)dataptr[0])[1];
+ re = ((@temptype@ *)dataptr[0])[0];
+ im = ((@temptype@ *)dataptr[0])[1];
for (i = 1; i < _SUMPROD_NOP; ++i) {
- tmp = re * ((npy_@temp@ *)dataptr[i])[0] -
- im * ((npy_@temp@ *)dataptr[i])[1];
- im = re * ((npy_@temp@ *)dataptr[i])[1] +
- im * ((npy_@temp@ *)dataptr[i])[0];
+ tmp = re * ((@temptype@ *)dataptr[i])[0] -
+ im * ((@temptype@ *)dataptr[i])[1];
+ im = re * ((@temptype@ *)dataptr[i])[1] +
+ im * ((@temptype@ *)dataptr[i])[0];
re = tmp;
}
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[0] = re +
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[0];
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[1] = im +
- ((npy_@temp@ *)dataptr[_SUMPROD_NOP])[1];
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[0] = re +
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[0];
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[1] = im +
+ ((@temptype@ *)dataptr[_SUMPROD_NOP])[1];
for (i = 0; i <= _SUMPROD_NOP; ++i) {
- dataptr[i] += sizeof(npy_@name@);
+ dataptr[i] += sizeof(@type@);
}
# undef _SUMPROD_NOP
#endif
@@ -1027,11 +1031,11 @@ static void
npy_intp *strides, npy_intp count)
{
#if @complex@
- npy_@temp@ accum_re = 0, accum_im = 0;
- npy_@temp@ *data0 = (npy_@temp@ *)dataptr[0];
+ @temptype@ accum_re = 0, accum_im = 0;
+ @temptype@ *data0 = (@temptype@ *)dataptr[0];
#else
- npy_@temp@ accum = 0;
- npy_@name@ *data0 = (npy_@name@ *)dataptr[0];
+ @temptype@ accum = 0;
+ @type@ *data0 = (@type@ *)dataptr[0];
#endif
#if EINSUM_USE_SSE1 && @float32@
@@ -1060,11 +1064,11 @@ finish_after_unrolled_loop:
/**end repeat2**/
case 0:
#if @complex@
- ((npy_@temp@ *)dataptr[1])[0] += accum_re;
- ((npy_@temp@ *)dataptr[1])[1] += accum_im;
+ ((@temptype@ *)dataptr[1])[0] += accum_re;
+ ((@temptype@ *)dataptr[1])[1] += accum_im;
#else
- *((npy_@name@ *)dataptr[1]) = @to@(accum +
- @from@(*((npy_@name@ *)dataptr[1])));
+ *((@type@ *)dataptr[1]) = @to@(accum +
+ @from@(*((@type@ *)dataptr[1])));
#endif
return;
}
@@ -1204,9 +1208,9 @@ static void
npy_intp *strides, npy_intp count)
{
#if @complex@
- npy_@temp@ accum_re = 0, accum_im = 0;
+ @temptype@ accum_re = 0, accum_im = 0;
#else
- npy_@temp@ accum = 0;
+ @temptype@ accum = 0;
#endif
#if (@nop@ == 1) || (@nop@ <= 3 && !@complex@)
@@ -1228,25 +1232,25 @@ static void
while (count--) {
#if !@complex@
# if @nop@ == 1
- accum += @from@(*(npy_@name@ *)data0);
+ accum += @from@(*(@type@ *)data0);
data0 += stride0;
# elif @nop@ == 2
- accum += @from@(*(npy_@name@ *)data0) *
- @from@(*(npy_@name@ *)data1);
+ accum += @from@(*(@type@ *)data0) *
+ @from@(*(@type@ *)data1);
data0 += stride0;
data1 += stride1;
# elif @nop@ == 3
- accum += @from@(*(npy_@name@ *)data0) *
- @from@(*(npy_@name@ *)data1) *
- @from@(*(npy_@name@ *)data2);
+ accum += @from@(*(@type@ *)data0) *
+ @from@(*(@type@ *)data1) *
+ @from@(*(@type@ *)data2);
data0 += stride0;
data1 += stride1;
data2 += stride2;
# else
- npy_@temp@ temp = @from@(*(npy_@name@ *)dataptr[0]);
+ @temptype@ temp = @from@(*(@type@ *)dataptr[0]);
int i;
for (i = 1; i < nop; ++i) {
- temp *= @from@(*(npy_@name@ *)dataptr[i]);
+ temp *= @from@(*(@type@ *)dataptr[i]);
}
accum += temp;
for (i = 0; i < nop; ++i) {
@@ -1255,8 +1259,8 @@ static void
# endif
#else /* complex */
# if @nop@ == 1
- accum_re += ((npy_@temp@ *)data0)[0];
- accum_im += ((npy_@temp@ *)data0)[1];
+ accum_re += ((@temptype@ *)data0)[0];
+ accum_im += ((@temptype@ *)data0)[1];
data0 += stride0;
# else
# if @nop@ <= 3
@@ -1264,15 +1268,15 @@ static void
# else
#define _SUMPROD_NOP nop
# endif
- npy_@temp@ re, im, tmp;
+ @temptype@ re, im, tmp;
int i;
- re = ((npy_@temp@ *)dataptr[0])[0];
- im = ((npy_@temp@ *)dataptr[0])[1];
+ re = ((@temptype@ *)dataptr[0])[0];
+ im = ((@temptype@ *)dataptr[0])[1];
for (i = 1; i < _SUMPROD_NOP; ++i) {
- tmp = re * ((npy_@temp@ *)dataptr[i])[0] -
- im * ((npy_@temp@ *)dataptr[i])[1];
- im = re * ((npy_@temp@ *)dataptr[i])[1] +
- im * ((npy_@temp@ *)dataptr[i])[0];
+ tmp = re * ((@temptype@ *)dataptr[i])[0] -
+ im * ((@temptype@ *)dataptr[i])[1];
+ im = re * ((@temptype@ *)dataptr[i])[1] +
+ im * ((@temptype@ *)dataptr[i])[0];
re = tmp;
}
accum_re += re;
@@ -1287,19 +1291,19 @@ static void
#if @complex@
# if @nop@ <= 3
- ((npy_@temp@ *)dataptr[@nop@])[0] += accum_re;
- ((npy_@temp@ *)dataptr[@nop@])[1] += accum_im;
+ ((@temptype@ *)dataptr[@nop@])[0] += accum_re;
+ ((@temptype@ *)dataptr[@nop@])[1] += accum_im;
# else
- ((npy_@temp@ *)dataptr[nop])[0] += accum_re;
- ((npy_@temp@ *)dataptr[nop])[1] += accum_im;
+ ((@temptype@ *)dataptr[nop])[0] += accum_re;
+ ((@temptype@ *)dataptr[nop])[1] += accum_im;
# endif
#else
# if @nop@ <= 3
- *((npy_@name@ *)dataptr[@nop@]) = @to@(accum +
- @from@(*((npy_@name@ *)dataptr[@nop@])));
+ *((@type@ *)dataptr[@nop@]) = @to@(accum +
+ @from@(*((@type@ *)dataptr[@nop@])));
# else
- *((npy_@name@ *)dataptr[nop]) = @to@(accum +
- @from@(*((npy_@name@ *)dataptr[nop])));
+ *((@type@ *)dataptr[nop]) = @to@(accum +
+ @from@(*((@type@ *)dataptr[nop])));
# endif
#endif
diff --git a/numpy/core/src/multiarray/flagsobject.c b/numpy/core/src/multiarray/flagsobject.c
index 3de49b74c..9ada8a26b 100644
--- a/numpy/core/src/multiarray/flagsobject.c
+++ b/numpy/core/src/multiarray/flagsobject.c
@@ -6,7 +6,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -118,8 +117,8 @@ PyArray_UpdateFlags(PyArrayObject *ret, int flagmask)
static int
_IsContiguous(PyArrayObject *ap)
{
- intp sd;
- intp dim;
+ npy_intp sd;
+ npy_intp dim;
int i;
if (PyArray_NDIM(ap) == 0) {
@@ -148,8 +147,8 @@ _IsContiguous(PyArrayObject *ap)
static int
_IsFortranContiguous(PyArrayObject *ap)
{
- intp sd;
- intp dim;
+ npy_intp sd;
+ npy_intp dim;
int i;
if (PyArray_NDIM(ap) == 0) {
diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c
index 8dddb592f..bcd6f207e 100644
--- a/numpy/core/src/multiarray/getset.c
+++ b/numpy/core/src/multiarray/getset.c
@@ -6,7 +6,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_config.h"
@@ -72,9 +71,9 @@ array_shape_set(PyArrayObject *self, PyObject *val)
}
((PyArrayObject_fields *)self)->strides = PyArray_DIMS(self) + nd;
((PyArrayObject_fields *)self)->maskna_strides = PyArray_DIMS(self) + 2*nd;
- memcpy(PyArray_DIMS(self), PyArray_DIMS(ret), nd*sizeof(intp));
- memcpy(PyArray_STRIDES(self), PyArray_STRIDES(ret), nd*sizeof(intp));
- memcpy(PyArray_MASKNA_STRIDES(self), PyArray_MASKNA_STRIDES(ret), nd*sizeof(intp));
+ memcpy(PyArray_DIMS(self), PyArray_DIMS(ret), nd*sizeof(npy_intp));
+ memcpy(PyArray_STRIDES(self), PyArray_STRIDES(ret), nd*sizeof(npy_intp));
+ memcpy(PyArray_MASKNA_STRIDES(self), PyArray_MASKNA_STRIDES(ret), nd*sizeof(npy_intp));
}
else {
((PyArrayObject_fields *)self)->dimensions = NULL;
@@ -97,8 +96,8 @@ array_strides_set(PyArrayObject *self, PyObject *obj)
{
PyArray_Dims newstrides = {NULL, 0};
PyArrayObject *new;
- intp numbytes = 0;
- intp offset = 0;
+ npy_intp numbytes = 0;
+ npy_intp offset = 0;
Py_ssize_t buf_len;
char *buf;
@@ -140,7 +139,7 @@ array_strides_set(PyArrayObject *self, PyObject *obj)
"compatible with available memory");
goto fail;
}
- memcpy(PyArray_STRIDES(self), newstrides.ptr, sizeof(intp)*newstrides.len);
+ memcpy(PyArray_STRIDES(self), newstrides.ptr, sizeof(npy_intp)*newstrides.len);
PyArray_UpdateFlags(self, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS);
PyDimMem_FREE(newstrides.ptr);
return 0;
@@ -285,7 +284,7 @@ array_data_get(PyArrayObject *self)
#if defined(NPY_PY3K)
return PyMemoryView_FromObject((PyObject *)self);
#else
- intp nbytes;
+ npy_intp nbytes;
if (!(PyArray_ISONESEGMENT(self))) {
PyErr_SetString(PyExc_AttributeError, "cannot get single-"\
"segment buffer for discontiguous array");
@@ -362,11 +361,11 @@ array_itemsize_get(PyArrayObject *self)
static PyObject *
array_size_get(PyArrayObject *self)
{
- intp size=PyArray_SIZE(self);
-#if SIZEOF_INTP <= SIZEOF_LONG
+ npy_intp size=PyArray_SIZE(self);
+#if NPY_SIZEOF_INTP <= SIZEOF_LONG
return PyInt_FromLong((long) size);
#else
- if (size > MAX_LONG || size < MIN_LONG) {
+ if (size > NPY_MAX_LONG || size < NPY_MIN_LONG) {
return PyLong_FromLongLong(size);
}
else {
@@ -378,11 +377,11 @@ array_size_get(PyArrayObject *self)
static PyObject *
array_nbytes_get(PyArrayObject *self)
{
- intp nbytes = PyArray_NBYTES(self);
-#if SIZEOF_INTP <= SIZEOF_LONG
+ npy_intp nbytes = PyArray_NBYTES(self);
+#if NPY_SIZEOF_INTP <= SIZEOF_LONG
return PyInt_FromLong((long) nbytes);
#else
- if (nbytes > MAX_LONG || nbytes < MIN_LONG) {
+ if (nbytes > NPY_MAX_LONG || nbytes < NPY_MIN_LONG) {
return PyLong_FromLongLong(nbytes);
}
else {
@@ -405,7 +404,7 @@ static int
array_descr_set(PyArrayObject *self, PyObject *arg)
{
PyArray_Descr *newtype = NULL;
- intp newdim;
+ npy_intp newdim;
int i;
char *msg = "new type not compatible with array.";
@@ -527,7 +526,7 @@ array_struct_get(PyArrayObject *self)
PyArrayInterface *inter;
PyObject *ret;
- inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface));
+ inter = (PyArrayInterface *)PyArray_malloc(sizeof(PyArrayInterface));
if (inter==NULL) {
return PyErr_NoMemory();
}
@@ -544,14 +543,14 @@ array_struct_get(PyArrayObject *self)
*when the array is "reshaped".
*/
if (PyArray_NDIM(self) > 0) {
- inter->shape = (intp *)_pya_malloc(2*sizeof(intp)*PyArray_NDIM(self));
+ inter->shape = (npy_intp *)PyArray_malloc(2*sizeof(npy_intp)*PyArray_NDIM(self));
if (inter->shape == NULL) {
- _pya_free(inter);
+ PyArray_free(inter);
return PyErr_NoMemory();
}
inter->strides = inter->shape + PyArray_NDIM(self);
- memcpy(inter->shape, PyArray_DIMS(self), sizeof(intp)*PyArray_NDIM(self));
- memcpy(inter->strides, PyArray_STRIDES(self), sizeof(intp)*PyArray_NDIM(self));
+ memcpy(inter->shape, PyArray_DIMS(self), sizeof(npy_intp)*PyArray_NDIM(self));
+ memcpy(inter->strides, PyArray_STRIDES(self), sizeof(npy_intp)*PyArray_NDIM(self));
}
else {
inter->shape = NULL;
@@ -564,7 +563,7 @@ array_struct_get(PyArrayObject *self)
PyErr_Clear();
}
else {
- inter->flags &= ARR_HAS_DESCR;
+ inter->flags &= NPY_ARR_HAS_DESCR;
}
}
else {
diff --git a/numpy/core/src/multiarray/hashdescr.c b/numpy/core/src/multiarray/hashdescr.c
index b64122985..a5ca2d3c5 100644
--- a/numpy/core/src/multiarray/hashdescr.c
+++ b/numpy/core/src/multiarray/hashdescr.c
@@ -2,7 +2,7 @@
#include <Python.h>
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 4aa52d230..00398e49b 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -33,8 +32,8 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
PyArray_Descr *dtype;
PyArray_FastTakeFunc *func;
PyArrayObject *obj = NULL, *self, *indices;
- intp nd, i, j, n, m, max_item, tmp, chunk, nelem;
- intp shape[MAX_DIMS];
+ npy_intp nd, i, j, n, m, max_item, tmp, chunk, nelem;
+ npy_intp shape[NPY_MAXDIMS];
char *src, *dest;
int err, use_maskna = 0;
@@ -174,7 +173,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_RAISE:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
tmp = tmp + max_item;
}
@@ -199,7 +198,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_WRAP:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
while (tmp < 0) {
tmp += max_item;
@@ -225,7 +224,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_CLIP:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
tmp = 0;
}
@@ -252,7 +251,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_RAISE:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
tmp = tmp + max_item;
}
@@ -271,7 +270,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_WRAP:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
while (tmp < 0) {
tmp += max_item;
@@ -291,7 +290,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
case NPY_CLIP:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
- tmp = ((intp *)(PyArray_DATA(indices)))[j];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
if (tmp < 0) {
tmp = 0;
}
@@ -307,7 +306,7 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
}
}
else {
- err = func(dest, src, (intp *)(PyArray_DATA(indices)),
+ err = func(dest, src, (npy_intp *)(PyArray_DATA(indices)),
max_item, n, m, nelem, clipmode);
if (err) {
goto fail;
@@ -339,7 +338,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
NPY_CLIPMODE clipmode)
{
PyArrayObject *indices, *values;
- intp i, chunk, ni, max_item, nv, tmp;
+ npy_intp i, chunk, ni, max_item, nv, tmp;
char *src, *dest;
int copied = 0;
@@ -389,7 +388,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_RAISE:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk*(i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
tmp = tmp + max_item;
}
@@ -407,7 +406,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_WRAP:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk * (i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
while (tmp < 0) {
tmp += max_item;
@@ -426,7 +425,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_CLIP:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk * (i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
tmp = 0;
}
@@ -445,7 +444,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_RAISE:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk * (i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
tmp = tmp + max_item;
}
@@ -461,7 +460,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_WRAP:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk * (i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
while (tmp < 0) {
tmp += max_item;
@@ -478,7 +477,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
case NPY_CLIP:
for (i = 0; i < ni; i++) {
src = PyArray_DATA(values) + chunk * (i % nv);
- tmp = ((intp *)(PyArray_DATA(indices)))[i];
+ tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
if (tmp < 0) {
tmp = 0;
}
@@ -518,7 +517,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0)
PyArray_FastPutmaskFunc *func;
PyArrayObject *mask, *values;
PyArray_Descr *dtype;
- intp i, chunk, ni, max_item, nv, tmp;
+ npy_intp i, chunk, ni, max_item, nv, tmp;
char *src, *dest;
int copied = 0;
@@ -622,9 +621,9 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0)
NPY_NO_EXPORT PyObject *
PyArray_Repeat(PyArrayObject *aop, PyObject *op, int axis)
{
- intp *counts;
- intp n, n_outer, i, j, k, chunk, total;
- intp tmp;
+ npy_intp *counts;
+ npy_intp n, n_outer, i, j, k, chunk, total;
+ npy_intp tmp;
int nd;
PyArrayObject *repeats = NULL;
PyObject *ap = NULL;
@@ -730,11 +729,11 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out,
PyArrayObject *obj = NULL;
PyArray_Descr *dtype;
int n, elsize;
- intp i;
+ npy_intp i;
char *ret_data;
PyArrayObject **mps, *ap;
PyArrayMultiIterObject *multi = NULL;
- intp mi;
+ npy_intp mi;
ap = NULL;
/*
@@ -804,7 +803,7 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out,
ret_data = PyArray_DATA(obj);
while (PyArray_MultiIter_NOTDONE(multi)) {
- mi = *((intp *)PyArray_MultiIter_DATA(multi, n));
+ mi = *((npy_intp *)PyArray_MultiIter_DATA(multi, n));
if (mi < 0 || mi >= n) {
switch(clipmode) {
case NPY_RAISE:
@@ -877,11 +876,11 @@ _new_sort(PyArrayObject *op, int axis, NPY_SORTKIND which)
{
PyArrayIterObject *it;
int needcopy = 0, swap;
- intp N, size;
+ npy_intp N, size;
int elsize;
- intp astride;
+ npy_intp astride;
PyArray_SortFunc *sort;
- BEGIN_THREADS_DEF;
+ NPY_BEGIN_THREADS_DEF;
it = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, &axis);
swap = !PyArray_ISNOTSWAPPED(op);
@@ -897,25 +896,25 @@ _new_sort(PyArrayObject *op, int axis, NPY_SORTKIND which)
astride = PyArray_STRIDES(op)[axis];
needcopy = !(PyArray_FLAGS(op) & NPY_ARRAY_ALIGNED) ||
- (astride != (intp) elsize) || swap;
+ (astride != (npy_intp) elsize) || swap;
if (needcopy) {
char *buffer = PyDataMem_NEW(N*elsize);
while (size--) {
- _unaligned_strided_byte_copy(buffer, (intp) elsize, it->dataptr,
+ _unaligned_strided_byte_copy(buffer, (npy_intp) elsize, it->dataptr,
astride, N, elsize);
if (swap) {
- _strided_byte_swap(buffer, (intp) elsize, N, elsize);
+ _strided_byte_swap(buffer, (npy_intp) elsize, N, elsize);
}
if (sort(buffer, N, op) < 0) {
PyDataMem_FREE(buffer);
goto fail;
}
if (swap) {
- _strided_byte_swap(buffer, (intp) elsize, N, elsize);
+ _strided_byte_swap(buffer, (npy_intp) elsize, N, elsize);
}
_unaligned_strided_byte_copy(it->dataptr, astride, buffer,
- (intp) elsize, N, elsize);
+ (npy_intp) elsize, N, elsize);
PyArray_ITER_NEXT(it);
}
PyDataMem_FREE(buffer);
@@ -946,11 +945,11 @@ _new_argsort(PyArrayObject *op, int axis, NPY_SORTKIND which)
PyArrayIterObject *rit = NULL;
PyArrayObject *ret;
int needcopy = 0, i;
- intp N, size;
+ npy_intp N, size;
int elsize, swap;
- intp astride, rstride, *iptr;
+ npy_intp astride, rstride, *iptr;
PyArray_ArgSortFunc *argsort;
- BEGIN_THREADS_DEF;
+ NPY_BEGIN_THREADS_DEF;
ret = (PyArrayObject *)PyArray_New(Py_TYPE(op),
PyArray_NDIM(op),
@@ -976,30 +975,30 @@ _new_argsort(PyArrayObject *op, int axis, NPY_SORTKIND which)
rstride = PyArray_STRIDE(ret,axis);
needcopy = swap || !(PyArray_FLAGS(op) & NPY_ARRAY_ALIGNED) ||
- (astride != (intp) elsize) ||
- (rstride != sizeof(intp));
+ (astride != (npy_intp) elsize) ||
+ (rstride != sizeof(npy_intp));
if (needcopy) {
char *valbuffer, *indbuffer;
valbuffer = PyDataMem_NEW(N*elsize);
- indbuffer = PyDataMem_NEW(N*sizeof(intp));
+ indbuffer = PyDataMem_NEW(N*sizeof(npy_intp));
while (size--) {
- _unaligned_strided_byte_copy(valbuffer, (intp) elsize, it->dataptr,
+ _unaligned_strided_byte_copy(valbuffer, (npy_intp) elsize, it->dataptr,
astride, N, elsize);
if (swap) {
- _strided_byte_swap(valbuffer, (intp) elsize, N, elsize);
+ _strided_byte_swap(valbuffer, (npy_intp) elsize, N, elsize);
}
- iptr = (intp *)indbuffer;
+ iptr = (npy_intp *)indbuffer;
for (i = 0; i < N; i++) {
*iptr++ = i;
}
- if (argsort(valbuffer, (intp *)indbuffer, N, op) < 0) {
+ if (argsort(valbuffer, (npy_intp *)indbuffer, N, op) < 0) {
PyDataMem_FREE(valbuffer);
PyDataMem_FREE(indbuffer);
goto fail;
}
_unaligned_strided_byte_copy(rit->dataptr, rstride, indbuffer,
- sizeof(intp), N, sizeof(intp));
+ sizeof(npy_intp), N, sizeof(npy_intp));
PyArray_ITER_NEXT(it);
PyArray_ITER_NEXT(rit);
}
@@ -1008,11 +1007,11 @@ _new_argsort(PyArrayObject *op, int axis, NPY_SORTKIND which)
}
else {
while (size--) {
- iptr = (intp *)rit->dataptr;
+ iptr = (npy_intp *)rit->dataptr;
for (i = 0; i < N; i++) {
*iptr++ = i;
}
- if (argsort(it->dataptr, (intp *)rit->dataptr, N, op) < 0) {
+ if (argsort(it->dataptr, (npy_intp *)rit->dataptr, N, op) < 0) {
goto fail;
}
PyArray_ITER_NEXT(it);
@@ -1074,7 +1073,7 @@ qsortCompare (const void *a, const void *b)
}
/* These swap axes in-place if necessary */
-#define SWAPINTP(a,b) {intp c; c=(a); (a) = (b); (b) = c;}
+#define SWAPINTP(a,b) {npy_intp c; c=(a); (a) = (b); (b) = c;}
#define SWAPAXES2(ap) { \
orign = PyArray_NDIM(ap)-1; \
if (axis != orign) { \
@@ -1177,8 +1176,8 @@ static int
argsort_static_compare(const void *ip1, const void *ip2)
{
int isize = PyArray_DESCR(global_obj)->elsize;
- const intp *ipa = ip1;
- const intp *ipb = ip2;
+ const npy_intp *ipa = ip1;
+ const npy_intp *ipb = ip2;
return PyArray_DESCR(global_obj)->f->compare(global_data + (isize * *ipa),
global_data + (isize * *ipb),
global_obj);
@@ -1191,8 +1190,8 @@ NPY_NO_EXPORT PyObject *
PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which)
{
PyArrayObject *ap = NULL, *ret = NULL, *store, *op2;
- intp *ip;
- intp i, j, n, m, orign;
+ npy_intp *ip;
+ npy_intp i, j, n, m, orign;
int argsort_elsize;
char *store_ptr;
@@ -1206,7 +1205,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which)
if (ret == NULL) {
return NULL;
}
- *((intp *)PyArray_DATA(ret)) = 0;
+ *((npy_intp *)PyArray_DATA(ret)) = 0;
return (PyObject *)ret;
}
@@ -1244,7 +1243,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which)
if (ret == NULL) {
goto fail;
}
- ip = (intp *)PyArray_DATA(ret);
+ ip = (npy_intp *)PyArray_DATA(ret);
argsort_elsize = PyArray_DESCR(op)->elsize;
m = PyArray_DIMS(op)[PyArray_NDIM(op)-1];
if (m == 0) {
@@ -1259,7 +1258,7 @@ PyArray_ArgSort(PyArrayObject *op, int axis, NPY_SORTKIND which)
for (j = 0; j < m; j++) {
ip[j] = j;
}
- qsort((char *)ip, m, sizeof(intp), argsort_static_compare);
+ qsort((char *)ip, m, sizeof(npy_intp), argsort_static_compare);
}
global_data = store_ptr;
global_obj = store;
@@ -1295,10 +1294,10 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
int n;
int nd;
int needcopy = 0, i,j;
- intp N, size;
+ npy_intp N, size;
int elsize;
int maxelsize;
- intp astride, rstride, *iptr;
+ npy_intp astride, rstride, *iptr;
int object = 0;
PyArray_ArgSortFunc *argsort;
NPY_BEGIN_THREADS_DEF;
@@ -1309,13 +1308,13 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
"need sequence of keys with len > 0 in lexsort");
return NULL;
}
- mps = (PyArrayObject **) _pya_malloc(n*NPY_SIZEOF_PYARRAYOBJECT);
+ mps = (PyArrayObject **) PyArray_malloc(n*NPY_SIZEOF_PYARRAYOBJECT);
if (mps == NULL) {
return PyErr_NoMemory();
}
- its = (PyArrayIterObject **) _pya_malloc(n*sizeof(PyArrayIterObject));
+ its = (PyArrayIterObject **) PyArray_malloc(n*sizeof(PyArrayIterObject));
if (its == NULL) {
- _pya_free(mps);
+ PyArray_free(mps);
return PyErr_NoMemory();
}
for (i = 0; i < n; i++) {
@@ -1368,7 +1367,7 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
if (ret == NULL) {
goto fail;
}
- *((intp *)(PyArray_DATA(ret))) = 0;
+ *((npy_intp *)(PyArray_DATA(ret))) = 0;
goto finish;
}
if (axis < 0) {
@@ -1399,12 +1398,12 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
N = PyArray_DIMS(mps[0])[axis];
rstride = PyArray_STRIDE(ret, axis);
maxelsize = PyArray_DESCR(mps[0])->elsize;
- needcopy = (rstride != sizeof(intp));
+ needcopy = (rstride != sizeof(npy_intp));
for (j = 0; j < n; j++) {
needcopy = needcopy
|| PyArray_ISBYTESWAPPED(mps[j])
|| !(PyArray_FLAGS(mps[j]) & NPY_ARRAY_ALIGNED)
- || (PyArray_STRIDES(mps[j])[axis] != (intp)PyArray_DESCR(mps[j])->elsize);
+ || (PyArray_STRIDES(mps[j])[axis] != (npy_intp)PyArray_DESCR(mps[j])->elsize);
if (PyArray_DESCR(mps[j])->elsize > maxelsize) {
maxelsize = PyArray_DESCR(mps[j])->elsize;
}
@@ -1415,13 +1414,13 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
int *swaps;
valbuffer = PyDataMem_NEW(N*maxelsize);
- indbuffer = PyDataMem_NEW(N*sizeof(intp));
+ indbuffer = PyDataMem_NEW(N*sizeof(npy_intp));
swaps = malloc(n*sizeof(int));
for (j = 0; j < n; j++) {
swaps[j] = PyArray_ISBYTESWAPPED(mps[j]);
}
while (size--) {
- iptr = (intp *)indbuffer;
+ iptr = (npy_intp *)indbuffer;
for (i = 0; i < N; i++) {
*iptr++ = i;
}
@@ -1429,12 +1428,12 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
elsize = PyArray_DESCR(mps[j])->elsize;
astride = PyArray_STRIDES(mps[j])[axis];
argsort = PyArray_DESCR(mps[j])->f->argsort[NPY_MERGESORT];
- _unaligned_strided_byte_copy(valbuffer, (intp) elsize,
+ _unaligned_strided_byte_copy(valbuffer, (npy_intp) elsize,
its[j]->dataptr, astride, N, elsize);
if (swaps[j]) {
- _strided_byte_swap(valbuffer, (intp) elsize, N, elsize);
+ _strided_byte_swap(valbuffer, (npy_intp) elsize, N, elsize);
}
- if (argsort(valbuffer, (intp *)indbuffer, N, mps[j]) < 0) {
+ if (argsort(valbuffer, (npy_intp *)indbuffer, N, mps[j]) < 0) {
PyDataMem_FREE(valbuffer);
PyDataMem_FREE(indbuffer);
free(swaps);
@@ -1443,7 +1442,7 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
PyArray_ITER_NEXT(its[j]);
}
_unaligned_strided_byte_copy(rit->dataptr, rstride, indbuffer,
- sizeof(intp), N, sizeof(intp));
+ sizeof(npy_intp), N, sizeof(npy_intp));
PyArray_ITER_NEXT(rit);
}
PyDataMem_FREE(valbuffer);
@@ -1452,13 +1451,13 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
}
else {
while (size--) {
- iptr = (intp *)rit->dataptr;
+ iptr = (npy_intp *)rit->dataptr;
for (i = 0; i < N; i++) {
*iptr++ = i;
}
for (j = 0; j < n; j++) {
argsort = PyArray_DESCR(mps[j])->f->argsort[NPY_MERGESORT];
- if (argsort(its[j]->dataptr, (intp *)rit->dataptr,
+ if (argsort(its[j]->dataptr, (npy_intp *)rit->dataptr,
N, mps[j]) < 0) {
goto fail;
}
@@ -1478,8 +1477,8 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
Py_XDECREF(its[i]);
}
Py_XDECREF(rit);
- _pya_free(mps);
- _pya_free(its);
+ PyArray_free(mps);
+ PyArray_free(its);
return (PyObject *)ret;
fail:
@@ -1490,8 +1489,8 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
Py_XDECREF(mps[i]);
Py_XDECREF(its[i]);
}
- _pya_free(mps);
- _pya_free(its);
+ PyArray_free(mps);
+ PyArray_free(its);
return NULL;
}
@@ -1512,19 +1511,19 @@ static void
local_search_left(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret)
{
PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- intp nkeys = PyArray_SIZE(key);
+ npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
+ npy_intp nkeys = PyArray_SIZE(key);
char *parr = PyArray_DATA(arr);
char *pkey = PyArray_DATA(key);
- intp *pret = (intp *)PyArray_DATA(ret);
+ npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
int elsize = PyArray_DESCR(arr)->elsize;
- intp i;
+ npy_intp i;
for (i = 0; i < nkeys; ++i) {
- intp imin = 0;
- intp imax = nelts;
+ npy_intp imin = 0;
+ npy_intp imax = nelts;
while (imin < imax) {
- intp imid = imin + ((imax - imin) >> 1);
+ npy_intp imid = imin + ((imax - imin) >> 1);
if (compare(parr + elsize*imid, pkey, key) < 0) {
imin = imid + 1;
}
@@ -1555,19 +1554,19 @@ static void
local_search_right(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret)
{
PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- intp nkeys = PyArray_SIZE(key);
+ npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
+ npy_intp nkeys = PyArray_SIZE(key);
char *parr = PyArray_DATA(arr);
char *pkey = PyArray_DATA(key);
- intp *pret = (intp *)PyArray_DATA(ret);
+ npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
int elsize = PyArray_DESCR(arr)->elsize;
- intp i;
+ npy_intp i;
for(i = 0; i < nkeys; ++i) {
- intp imin = 0;
- intp imax = nelts;
+ npy_intp imin = 0;
+ npy_intp imax = nelts;
while (imin < imax) {
- intp imid = imin + ((imax - imin) >> 1);
+ npy_intp imid = imin + ((imax - imin) >> 1);
if (compare(parr + elsize*imid, pkey, key) <= 0) {
imin = imid + 1;
}
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index 4347b9aee..2c173e3e9 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -632,7 +631,7 @@ static void
arrayiter_dealloc(PyArrayIterObject *it)
{
array_iter_base_dealloc(it);
- _pya_free(it);
+ PyArray_free(it);
}
static Py_ssize_t
@@ -670,7 +669,7 @@ iter_subscript_Bool(PyArrayIterObject *self, PyArrayObject *ind)
dptr = PyArray_DATA(ind);
/* Get size of return array */
while (counter--) {
- if (*((Bool *)dptr) != 0) {
+ if (*((npy_bool *)dptr) != 0) {
count++;
}
dptr += strides;
@@ -692,7 +691,7 @@ iter_subscript_Bool(PyArrayIterObject *self, PyArrayObject *ind)
/* Loop over Boolean array */
swap = (PyArray_ISNOTSWAPPED(self->ao) != PyArray_ISNOTSWAPPED(ret));
while (counter--) {
- if (*((Bool *)dptr) != 0) {
+ if (*((npy_bool *)dptr) != 0) {
copyswap(optr, self->dataptr, swap, self->ao);
optr += itemsize;
}
@@ -723,8 +722,8 @@ iter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)
}
if (num < 0 || num >= self->size) {
PyErr_Format(PyExc_IndexError,
- "index %"INTP_FMT" out of bounds" \
- " 0<=index<%"INTP_FMT,
+ "index %"NPY_INTP_FMT" out of bounds" \
+ " 0<=index<%"NPY_INTP_FMT,
num, self->size);
PyArray_ITER_RESET(self);
return NULL;
@@ -764,8 +763,8 @@ iter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)
}
if (num < 0 || num >= self->size) {
PyErr_Format(PyExc_IndexError,
- "index %"INTP_FMT" out of bounds" \
- " 0<=index<%"INTP_FMT,
+ "index %"NPY_INTP_FMT" out of bounds" \
+ " 0<=index<%"NPY_INTP_FMT,
num, self->size);
Py_DECREF(ind_it);
Py_DECREF(ret);
@@ -964,7 +963,7 @@ iter_ass_sub_Bool(PyArrayIterObject *self, PyArrayObject *ind,
/* Loop over Boolean array */
copyswap = PyArray_DESCR(self->ao)->f->copyswap;
while (counter--) {
- if (*((Bool *)dptr) != 0) {
+ if (*((npy_bool *)dptr) != 0) {
copyswap(self->dataptr, val->dataptr, swap, self->ao);
PyArray_ITER_NEXT(val);
if (val->index == val->size) {
@@ -1006,8 +1005,8 @@ iter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,
}
if ((num < 0) || (num >= self->size)) {
PyErr_Format(PyExc_IndexError,
- "index %"INTP_FMT" out of bounds" \
- " 0<=index<%"INTP_FMT, num,
+ "index %"NPY_INTP_FMT" out of bounds" \
+ " 0<=index<%"NPY_INTP_FMT, num,
self->size);
Py_DECREF(ind_it);
return -1;
@@ -1425,7 +1424,7 @@ PyArray_Broadcast(PyArrayMultiIterObject *mit)
/* Discover the broadcast number of dimensions */
for (i = 0, nd = 0; i < mit->numiter; i++) {
- nd = MAX(nd, PyArray_NDIM(mit->iters[i]->ao));
+ nd = PyArray_MAX(nd, PyArray_NDIM(mit->iters[i]->ao));
}
mit->nd = nd;
@@ -1724,14 +1723,14 @@ arraymultiter_dealloc(PyArrayMultiIterObject *multi)
static PyObject *
arraymultiter_size_get(PyArrayMultiIterObject *self)
{
-#if SIZEOF_INTP <= SIZEOF_LONG
+#if NPY_SIZEOF_INTP <= SIZEOF_LONG
return PyInt_FromLong((long) self->size);
#else
- if (self->size < MAX_LONG) {
+ if (self->size < NPY_MAX_LONG) {
return PyInt_FromLong((long) self->size);
}
else {
- return PyLong_FromLongLong((longlong) self->size);
+ return PyLong_FromLongLong((npy_longlong) self->size);
}
#endif
}
@@ -1739,14 +1738,14 @@ arraymultiter_size_get(PyArrayMultiIterObject *self)
static PyObject *
arraymultiter_index_get(PyArrayMultiIterObject *self)
{
-#if SIZEOF_INTP <= SIZEOF_LONG
+#if NPY_SIZEOF_INTP <= SIZEOF_LONG
return PyInt_FromLong((long) self->index);
#else
- if (self->size < MAX_LONG) {
+ if (self->size < NPY_MAX_LONG) {
return PyInt_FromLong((long) self->index);
}
else {
- return PyLong_FromLongLong((longlong) self->index);
+ return PyLong_FromLongLong((npy_longlong) self->index);
}
#endif
}
@@ -2138,7 +2137,7 @@ PyArray_NeighborhoodIterNew(PyArrayIterObject *x, npy_intp *bounds,
clean_x:
Py_DECREF(ret->_internal_iter);
array_iter_base_dealloc((PyArrayIterObject*)ret);
- _pya_free((PyArrayObject*)ret);
+ PyArray_free((PyArrayObject*)ret);
return NULL;
}
@@ -2155,7 +2154,7 @@ static void neighiter_dealloc(PyArrayNeighborhoodIterObject* iter)
Py_DECREF(iter->_internal_iter);
array_iter_base_dealloc((PyArrayIterObject*)iter);
- _pya_free((PyArrayObject*)iter);
+ PyArray_free((PyArrayObject*)iter);
}
NPY_NO_EXPORT PyTypeObject PyArrayNeighborhoodIter_Type = {
diff --git a/numpy/core/src/multiarray/iterators.h b/numpy/core/src/multiarray/iterators.h
index e877f8520..6d648810e 100644
--- a/numpy/core/src/multiarray/iterators.h
+++ b/numpy/core/src/multiarray/iterators.h
@@ -22,8 +22,8 @@ NPY_NO_EXPORT int
iter_ass_subscript(PyArrayIterObject *, PyObject *, PyObject *);
NPY_NO_EXPORT int
-slice_GetIndices(PySliceObject *r, intp length,
- intp *start, intp *stop, intp *step,
- intp *slicelength);
+slice_GetIndices(PySliceObject *r, npy_intp length,
+ npy_intp *start, npy_intp *stop, npy_intp *step,
+ npy_intp *slicelength);
#endif
diff --git a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
index ec2173daf..2ba531116 100644
--- a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
+++ b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
@@ -14,7 +14,7 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include <numpy/npy_cpu.h>
#include <numpy/halffloat.h>
@@ -658,11 +658,16 @@ NPY_NO_EXPORT PyArray_StridedUnaryOp *
* byte, short, int, long, longlong,
* half, float, double, longdouble,
* cfloat, cdouble, clongdouble#
- * #rname1 = bool,
- * ubyte, ushort, uint, ulong, ulonglong,
- * byte, short, int, long, longlong,
- * half, float, double, longdouble,
- * float, double, longdouble#
+ * #type1 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #rtype1 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble#
* #is_bool1 = 1, 0*17#
* #is_half1 = 0*11, 1, 0*6#
* #is_float1 = 0*12, 1, 0, 0, 1, 0, 0#
@@ -682,11 +687,16 @@ NPY_NO_EXPORT PyArray_StridedUnaryOp *
* byte, short, int, long, longlong,
* half, float, double, longdouble,
* cfloat, cdouble, clongdouble#
- * #rname2 = bool,
- * ubyte, ushort, uint, ulong, ulonglong,
- * byte, short, int, long, longlong,
- * half, float, double, longdouble,
- * float, double, longdouble#
+ * #type2 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #rtype2 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble#
* #is_bool2 = 1, 0*17#
* #is_half2 = 0*11, 1, 0*6#
* #is_float2 = 0*12, 1, 0, 0, 1, 0, 0#
@@ -710,7 +720,7 @@ NPY_NO_EXPORT PyArray_StridedUnaryOp *
# elif @is_double1@
# define _TYPE1 npy_uint64
# else
-# define _TYPE1 npy_@rname1@
+# define _TYPE1 @rtype1@
# endif
# if @is_float2@
@@ -718,13 +728,13 @@ NPY_NO_EXPORT PyArray_StridedUnaryOp *
# elif @is_double2@
# define _TYPE2 npy_uint64
# else
-# define _TYPE2 npy_@rname2@
+# define _TYPE2 @rtype2@
# endif
#else
-#define _TYPE1 npy_@rname1@
-#define _TYPE2 npy_@rname2@
+#define _TYPE1 @rtype1@
+#define _TYPE2 @rtype2@
#endif
@@ -832,8 +842,8 @@ static void
#endif
#if @contig@
- dst += sizeof(npy_@name2@);
- src += sizeof(npy_@name1@);
+ dst += sizeof(@type2@);
+ src += sizeof(@type1@);
#else
dst += dst_stride;
src += src_stride;
@@ -871,6 +881,11 @@ PyArray_GetStridedNumericCastFn(int aligned, npy_intp src_stride,
* byte, short, int, long, longlong,
* half, float, double, longdouble,
* cfloat, cdouble, clongdouble#
+ * #type1 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
*/
case NPY_@NAME1@:
@@ -888,21 +903,26 @@ PyArray_GetStridedNumericCastFn(int aligned, npy_intp src_stride,
* byte, short, int, long, longlong,
* half, float, double, longdouble,
* cfloat, cdouble, clongdouble#
+ * #type2 = npy_bool,
+ * npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong,
+ * npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
*/
case NPY_@NAME2@:
/*printf("ret fn %d %d\n", NPY_@NAME1@, NPY_@NAME2@);*/
# if NPY_USE_UNALIGNED_ACCESS
- if (src_stride == sizeof(npy_@name1@) &&
- dst_stride == sizeof(npy_@name2@)) {
+ if (src_stride == sizeof(@type1@) &&
+ dst_stride == sizeof(@type2@)) {
return &_aligned_contig_cast_@name1@_to_@name2@;
}
else {
return &_aligned_cast_@name1@_to_@name2@;
}
# else
- if (src_stride == sizeof(npy_@name1@) &&
- dst_stride == sizeof(npy_@name2@)) {
+ if (src_stride == sizeof(@type1@) &&
+ dst_stride == sizeof(@type2@)) {
return aligned ?
&_aligned_contig_cast_@name1@_to_@name2@ :
&_contig_cast_@name1@_to_@name2@;
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index 15952fe93..b25d770fe 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -5,7 +5,6 @@
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_config.h"
@@ -1610,8 +1609,8 @@ array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
}
if (v < 0 || v >= shape[idim]) {
PyErr_Format(PyExc_IndexError,
- "index (%"INTP_FMT") out of range "\
- "(0<=index<%"INTP_FMT") in dimension %d",
+ "index (%"NPY_INTP_FMT") out of range "\
+ "(0<=index<%"NPY_INTP_FMT") in dimension %d",
vals[idim], PyArray_DIMS(self)[idim], idim);
return -1;
}
@@ -1633,8 +1632,8 @@ array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
}
if (v < 0 || v >= shape[idim]) {
PyErr_Format(PyExc_IndexError,
- "index (%"INTP_FMT") out of range "\
- "(0<=index<%"INTP_FMT") in dimension %d",
+ "index (%"NPY_INTP_FMT") out of range "\
+ "(0<=index<%"NPY_INTP_FMT") in dimension %d",
vals[idim], PyArray_DIMS(self)[idim], idim);
return -1;
}
@@ -1768,8 +1767,8 @@ array_subscript_nice(PyArrayObject *self, PyObject *op)
}
if (v < 0 || v >= shape[idim]) {
PyErr_Format(PyExc_IndexError,
- "index (%"INTP_FMT") out of range "\
- "(0<=index<%"INTP_FMT") in dimension %d",
+ "index (%"NPY_INTP_FMT") out of range "\
+ "(0<=index<%"NPY_INTP_FMT") in dimension %d",
vals[idim], PyArray_DIMS(self)[idim], idim);
return NULL;
}
@@ -1790,8 +1789,8 @@ array_subscript_nice(PyArrayObject *self, PyObject *op)
}
if (v < 0 || v >= shape[idim]) {
PyErr_Format(PyExc_IndexError,
- "index (%"INTP_FMT") out of range "\
- "(0<=index<%"INTP_FMT") in dimension %d",
+ "index (%"NPY_INTP_FMT") out of range "\
+ "(0<=index<%"NPY_INTP_FMT") in dimension %d",
vals[idim], PyArray_DIMS(self)[idim], idim);
return NULL;
}
@@ -1834,15 +1833,15 @@ array_subscript_nice(PyArrayObject *self, PyObject *op)
*/
if (PyArray_Check(mp) && PyArray_NDIM(mp) == 0) {
- npy_bool noellipses = TRUE;
+ npy_bool noellipses = NPY_TRUE;
if ((op == Py_Ellipsis) || PyString_Check(op) || PyUnicode_Check(op)) {
- noellipses = FALSE;
+ noellipses = NPY_FALSE;
}
else if (PyBool_Check(op) || PyArray_IsScalar(op, Bool) ||
(PyArray_Check(op) &&
(PyArray_DIMS((PyArrayObject *)op)==0) &&
PyArray_ISBOOL((PyArrayObject *)op))) {
- noellipses = FALSE;
+ noellipses = NPY_FALSE;
}
else if (PySequence_Check(op)) {
Py_ssize_t n, i;
@@ -1853,7 +1852,7 @@ array_subscript_nice(PyArrayObject *self, PyObject *op)
while (i < n && noellipses) {
temp = PySequence_GetItem(op, i);
if (temp == Py_Ellipsis) {
- noellipses = FALSE;
+ noellipses = NPY_FALSE;
}
Py_DECREF(temp);
i++;
@@ -1915,7 +1914,7 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
iters[j] = NULL;
}
size = PyArray_SIZE(ba);
- ptr = (Bool *)PyArray_DATA(ba);
+ ptr = (npy_bool *)PyArray_DATA(ba);
count = 0;
/* pre-determine how many nonzero entries there are */
@@ -2270,8 +2269,8 @@ PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)
}
if (indval < 0 || indval >= dimsize) {
PyErr_Format(PyExc_IndexError,
- "index (%"INTP_FMT") out of range "\
- "(0<=index<%"INTP_FMT") in dimension %d",
+ "index (%"NPY_INTP_FMT") out of range "\
+ "(0<=index<%"NPY_INTP_FMT") in dimension %d",
indval, (dimsize-1), mit->iteraxes[i]);
goto fail;
}
diff --git a/numpy/core/src/multiarray/mapping.h b/numpy/core/src/multiarray/mapping.h
index d5ac74735..d4da61b0c 100644
--- a/numpy/core/src/multiarray/mapping.h
+++ b/numpy/core/src/multiarray/mapping.h
@@ -8,7 +8,7 @@ NPY_NO_EXPORT PyMappingMethods array_as_mapping;
#endif
NPY_NO_EXPORT PyObject *
-array_big_item(PyArrayObject *self, intp i);
+array_big_item(PyArrayObject *self, npy_intp i);
NPY_NO_EXPORT Py_ssize_t
array_length(PyArrayObject *self);
@@ -20,14 +20,14 @@ NPY_NO_EXPORT PyObject *
array_subscript(PyArrayObject *self, PyObject *op);
NPY_NO_EXPORT int
-array_ass_big_item(PyArrayObject *self, intp i, PyObject *v);
+array_ass_big_item(PyArrayObject *self, npy_intp i, PyObject *v);
#if PY_VERSION_HEX < 0x02050000
- #if SIZEOF_INT == SIZEOF_INTP
+ #if SIZEOF_INT == NPY_SIZEOF_INTP
#define array_ass_item array_ass_big_item
#endif
#else
- #if SIZEOF_SIZE_T == SIZEOF_INTP
+ #if SIZEOF_SIZE_T == NPY_SIZEOF_INTP
#define array_ass_item array_ass_big_item
#endif
#endif
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
index 24af4db5b..13ef868ae 100644
--- a/numpy/core/src/multiarray/methods.c
+++ b/numpy/core/src/multiarray/methods.c
@@ -5,7 +5,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -124,7 +123,7 @@ forward_ndarray_method(PyArrayObject *self, PyObject *args, PyObject *kwds,
static PyObject *
array_take(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int dimension = MAX_DIMS;
+ int dimension = NPY_MAXDIMS;
PyObject *indices;
PyArrayObject *out = NULL;
NPY_CLIPMODE mode = NPY_RAISE;
@@ -301,7 +300,7 @@ array_view(PyArrayObject *self, PyObject *args, PyObject *kwds)
}
if ((out_dtype) &&
- (PyArray_DescrConverter(out_dtype, &dtype) == PY_FAIL)) {
+ (PyArray_DescrConverter(out_dtype, &dtype) == NPY_FAIL)) {
return NULL;
}
@@ -334,7 +333,7 @@ array_view(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_argmax(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyArrayObject *out = NULL;
static char *kwlist[] = {"axis", "out", NULL};
@@ -349,7 +348,7 @@ array_argmax(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_argmin(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyArrayObject *out = NULL;
static char *kwlist[] = {"axis", "out", NULL};
@@ -376,7 +375,7 @@ array_min(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_ptp(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyArrayObject *out = NULL;
static char *kwlist[] = {"axis", "out", NULL};
@@ -524,7 +523,7 @@ array_setfield(PyArrayObject *self, PyObject *args, PyObject *kwds)
/*NUMPY_API*/
NPY_NO_EXPORT PyObject *
-PyArray_Byteswap(PyArrayObject *self, Bool inplace)
+PyArray_Byteswap(PyArrayObject *self, npy_bool inplace)
{
PyArrayObject *ret;
npy_intp size;
@@ -565,7 +564,7 @@ PyArray_Byteswap(PyArrayObject *self, Bool inplace)
if ((ret = (PyArrayObject *)PyArray_NewCopy(self,-1)) == NULL) {
return NULL;
}
- new = PyArray_Byteswap(ret, TRUE);
+ new = PyArray_Byteswap(ret, NPY_TRUE);
Py_DECREF(new);
return (PyObject *)ret;
}
@@ -575,7 +574,7 @@ PyArray_Byteswap(PyArrayObject *self, Bool inplace)
static PyObject *
array_byteswap(PyArrayObject *self, PyObject *args)
{
- Bool inplace = FALSE;
+ npy_bool inplace = NPY_FALSE;
if (!PyArg_ParseTuple(args, "|O&",
PyArray_BoolConverter, &inplace)) {
@@ -1204,7 +1203,7 @@ array_resize(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_repeat(PyArrayObject *self, PyObject *args, PyObject *kwds) {
PyObject *repeats;
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
static char *kwlist[] = {"repeats", "axis", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&", kwlist,
@@ -1535,7 +1534,7 @@ array_reduce(PyArrayObject *self, PyObject *NPY_UNUSED(args))
1) an integer with the pickle version.
2) a Tuple giving the shape
3) a PyArray_Descr Object (with correct bytorder set)
- 4) a Bool stating if Fortran or not
+ 4) a npy_bool stating if Fortran or not
5) a Python object representing the data (a string, or
a list or any user-defined object).
@@ -1583,7 +1582,7 @@ array_setstate(PyArrayObject *self, PyObject *args)
PyObject *rawdata = NULL;
char *datastr;
Py_ssize_t len;
- npy_intp size, dimensions[MAX_DIMS];
+ npy_intp size, dimensions[NPY_MAXDIMS];
int nd;
PyArrayObject_fields *fa = (PyArrayObject_fields *)self;
@@ -1621,7 +1620,7 @@ array_setstate(PyArrayObject *self, PyObject *args)
Py_XDECREF(PyArray_DESCR(self));
fa->descr = typecode;
Py_INCREF(typecode);
- nd = PyArray_IntpFromSequence(shape, dimensions, MAX_DIMS);
+ nd = PyArray_IntpFromSequence(shape, dimensions, NPY_MAXDIMS);
if (nd < 0) {
return NULL;
}
@@ -1630,7 +1629,7 @@ array_setstate(PyArrayObject *self, PyObject *args)
PyErr_SetString(PyExc_ValueError, "Invalid data-type size.");
return NULL;
}
- if (size < 0 || size > MAX_INTP / PyArray_DESCR(self)->elsize) {
+ if (size < 0 || size > NPY_MAX_INTP / PyArray_DESCR(self)->elsize) {
PyErr_NoMemory();
return NULL;
}
@@ -1725,7 +1724,8 @@ array_setstate(PyArrayObject *self, PyObject *args)
Py_DECREF(rawdata);
return PyErr_NoMemory();
}
- if (swap) { /* byte-swap on pickle-read */
+ if (swap) {
+ /* byte-swap on pickle-read */
npy_intp numels = num / PyArray_DESCR(self)->elsize;
PyArray_DESCR(self)->f->copyswapn(PyArray_DATA(self),
PyArray_DESCR(self)->elsize,
@@ -1918,7 +1918,7 @@ array_sum(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_cumsum(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyArray_Descr *dtype = NULL;
PyArrayObject *out = NULL;
int rtype;
@@ -1946,7 +1946,7 @@ array_prod(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_cumprod(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyArray_Descr *dtype = NULL;
PyArrayObject *out = NULL;
int rtype;
@@ -2075,7 +2075,7 @@ array_variance(PyArrayObject *self, PyObject *args, PyObject *kwds)
static PyObject *
array_compress(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
- int axis = MAX_DIMS;
+ int axis = NPY_MAXDIMS;
PyObject *condition;
PyArrayObject *out = NULL;
static char *kwlist[] = {"condition", "axis", "out", NULL};
diff --git a/numpy/core/src/multiarray/multiarray_tests.c.src b/numpy/core/src/multiarray/multiarray_tests.c.src
index 90c63ca44..1868c9a07 100644
--- a/numpy/core/src/multiarray/multiarray_tests.c.src
+++ b/numpy/core/src/multiarray/multiarray_tests.c.src
@@ -1,6 +1,6 @@
#define NPY_NO_DEPRECATED_API
#include <Python.h>
-#include "numpy/ndarrayobject.h"
+#include "numpy/arrayobject.h"
#include "numpy/npy_3kcompat.h"
@@ -10,10 +10,11 @@
*/
/**begin repeat
- * #type = double, int#
+ * #name = double, int#
+ * #type = npy_double, npy_int#
* #typenum = NPY_DOUBLE, NPY_INT#
*/
-static int copy_@type@(PyArrayIterObject *itx, PyArrayNeighborhoodIterObject *niterx,
+static int copy_@name@(PyArrayIterObject *itx, PyArrayNeighborhoodIterObject *niterx,
npy_intp *bounds,
PyObject **out)
{
@@ -142,7 +143,8 @@ test_neighborhood_iterator(PyObject* NPY_UNUSED(self), PyObject* args)
goto clean_itx;
}
if (!PyInt_Check(bound)) {
- PyErr_SetString(PyExc_ValueError, "bound not long");
+ PyErr_SetString(PyExc_ValueError,
+ "bound not long");
Py_DECREF(bound);
goto clean_itx;
}
@@ -176,7 +178,8 @@ test_neighborhood_iterator(PyObject* NPY_UNUSED(self), PyObject* args)
st = copy_double(itx, niterx, bounds, &out);
break;
default:
- PyErr_SetString(PyExc_ValueError, "Type not supported");
+ PyErr_SetString(PyExc_ValueError,
+ "Type not supported");
goto clean_niterx;
}
@@ -299,7 +302,8 @@ test_neighborhood_iterator_oob(PyObject* NPY_UNUSED(self), PyObject* args)
goto clean_itx;
}
if (!PyInt_Check(bound)) {
- PyErr_SetString(PyExc_ValueError, "bound not long");
+ PyErr_SetString(PyExc_ValueError,
+ "bound not long");
Py_DECREF(bound);
goto clean_itx;
}
@@ -322,7 +326,8 @@ test_neighborhood_iterator_oob(PyObject* NPY_UNUSED(self), PyObject* args)
goto clean_itx;
}
if (!PyInt_Check(bound)) {
- PyErr_SetString(PyExc_ValueError, "bound not long");
+ PyErr_SetString(PyExc_ValueError,
+ "bound not long");
Py_DECREF(bound);
goto clean_itx;
}
@@ -342,7 +347,8 @@ test_neighborhood_iterator_oob(PyObject* NPY_UNUSED(self), PyObject* args)
st = copy_double_double(niterx1, niterx2, bounds, &out);
break;
default:
- PyErr_SetString(PyExc_ValueError, "Type not supported");
+ PyErr_SetString(PyExc_ValueError,
+ "Type not supported");
goto clean_niterx2;
}
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index 53d03ae8e..6231e1cb0 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -20,7 +20,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -654,7 +653,7 @@ static int
_signbit_set(PyArrayObject *arr)
{
static char bitmask = (char) 0x80;
- char *ptr; /* points to the byte to test */
+ char *ptr; /* points to the npy_byte to test */
char byteorder;
int elsize;
@@ -1491,7 +1490,7 @@ PyArray_EquivTypes(PyArray_Descr *type1, PyArray_Descr *type2)
int type_num1, type_num2, size1, size2;
if (type1 == type2) {
- return TRUE;
+ return NPY_TRUE;
}
type_num1 = type1->type_num;
@@ -1500,10 +1499,10 @@ PyArray_EquivTypes(PyArray_Descr *type1, PyArray_Descr *type2)
size2 = type2->elsize;
if (size1 != size2) {
- return FALSE;
+ return NPY_FALSE;
}
if (PyArray_ISNBO(type1->byteorder) != PyArray_ISNBO(type2->byteorder)) {
- return FALSE;
+ return NPY_FALSE;
}
if (type1->subarray || type2->subarray) {
return ((type_num1 == type_num2)
@@ -1529,7 +1528,7 @@ NPY_NO_EXPORT unsigned char
PyArray_EquivTypenums(int typenum1, int typenum2)
{
PyArray_Descr *d1, *d2;
- Bool ret;
+ npy_bool ret;
d1 = PyArray_DescrFromType(typenum1);
d2 = PyArray_DescrFromType(typenum2);
@@ -1609,8 +1608,8 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
{
PyObject *op;
PyArrayObject *oparr = NULL, *ret = NULL;
- Bool subok = FALSE;
- Bool copy = TRUE;
+ npy_bool subok = NPY_FALSE;
+ npy_bool copy = NPY_TRUE;
int ndmin = 0, nd;
PyArray_Descr *type = NULL;
PyArray_Descr *oldtype = NULL;
@@ -1854,10 +1853,10 @@ array_empty(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
switch (order) {
case NPY_CORDER:
- is_f_order = FALSE;
+ is_f_order = NPY_FALSE;
break;
case NPY_FORTRANORDER:
- is_f_order = TRUE;
+ is_f_order = NPY_TRUE;
break;
default:
PyErr_SetString(PyExc_ValueError,
@@ -2002,7 +2001,7 @@ array_zeros(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
PyArray_Descr *typecode = NULL;
PyArray_Dims shape = {NULL, 0};
NPY_ORDER order = NPY_CORDER;
- npy_bool is_f_order = FALSE;
+ npy_bool is_f_order = NPY_FALSE;
PyArrayObject *ret = NULL;
int maskna = 0;
@@ -2016,10 +2015,10 @@ array_zeros(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kwds)
switch (order) {
case NPY_CORDER:
- is_f_order = FALSE;
+ is_f_order = NPY_FALSE;
break;
case NPY_FORTRANORDER:
- is_f_order = TRUE;
+ is_f_order = NPY_TRUE;
break;
default:
PyErr_SetString(PyExc_ValueError,
@@ -2945,7 +2944,7 @@ array_can_cast_safely(PyObject *NPY_UNUSED(self), PyObject *args,
PyObject *from_obj = NULL;
PyArray_Descr *d1 = NULL;
PyArray_Descr *d2 = NULL;
- Bool ret;
+ npy_bool ret;
PyObject *retobj = NULL;
NPY_CASTING casting = NPY_SAFE_CASTING;
static char *kwlist[] = {"from", "to", "casting", NULL};
@@ -3193,7 +3192,7 @@ as_buffer(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *mem;
Py_ssize_t size;
- Bool ro = FALSE, check = TRUE;
+ npy_bool ro = NPY_FALSE, check = NPY_TRUE;
void *memptr;
static char *kwlist[] = {"mem", "size", "readonly", "check", NULL};
@@ -3260,7 +3259,7 @@ format_longfloat(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyObject *obj;
unsigned int precision;
- longdouble x;
+ npy_longdouble x;
static char *kwlist[] = {"x", "precision", NULL};
static char repr[100];
@@ -3288,7 +3287,7 @@ compare_chararrays(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
PyObject *other;
PyArrayObject *newarr, *newoth;
int cmp_op;
- Bool rstrip;
+ npy_bool rstrip;
char *cmp_str;
Py_ssize_t strlength;
PyObject *res = NULL;
@@ -3586,7 +3585,7 @@ _vec_string(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
#ifndef __NPY_PRIVATE_NO_SIGNAL
-SIGJMP_BUF _NPY_SIGINT_BUF;
+NPY_SIGJMP_BUF _NPY_SIGINT_BUF;
/*NUMPY_API
*/
@@ -3594,7 +3593,7 @@ NPY_NO_EXPORT void
_PyArray_SigintHandler(int signum)
{
PyOS_setsig(signum, SIG_IGN);
- SIGLONGJMP(_NPY_SIGINT_BUF, signum);
+ NPY_SIGLONGJMP(_NPY_SIGINT_BUF, signum);
}
/*NUMPY_API
@@ -3913,7 +3912,7 @@ setup_scalartypes(PyObject *NPY_UNUSED(dict))
#else
SINGLE_INHERIT(Long, SignedInteger);
#endif
-#if SIZEOF_LONGLONG == SIZEOF_LONG && !defined(NPY_PY3K)
+#if NPY_SIZEOF_LONGLONG == SIZEOF_LONG && !defined(NPY_PY3K)
DUAL_INHERIT(LongLong, Int, SignedInteger);
#else
SINGLE_INHERIT(LongLong, SignedInteger);
diff --git a/numpy/core/src/multiarray/nditer_impl.h b/numpy/core/src/multiarray/nditer_impl.h
index de361470d..dc749fc8c 100644
--- a/numpy/core/src/multiarray/nditer_impl.h
+++ b/numpy/core/src/multiarray/nditer_impl.h
@@ -16,7 +16,7 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include <numpy/npy_3kcompat.h>
#include "convert_datatype.h"
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index db6d113f4..c0323c346 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -12,7 +12,7 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#include <numpy/ndarrayobject.h>
+#include <numpy/arrayobject.h>
#include <numpy/npy_3kcompat.h>
#include "npy_config.h"
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index a4e42ead0..3dd8e0ae4 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -5,7 +5,6 @@
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "npy_config.h"
@@ -547,7 +546,7 @@ array_inplace_true_divide(PyArrayObject *m1, PyObject *m2)
static int
_array_nonzero(PyArrayObject *mp)
{
- intp n;
+ npy_intp n;
n = PyArray_SIZE(mp);
if (n == 1) {
diff --git a/numpy/core/src/multiarray/numpymemoryview.c b/numpy/core/src/multiarray/numpymemoryview.c
index eb4a2e742..15934d062 100644
--- a/numpy/core/src/multiarray/numpymemoryview.c
+++ b/numpy/core/src/multiarray/numpymemoryview.c
@@ -12,7 +12,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
diff --git a/numpy/core/src/multiarray/numpyos.c b/numpy/core/src/multiarray/numpyos.c
index aa0e0f9a8..1fa514757 100644
--- a/numpy/core/src/multiarray/numpyos.c
+++ b/numpy/core/src/multiarray/numpyos.c
@@ -6,7 +6,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index 9e5bd888e..44911a5fc 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -9,7 +9,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -99,7 +98,7 @@ PyArray_Item_XDECREF(char *data, PyArray_Descr *descr)
NPY_NO_EXPORT int
PyArray_INCREF(PyArrayObject *mp)
{
- intp i, n;
+ npy_intp i, n;
PyObject **data;
PyObject *temp;
PyArrayIterObject *it;
@@ -157,7 +156,7 @@ PyArray_INCREF(PyArrayObject *mp)
NPY_NO_EXPORT int
PyArray_XDECREF(PyArrayObject *mp)
{
- intp i, n;
+ npy_intp i, n;
PyObject **data;
PyObject *temp;
PyArrayIterObject *it;
@@ -212,7 +211,7 @@ PyArray_XDECREF(PyArrayObject *mp)
NPY_NO_EXPORT void
PyArray_FillObjectArray(PyArrayObject *arr, PyObject *obj)
{
- intp i,n;
+ npy_intp i,n;
n = PyArray_SIZE(arr);
if (PyArray_DESCR(arr)->type_num == NPY_OBJECT) {
PyObject **optr;
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c
index 0cee4b2ea..2bb7ff2ae 100644
--- a/numpy/core/src/multiarray/scalarapi.c
+++ b/numpy/core/src/multiarray/scalarapi.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -37,7 +36,7 @@ scalar_value(PyObject *scalar, PyArray_Descr *descr)
{
int type_num;
int align;
- intp memloc;
+ npy_intp memloc;
if (descr == NULL) {
descr = PyArray_DescrFromScalar(scalar);
type_num = descr->type_num;
@@ -149,7 +148,7 @@ scalar_value(PyObject *scalar, PyArray_Descr *descr)
* Use the alignment flag to figure out where the data begins
* after a PyObject_HEAD
*/
- memloc = (intp)scalar;
+ memloc = (npy_intp)scalar;
memloc += sizeof(PyObject);
/* now round-up to the nearest alignment value */
align = descr->alignment;
@@ -399,7 +398,7 @@ PyArray_ScalarFromObject(PyObject *object)
PyArrayScalar_VAL(ret, CDouble).imag = PyComplex_ImagAsDouble(object);
}
else if (PyLong_Check(object)) {
- longlong val;
+ npy_longlong val;
val = PyLong_AsLongLong(object);
if (val==-1 && PyErr_Occurred()) {
PyErr_Clear();
@@ -536,7 +535,7 @@ PyArray_DescrFromScalar(PyObject *sc)
PyObject *cobj;
PyArray_DatetimeMetaData *dt_data;
- dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData));
+ dt_data = PyArray_malloc(sizeof(PyArray_DatetimeMetaData));
if (PyArray_IsScalar(sc, Datetime)) {
descr = PyArray_DescrNewFromType(NPY_DATETIME);
memcpy(dt_data, &((PyDatetimeScalarObject *)sc)->obmeta,
@@ -637,7 +636,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
type_num = descr->type_num;
if (type_num == NPY_BOOL) {
- PyArrayScalar_RETURN_BOOL_FROM_LONG(*(Bool*)data);
+ PyArrayScalar_RETURN_BOOL_FROM_LONG(*(npy_bool*)data);
}
else if (PyDataType_FLAGCHK(descr, NPY_USE_GETITEM)) {
return descr->f->getitem(data, base);
@@ -726,8 +725,8 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
}
#else
/* need aligned data buffer */
- if ((swap) || ((((intp)data) % descr->alignment) != 0)) {
- buffer = _pya_malloc(itemsize);
+ if ((swap) || ((((npy_intp)data) % descr->alignment) != 0)) {
+ buffer = PyArray_malloc(itemsize);
if (buffer == NULL) {
return PyErr_NoMemory();
}
@@ -748,7 +747,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
length = PyUCS2Buffer_FromUCS4(uni->str,
(npy_ucs4 *)buffer, itemsize >> 2);
if (alloc) {
- _pya_free(buffer);
+ PyArray_free(buffer);
}
/* Resize the unicode result */
if (MyPyUnicode_Resize(uni, length) < 0) {
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index dc9facfc4..562c3c82c 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -7,7 +7,7 @@
#ifndef _MULTIARRAYMODULE
#define _MULTIARRAYMODULE
#endif
-#define NPY_NO_PREFIX
+
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
#include "numpy/halffloat.h"
@@ -137,12 +137,12 @@ gentype_power(PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3))
PyObject *arr, *ret, *arg2;
char *msg="unsupported operand type(s) for ** or pow()";
- if (!PyArray_IsScalar(m1,Generic)) {
+ if (!PyArray_IsScalar(m1, Generic)) {
if (PyArray_Check(m1)) {
ret = Py_TYPE(m1)->tp_as_number->nb_power(m1,m2, Py_None);
}
else {
- if (!PyArray_IsScalar(m2,Generic)) {
+ if (!PyArray_IsScalar(m2, Generic)) {
PyErr_SetString(PyExc_TypeError, msg);
return NULL;
}
@@ -279,7 +279,7 @@ gentype_multiply(PyObject *m1, PyObject *m2)
/**begin repeat
*
- * #name=positive, negative, absolute, invert, int, float#
+ * #name = positive, negative, absolute, invert, int, float#
*/
static PyObject *
gentype_@name@(PyObject *m1)
@@ -299,7 +299,7 @@ gentype_@name@(PyObject *m1)
#if !defined(NPY_PY3K)
/**begin repeat
*
- * #name=long, oct, hex#
+ * #name = long, oct, hex#
*/
static PyObject *
gentype_@name@(PyObject *m1)
@@ -445,21 +445,22 @@ gentype_format(PyObject *self, PyObject *args)
/**begin repeat
* #name = float, double, longdouble#
* #NAME = FLOAT, DOUBLE, LONGDOUBLE#
- * #type = f, d, l#
+ * #type = npy_float, npy_double, npy_longdouble#
+ * #suff = f, d, l#
*/
#define _FMT1 "%%.%i" NPY_@NAME@_FMT
#define _FMT2 "%%+.%i" NPY_@NAME@_FMT
NPY_NO_EXPORT void
-format_@name@(char *buf, size_t buflen, @name@ val, unsigned int prec)
+format_@name@(char *buf, size_t buflen, @type@ val, unsigned int prec)
{
/* XXX: Find a correct size here for format string */
char format[64], *res;
size_t i, cnt;
PyOS_snprintf(format, sizeof(format), _FMT1, prec);
- res = NumPyOS_ascii_format@type@(buf, buflen, format, val, 0);
+ res = NumPyOS_ascii_format@suff@(buf, buflen, format, val, 0);
if (res == NULL) {
fprintf(stderr, "Error while formatting\n");
return;
@@ -477,8 +478,23 @@ format_@name@(char *buf, size_t buflen, @name@ val, unsigned int prec)
}
}
+#undef _FMT1
+#undef _FMT2
+
+/**end repeat**/
+
+/**begin repeat
+ * #name = cfloat, cdouble, clongdouble#
+ * #NAME = FLOAT, DOUBLE, LONGDOUBLE#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #suff = f, d, l#
+ */
+
+#define _FMT1 "%%.%i" NPY_@NAME@_FMT
+#define _FMT2 "%%+.%i" NPY_@NAME@_FMT
+
static void
-format_c@name@(char *buf, size_t buflen, c@name@ val, unsigned int prec)
+format_@name@(char *buf, size_t buflen, @type@ val, unsigned int prec)
{
/* XXX: Find a correct size here for format string */
char format[64];
@@ -493,8 +509,11 @@ format_c@name@(char *buf, size_t buflen, c@name@ val, unsigned int prec)
if (val.real == 0.0) {
#endif
PyOS_snprintf(format, sizeof(format), _FMT1, prec);
- res = NumPyOS_ascii_format@type@(buf, buflen-1, format, val.imag, 0);
+ res = NumPyOS_ascii_format@suff@(buf, buflen - 1, format, val.imag, 0);
if (res == NULL) {
+ /* FIXME
+ * We need a better way to handle the error message
+ */
fprintf(stderr, "Error while formatting\n");
return;
}
@@ -509,17 +528,24 @@ format_c@name@(char *buf, size_t buflen, c@name@ val, unsigned int prec)
char re[64], im[64];
if (npy_isfinite(val.real)) {
PyOS_snprintf(format, sizeof(format), _FMT1, prec);
- res = NumPyOS_ascii_format@type@(re, sizeof(re), format, val.real, 0);
+ res = NumPyOS_ascii_format@suff@(re, sizeof(re), format,
+ val.real, 0);
if (res == NULL) {
+ /* FIXME
+ * We need a better way to handle the error message
+ */
fprintf(stderr, "Error while formatting\n");
return;
}
- } else {
+ }
+ else {
if (npy_isnan(val.real)) {
strcpy(re, "nan");
- } else if (val.real > 0){
+ }
+ else if (val.real > 0){
strcpy(re, "inf");
- } else {
+ }
+ else {
strcpy(re, "-inf");
}
}
@@ -527,17 +553,21 @@ format_c@name@(char *buf, size_t buflen, c@name@ val, unsigned int prec)
if (npy_isfinite(val.imag)) {
PyOS_snprintf(format, sizeof(format), _FMT2, prec);
- res = NumPyOS_ascii_format@type@(im, sizeof(im), format, val.imag, 0);
+ res = NumPyOS_ascii_format@suff@(im, sizeof(im), format,
+ val.imag, 0);
if (res == NULL) {
fprintf(stderr, "Error while formatting\n");
return;
}
- } else {
+ }
+ else {
if (npy_isnan(val.imag)) {
strcpy(im, "+nan");
- } else if (val.imag > 0){
+ }
+ else if (val.imag > 0){
strcpy(im, "+inf");
- } else {
+ }
+ else {
strcpy(im, "-inf");
}
#if PY_VERSION_HEX >= 0x02060000
@@ -573,7 +603,7 @@ format_half(char *buf, size_t buflen, npy_half val, unsigned int prec)
* #Name = String*2,Unicode*2#
* #NAME = STRING*2,UNICODE*2#
* #extra = AndSize*2,,#
- * #type = char*2, Py_UNICODE*2#
+ * #type = npy_char*2, Py_UNICODE*2#
*/
static PyObject *
@name@type_@form@(PyObject *self)
@@ -611,14 +641,14 @@ datetimetype_repr(PyObject *self)
if (!PyArray_IsScalar(self, Datetime)) {
PyErr_SetString(PyExc_RuntimeError,
- "Called NumPy datetime repr on a non-datetime type");
+ "Called NumPy datetime repr on a non-datetime type");
return NULL;
}
scal = (PyDatetimeScalarObject *)self;
- if (convert_datetime_to_datetimestruct(&scal->obmeta, scal->obval,
- &dts) < 0) {
+ if (convert_datetime_to_datetimestruct(&scal->obmeta,
+ scal->obval, &dts) < 0) {
return NULL;
}
@@ -670,7 +700,7 @@ timedeltatype_repr(PyObject *self)
if (!PyArray_IsScalar(self, Timedelta)) {
PyErr_SetString(PyExc_RuntimeError,
- "Called NumPy timedelta repr on a non-datetime type");
+ "Called NumPy timedelta repr on a non-datetime type");
return NULL;
}
@@ -722,7 +752,7 @@ datetimetype_str(PyObject *self)
if (!PyArray_IsScalar(self, Datetime)) {
PyErr_SetString(PyExc_RuntimeError,
- "Called NumPy datetime str on a non-datetime type");
+ "Called NumPy datetime str on a non-datetime type");
return NULL;
}
@@ -776,7 +806,7 @@ timedeltatype_str(PyObject *self)
if (!PyArray_IsScalar(self, Timedelta)) {
PyErr_SetString(PyExc_RuntimeError,
- "Called NumPy timedelta str on a non-datetime type");
+ "Called NumPy timedelta str on a non-datetime type");
return NULL;
}
@@ -822,7 +852,7 @@ timedeltatype_str(PyObject *self)
#define FLOATPREC_STR 6
#define DOUBLEPREC_REPR 17
#define DOUBLEPREC_STR 12
-#if SIZEOF_LONGDOUBLE == SIZEOF_DOUBLE
+#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
#define LONGDOUBLEPREC_REPR DOUBLEPREC_REPR
#define LONGDOUBLEPREC_STR DOUBLEPREC_STR
#else /* More than probably needed on Intel FP */
@@ -864,7 +894,7 @@ static PyObject *
c@name@type_@kind@(PyObject *self)
{
char buf[202];
- c@name@ val = ((PyC@Name@ScalarObject *)self)->obval;
+ npy_c@name@ val = ((PyC@Name@ScalarObject *)self)->obval;
format_c@name@(buf, sizeof(buf), val, PREC);
return PyUString_FromString(buf);
@@ -906,7 +936,7 @@ c@name@type_print(PyObject *v, FILE *fp, int flags)
{
/* Size of buf: twice sizeof(real) + 2 (for the parenthesis) */
char buf[202];
- c@name@ val = ((PyC@Name@ScalarObject *)v)->obval;
+ npy_c@name@ val = ((PyC@Name@ScalarObject *)v)->obval;
format_c@name@(buf, sizeof(buf), val,
(flags & Py_PRINT_RAW) ? @NAME@PREC_STR : @NAME@PREC_REPR);
@@ -1499,7 +1529,7 @@ gentype_getreadbuf(PyObject *, Py_ssize_t, void **);
static PyObject *
gentype_byteswap(PyObject *self, PyObject *args)
{
- Bool inplace=FALSE;
+ npy_bool inplace = NPY_FALSE;
if (!PyArg_ParseTuple(args, "|O&", PyArray_BoolConverter, &inplace)) {
return NULL;
@@ -1783,8 +1813,8 @@ gentype_setflags(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args),
* to Python complex */
/**begin repeat
- * #name=cfloat,clongdouble#
- * #Name=CFloat,CLongDouble#
+ * #name = cfloat, clongdouble#
+ * #Name = CFloat, CLongDouble#
*/
static PyObject *
@name@_complex(PyObject *self, PyObject *NPY_UNUSED(args),
@@ -2022,7 +2052,7 @@ static PyMethodDef voidtype_methods[] = {
};
/**begin repeat
- * #name=cfloat,clongdouble#
+ * #name = cfloat,clongdouble#
*/
static PyMethodDef @name@type_methods[] = {
{"__complex__",
@@ -2040,7 +2070,8 @@ voidtype_length(PyVoidScalarObject *self)
if (!PyDataType_HASFIELDS(self->descr)) {
return 0;
}
- else { /* return the number of fields */
+ else {
+ /* return the number of fields */
return (Py_ssize_t) PyTuple_GET_SIZE(self->descr->names);
}
}
@@ -2048,7 +2079,7 @@ voidtype_length(PyVoidScalarObject *self)
static PyObject *
voidtype_item(PyVoidScalarObject *self, Py_ssize_t n)
{
- intp m;
+ npy_intp m;
PyObject *flist=NULL, *fieldinfo;
if (!(PyDataType_HASFIELDS(self->descr))) {
@@ -2075,7 +2106,7 @@ voidtype_item(PyVoidScalarObject *self, Py_ssize_t n)
static PyObject *
voidtype_subscript(PyVoidScalarObject *self, PyObject *ind)
{
- intp n;
+ npy_intp n;
PyObject *fieldinfo;
if (!(PyDataType_HASFIELDS(self->descr))) {
@@ -2112,7 +2143,7 @@ fail:
static int
voidtype_ass_item(PyVoidScalarObject *self, Py_ssize_t n, PyObject *val)
{
- intp m;
+ npy_intp m;
PyObject *flist=NULL, *fieldinfo, *newtup;
PyObject *res;
@@ -2151,7 +2182,7 @@ fail:
static int
voidtype_ass_subscript(PyVoidScalarObject *self, PyObject *ind, PyObject *val)
{
- intp n;
+ npy_intp n;
char *msg = "invalid index";
PyObject *fieldinfo, *newtup;
PyObject *res;
@@ -2671,7 +2702,7 @@ bool_arrtype_and(PyObject *a, PyObject *b)
{
if (PyArray_IsScalar(a, Bool) && PyArray_IsScalar(b, Bool)) {
PyArrayScalar_RETURN_BOOL_FROM_LONG
- ((a == PyArrayScalar_True)&(b == PyArrayScalar_True));
+ ((a == PyArrayScalar_True) & (b == PyArrayScalar_True));
}
return PyGenericArrType_Type.tp_as_number->nb_and(a, b);
}
@@ -2704,12 +2735,12 @@ bool_arrtype_nonzero(PyObject *a)
#if PY_VERSION_HEX >= 0x02050000
/**begin repeat
- * #name = byte, short, int, long, ubyte, ushort, longlong, uint, ulong,
- * ulonglong#
- * #Name = Byte, Short, Int, Long, UByte, UShort, LongLong, UInt, ULong,
- * ULongLong#
- * #type = PyInt_FromLong*6, PyLong_FromLongLong*1, PyLong_FromUnsignedLong*2,
- * PyLong_FromUnsignedLongLong#
+ * #name = byte, short, int, long, ubyte, ushort, longlong, uint,
+ * ulong, ulonglong#
+ * #Name = Byte, Short, Int, Long, UByte, UShort, LongLong, UInt,
+ * ULong, ULongLong#
+ * #type = PyInt_FromLong*6, PyLong_FromLongLong*1,
+ * PyLong_FromUnsignedLong*2, PyLong_FromUnsignedLongLong#
*/
static PyNumberMethods @name@_arrtype_as_number;
static PyObject *
@@ -2795,7 +2826,7 @@ static PyObject *
void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
{
PyObject *obj, *arr;
- ulonglong memu = 1;
+ npy_ulonglong memu = 1;
PyObject *new = NULL;
char *destptr;
@@ -2821,11 +2852,11 @@ void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
PyObject *ret;
memu = PyLong_AsUnsignedLongLong(new);
Py_DECREF(new);
- if (PyErr_Occurred() || (memu > MAX_INT)) {
+ if (PyErr_Occurred() || (memu > NPY_MAX_INT)) {
PyErr_Clear();
PyErr_Format(PyExc_OverflowError,
"size must be smaller than %d",
- (int) MAX_INT);
+ (int) NPY_MAX_INT);
return NULL;
}
destptr = PyDataMem_NEW((int) memu);
@@ -2857,7 +2888,7 @@ void_arrtype_new(PyTypeObject *type, PyObject *args, PyObject *NPY_UNUSED(kwds))
/**************** Define Hash functions ********************/
/**begin repeat
- * #lname = bool,ubyte,ushort#
+ * #lname = bool, ubyte, ushort#
* #name = Bool,UByte, UShort#
*/
static long
@@ -2868,8 +2899,8 @@ static long
/**end repeat**/
/**begin repeat
- * #lname=byte,short,uint,ulong#
- * #name=Byte,Short,UInt,ULong#
+ * #lname = byte, short, uint, ulong#
+ * #name = Byte, Short, UInt, ULong#
*/
static long
@lname@_arrtype_hash(PyObject *obj)
@@ -2882,7 +2913,7 @@ static long
}
/**end repeat**/
-#if (SIZEOF_INT != SIZEOF_LONG) || defined(NPY_PY3K)
+#if (NPY_SIZEOF_INT != NPY_SIZEOF_LONG) || defined(NPY_PY3K)
static long
int_arrtype_hash(PyObject *obj)
{
@@ -2899,13 +2930,13 @@ int_arrtype_hash(PyObject *obj)
* #Char = ,U#
* #ext = && (x >= LONG_MIN),#
*/
-#if SIZEOF_LONG != SIZEOF_LONGLONG
+#if NPY_SIZEOF_LONG != NPY_SIZEOF_LONGLONG
/* we assume SIZEOF_LONGLONG=2*SIZEOF_LONG */
static long
@char@longlong_arrtype_hash(PyObject *obj)
{
long y;
- @char@longlong x = (((Py@Char@LongLongScalarObject *)obj)->obval);
+ npy_@char@longlong x = (((Py@Char@LongLongScalarObject *)obj)->obval);
if ((x <= LONG_MAX)@ext@) {
y = (long) x;
@@ -2913,7 +2944,7 @@ static long
else {
union Mask {
long hashvals[2];
- @char@longlong v;
+ npy_@char@longlong v;
} both;
both.v = x;
@@ -2941,10 +2972,10 @@ static long
/**begin repeat
- * #lname=datetime, timedelta#
- * #name=Datetime,Timedelta#
+ * #lname = datetime, timedelta#
+ * #name = Datetime, Timedelta#
*/
-#if SIZEOF_LONG==SIZEOF_DATETIME
+#if NPY_SIZEOF_LONG==NPY_SIZEOF_DATETIME
static long
@lname@_arrtype_hash(PyObject *obj)
{
@@ -2954,12 +2985,12 @@ static long
}
return x;
}
-#elif SIZEOF_LONGLONG==SIZEOF_DATETIME
+#elif NPY_SIZEOF_LONGLONG==NPY_SIZEOF_DATETIME
static long
@lname@_arrtype_hash(PyObject *obj)
{
long y;
- longlong x = (((Py@name@ScalarObject *)obj)->obval);
+ npy_longlong x = (((Py@name@ScalarObject *)obj)->obval);
if ((x <= LONG_MAX)) {
y = (long) x;
@@ -2967,7 +2998,7 @@ static long
else {
union Mask {
long hashvals[2];
- longlong v;
+ npy_longlong v;
} both;
both.v = x;
@@ -3465,21 +3496,21 @@ NPY_NO_EXPORT PyTypeObject Py@NAME@ArrType_Type = {
* #CNAME = (CHAR, SHORT, INT, LONG, LONGLONG)*2, HALF, FLOAT, DOUBLE,
* LONGDOUBLE, DATETIME, TIMEDELTA#
*/
-#if BITSOF_@CNAME@ == 8
+#if NPY_BITSOF_@CNAME@ == 8
#define _THIS_SIZE "8"
-#elif BITSOF_@CNAME@ == 16
+#elif NPY_BITSOF_@CNAME@ == 16
#define _THIS_SIZE "16"
-#elif BITSOF_@CNAME@ == 32
+#elif NPY_BITSOF_@CNAME@ == 32
#define _THIS_SIZE "32"
-#elif BITSOF_@CNAME@ == 64
+#elif NPY_BITSOF_@CNAME@ == 64
#define _THIS_SIZE "64"
-#elif BITSOF_@CNAME@ == 80
+#elif NPY_BITSOF_@CNAME@ == 80
#define _THIS_SIZE "80"
-#elif BITSOF_@CNAME@ == 96
+#elif NPY_BITSOF_@CNAME@ == 96
#define _THIS_SIZE "96"
-#elif BITSOF_@CNAME@ == 128
+#elif NPY_BITSOF_@CNAME@ == 128
#define _THIS_SIZE "128"
-#elif BITSOF_@CNAME@ == 256
+#elif NPY_BITSOF_@CNAME@ == 256
#define _THIS_SIZE "256"
#endif
NPY_NO_EXPORT PyTypeObject Py@NAME@ArrType_Type = {
@@ -3559,25 +3590,25 @@ static PyMappingMethods gentype_as_mapping = {
* #name = complex*3#
* #CNAME = FLOAT, DOUBLE, LONGDOUBLE#
*/
-#if BITSOF_@CNAME@ == 16
+#if NPY_BITSOF_@CNAME@ == 16
#define _THIS_SIZE2 "16"
#define _THIS_SIZE1 "32"
-#elif BITSOF_@CNAME@ == 32
+#elif NPY_BITSOF_@CNAME@ == 32
#define _THIS_SIZE2 "32"
#define _THIS_SIZE1 "64"
-#elif BITSOF_@CNAME@ == 64
+#elif NPY_BITSOF_@CNAME@ == 64
#define _THIS_SIZE2 "64"
#define _THIS_SIZE1 "128"
-#elif BITSOF_@CNAME@ == 80
+#elif NPY_BITSOF_@CNAME@ == 80
#define _THIS_SIZE2 "80"
#define _THIS_SIZE1 "160"
-#elif BITSOF_@CNAME@ == 96
+#elif NPY_BITSOF_@CNAME@ == 96
#define _THIS_SIZE2 "96"
#define _THIS_SIZE1 "192"
-#elif BITSOF_@CNAME@ == 128
+#elif NPY_BITSOF_@CNAME@ == 128
#define _THIS_SIZE2 "128"
#define _THIS_SIZE1 "256"
-#elif BITSOF_@CNAME@ == 256
+#elif NPY_BITSOF_@CNAME@ == 256
#define _THIS_SIZE2 "256"
#define _THIS_SIZE1 "512"
#endif
@@ -3708,20 +3739,28 @@ initialize_casting_tables(void)
sizeof(_npy_next_larger_type_table));
/* Compile-time loop of scalar kinds */
-/**begin repeat
- * #NAME = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #BIGGERTYPE = -1, NPY_SHORT, NPY_USHORT, NPY_INT, NPY_UINT,
- * NPY_LONG, NPY_ULONG, NPY_LONGLONG, NPY_ULONGLONG,
- * -1, -1, NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, -1,
- * NPY_CDOUBLE, NPY_CLONGDOUBLE, -1#
- * #SCKIND = BOOL, (INTNEG, INTPOS)*5, FLOAT*4,
- * COMPLEX*3#
- */
+
+ /**begin repeat
+ * #NAME = BOOL,
+ * BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #BIGGERTYPE = -1,
+ * NPY_SHORT, NPY_USHORT, NPY_INT, NPY_UINT, NPY_LONG, NPY_ULONG,
+ * NPY_LONGLONG, NPY_ULONGLONG, -1, -1,
+ * NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, -1,
+ * NPY_CDOUBLE, NPY_CLONGDOUBLE, -1#
+ * #SCKIND = BOOL,
+ * (INTNEG, INTPOS)*5,
+ * FLOAT*4,
+ * COMPLEX*3#
+ */
+
_npy_scalar_kinds_table[NPY_@NAME@] = NPY_@SCKIND@_SCALAR;
_npy_next_larger_type_table[NPY_@NAME@] = @BIGGERTYPE@;
-/**end repeat**/
+
+ /**end repeat**/
memset(_npy_can_cast_safely_table, 0, sizeof(_npy_can_cast_safely_table));
@@ -3749,26 +3788,30 @@ initialize_casting_tables(void)
#endif
/* Compile-time loop of casting rules */
-/**begin repeat
- * #FROM_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #FROM_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT, LONG, LONG,
- * LONGLONG, LONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * FLOAT, DOUBLE, LONGDOUBLE#
- * #from_isint = 1, 0, 1, 0, 1, 0, 1, 0,
- * 1, 0, 0, 0, 0, 0,
- * 0, 0, 0#
- * #from_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
- * 0, 1, 0, 0, 0, 0,
- * 0, 0, 0#
- * #from_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
- * 0, 0, 1, 1, 1, 1,
- * 0, 0, 0#
- * #from_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
- * 0, 0, 0, 0, 0, 0,
- * 1, 1, 1#
- */
+
+ /**begin repeat
+ * #FROM_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #FROM_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT,
+ * LONG, LONG, LONGLONG, LONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * FLOAT, DOUBLE, LONGDOUBLE#
+ * #from_isint = 1, 0, 1, 0, 1, 0, 1, 0,
+ * 1, 0, 0, 0, 0, 0,
+ * 0, 0, 0#
+ * #from_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
+ * 0, 1, 0, 0, 0, 0,
+ * 0, 0, 0#
+ * #from_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
+ * 0, 0, 1, 1, 1, 1,
+ * 0, 0, 0#
+ * #from_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
+ * 0, 0, 0, 0, 0, 0,
+ * 1, 1, 1#
+ */
+
#define _FROM_BSIZE NPY_SIZEOF_@FROM_BASENAME@
#define _FROM_NUM (NPY_@FROM_NAME@)
@@ -3780,34 +3823,36 @@ initialize_casting_tables(void)
_npy_can_cast_safely_table[_FROM_NUM][NPY_TIMEDELTA] = 1;
#endif
-/**begin repeat1
- * #TO_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
- * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * CFLOAT, CDOUBLE, CLONGDOUBLE#
- * #TO_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT, LONG, LONG,
- * LONGLONG, LONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
- * FLOAT, DOUBLE, LONGDOUBLE#
- * #to_isint = 1, 0, 1, 0, 1, 0, 1, 0,
- * 1, 0, 0, 0, 0, 0,
- * 0, 0, 0#
- * #to_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
- * 0, 1, 0, 0, 0, 0,
- * 0, 0, 0#
- * #to_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
- * 0, 0, 1, 1, 1, 1,
- * 0, 0, 0#
- * #to_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
- * 0, 0, 0, 0, 0, 0,
- * 1, 1, 1#
- */
+ /**begin repeat1
+ * #TO_NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #TO_BASENAME = BYTE, BYTE, SHORT, SHORT, INT, INT,
+ * LONG, LONG, LONGLONG, LONGLONG,
+ * HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * FLOAT, DOUBLE, LONGDOUBLE#
+ * #to_isint = 1, 0, 1, 0, 1, 0, 1, 0,
+ * 1, 0, 0, 0, 0, 0,
+ * 0, 0, 0#
+ * #to_isuint = 0, 1, 0, 1, 0, 1, 0, 1,
+ * 0, 1, 0, 0, 0, 0,
+ * 0, 0, 0#
+ * #to_isfloat = 0, 0, 0, 0, 0, 0, 0, 0,
+ * 0, 0, 1, 1, 1, 1,
+ * 0, 0, 0#
+ * #to_iscomplex = 0, 0, 0, 0, 0, 0, 0, 0,
+ * 0, 0, 0, 0, 0, 0,
+ * 1, 1, 1#
+ */
#define _TO_BSIZE NPY_SIZEOF_@TO_BASENAME@
#define _TO_NUM (NPY_@TO_NAME@)
-/*
- * NOTE: _FROM_BSIZE and _TO_BSIZE are the sizes of the "base type"
- * which is the same as the size of the type except for
- * complex, where it is the size of the real type.
- */
+ /*
+ * NOTE: _FROM_BSIZE and _TO_BSIZE are the sizes of the "base type"
+ * which is the same as the size of the type except for
+ * complex, where it is the size of the real type.
+ */
#if @from_isint@
@@ -3888,10 +3933,10 @@ initialize_casting_tables(void)
_npy_type_promotion_table[i][i] = i;
/* Don't let number promote to string/unicode/void/datetime/timedelta */
if (i == NPY_STRING || i == NPY_UNICODE || i == NPY_VOID ||
- i == NPY_DATETIME || i == NPY_TIMEDELTA) {
+ i == NPY_DATETIME || i == NPY_TIMEDELTA) {
/* Promoting these types requires examining their contents */
_npy_type_promotion_table[i][i] = -1;
- for (j = i+1; j < NPY_NTYPES; ++j) {
+ for (j = i + 1; j < NPY_NTYPES; ++j) {
_npy_type_promotion_table[i][j] = -1;
_npy_type_promotion_table[j][i] = -1;
}
@@ -3900,7 +3945,7 @@ initialize_casting_tables(void)
_npy_type_promotion_table[NPY_OBJECT][i] = NPY_OBJECT;
}
else {
- for (j = i+1; j < NPY_NTYPES; ++j) {
+ for (j = i + 1; j < NPY_NTYPES; ++j) {
/* Don't let number promote to string/unicode/void */
if (j == NPY_STRING || j == NPY_UNICODE || j == NPY_VOID) {
_npy_type_promotion_table[i][j] = -1;
@@ -3991,6 +4036,7 @@ initialize_numeric_types(void)
* need to add dummy versions with filled-in nb_index
* in-order for PyType_Ready to fill in .__index__() method
*/
+
/**begin repeat
* #name = byte, short, int, long, longlong, ubyte, ushort,
* uint, ulong, ulonglong#
@@ -4022,7 +4068,9 @@ initialize_numeric_types(void)
* #NAME= Number, Integer, SignedInteger, UnsignedInteger, Inexact,
* Floating, ComplexFloating, Flexible, Character#
*/
+
Py@NAME@ArrType_Type.tp_flags = BASEFLAGS;
+
/**end repeat**/
/**begin repeat
@@ -4035,9 +4083,11 @@ initialize_numeric_types(void)
* CDouble, CLongDouble, String, Unicode, Void, Object, Datetime,
* Timedelta#
*/
+
Py@NAME@ArrType_Type.tp_flags = BASEFLAGS;
Py@NAME@ArrType_Type.tp_new = @name@_arrtype_new;
Py@NAME@ArrType_Type.tp_richcompare = gentype_richcompare;
+
/**end repeat**/
/**begin repeat
@@ -4048,17 +4098,21 @@ initialize_numeric_types(void)
* Half, Float, LongDouble, CFloat, CLongDouble, Void, Object,
* Datetime, Timedelta#
*/
+
Py@NAME@ArrType_Type.tp_hash = @name@_arrtype_hash;
+
/**end repeat**/
/**begin repeat
* #name = cfloat, clongdouble#
* #NAME = CFloat, CLongDouble#
*/
+
Py@NAME@ArrType_Type.tp_methods = @name@type_methods;
+
/**end repeat**/
-#if (SIZEOF_INT != SIZEOF_LONG) || defined(NPY_PY3K)
+#if (NPY_SIZEOF_INT != NPY_SIZEOF_LONG) || defined(NPY_PY3K)
/* We won't be inheriting from Python Int type. */
PyIntArrType_Type.tp_hash = int_arrtype_hash;
#endif
@@ -4068,7 +4122,7 @@ initialize_numeric_types(void)
PyLongArrType_Type.tp_hash = int_arrtype_hash;
#endif
-#if (SIZEOF_LONG != SIZEOF_LONGLONG) || defined(NPY_PY3K)
+#if (NPY_SIZEOF_LONG != NPY_SIZEOF_LONGLONG) || defined(NPY_PY3K)
/* We won't be inheriting from Python Int type. */
PyLongLongArrType_Type.tp_hash = longlong_arrtype_hash;
#endif
@@ -4076,6 +4130,7 @@ initialize_numeric_types(void)
/**begin repeat
* #name = repr, str#
*/
+
PyHalfArrType_Type.tp_@name@ = halftype_@name@;
PyFloatArrType_Type.tp_@name@ = floattype_@name@;
@@ -4086,6 +4141,7 @@ initialize_numeric_types(void)
PyDatetimeArrType_Type.tp_@name@ = datetimetype_@name@;
PyTimedeltaArrType_Type.tp_@name@ = timedeltatype_@name@;
+
/**end repeat**/
PyHalfArrType_Type.tp_print = halftype_print;
@@ -4108,8 +4164,10 @@ initialize_numeric_types(void)
* #name = int, float, repr, str#
* #kind = tp_as_number->nb*2, tp*2#
*/
+
PyLongDoubleArrType_Type.@kind@_@name@ = longdoubletype_@name@;
PyCLongDoubleArrType_Type.@kind@_@name@ = clongdoubletype_@name@;
+
/**end repeat**/
@@ -4118,8 +4176,10 @@ initialize_numeric_types(void)
* #name = long, hex, oct#
* #kind = tp_as_number->nb*3#
*/
+
PyLongDoubleArrType_Type.@kind@_@name@ = longdoubletype_@name@;
PyCLongDoubleArrType_Type.@kind@_@name@ = clongdoubletype_@name@;
+
/**end repeat**/
#endif
diff --git a/numpy/core/src/multiarray/scalartypes.h b/numpy/core/src/multiarray/scalartypes.h
index 7397a97e0..29fbb9e5e 100644
--- a/numpy/core/src/multiarray/scalartypes.h
+++ b/numpy/core/src/multiarray/scalartypes.h
@@ -33,7 +33,7 @@ NPY_NO_EXPORT void
initialize_numeric_types(void);
NPY_NO_EXPORT void
-format_longdouble(char *buf, size_t buflen, longdouble val, unsigned int prec);
+format_longdouble(char *buf, size_t buflen, npy_longdouble val, unsigned int prec);
#if PY_VERSION_HEX >= 0x03000000
NPY_NO_EXPORT void
diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c
index 92607b3b9..0491fe1ad 100644
--- a/numpy/core/src/multiarray/sequence.c
+++ b/numpy/core/src/multiarray/sequence.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -192,7 +191,7 @@ array_any_nonzero(PyArrayObject *arr)
{
npy_intp counter;
PyArrayIterObject *it;
- Bool anyTRUE = FALSE;
+ npy_bool anyTRUE = NPY_FALSE;
it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);
if (it == NULL) {
@@ -201,7 +200,7 @@ array_any_nonzero(PyArrayObject *arr)
counter = it->size;
while (counter--) {
if (PyArray_DESCR(arr)->f->nonzero(it->dataptr, arr)) {
- anyTRUE = TRUE;
+ anyTRUE = NPY_TRUE;
break;
}
PyArray_ITER_NEXT(it);
diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c
index 611071cc0..2258d9f50 100644
--- a/numpy/core/src/multiarray/shape.c
+++ b/numpy/core/src/multiarray/shape.c
@@ -4,7 +4,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -65,7 +64,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck,
return NULL;
}
newsize = 1;
- largest = MAX_INTP / PyArray_DESCR(self)->elsize;
+ largest = NPY_MAX_INTP / PyArray_DESCR(self)->elsize;
for(k = 0; k < new_nd; k++) {
if (new_dimensions[k] == 0) {
break;
@@ -90,7 +89,7 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck,
}
if (refcheck) {
- refcnt = REFCOUNT(self);
+ refcnt = PyArray_REFCOUNT(self);
}
else {
refcnt = 1;
@@ -182,7 +181,7 @@ PyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims,
npy_intp *dimensions = newdims->ptr;
PyArrayObject *ret;
int ndim = newdims->len;
- npy_bool same, incref = TRUE;
+ npy_bool same, incref = NPY_TRUE;
npy_intp *strides = NULL;
npy_intp newstrides[NPY_MAXDIMS];
npy_intp newmasknastrides[NPY_MAXDIMS];
@@ -193,11 +192,11 @@ PyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims,
}
/* Quick check to make sure anything actually needs to be done */
if (ndim == PyArray_NDIM(self)) {
- same = TRUE;
+ same = NPY_TRUE;
i = 0;
while (same && i < ndim) {
if (PyArray_DIM(self,i) != dimensions[i]) {
- same=FALSE;
+ same=NPY_FALSE;
}
i++;
}
@@ -253,7 +252,7 @@ PyArray_Newshape(PyArrayObject *self, PyArray_Dims *newdims,
if (newcopy == NULL) {
return NULL;
}
- incref = FALSE;
+ incref = NPY_FALSE;
self = (PyArrayObject *)newcopy;
build_maskna_strides = 1;
}
@@ -391,7 +390,7 @@ _check_ones(PyArrayObject *self, int newnd,
{
int nd;
npy_intp *dims;
- npy_bool done=FALSE;
+ npy_bool done=NPY_FALSE;
int j, k;
int has_maskna = PyArray_HASMASKNA(self);
@@ -418,7 +417,7 @@ _check_ones(PyArrayObject *self, int newnd,
j++;
}
else {
- done = TRUE;
+ done = NPY_TRUE;
}
}
if (done) {
diff --git a/numpy/core/src/multiarray/ucsnarrow.c b/numpy/core/src/multiarray/ucsnarrow.c
index 689b53d69..dee7e3c0f 100644
--- a/numpy/core/src/multiarray/ucsnarrow.c
+++ b/numpy/core/src/multiarray/ucsnarrow.c
@@ -6,7 +6,6 @@
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"
@@ -14,20 +13,20 @@
#include "numpy/npy_3kcompat.h"
-/* Functions only needed on narrow builds of Python
- for converting back and forth between the NumPy Unicode data-type
- (always 4-byte)
- and the Python Unicode scalar (2-bytes on a narrow build).
-*/
+/*
+ * Functions only needed on narrow builds of Python for converting back and
+ * forth between the NumPy Unicode data-type (always 4-bytes) and the
+ * Python Unicode scalar (2-bytes on a narrow build).
+ */
/* the ucs2 buffer must be large enough to hold 2*ucs4length characters
- due to the use of surrogate pairs.
-
- The return value is the number of ucs2 bytes used-up which
- is ucs4length + number of surrogate pairs found.
-
- values above 0xffff are converted to surrogate pairs.
-*/
+ * due to the use of surrogate pairs.
+ *
+ * The return value is the number of ucs2 bytes used-up which
+ * is ucs4length + number of surrogate pairs found.
+ *
+ * values above 0xffff are converted to surrogate pairs.
+ */
NPY_NO_EXPORT int
PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, npy_ucs4 *ucs4, int ucs4length)
{
@@ -52,13 +51,13 @@ PyUCS2Buffer_FromUCS4(Py_UNICODE *ucs2, npy_ucs4 *ucs4, int ucs4length)
/* This converts a UCS2 buffer of the given length to UCS4 buffer.
- It converts up to ucs4len characters of UCS2
-
- It returns the number of characters converted which can
- be less than ucs2len if there are surrogate pairs in ucs2.
-
- The return value is the actual size of the used part of the ucs4 buffer.
-*/
+ * It converts up to ucs4len characters of UCS2
+ *
+ * It returns the number of characters converted which can
+ * be less than ucs2len if there are surrogate pairs in ucs2.
+ *
+ * The return value is the actual size of the used part of the ucs4 buffer.
+ */
NPY_NO_EXPORT int
PyUCS2Buffer_AsUCS4(Py_UNICODE *ucs2, npy_ucs4 *ucs4, int ucs2len, int ucs4len)
diff --git a/numpy/core/src/multiarray/usertypes.c b/numpy/core/src/multiarray/usertypes.c
index 49f9618ed..c11e83185 100644
--- a/numpy/core/src/multiarray/usertypes.c
+++ b/numpy/core/src/multiarray/usertypes.c
@@ -27,7 +27,6 @@ maintainer email: oliphant.travis@ieee.org
/*#include <stdio.h>*/
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
-#define NPY_NO_PREFIX
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -56,17 +55,17 @@ _append_new(int *types, int insert)
return newtypes;
}
-static Bool
+static npy_bool
_default_nonzero(void *ip, void *arr)
{
int elsize = PyArray_ITEMSIZE(arr);
char *ptr = ip;
while (elsize--) {
if (*ptr++ != 0) {
- return TRUE;
+ return NPY_TRUE;
}
}
- return FALSE;
+ return NPY_FALSE;
}
static void
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
index a81cabe5b..8b314d6a1 100644
--- a/numpy/core/src/npymath/ieee754.c.src
+++ b/numpy/core/src/npymath/ieee754.c.src
@@ -511,7 +511,7 @@ npy_longdouble npy_nextafterl(npy_longdouble x, npy_longdouble y)
/**begin repeat
* #suff = f,,l#
* #SUFF = F,,L#
- * #type = float, double, npy_longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
@type@ npy_spacing@suff@(@type@ x)
{
diff --git a/numpy/core/src/npymath/npy_math.c.src b/numpy/core/src/npymath/npy_math.c.src
index 04a09bcba..6f6f2242e 100644
--- a/numpy/core/src/npymath/npy_math.c.src
+++ b/numpy/core/src/npymath/npy_math.c.src
@@ -315,7 +315,7 @@ double npy_log2(double x)
*/
/**begin repeat
- * #type = npy_longdouble, float#
+ * #type = npy_longdouble, npy_float#
* #TYPE = NPY_LONGDOUBLE, FLOAT#
* #c = l,f#
* #C = L,F#
@@ -376,7 +376,7 @@ double npy_log2(double x)
*/
/**begin repeat
- * #type = npy_longdouble,double,float#
+ * #type = npy_longdouble, npy_double, npy_float#
* #c = l,,f#
* #C = L,,F#
*/
@@ -422,7 +422,7 @@ double npy_log2(double x)
*/
/**begin repeat
- * #type = float, double, npy_longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
* #c = f, ,l#
* #C = F, ,L#
*/
diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src
index 718de5b6c..920f107b8 100644
--- a/numpy/core/src/npymath/npy_math_complex.c.src
+++ b/numpy/core/src/npymath/npy_math_complex.c.src
@@ -36,7 +36,7 @@
*=========================================================*/
/**begin repeat
- * #type = float,double,npy_longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
* #ctype = npy_cfloat,npy_cdouble,npy_clongdouble#
* #c = f, , l#
* #C = F, , L#
@@ -234,7 +234,7 @@
*=========================================================*/
/**begin repeat
- * #type = float, double, npy_longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
* #ctype = npy_cfloat, npy_cdouble, npy_clongdouble#
* #c = f, , l#
* #C = F, , L#
diff --git a/numpy/core/src/scalarmathmodule.c.src b/numpy/core/src/scalarmathmodule.c.src
index 24f5ebfe8..0bff8d171 100644
--- a/numpy/core/src/scalarmathmodule.c.src
+++ b/numpy/core/src/scalarmathmodule.c.src
@@ -9,7 +9,7 @@
#define NPY_NO_DEPRECATED_API
#include "Python.h"
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy/arrayscalars.h"
@@ -20,9 +20,9 @@
/** numarray adapted routines.... **/
#if SIZEOF_LONGLONG == 64 || SIZEOF_LONGLONG == 128
-static int ulonglong_overflow(ulonglong a, ulonglong b)
+static int ulonglong_overflow(npy_ulonglong a, npy_ulonglong b)
{
- ulonglong ah, al, bh, bl, w, x, y, z;
+ npy_ulonglong ah, al, bh, bl, w, x, y, z;
#if SIZEOF_LONGLONG == 64
ah = (a >> 32);
@@ -57,16 +57,16 @@ static int ulonglong_overflow(ulonglong a, ulonglong b)
}
#else
-static int ulonglong_overflow(ulonglong NPY_UNUSED(a), ulonglong NPY_UNUSED(b))
+static int ulonglong_overflow(npy_ulonglong NPY_UNUSED(a), npy_ulonglong NPY_UNUSED(b))
{
return 0;
}
#endif
-static int slonglong_overflow(longlong a0, longlong b0)
+static int slonglong_overflow(npy_longlong a0, npy_longlong b0)
{
- ulonglong a, b;
- ulonglong ah, al, bh, bl, w, x, y, z;
+ npy_ulonglong a, b;
+ npy_ulonglong ah, al, bh, bl, w, x, y, z;
/* Convert to non-negative quantities */
if (a0 < 0) {
@@ -140,9 +140,10 @@ static int slonglong_overflow(longlong a0, longlong b0)
/**begin repeat
* #name = byte, short, int, long, longlong#
+ * #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong#
*/
static void
-@name@_ctype_add(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_add(@type@ a, @type@ b, @type@ *out) {
*out = a + b;
if ((*out^a) >= 0 || (*out^b) >= 0) {
return;
@@ -151,7 +152,7 @@ static void
return;
}
static void
-@name@_ctype_subtract(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_subtract(@type@ a, @type@ b, @type@ *out) {
*out = a - b;
if ((*out^a) >= 0 || (*out^~b) >= 0) {
return;
@@ -163,9 +164,10 @@ static void
/**begin repeat
* #name = ubyte, ushort, uint, ulong, ulonglong#
+ * #type = npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong#
*/
static void
-@name@_ctype_add(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_add(@type@ a, @type@ b, @type@ *out) {
*out = a + b;
if (*out >= a && *out >= b) {
return;
@@ -174,7 +176,7 @@ static void
return;
}
static void
-@name@_ctype_subtract(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_subtract(@type@ a, @type@ b, @type@ *out) {
*out = a - b;
if (a >= b) {
return;
@@ -190,23 +192,28 @@ static void
/**begin repeat
*
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong#
- * #big = (int,uint)*2, (longlong,ulonglong)*2#
- * #NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG#
+ * #name = byte, ubyte, short, ushort,
+ * int, uint, long, ulong#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort,
+ * npy_int, npy_uint, npy_long, npy_ulong#
+ * #big = npy_int, npy_uint, npy_int, npy_uint,
+ * npy_longlong, npy_ulonglong, npy_longlong, npy_ulonglong#
+ * #NAME = BYTE, UBYTE, SHORT, USHORT,
+ * INT, UINT, LONG, ULONG#
* #SIZENAME = BYTE*2, SHORT*2, INT*2, LONG*2#
* #SIZE = INT*4,LONGLONG*4#
* #neg = (1,0)*4#
*/
-#if SIZEOF_@SIZE@ > SIZEOF_@SIZENAME@
+#if NPY_SIZEOF_@SIZE@ > NPY_SIZEOF_@SIZENAME@
static void
-@name@_ctype_multiply(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_multiply(@type@ a, @type@ b, @type@ *out) {
@big@ temp;
temp = ((@big@) a) * ((@big@) b);
- *out = (@name@) temp;
+ *out = (@type@) temp;
#if @neg@
- if (temp > MAX_@NAME@ || temp < MIN_@NAME@)
+ if (temp > NPY_MAX_@NAME@ || temp < NPY_MIN_@NAME@)
#else
- if (temp > MAX_@NAME@)
+ if (temp > NPY_MAX_@NAME@)
#endif
npy_set_floatstatus_overflow();
return;
@@ -216,13 +223,16 @@ static void
/**begin repeat
*
- * #name = int, uint, long, ulong, longlong, ulonglong#
+ * #name = int, uint, long, ulong,
+ * longlong, ulonglong#
+ * #type = npy_int, npy_uint, npy_long, npy_ulong,
+ * npy_longlong, npy_ulonglong#
* #SIZE = INT*2, LONG*2, LONGLONG*2#
- * #char = (s,u)*3#
+ * #char = (s, u)*3#
*/
-#if SIZEOF_LONGLONG == SIZEOF_@SIZE@
+#if NPY_SIZEOF_LONGLONG == NPY_SIZEOF_@SIZE@
static void
-@name@_ctype_multiply(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_multiply(@type@ a, @type@ b, @type@ *out) {
*out = a * b;
if (@char@longlong_overflow(a, b)) {
npy_set_floatstatus_overflow();
@@ -234,12 +244,14 @@ static void
/**begin repeat
*
- * #name = byte, ubyte, short, ushort, int, uint, long,
- * ulong, longlong, ulonglong#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
* #neg = (1,0)*5#
*/
static void
-@name@_ctype_divide(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_divide(@type@ a, @type@ b, @type@ *out) {
if (b == 0) {
npy_set_floatstatus_divbyzero();
*out = 0;
@@ -252,7 +264,7 @@ static void
#endif
else {
#if @neg@
- @name@ tmp;
+ @type@ tmp;
tmp = a / b;
if (((a > 0) != (b > 0)) && (a % b != 0)) {
tmp--;
@@ -266,7 +278,7 @@ static void
#define @name@_ctype_floor_divide @name@_ctype_divide
static void
-@name@_ctype_remainder(@name@ a, @name@ b, @name@ *out) {
+@name@_ctype_remainder(@type@ a, @type@ b, @type@ *out) {
if (a == 0 || b == 0) {
if (b == 0) npy_set_floatstatus_divbyzero();
*out = 0;
@@ -291,7 +303,7 @@ static void
*
* #name = byte, ubyte, short, ushort, int, uint, long,
* ulong, longlong, ulonglong#
- * #otyp = float*4, double*6#
+ * #otyp = npy_float*4, npy_double*6#
*/
#define @name@_ctype_true_divide(a, b, out) \
*(out) = ((@otyp@) (a)) / ((@otyp@) (b));
@@ -300,12 +312,16 @@ static void
/* b will always be positive in this call */
/**begin repeat
*
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong#
- * #upc = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ * #upc = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG#
*/
static void
-@name@_ctype_power(@name@ a, @name@ b, @name@ *out) {
- @name@ temp, ix, mult;
+@name@_ctype_power(@type@ a, @type@ b, @type@ *out) {
+ @type@ temp, ix, mult;
/* code from Python's intobject.c, with overflow checking removed. */
temp = a;
ix = 1;
@@ -334,19 +350,30 @@ static void
/* QUESTION: Should we check for overflow / underflow in (l,r)shift? */
/**begin repeat
- * #name = (byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*5#
- * #oper = and*10, xor*10, or*10, lshift*10, rshift*10#
- * #op = &*10, ^*10, |*10, <<*10, >>*10#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ */
+
+/**begin repeat1
+ * #oper = and, xor, or, lshift, rshift#
+ * #op = &, ^, |, <<, >>#
*/
+
#define @name@_ctype_@oper@(arg1, arg2, out) *(out) = (arg1) @op@ (arg2)
+
+/**end repeat1**/
+
/**end repeat**/
/**begin repeat
* #name = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
-static @name@ (*_basic_@name@_floor)(@name@);
-static @name@ (*_basic_@name@_sqrt)(@name@);
-static @name@ (*_basic_@name@_fmod)(@name@, @name@);
+static @type@ (*_basic_@name@_floor)(@type@);
+static @type@ (*_basic_@name@_sqrt)(@type@);
+static @type@ (*_basic_@name@_fmod)(@type@, @type@);
#define @name@_ctype_add(a, b, outp) *(outp) = a + b
#define @name@_ctype_subtract(a, b, outp) *(outp) = a - b
#define @name@_ctype_multiply(a, b, outp) *(outp) = a * b
@@ -359,17 +386,24 @@ static @name@ (*_basic_@name@_fmod)(@name@, @name@);
static npy_half (*_basic_half_floor)(npy_half);
static npy_half (*_basic_half_sqrt)(npy_half);
static npy_half (*_basic_half_fmod)(npy_half, npy_half);
-#define half_ctype_add(a, b, outp) *(outp) = npy_float_to_half(npy_half_to_float(a) + npy_half_to_float(b))
-#define half_ctype_subtract(a, b, outp) *(outp) = npy_float_to_half(npy_half_to_float(a) - npy_half_to_float(b))
-#define half_ctype_multiply(a, b, outp) *(outp) = npy_float_to_half(npy_half_to_float(a) * npy_half_to_float(b))
-#define half_ctype_divide(a, b, outp) *(outp) = npy_float_to_half(npy_half_to_float(a) / npy_half_to_float(b))
+
+#define half_ctype_add(a, b, outp) *(outp) = \
+ npy_float_to_half(npy_half_to_float(a) + npy_half_to_float(b))
+#define half_ctype_subtract(a, b, outp) *(outp) = \
+ npy_float_to_half(npy_half_to_float(a) - npy_half_to_float(b))
+#define half_ctype_multiply(a, b, outp) *(outp) = \
+ npy_float_to_half(npy_half_to_float(a) * npy_half_to_float(b))
+#define half_ctype_divide(a, b, outp) *(outp) = \
+ npy_float_to_half(npy_half_to_float(a) / npy_half_to_float(b))
#define half_ctype_true_divide half_ctype_divide
#define half_ctype_floor_divide(a, b, outp) \
- *(outp) = npy_float_to_half(_basic_float_floor(npy_half_to_float(a) / npy_half_to_float(b)))
+ *(outp) = npy_float_to_half(_basic_float_floor(npy_half_to_float(a) / \
+ npy_half_to_float(b)))
/**begin repeat
* #name = cfloat, cdouble, clongdouble#
- * #rtype = float, double, longdouble#
+ * #rname = float, double, longdouble#
+ * #rtype = npy_float, npy_double, npy_longdouble#
* #c = f,,l#
*/
#define @name@_ctype_add(a, b, outp) do{ \
@@ -398,7 +432,7 @@ static npy_half (*_basic_half_fmod)(npy_half, npy_half);
} while(0)
#define @name@_ctype_true_divide @name@_ctype_divide
#define @name@_ctype_floor_divide(a, b, outp) do { \
- (outp)->real = _basic_@rtype@_floor \
+ (outp)->real = _basic_@rname@_floor \
(((a).real*(b).real + (a).imag*(b).imag) / \
((b).real*(b).real + (b).imag*(b).imag)); \
(outp)->imag = 0; \
@@ -407,10 +441,11 @@ static npy_half (*_basic_half_fmod)(npy_half, npy_half);
/**begin repeat
* #name = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
*/
static void
-@name@_ctype_remainder(@name@ a, @name@ b, @name@ *out) {
- @name@ mod;
+@name@_ctype_remainder(@type@ a, @type@ b, @type@ *out) {
+ @type@ mod;
mod = _basic_@name@_fmod(a, b);
if (mod && (((b < 0) != (mod < 0)))) {
mod += b;
@@ -431,8 +466,9 @@ half_ctype_remainder(npy_half a, npy_half b, npy_half *out) {
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble#
+ * #name = byte, ubyte, short, ushort, int, uint, long, ulong,
+ * longlong, ulonglong, half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
*/
#define @name@_ctype_divmod(a, b, out, out2) { \
@name@_ctype_floor_divide(a, b, out); \
@@ -442,21 +478,27 @@ half_ctype_remainder(npy_half a, npy_half b, npy_half *out) {
/**begin repeat
* #name = half, float, double, longdouble#
+ * #type = npy_half, npy_float, npy_double, npy_longdouble#
*/
-static npy_@name@ (*_basic_@name@_pow)(npy_@name@ a, npy_@name@ b);
+static npy_@name@ (*_basic_@name@_pow)(@type@ a, @type@ b);
+
static void
-@name@_ctype_power(npy_@name@ a, npy_@name@ b, npy_@name@ *out) {
+@name@_ctype_power(@type@ a, @type@ b, @type@ *out) {
*out = _basic_@name@_pow(a, b);
}
/**end repeat**/
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, float, double, longdouble#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * float, double, longdouble#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_float, npy_double, npy_longdouble#
* #uns = (0,1)*5,0*3#
*/
static void
-@name@_ctype_negative(npy_@name@ a, npy_@name@ *out)
+@name@_ctype_negative(@type@ a, @type@ *out)
{
#if @uns@
npy_set_floatstatus_overflow();
@@ -474,9 +516,10 @@ half_ctype_negative(npy_half a, npy_half *out)
/**begin repeat
* #name = cfloat, cdouble, clongdouble#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@name@_ctype_negative(@name@ a, @name@ *out)
+@name@_ctype_negative(@type@ a, @type@ *out)
{
out->real = -a.real;
out->imag = -a.imag;
@@ -484,11 +527,15 @@ static void
/**end repeat**/
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, half, float, double, longdouble#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble#
*/
static void
-@name@_ctype_positive(npy_@name@ a, npy_@name@ *out)
+@name@_ctype_positive(@type@ a, @type@ *out)
{
*out = a;
}
@@ -501,16 +548,19 @@ static void
/**begin repeat
* #name = cfloat, cdouble, clongdouble#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
*/
static void
-@name@_ctype_positive(@name@ a, @name@ *out)
+@name@_ctype_positive(@type@ a, @type@ *out)
{
out->real = a.real;
out->imag = a.imag;
}
-static void (*_basic_@name@_pow)(@name@ *, @name@ *, @name@ *);
+
+static void (*_basic_@name@_pow)(@type@ *, @type@ *, @type@ *);
+
static void
-@name@_ctype_power(@name@ a, @name@ b, @name@ *out)
+@name@_ctype_power(@type@ a, @type@ b, @type@ *out)
{
_basic_@name@_pow(&a, &b, out);
}
@@ -520,15 +570,20 @@ static void
/**begin repeat
* #name = ubyte, ushort, uint, ulong, ulonglong#
*/
+
#define @name@_ctype_absolute @name@_ctype_positive
+
/**end repeat**/
/**begin repeat
- * #name = byte, short, int, long, longlong, float, double, longdouble#
+ * #name = byte, short, int, long, longlong,
+ * float, double, longdouble#
+ * #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong,
+ * npy_float, npy_double, npy_longdouble#
*/
static void
-@name@_ctype_absolute(@name@ a, @name@ *out)
+@name@_ctype_absolute(@type@ a, @type@ *out)
{
*out = (a < 0 ? -a : a);
}
@@ -542,10 +597,12 @@ half_ctype_absolute(npy_half a, npy_half *out)
/**begin repeat
* #name = cfloat, cdouble, clongdouble#
+ * #type = npy_cfloat, npy_cdouble, npy_clongdouble#
* #rname = float, double, longdouble#
+ * #rtype = npy_float, npy_double, npy_longdouble#
*/
static void
-@name@_ctype_absolute(@name@ a, @rname@ *out)
+@name@_ctype_absolute(@type@ a, @rtype@ *out)
{
*out = _basic_@rname@_sqrt(a.real*a.real + a.imag*a.imag);
}
@@ -555,7 +612,9 @@ static void
* #name = byte, ubyte, short, ushort, int, uint, long,
* ulong, longlong, ulonglong#
*/
+
#define @name@_ctype_invert(a, out) *(out) = ~a;
+
/**end repeat**/
/*** END OF BASIC CODE **/
@@ -576,16 +635,26 @@ static void
*/
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble#
- * #Name = Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong,
- * ULongLong, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#
- * #NAME = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG,
- * ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #Name = Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ * #TYPE = NPY_BYTE, NPY_UBYTE, NPY_SHORT, NPY_USHORT, NPY_INT, NPY_UINT,
+ * NPY_LONG, NPY_ULONG, NPY_LONGLONG, NPY_ULONGLONG,
+ * NPY_HALF, NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE,
+ * NPY_CFLOAT, NPY_CDOUBLE, NPY_CLONGDOUBLE#
*/
static int
-_@name@_convert_to_ctype(PyObject *a, npy_@name@ *arg1)
+_@name@_convert_to_ctype(PyObject *a, @type@ *arg1)
{
PyObject *temp;
@@ -600,8 +669,8 @@ _@name@_convert_to_ctype(PyObject *a, npy_@name@ *arg1)
return -1;
}
descr1 = PyArray_DescrFromTypeObject((PyObject *)Py_TYPE(a));
- if (PyArray_CanCastSafely(descr1->type_num, NPY_@NAME@)) {
- PyArray_CastScalarDirect(a, descr1, arg1, NPY_@NAME@);
+ if (PyArray_CanCastSafely(descr1->type_num, @TYPE@)) {
+ PyArray_CastScalarDirect(a, descr1, arg1, @TYPE@);
Py_DECREF(descr1);
return 0;
}
@@ -610,8 +679,7 @@ _@name@_convert_to_ctype(PyObject *a, npy_@name@ *arg1)
return -1;
}
}
- else if (PyArray_GetPriority(a, NPY_PRIORITY) >
- NPY_PRIORITY) {
+ else if (PyArray_GetPriority(a, NPY_PRIORITY) > NPY_PRIORITY) {
return -2;
}
else if ((temp = PyArray_ScalarFromObject(a)) != NULL) {
@@ -627,12 +695,16 @@ _@name@_convert_to_ctype(PyObject *a, npy_@name@ *arg1)
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong,
- * longlong, ulonglong, half, float, double, cfloat, cdouble#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, cfloat, cdouble#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_cfloat, npy_cdouble#
*/
static int
-_@name@_convert2_to_ctypes(PyObject *a, npy_@name@ *arg1,
- PyObject *b, npy_@name@ *arg2)
+_@name@_convert2_to_ctypes(PyObject *a, @type@ *arg1,
+ PyObject *b, @type@ *arg2)
{
int ret;
ret = _@name@_convert_to_ctype(a, arg1);
@@ -649,11 +721,12 @@ _@name@_convert2_to_ctypes(PyObject *a, npy_@name@ *arg1,
/**begin repeat
* #name = longdouble, clongdouble#
+ * #type = npy_longdouble, npy_clongdouble#
*/
static int
-_@name@_convert2_to_ctypes(PyObject *a, @name@ *arg1,
- PyObject *b, @name@ *arg2)
+_@name@_convert2_to_ctypes(PyObject *a, @type@ *arg1,
+ PyObject *b, @type@ *arg2)
{
int ret;
ret = _@name@_convert_to_ctype(a, arg1);
@@ -678,31 +751,47 @@ _@name@_convert2_to_ctypes(PyObject *a, @name@ *arg1,
#endif
/**begin repeat
- * #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*13,
- * (half, float, double, longdouble, cfloat, cdouble, clongdouble)*6,
- * (half, float, double, longdouble)*2#
- * #Name=(Byte,UByte,Short,UShort,Int,UInt,Long,ULong,LongLong,ULongLong)*13,
- * (Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*6,
- * (Half, Float, Double, LongDouble)*2#
- * #oper=add*10, subtract*10, multiply*10, divide*10, remainder*10,
- * divmod*10, floor_divide*10, lshift*10, rshift*10, and*10,
- * or*10, xor*10, true_divide*10,
- * add*7, subtract*7, multiply*7, divide*7, floor_divide*7, true_divide*7,
- * divmod*4, remainder*4#
- * #fperr=1*70,0*50,1*10,
- * 1*42,
- * 1*8#
- * #twoout=0*50,1*10,0*70,
- * 0*42,
- * 1*4,0*4#
- * #otyp=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*12,
- * float*4, double*6,
- * (half, float, double, longdouble, cfloat, cdouble, clongdouble)*6,
- * (half, float, double, longdouble)*2#
- * #OName=(Byte,UByte,Short,UShort,Int,UInt,Long,ULong,LongLong,ULongLong)*12,
- * Float*4, Double*6,
- * (Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*6,
- * (Half, Float, Double, LongDouble)*2#
+ *
+ * #name = (byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong)*13,
+ * (half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble)*6,
+ * (half, float, double, longdouble)*2#
+ * #Name = (Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong,LongLong,ULongLong)*13,
+ * (Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble)*6,
+ * (Half, Float, Double, LongDouble)*2#
+ * #type = (npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong)*13,
+ * (npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble)*6,
+ * (npy_half, npy_float, npy_double, npy_longdouble)*2#
+ *
+ * #oper = add*10, subtract*10, multiply*10, divide*10, remainder*10,
+ * divmod*10, floor_divide*10, lshift*10, rshift*10, and*10,
+ * or*10, xor*10, true_divide*10,
+ * add*7, subtract*7, multiply*7, divide*7, floor_divide*7, true_divide*7,
+ * divmod*4, remainder*4#
+ *
+ * #fperr = 1*70,0*50,1*10,
+ * 1*42,
+ * 1*8#
+ * #twoout = 0*50,1*10,0*70,
+ * 0*42,
+ * 1*4,0*4#
+ * #otype = (npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong)*12,
+ * npy_float*4, npy_double*6,
+ * (npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble)*6,
+ * (npy_half, npy_float, npy_double, npy_longdouble)*2#
+ * #OName = (Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong)*12,
+ * Float*4, Double*6,
+ * (Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble)*6,
+ * (Half, Float, Double, LongDouble)*2#
*/
#if !defined(CODEGEN_SKIP_@oper@_FLAG)
@@ -711,7 +800,7 @@ static PyObject *
@name@_@oper@(PyObject *a, PyObject *b)
{
PyObject *ret;
- npy_@name@ arg1, arg2;
+ @type@ arg1, arg2;
/*
* NOTE: In gcc >= 4.1, the compiler will reorder floating point
* operations and floating point error state checks. In
@@ -720,9 +809,9 @@ static PyObject *
* variable volatile was the minimal fix for the issue.
* (Ticket #1671)
*/
- volatile npy_@otyp@ out;
+ volatile @otype@ out;
#if @twoout@
- npy_@otyp@ out2;
+ @otype@ out2;
PyObject *obj;
#endif
@@ -761,9 +850,9 @@ static PyObject *
* as a function call.
*/
#if @twoout@
- @name@_ctype_@oper@(arg1, arg2, (npy_@otyp@ *)&out, &out2);
+ @name@_ctype_@oper@(arg1, arg2, (@otype@ *)&out, &out2);
#else
- @name@_ctype_@oper@(arg1, arg2, (npy_@otyp@ *)&out);
+ @name@_ctype_@oper@(arg1, arg2, (@otype@ *)&out);
#endif
#if @fperr@
@@ -822,35 +911,54 @@ static PyObject *
#undef CODEGEN_SKIP_divide_FLAG
#define _IS_ZERO(x) (x ==0)
+
/**begin repeat
- * #name=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong,
- * half, float, double, longdouble, cfloat, cdouble, clongdouble#
- * #Name=Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong,
- * Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#
- * #otyp=float*4, double*6, half, float, double, longdouble, cfloat, cdouble, clongdouble#
- * #OName=Float*4, Double*6, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#
- * #isint=(1,0)*5,0*7#
- * #cmplx=0*14,1*3#
- * #iszero=_IS_ZERO*10, npy_half_iszero, _IS_ZERO*6#
- * #zero=0*10, NPY_HALF_ZERO, 0*6#
- * #one=1*10, NPY_HALF_ONE, 1*6#
+ *
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ *
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ *
+ * #Name = Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ *
+ * #otype = npy_float*4, npy_double*6, npy_half, npy_float,
+ * npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ *
+ * #OName = Float*4, Double*6, Half, Float,
+ * Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ *
+ * #isint = (1,0)*5,0*7#
+ * #cmplx = 0*14,1*3#
+ * #iszero = _IS_ZERO*10, npy_half_iszero, _IS_ZERO*6#
+ * #zero = 0*10, NPY_HALF_ZERO, 0*6#
+ * #one = 1*10, NPY_HALF_ONE, 1*6#
*/
static PyObject *
@name@_power(PyObject *a, PyObject *b, PyObject *NPY_UNUSED(c))
{
PyObject *ret;
- npy_@name@ arg1, arg2;
+ @type@ arg1, arg2;
int retstatus;
int first;
#if @cmplx@
- npy_@name@ out = {@zero@,@zero@};
- npy_@otyp@ out1;
+ @type@ out = {@zero@, @zero@};
+ @otype@ out1;
out1.real = out.imag = @zero@;
#else
- npy_@name@ out = @zero@;
- npy_@otyp@ out1 = @zero@;
+ @type@ out = @zero@;
+ @otype@ out1 = @zero@;
#endif
switch(_@name@_convert2_to_ctypes(a, &arg1, b, &arg2)) {
@@ -893,7 +1001,7 @@ static PyObject *
#if @isint@
else if (arg2 < 0) {
@name@_ctype_power(arg1, -arg2, &out);
- out1 = (@otyp@) (1.0 / out);
+ out1 = (@otype@) (1.0 / out);
}
#endif
else {
@@ -948,36 +1056,89 @@ static PyObject *
/**begin repeat
- * #name = (cfloat,cdouble,clongdouble)*2#
- * #oper = divmod*3,remainder*3#
+ *
+ * #name = cfloat, cdouble, clongdouble#
+ *
*/
+
+/**begin repeat1
+ *
+ * #oper = divmod, remainder#
+ *
+ */
+
#define @name@_@oper@ NULL
+
+/**end repeat1**/
+
/**end repeat**/
/**begin repeat
- * #name = (half,float,double,longdouble,cfloat,cdouble,clongdouble)*5#
- * #oper = lshift*7, rshift*7, and*7, or*7, xor*7#
+ *
+ * #name = half, float, double, longdouble, cfloat, cdouble, clongdouble#
+ *
+ */
+
+/**begin repeat1
+ *
+ * #oper = lshift, rshift, and, or, xor#
+ *
*/
+
#define @name@_@oper@ NULL
-/**end repeat**/
+/**end repeat1**/
+
+/**end repeat**/
/**begin repeat
- * #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble)*3,
- * byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong#
- * #otyp=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble)*2,
- * byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,float,double,longdouble,
- * byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong#
- * #OName=(Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*2,
- Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Half, Float, Double, LongDouble, Float, Double, LongDouble,
- Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong#
- * #oper=negative*17, positive*17, absolute*17, invert*10#
+ * #name = (byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble)*3,
+ *
+ * byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong#
+ *
+ * #type = (npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble)*3,
+ *
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ *
+ * #otype = (npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble)*2,
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_float, npy_double, npy_longdouble,
+ *
+ * npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ *
+ * #OName = (Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble)*2,
+ * Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * Float, Double, LongDouble,
+ *
+ * Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong#
+ *
+ * #oper = negative*17, positive*17, absolute*17, invert*10#
*/
static PyObject *
@name@_@oper@(PyObject *a)
{
- npy_@name@ arg1;
- npy_@otyp@ out;
+ @type@ arg1;
+ @otype@ out;
PyObject *ret;
switch(_@name@_convert_to_ctype(a, &arg1)) {
@@ -1010,9 +1171,12 @@ static PyObject *
/**end repeat**/
/**begin repeat
+ *
* #name = half, float, double, longdouble, cfloat, cdouble, clongdouble#
*/
+
#define @name@_invert NULL
+
/**end repeat**/
#if defined(NPY_PY3K)
@@ -1023,16 +1187,23 @@ static PyObject *
#define _IS_NONZERO(x) (x != 0)
/**begin repeat
- * #name = byte, ubyte, short, ushort, int, uint, long, ulong, longlong,
- * ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble#
- * #simp=1*14,0*3#
- * #nonzero=_IS_NONZERO*10, !npy_half_iszero, _IS_NONZERO*6#
+ *
+ * #name = byte, ubyte, short, ushort, int,
+ * uint, long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int,
+ * npy_uint, npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_half, npy_float, npy_double, npy_longdouble,
+ * npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #simp = 1*14, 0*3#
+ * #nonzero = _IS_NONZERO*10, !npy_half_iszero, _IS_NONZERO*6#
*/
static int
NONZERO_NAME(@name@_)(PyObject *a)
{
int ret;
- npy_@name@ arg1;
+ @type@ arg1;
if (_@name@_convert_to_ctype(a, &arg1) < 0) {
if (PyErr_Occurred()) {
@@ -1072,26 +1243,34 @@ emit_complexwarning()
}
#if PY_VERSION_HEX >= 0x02050000
return PyErr_WarnEx(cls,
- "Casting complex values to real discards the imaginary "
- "part", 1);
+ "Casting complex values to real discards the imaginary part", 1);
#else
return PyErr_Warn(cls,
- "Casting complex values to real discards the imaginary "
- "part");
+ "Casting complex values to real discards the imaginary part");
#endif
}
/**begin repeat
*
- * #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble#
- * #Name=Byte,UByte,Short,UShort,Int,UInt,Long,ULong,LongLong,ULongLong,Half,Float,Double,LongDouble,CFloat,CDouble,CLongDouble#
- * #cmplx=0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1#
- * #sign=(signed,unsigned)*5,,,,,,,#
- * #unsigntyp=0,1,0,1,0,1,0,1,0,1,0*7#
- * #ctype=long*8,PY_LONG_LONG*2,double*7#
- * #to_ctype=,,,,,,,,,,npy_half_to_double,,,,,,#
- * #realtyp=0*10,1*7#
- * #func=(PyLong_FromLong,PyLong_FromUnsignedLong)*4,PyLong_FromLongLong,PyLong_FromUnsignedLongLong,PyLong_FromDouble*7#
+ * #name = byte, ubyte, short, ushort, int,
+ * uint, long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ *
+ * #Name = Byte, UByte, Short, UShort, Int,
+ * UInt, Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ *
+ * #cmplx = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1#
+ * #sign = (signed, unsigned)*5, , , , , , , #
+ * #unsigntyp = 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0*7#
+ * #ctype = long*8, PY_LONG_LONG*2, double*7#
+ * #to_ctype = , , , , , , , , , , npy_half_to_double, , , , , , #
+ * #realtyp = 0*10, 1*7#
+ * #func = (PyLong_FromLong, PyLong_FromUnsignedLong)*4,
+ * PyLong_FromLongLong, PyLong_FromUnsignedLongLong,
+ * PyLong_FromDouble*7#
*/
static PyObject *
@name@_int(PyObject *obj)
@@ -1102,11 +1281,13 @@ static PyObject *
#else
@sign@ @ctype@ x= @to_ctype@(PyArrayScalar_VAL(obj, @Name@));
#endif
+
#if @realtyp@
double ix;
modf(x, &ix);
x = ix;
#endif
+
#if @cmplx@
ret = emit_complexwarning();
if (ret < 0) {
@@ -1127,12 +1308,19 @@ static PyObject *
/**begin repeat
*
- * #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble)*2#
- * #Name=(Byte,UByte,Short,UShort,Int,UInt,Long,ULong,LongLong,ULongLong,Half,Float,Double,LongDouble,CFloat,CDouble,CLongDouble)*2#
- * #cmplx=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1)*2#
- * #to_ctype=(,,,,,,,,,,npy_half_to_double,,,,,,)*2#
- * #which=long*17,float*17#
- * #func=(PyLong_FromLongLong, PyLong_FromUnsignedLongLong)*5,PyLong_FromDouble*7,PyFloat_FromDouble*17#
+ * #name = (byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble)*2#
+ * #Name = (Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble)*2#
+ * #cmplx = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1)*2#
+ * #to_ctype = (, , , , , , , , , , npy_half_to_double, , , , , , )*2#
+ * #which = long*17, float*17#
+ * #func = (PyLong_FromLongLong, PyLong_FromUnsignedLongLong)*5,
+ * PyLong_FromDouble*7, PyFloat_FromDouble*17#
*/
static PyObject *
@name@_@which@(PyObject *obj)
@@ -1154,17 +1342,22 @@ static PyObject *
/**begin repeat
*
- * #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble)*2#
- * #oper=oct*17, hex*17#
- * #kind=(int*5, long*5, int*2, long*2, int, long*2)*2#
- * #cap=(Int*5, Long*5, Int*2, Long*2, Int, Long*2)*2#
+ * #name = (byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble)*2#
+ * #oper = oct*17, hex*17#
+ * #kind = (int*5, long*5, int*2, long*2, int, long*2)*2#
+ * #cap = (Int*5, Long*5, Int*2, Long*2, Int, Long*2)*2#
*/
static PyObject *
@name@_@oper@(PyObject *obj)
{
PyObject *pyint;
pyint = @name@_@kind@(obj);
- if (pyint == NULL) return NULL;
+ if (pyint == NULL) {
+ return NULL;
+ }
return Py@cap@_Type.tp_as_number->nb_@oper@(pyint);
}
/**end repeat**/
@@ -1172,9 +1365,10 @@ static PyObject *
#endif
/**begin repeat
- * #oper=le,ge,lt,gt,eq,ne#
- * #op=<=,>=,<,>,==,!=#
- * #halfop=npy_half_le,npy_half_ge,npy_half_lt,npy_half_gt,npy_half_eq,npy_half_ne#
+ * #oper = le, ge, lt, gt, eq, ne#
+ * #op = <=, >=, <, >, ==, !=#
+ * #halfop = npy_half_le, npy_half_ge, npy_half_lt,
+ * npy_half_gt, npy_half_eq, npy_half_ne#
*/
#define def_cmp_@oper@(arg1, arg2) (arg1 @op@ arg2)
#define cmplx_cmp_@oper@(arg1, arg2) ((arg1.real == arg2.real) ? \
@@ -1184,8 +1378,11 @@ static PyObject *
/**end repeat**/
/**begin repeat
- * #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble#
- * #simp=def*10,def_half,def*3,cmplx*3#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ * #simp = def*10, def_half, def*3, cmplx*3#
*/
static PyObject*
@name@_richcompare(PyObject *self, PyObject *other, int cmp_op)
@@ -1196,12 +1393,19 @@ static PyObject*
switch(_@name@_convert2_to_ctypes(self, &arg1, other, &arg2)) {
case 0:
break;
- case -1: /* can't cast both safely use different add function */
- case -2: /* use ufunc */
- if (PyErr_Occurred()) return NULL;
+ case -1:
+ /* can't cast both safely use different add function */
+ case -2:
+ /* use ufunc */
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
return PyGenericArrType_Type.tp_richcompare(self, other, cmp_op);
- case -3: /* special case for longdouble and clongdouble
- because they have a recursive getitem in their dtype */
+ case -3:
+ /*
+ * special case for longdouble and clongdouble
+ * because they have a recursive getitem in their dtype
+ */
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1239,69 +1443,72 @@ static PyObject*
/**begin repeat
- #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,half,float,double,longdouble,cfloat,cdouble,clongdouble#
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
**/
static PyNumberMethods @name@_as_number = {
- (binaryfunc)@name@_add, /*nb_add*/
- (binaryfunc)@name@_subtract, /*nb_subtract*/
- (binaryfunc)@name@_multiply, /*nb_multiply*/
+ (binaryfunc)@name@_add, /*nb_add*/
+ (binaryfunc)@name@_subtract, /*nb_subtract*/
+ (binaryfunc)@name@_multiply, /*nb_multiply*/
#if defined(NPY_PY3K)
#else
- (binaryfunc)@name@_divide, /*nb_divide*/
+ (binaryfunc)@name@_divide, /*nb_divide*/
#endif
- (binaryfunc)@name@_remainder, /*nb_remainder*/
- (binaryfunc)@name@_divmod, /*nb_divmod*/
- (ternaryfunc)@name@_power, /*nb_power*/
+ (binaryfunc)@name@_remainder, /*nb_remainder*/
+ (binaryfunc)@name@_divmod, /*nb_divmod*/
+ (ternaryfunc)@name@_power, /*nb_power*/
(unaryfunc)@name@_negative,
- (unaryfunc)@name@_positive, /*nb_pos*/
- (unaryfunc)@name@_absolute, /*nb_abs*/
+ (unaryfunc)@name@_positive, /*nb_pos*/
+ (unaryfunc)@name@_absolute, /*nb_abs*/
#if defined(NPY_PY3K)
- (inquiry)@name@_bool, /*nb_bool*/
+ (inquiry)@name@_bool, /*nb_bool*/
#else
- (inquiry)@name@_nonzero, /*nb_nonzero*/
+ (inquiry)@name@_nonzero, /*nb_nonzero*/
#endif
- (unaryfunc)@name@_invert, /*nb_invert*/
- (binaryfunc)@name@_lshift, /*nb_lshift*/
- (binaryfunc)@name@_rshift, /*nb_rshift*/
- (binaryfunc)@name@_and, /*nb_and*/
- (binaryfunc)@name@_xor, /*nb_xor*/
- (binaryfunc)@name@_or, /*nb_or*/
+ (unaryfunc)@name@_invert, /*nb_invert*/
+ (binaryfunc)@name@_lshift, /*nb_lshift*/
+ (binaryfunc)@name@_rshift, /*nb_rshift*/
+ (binaryfunc)@name@_and, /*nb_and*/
+ (binaryfunc)@name@_xor, /*nb_xor*/
+ (binaryfunc)@name@_or, /*nb_or*/
#if defined(NPY_PY3K)
#else
- 0, /*nb_coerce*/
+ 0, /*nb_coerce*/
#endif
- (unaryfunc)@name@_int, /*nb_int*/
+ (unaryfunc)@name@_int, /*nb_int*/
#if defined(NPY_PY3K)
- (unaryfunc)0, /*nb_reserved*/
+ (unaryfunc)0, /*nb_reserved*/
#else
- (unaryfunc)@name@_long, /*nb_long*/
+ (unaryfunc)@name@_long, /*nb_long*/
#endif
- (unaryfunc)@name@_float, /*nb_float*/
+ (unaryfunc)@name@_float, /*nb_float*/
#if defined(NPY_PY3K)
#else
- (unaryfunc)@name@_oct, /*nb_oct*/
- (unaryfunc)@name@_hex, /*nb_hex*/
+ (unaryfunc)@name@_oct, /*nb_oct*/
+ (unaryfunc)@name@_hex, /*nb_hex*/
#endif
- 0, /*inplace_add*/
- 0, /*inplace_subtract*/
- 0, /*inplace_multiply*/
+ 0, /*inplace_add*/
+ 0, /*inplace_subtract*/
+ 0, /*inplace_multiply*/
#if defined(NPY_PY3K)
#else
- 0, /*inplace_divide*/
+ 0, /*inplace_divide*/
#endif
- 0, /*inplace_remainder*/
- 0, /*inplace_power*/
- 0, /*inplace_lshift*/
- 0, /*inplace_rshift*/
- 0, /*inplace_and*/
- 0, /*inplace_xor*/
- 0, /*inplace_or*/
+ 0, /*inplace_remainder*/
+ 0, /*inplace_power*/
+ 0, /*inplace_lshift*/
+ 0, /*inplace_rshift*/
+ 0, /*inplace_and*/
+ 0, /*inplace_xor*/
+ 0, /*inplace_or*/
(binaryfunc)@name@_floor_divide, /*nb_floor_divide*/
(binaryfunc)@name@_true_divide, /*nb_true_divide*/
- 0, /*nb_inplace_floor_divide*/
- 0, /*nb_inplace_true_divide*/
+ 0, /*nb_inplace_floor_divide*/
+ 0, /*nb_inplace_true_divide*/
#if PY_VERSION_HEX >= 0x02050000
- (unaryfunc)NULL, /*nb_index*/
+ (unaryfunc)NULL, /*nb_index*/
#endif
};
/**end repeat**/
@@ -1312,9 +1519,15 @@ static void
add_scalarmath(void)
{
/**begin repeat
- #name=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, half, float, double, longdouble, cfloat, cdouble, clongdouble#
- #NAME=Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Half, Float, Double, LongDouble, CFloat, CDouble, CLongDouble#
- **/
+ * #name = byte, ubyte, short, ushort, int, uint,
+ * long, ulong, longlong, ulonglong,
+ * half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble#
+ * #NAME = Byte, UByte, Short, UShort, Int, UInt,
+ * Long, ULong, LongLong, ULongLong,
+ * Half, Float, Double, LongDouble,
+ * CFloat, CDouble, CLongDouble#
+ **/
#if PY_VERSION_HEX >= 0x02050000
@name@_as_number.nb_index = Py@NAME@ArrType_Type.tp_as_number->nb_index;
#endif
@@ -1351,69 +1564,89 @@ get_functions(void)
/* Get the nc_pow functions */
/* Get the pow functions */
mm = PyImport_ImportModule("numpy.core.umath");
- if (mm == NULL) return -1;
+ if (mm == NULL) {
+ return -1;
+ }
obj = PyObject_GetAttrString(mm, "power");
- if (obj == NULL) goto fail;
+ if (obj == NULL) {
+ goto fail;
+ }
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
i = 0;
j = 0;
- while(signatures[i] != NPY_FLOAT) {i+=3; j++;}
- _basic_half_pow = funcdata[j-1];
+ while (signatures[i] != NPY_FLOAT) {
+ i += 3;
+ j++;
+ }
+ _basic_half_pow = funcdata[j - 1];
_basic_float_pow = funcdata[j];
- _basic_double_pow = funcdata[j+1];
- _basic_longdouble_pow = funcdata[j+2];
- _basic_cfloat_pow = funcdata[j+3];
- _basic_cdouble_pow = funcdata[j+4];
- _basic_clongdouble_pow = funcdata[j+5];
+ _basic_double_pow = funcdata[j + 1];
+ _basic_longdouble_pow = funcdata[j + 2];
+ _basic_cfloat_pow = funcdata[j + 3];
+ _basic_cdouble_pow = funcdata[j + 4];
+ _basic_clongdouble_pow = funcdata[j + 5];
Py_DECREF(obj);
/* Get the floor functions */
obj = PyObject_GetAttrString(mm, "floor");
- if (obj == NULL) goto fail;
+ if (obj == NULL) {
+ goto fail;
+ }
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
i = 0;
j = 0;
- while(signatures[i] != NPY_FLOAT) {i+=2; j++;}
- _basic_half_floor = funcdata[j-1];
+ while(signatures[i] != NPY_FLOAT) {
+ i += 2;
+ j++;
+ }
+ _basic_half_floor = funcdata[j - 1];
_basic_float_floor = funcdata[j];
- _basic_double_floor = funcdata[j+1];
- _basic_longdouble_floor = funcdata[j+2];
+ _basic_double_floor = funcdata[j + 1];
+ _basic_longdouble_floor = funcdata[j + 2];
Py_DECREF(obj);
/* Get the sqrt functions */
obj = PyObject_GetAttrString(mm, "sqrt");
- if (obj == NULL) goto fail;
+ if (obj == NULL) {
+ goto fail;
+ }
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
i = 0;
j = 0;
- while(signatures[i] != NPY_FLOAT) {i+=2; j++;}
- _basic_half_sqrt = funcdata[j-1];
+ while (signatures[i] != NPY_FLOAT) {
+ i += 2; j++;
+ }
+ _basic_half_sqrt = funcdata[j - 1];
_basic_float_sqrt = funcdata[j];
- _basic_double_sqrt = funcdata[j+1];
- _basic_longdouble_sqrt = funcdata[j+2];
+ _basic_double_sqrt = funcdata[j + 1];
+ _basic_longdouble_sqrt = funcdata[j + 2];
Py_DECREF(obj);
/* Get the fmod functions */
obj = PyObject_GetAttrString(mm, "fmod");
- if (obj == NULL) goto fail;
+ if (obj == NULL) {
+ goto fail;
+ }
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
i = 0;
j = 0;
- while(signatures[i] != NPY_FLOAT) {i+=3; j++;}
- _basic_half_fmod = funcdata[j-1];
+ while (signatures[i] != NPY_FLOAT) {
+ i += 3;
+ j++;
+ }
+ _basic_half_fmod = funcdata[j - 1];
_basic_float_fmod = funcdata[j];
- _basic_double_fmod = funcdata[j+1];
- _basic_longdouble_fmod = funcdata[j+2];
+ _basic_double_fmod = funcdata[j + 1];
+ _basic_longdouble_fmod = funcdata[j + 2];
Py_DECREF(obj);
- return
+ return ret = 0;
- ret = 0;
fail:
Py_DECREF(mm);
return ret;
@@ -1429,7 +1662,7 @@ alter_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
int n;
PyObject *obj;
n = PyTuple_GET_SIZE(args);
- while(n--) {
+ while (n--) {
obj = PyTuple_GET_ITEM(args, n);
#if !defined(NPY_PY3K)
if (obj == (PyObject *)(&PyInt_Type)) {
@@ -1456,7 +1689,7 @@ alter_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "arguments must be int, float, or complex");
+ "arguments must be int, float, or complex");
return NULL;
}
}
@@ -1470,8 +1703,9 @@ restore_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
+
n = PyTuple_GET_SIZE(args);
- while(n--) {
+ while (n--) {
obj = PyTuple_GET_ITEM(args, n);
#if !defined(NPY_PY3K)
if (obj == (PyObject *)(&PyInt_Type)) {
@@ -1497,7 +1731,7 @@ restore_pyscalars(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "arguments must be int, float, or complex");
+ "arguments must be int, float, or complex");
return NULL;
}
}
@@ -1511,8 +1745,9 @@ use_pythonmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
+
n = PyTuple_GET_SIZE(args);
- while(n--) {
+ while (n--) {
obj = PyTuple_GET_ITEM(args, n);
#if !defined(NPY_PY3K)
if (obj == (PyObject *)(&PyInt_Type)) {
@@ -1538,7 +1773,7 @@ use_pythonmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "arguments must be int, float, or complex");
+ "arguments must be int, float, or complex");
return NULL;
}
}
@@ -1552,8 +1787,9 @@ use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
int n;
PyObject *obj;
+
n = PyTuple_GET_SIZE(args);
- while(n--) {
+ while (n--) {
obj = PyTuple_GET_ITEM(args, n);
#if !defined(NPY_PY3K)
if (obj == (PyObject *)(&PyInt_Type)) {
@@ -1579,7 +1815,7 @@ use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "arguments must be int, float, or complex");
+ "arguments must be int, float, or complex");
return NULL;
}
}
@@ -1588,14 +1824,18 @@ use_scalarmath(PyObject *NPY_UNUSED(dummy), PyObject *args)
}
static struct PyMethodDef methods[] = {
- {"alter_pythonmath", (PyCFunction) alter_pyscalars,
- METH_VARARGS, doc_alterpyscalars},
- {"restore_pythonmath", (PyCFunction) restore_pyscalars,
- METH_VARARGS, doc_restorepyscalars},
- {"use_pythonmath", (PyCFunction) use_pythonmath,
- METH_VARARGS, doc_usepythonmath},
- {"use_scalarmath", (PyCFunction) use_scalarmath,
- METH_VARARGS, doc_usescalarmath},
+ {"alter_pythonmath",
+ (PyCFunction) alter_pyscalars,
+ METH_VARARGS, doc_alterpyscalars},
+ {"restore_pythonmath",
+ (PyCFunction) restore_pyscalars,
+ METH_VARARGS, doc_restorepyscalars},
+ {"use_pythonmath",
+ (PyCFunction) use_pythonmath,
+ METH_VARARGS, doc_usepythonmath},
+ {"use_scalarmath",
+ (PyCFunction) use_scalarmath,
+ METH_VARARGS, doc_usescalarmath},
{NULL, NULL, 0, NULL}
};
@@ -1634,7 +1874,9 @@ initscalarmath(void)
import_array();
import_umath();
- if (get_functions() < 0) return RETVAL;
+ if (get_functions() < 0) {
+ return RETVAL;
+ }
add_scalarmath();
diff --git a/numpy/core/src/umath/funcs.inc.src b/numpy/core/src/umath/funcs.inc.src
index a8db99d5d..0b9398cd2 100644
--- a/numpy/core/src/umath/funcs.inc.src
+++ b/numpy/core/src/umath/funcs.inc.src
@@ -6,6 +6,7 @@
* object functions.
*/
+#define NPY_NO_DEPRECATED_API
#include "numpy/npy_3kcompat.h"
@@ -202,7 +203,8 @@ npy_ObjectLogicalNot(PyObject *i1)
/**begin repeat
*
- * #typ = float, double, longdouble#
+ * #ctype = npy_cfloat, npy_cdouble, npy_clongdouble#
+ * #ftype = npy_float, npy_double, npy_longdouble#
* #c = f, ,l#
* #C = F, ,L#
* #precision = 1,2,4#
@@ -221,18 +223,18 @@ npy_ObjectLogicalNot(PyObject *i1)
} while(0)
/* constants */
-static c@typ@ nc_1@c@ = {1., 0.};
-static c@typ@ nc_half@c@ = {0.5, 0.};
-static c@typ@ nc_i@c@ = {0., 1.};
-static c@typ@ nc_i2@c@ = {0., 0.5};
+static @ctype@ nc_1@c@ = {1., 0.};
+static @ctype@ nc_half@c@ = {0.5, 0.};
+static @ctype@ nc_i@c@ = {0., 1.};
+static @ctype@ nc_i2@c@ = {0., 0.5};
/*
- * static c@typ@ nc_mi@c@ = {0.0@c@, -1.0@c@};
- * static c@typ@ nc_pi2@c@ = {NPY_PI_2@c@., 0.0@c@};
+ * static @ctype@ nc_mi@c@ = {0.0@c@, -1.0@c@};
+ * static @ctype@ nc_pi2@c@ = {NPY_PI_2@c@., 0.0@c@};
*/
static void
-nc_sum@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
+nc_sum@c@(@ctype@ *a, @ctype@ *b, @ctype@ *r)
{
r->real = a->real + b->real;
r->imag = a->imag + b->imag;
@@ -240,7 +242,7 @@ nc_sum@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
}
static void
-nc_diff@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
+nc_diff@c@(@ctype@ *a, @ctype@ *b, @ctype@ *r)
{
r->real = a->real - b->real;
r->imag = a->imag - b->imag;
@@ -248,7 +250,7 @@ nc_diff@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
}
static void
-nc_neg@c@(c@typ@ *a, c@typ@ *r)
+nc_neg@c@(@ctype@ *a, @ctype@ *r)
{
r->real = -a->real;
r->imag = -a->imag;
@@ -256,66 +258,66 @@ nc_neg@c@(c@typ@ *a, c@typ@ *r)
}
static void
-nc_prod@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
+nc_prod@c@(@ctype@ *a, @ctype@ *b, @ctype@ *r)
{
- @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
+ @ftype@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
r->real = ar*br - ai*bi;
r->imag = ar*bi + ai*br;
return;
}
static void
-nc_quot@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
+nc_quot@c@(@ctype@ *a, @ctype@ *b, @ctype@ *r)
{
- @typ@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
- @typ@ d = br*br + bi*bi;
+ @ftype@ ar=a->real, br=b->real, ai=a->imag, bi=b->imag;
+ @ftype@ d = br*br + bi*bi;
r->real = (ar*br + ai*bi)/d;
r->imag = (ai*br - ar*bi)/d;
return;
}
static void
-nc_sqrt@c@(c@typ@ *x, c@typ@ *r)
+nc_sqrt@c@(@ctype@ *x, @ctype@ *r)
{
*r = npy_csqrt@c@(*x);
return;
}
static void
-nc_rint@c@(c@typ@ *x, c@typ@ *r)
+nc_rint@c@(@ctype@ *x, @ctype@ *r)
{
r->real = npy_rint@c@(x->real);
r->imag = npy_rint@c@(x->imag);
}
static void
-nc_log@c@(c@typ@ *x, c@typ@ *r)
+nc_log@c@(@ctype@ *x, @ctype@ *r)
{
*r = npy_clog@c@(*x);
return;
}
static void
-nc_log1p@c@(c@typ@ *x, c@typ@ *r)
+nc_log1p@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ l = npy_hypot@c@(x->real + 1,x->imag);
+ @ftype@ l = npy_hypot@c@(x->real + 1,x->imag);
r->imag = npy_atan2@c@(x->imag, x->real + 1);
r->real = npy_log@c@(l);
return;
}
static void
-nc_exp@c@(c@typ@ *x, c@typ@ *r)
+nc_exp@c@(@ctype@ *x, @ctype@ *r)
{
*r = npy_cexp@c@(*x);
return;
}
static void
-nc_exp2@c@(c@typ@ *x, c@typ@ *r)
+nc_exp2@c@(@ctype@ *x, @ctype@ *r)
{
- c@typ@ a;
+ @ctype@ a;
a.real = x->real*NPY_LOGE2@c@;
a.imag = x->imag*NPY_LOGE2@c@;
nc_exp@c@(&a, r);
@@ -323,22 +325,22 @@ nc_exp2@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_expm1@c@(c@typ@ *x, c@typ@ *r)
+nc_expm1@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ a = npy_exp@c@(x->real);
+ @ftype@ a = npy_exp@c@(x->real);
r->real = a*npy_cos@c@(x->imag) - 1.0@c@;
r->imag = a*npy_sin@c@(x->imag);
return;
}
static void
-nc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
+nc_pow@c@(@ctype@ *a, @ctype@ *b, @ctype@ *r)
{
- intp n;
- @typ@ ar = npy_creal@c@(*a);
- @typ@ br = npy_creal@c@(*b);
- @typ@ ai = npy_cimag@c@(*a);
- @typ@ bi = npy_cimag@c@(*b);
+ npy_intp n;
+ @ftype@ ar = npy_creal@c@(*a);
+ @ftype@ br = npy_creal@c@(*b);
+ @ftype@ ai = npy_cimag@c@(*a);
+ @ftype@ bi = npy_cimag@c@(*b);
if (br == 0. && bi == 0.) {
*r = npy_cpack@c@(1., 0.);
@@ -363,7 +365,7 @@ nc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
}
return;
}
- if (bi == 0 && (n=(intp)br) == br) {
+ if (bi == 0 && (n=(npy_intp)br) == br) {
if (n == 1) {
/* unroll: handle inf better */
*r = npy_cpack@c@(ar, ai);
@@ -381,8 +383,8 @@ nc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
return;
}
else if (n > -100 && n < 100) {
- c@typ@ p, aa;
- intp mask = 1;
+ @ctype@ p, aa;
+ npy_intp mask = 1;
if (n < 0) n = -n;
aa = nc_1@c@;
p = npy_cpack@c@(ar, ai);
@@ -405,9 +407,9 @@ nc_pow@c@(c@typ@ *a, c@typ@ *b, c@typ@ *r)
static void
-nc_prodi@c@(c@typ@ *x, c@typ@ *r)
+nc_prodi@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ xr = x->real;
+ @ftype@ xr = x->real;
r->real = -x->imag;
r->imag = xr;
return;
@@ -415,7 +417,7 @@ nc_prodi@c@(c@typ@ *x, c@typ@ *r)
static void
-nc_acos@c@(c@typ@ *x, c@typ@ *r)
+nc_acos@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_neg(nc_prodi(nc_log(nc_sum(x,nc_prod(nc_i,
@@ -433,13 +435,13 @@ nc_acos@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_acosh@c@(c@typ@ *x, c@typ@ *r)
+nc_acosh@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_log(nc_sum(x,
* nc_prod(nc_sqrt(nc_sum(x,nc_1)), nc_sqrt(nc_diff(x,nc_1)))));
*/
- c@typ@ t;
+ @ctype@ t;
nc_sum@c@(x, &nc_1@c@, &t);
nc_sqrt@c@(&t, &t);
@@ -452,14 +454,14 @@ nc_acosh@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_asin@c@(c@typ@ *x, c@typ@ *r)
+nc_asin@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_neg(nc_prodi(nc_log(nc_sum(nc_prod(nc_i,x),
* nc_sqrt(nc_diff(nc_1,nc_prod(x,x)))))));
*/
if (fabs(x->real) > 1e-3 || fabs(x->imag) > 1e-3) {
- c@typ@ a, *pa=&a;
+ @ctype@ a, *pa=&a;
nc_prod@c@(x, x, r);
nc_diff@c@(&nc_1@c@, r, r);
nc_sqrt@c@(r, r);
@@ -476,7 +478,7 @@ nc_asin@c@(c@typ@ *x, c@typ@ *r)
*
* |x| < 1e-3 => |rel. error| < 1e-18 (f), 1e-24, 1e-36 (l)
*/
- c@typ@ x2;
+ @ctype@ x2;
nc_prod@c@(x, x, &x2);
*r = nc_1@c@;
@@ -496,7 +498,7 @@ nc_asin@c@(c@typ@ *x, c@typ@ *r)
static void
-nc_asinh@c@(c@typ@ *x, c@typ@ *r)
+nc_asinh@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_log(nc_sum(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x));
@@ -515,7 +517,7 @@ nc_asinh@c@(c@typ@ *x, c@typ@ *r)
*
* |x| < 1e-3 => |rel. error| < 1e-18 (f), 1e-24, 1e-36 (l)
*/
- c@typ@ x2;
+ @ctype@ x2;
nc_prod@c@(x, x, &x2);
*r = nc_1@c@;
@@ -534,13 +536,13 @@ nc_asinh@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_atan@c@(c@typ@ *x, c@typ@ *r)
+nc_atan@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_prod(nc_i2,nc_log(nc_quot(nc_sum(nc_i,x),nc_diff(nc_i,x))));
*/
if (fabs(x->real) > 1e-3 || fabs(x->imag) > 1e-3) {
- c@typ@ a, *pa=&a;
+ @ctype@ a, *pa=&a;
nc_diff@c@(&nc_i@c@, x, pa);
nc_sum@c@(&nc_i@c@, x, r);
nc_quot@c@(r, pa, r);
@@ -554,7 +556,7 @@ nc_atan@c@(c@typ@ *x, c@typ@ *r)
*
* |x| < 1e-3 => |rel. error| < 1e-18 (f), 1e-24, 1e-36 (l)
*/
- c@typ@ x2;
+ @ctype@ x2;
nc_prod@c@(x, x, &x2);
*r = nc_1@c@;
@@ -573,13 +575,13 @@ nc_atan@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_atanh@c@(c@typ@ *x, c@typ@ *r)
+nc_atanh@c@(@ctype@ *x, @ctype@ *r)
{
/*
* return nc_prod(nc_half,nc_log(nc_quot(nc_sum(nc_1,x),nc_diff(nc_1,x))));
*/
if (fabs(x->real) > 1e-3 || fabs(x->imag) > 1e-3) {
- c@typ@ a, *pa=&a;
+ @ctype@ a, *pa=&a;
nc_diff@c@(&nc_1@c@, x, r);
nc_sum@c@(&nc_1@c@, x, pa);
nc_quot@c@(pa, r, r);
@@ -593,7 +595,7 @@ nc_atanh@c@(c@typ@ *x, c@typ@ *r)
*
* |x| < 1e-3 => |rel. error| < 1e-18 (f), 1e-24, 1e-36 (l)
*/
- c@typ@ x2;
+ @ctype@ x2;
nc_prod@c@(x, x, &x2);
*r = nc_1@c@;
@@ -612,25 +614,25 @@ nc_atanh@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_cos@c@(c@typ@ *x, c@typ@ *r)
+nc_cos@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ xr=x->real, xi=x->imag;
r->real = npy_cos@c@(xr)*npy_cosh@c@(xi);
r->imag = -npy_sin@c@(xr)*npy_sinh@c@(xi);
return;
}
static void
-nc_cosh@c@(c@typ@ *x, c@typ@ *r)
+nc_cosh@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ xr=x->real, xi=x->imag;
r->real = npy_cos@c@(xi)*npy_cosh@c@(xr);
r->imag = npy_sin@c@(xi)*npy_sinh@c@(xr);
return;
}
static void
-nc_log10@c@(c@typ@ *x, c@typ@ *r)
+nc_log10@c@(@ctype@ *x, @ctype@ *r)
{
nc_log@c@(x, r);
r->real *= NPY_LOG10E@c@;
@@ -639,7 +641,7 @@ nc_log10@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_log2@c@(c@typ@ *x, c@typ@ *r)
+nc_log2@c@(@ctype@ *x, @ctype@ *r)
{
nc_log@c@(x, r);
r->real *= NPY_LOG2E@c@;
@@ -648,30 +650,30 @@ nc_log2@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_sin@c@(c@typ@ *x, c@typ@ *r)
+nc_sin@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ xr=x->real, xi=x->imag;
r->real = npy_sin@c@(xr)*npy_cosh@c@(xi);
r->imag = npy_cos@c@(xr)*npy_sinh@c@(xi);
return;
}
static void
-nc_sinh@c@(c@typ@ *x, c@typ@ *r)
+nc_sinh@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ xr=x->real, xi=x->imag;
r->real = npy_cos@c@(xi)*npy_sinh@c@(xr);
r->imag = npy_sin@c@(xi)*npy_cosh@c@(xr);
return;
}
static void
-nc_tan@c@(c@typ@ *x, c@typ@ *r)
+nc_tan@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ sr,cr,shi,chi;
- @typ@ rs,is,rc,ic;
- @typ@ d;
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ sr,cr,shi,chi;
+ @ftype@ rs,is,rc,ic;
+ @ftype@ d;
+ @ftype@ xr=x->real, xi=x->imag;
sr = npy_sin@c@(xr);
cr = npy_cos@c@(xr);
shi = npy_sinh@c@(xi);
@@ -687,12 +689,12 @@ nc_tan@c@(c@typ@ *x, c@typ@ *r)
}
static void
-nc_tanh@c@(c@typ@ *x, c@typ@ *r)
+nc_tanh@c@(@ctype@ *x, @ctype@ *r)
{
- @typ@ si,ci,shr,chr;
- @typ@ rs,is,rc,ic;
- @typ@ d;
- @typ@ xr=x->real, xi=x->imag;
+ @ftype@ si,ci,shr,chr;
+ @ftype@ rs,is,rc,ic;
+ @ftype@ d;
+ @ftype@ xr=x->real, xi=x->imag;
si = npy_sin@c@(xi);
ci = npy_cos@c@(xi);
shr = npy_sinh@c@(xr);
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index f4b0fc0df..cc8d3f535 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -11,7 +11,7 @@
#define NO_IMPORT_ARRAY
#endif
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_math.h"
#include "numpy/halffloat.h"
@@ -86,11 +86,11 @@
typedef float halfUnaryFunc(npy_half x);
typedef float floatUnaryFunc(float x);
typedef double doubleUnaryFunc(double x);
-typedef longdouble longdoubleUnaryFunc(longdouble x);
+typedef npy_longdouble longdoubleUnaryFunc(npy_longdouble x);
typedef npy_half halfBinaryFunc(npy_half x, npy_half y);
typedef float floatBinaryFunc(float x, float y);
typedef double doubleBinaryFunc(double x, double y);
-typedef longdouble longdoubleBinaryFunc(longdouble x, longdouble y);
+typedef npy_longdouble longdoubleBinaryFunc(npy_longdouble x, npy_longdouble y);
/*UFUNC_API*/
@@ -237,8 +237,8 @@ PyUFunc_g_g(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
longdoubleUnaryFunc *f = (longdoubleUnaryFunc *)func;
UNARY_LOOP {
- longdouble in1 = *(longdouble *)ip1;
- *(longdouble *)op1 = f(in1);
+ npy_longdouble in1 = *(npy_longdouble *)ip1;
+ *(npy_longdouble *)op1 = f(in1);
}
}
@@ -248,9 +248,9 @@ PyUFunc_gg_g(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
longdoubleBinaryFunc *f = (longdoubleBinaryFunc *)func;
BINARY_LOOP {
- longdouble in1 = *(longdouble *)ip1;
- longdouble in2 = *(longdouble *)ip2;
- *(longdouble *)op1 = f(in1, in2);
+ npy_longdouble in1 = *(npy_longdouble *)ip1;
+ npy_longdouble in2 = *(npy_longdouble *)ip2;
+ *(npy_longdouble *)op1 = f(in1, in2);
}
}
@@ -261,13 +261,13 @@ PyUFunc_gg_g(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
*****************************************************************************/
-typedef void cdoubleUnaryFunc(cdouble *x, cdouble *r);
-typedef void cfloatUnaryFunc(cfloat *x, cfloat *r);
-typedef void clongdoubleUnaryFunc(clongdouble *x, clongdouble *r);
-typedef void cdoubleBinaryFunc(cdouble *x, cdouble *y, cdouble *r);
-typedef void cfloatBinaryFunc(cfloat *x, cfloat *y, cfloat *r);
-typedef void clongdoubleBinaryFunc(clongdouble *x, clongdouble *y,
- clongdouble *r);
+typedef void cdoubleUnaryFunc(npy_cdouble *x, npy_cdouble *r);
+typedef void cfloatUnaryFunc(npy_cfloat *x, npy_cfloat *r);
+typedef void clongdoubleUnaryFunc(npy_clongdouble *x, npy_clongdouble *r);
+typedef void cdoubleBinaryFunc(npy_cdouble *x, npy_cdouble *y, npy_cdouble *r);
+typedef void cfloatBinaryFunc(npy_cfloat *x, npy_cfloat *y, npy_cfloat *r);
+typedef void clongdoubleBinaryFunc(npy_clongdouble *x, npy_clongdouble *y,
+ npy_clongdouble *r);
/*UFUNC_API*/
NPY_NO_EXPORT void
@@ -275,8 +275,8 @@ PyUFunc_F_F(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
cfloatUnaryFunc *f = (cfloatUnaryFunc *)func;
UNARY_LOOP {
- cfloat in1 = *(cfloat *)ip1;
- cfloat *out = (cfloat *)op1;
+ npy_cfloat in1 = *(npy_cfloat *)ip1;
+ npy_cfloat *out = (npy_cfloat *)op1;
f(&in1, out);
}
}
@@ -287,7 +287,7 @@ PyUFunc_F_F_As_D_D(char **args, npy_intp *dimensions, npy_intp *steps, void *fun
{
cdoubleUnaryFunc *f = (cdoubleUnaryFunc *)func;
UNARY_LOOP {
- cdouble tmp, out;
+ npy_cdouble tmp, out;
tmp.real = (double)((float *)ip1)[0];
tmp.imag = (double)((float *)ip1)[1];
f(&tmp, &out);
@@ -302,9 +302,9 @@ PyUFunc_FF_F(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
cfloatBinaryFunc *f = (cfloatBinaryFunc *)func;
BINARY_LOOP {
- cfloat in1 = *(cfloat *)ip1;
- cfloat in2 = *(cfloat *)ip2;
- cfloat *out = (cfloat *)op1;
+ npy_cfloat in1 = *(npy_cfloat *)ip1;
+ npy_cfloat in2 = *(npy_cfloat *)ip2;
+ npy_cfloat *out = (npy_cfloat *)op1;
f(&in1, &in2, out);
}
}
@@ -315,7 +315,7 @@ PyUFunc_FF_F_As_DD_D(char **args, npy_intp *dimensions, npy_intp *steps, void *f
{
cdoubleBinaryFunc *f = (cdoubleBinaryFunc *)func;
BINARY_LOOP {
- cdouble tmp1, tmp2, out;
+ npy_cdouble tmp1, tmp2, out;
tmp1.real = (double)((float *)ip1)[0];
tmp1.imag = (double)((float *)ip1)[1];
tmp2.real = (double)((float *)ip2)[0];
@@ -332,8 +332,8 @@ PyUFunc_D_D(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
cdoubleUnaryFunc *f = (cdoubleUnaryFunc *)func;
UNARY_LOOP {
- cdouble in1 = *(cdouble *)ip1;
- cdouble *out = (cdouble *)op1;
+ npy_cdouble in1 = *(npy_cdouble *)ip1;
+ npy_cdouble *out = (npy_cdouble *)op1;
f(&in1, out);
}
}
@@ -344,9 +344,9 @@ PyUFunc_DD_D(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
cdoubleBinaryFunc *f = (cdoubleBinaryFunc *)func;
BINARY_LOOP {
- cdouble in1 = *(cdouble *)ip1;
- cdouble in2 = *(cdouble *)ip2;
- cdouble *out = (cdouble *)op1;
+ npy_cdouble in1 = *(npy_cdouble *)ip1;
+ npy_cdouble in2 = *(npy_cdouble *)ip2;
+ npy_cdouble *out = (npy_cdouble *)op1;
f(&in1, &in2, out);
}
}
@@ -357,8 +357,8 @@ PyUFunc_G_G(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
clongdoubleUnaryFunc *f = (clongdoubleUnaryFunc *)func;
UNARY_LOOP {
- clongdouble in1 = *(clongdouble *)ip1;
- clongdouble *out = (clongdouble *)op1;
+ npy_clongdouble in1 = *(npy_clongdouble *)ip1;
+ npy_clongdouble *out = (npy_clongdouble *)op1;
f(&in1, out);
}
}
@@ -369,9 +369,9 @@ PyUFunc_GG_G(char **args, npy_intp *dimensions, npy_intp *steps, void *func)
{
clongdoubleBinaryFunc *f = (clongdoubleBinaryFunc *)func;
BINARY_LOOP {
- clongdouble in1 = *(clongdouble *)ip1;
- clongdouble in2 = *(clongdouble *)ip2;
- clongdouble *out = (clongdouble *)op1;
+ npy_clongdouble in1 = *(npy_clongdouble *)ip1;
+ npy_clongdouble in2 = *(npy_clongdouble *)ip2;
+ npy_clongdouble *out = (npy_clongdouble *)op1;
f(&in1, &in2, out);
}
}
@@ -533,9 +533,9 @@ NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- Bool in1 = *((Bool *)ip1) != 0;
- Bool in2 = *((Bool *)ip2) != 0;
- *((Bool *)op1)= in1 @OP@ in2;
+ npy_bool in1 = *((npy_bool *)ip1) != 0;
+ npy_bool in2 = *((npy_bool *)ip2) != 0;
+ *((npy_bool *)op1)= in1 @OP@ in2;
}
}
/**end repeat**/
@@ -551,20 +551,20 @@ NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
if(IS_BINARY_REDUCE) {
- BINARY_REDUCE_LOOP(Bool) {
- const Bool in2 = *(Bool *)ip2;
+ BINARY_REDUCE_LOOP(npy_bool) {
+ const npy_bool in2 = *(npy_bool *)ip2;
io1 = io1 @OP@ in2;
if (io1 @SC@ 0) {
break;
}
}
- *((Bool *)iop1) = io1;
+ *((npy_bool *)iop1) = io1;
}
else {
BINARY_LOOP {
- const Bool in1 = *(Bool *)ip1;
- const Bool in2 = *(Bool *)ip2;
- *((Bool *)op1) = in1 @OP@ in2;
+ const npy_bool in1 = *(npy_bool *)ip1;
+ const npy_bool in2 = *(npy_bool *)ip2;
+ *((npy_bool *)op1) = in1 @OP@ in2;
}
}
}
@@ -575,9 +575,9 @@ NPY_NO_EXPORT void
BOOL_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- Bool in1 = *((Bool *)ip1) != 0;
- Bool in2 = *((Bool *)ip2) != 0;
- *((Bool *)op1)= (in1 && !in2) || (!in1 && in2);
+ npy_bool in1 = *((npy_bool *)ip1) != 0;
+ npy_bool in2 = *((npy_bool *)ip2) != 0;
+ *((npy_bool *)op1)= (in1 && !in2) || (!in1 && in2);
}
}
@@ -589,9 +589,9 @@ NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- Bool in1 = *((Bool *)ip1) != 0;
- Bool in2 = *((Bool *)ip2) != 0;
- *((Bool *)op1) = (in1 @OP@ in2) ? in1 : in2;
+ npy_bool in1 = *((npy_bool *)ip1) != 0;
+ npy_bool in2 = *((npy_bool *)ip2) != 0;
+ *((npy_bool *)op1) = (in1 @OP@ in2) ? in1 : in2;
}
}
/**end repeat**/
@@ -604,8 +604,8 @@ NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- Bool in1 = *(Bool *)ip1;
- *((Bool *)op1) = in1 @OP@ 0;
+ npy_bool in1 = *(npy_bool *)ip1;
+ *((npy_bool *)op1) = in1 @OP@ 0;
}
}
/**end repeat**/
@@ -614,7 +614,7 @@ NPY_NO_EXPORT void
BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
OUTPUT_LOOP {
- *((Bool *)op1) = 1;
+ *((npy_bool *)op1) = 1;
}
}
@@ -626,205 +626,204 @@ BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UN
*/
/**begin repeat
- * #type = byte, short, int, long, longlong#
- * #TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
- * #ftype = float, float, double, double, double#
+ * #TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT,
+ * LONG, ULONG, LONGLONG, ULONGLONG#
+ * #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
+ * npy_long, npy_ulong, npy_longlong, npy_ulonglong#
+ * #ftype = npy_float, npy_float, npy_float, npy_float, npy_double, npy_double,
+ * npy_double, npy_double, npy_double, npy_double#
*/
-/**begin repeat1
- * both signed and unsigned integer types
- * #s = , u#
- * #S = , U#
- */
-
-#define @S@@TYPE@_floor_divide @S@@TYPE@_divide
-#define @S@@TYPE@_fmax @S@@TYPE@_maximum
-#define @S@@TYPE@_fmin @S@@TYPE@_minimum
+#define @TYPE@_floor_divide @TYPE@_divide
+#define @TYPE@_fmax @TYPE@_maximum
+#define @TYPE@_fmin @TYPE@_minimum
NPY_NO_EXPORT void
-@S@@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
OUTPUT_LOOP {
- *((@s@@type@ *)op1) = 1;
+ *((@type@ *)op1) = 1;
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((@s@@type@ *)op1) = in1*in1;
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = in1*in1;
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((@s@@type@ *)op1) = (@s@@type@)(1.0/in1);
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = (@type@)(1.0/in1);
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((@s@@type@ *)op1) = in1;
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = in1;
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((@s@@type@ *)op1) = (@s@@type@)(-(@type@)in1);
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = (@type@)(-(@type@)in1);
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((Bool *)op1) = !in1;
+ const @type@ in1 = *(@type@ *)ip1;
+ *((npy_bool *)op1) = !in1;
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- *((@s@@type@ *)op1) = ~in1;
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = ~in1;
}
}
-/**begin repeat2
+/**begin repeat1
* Arithmetic
* #kind = add, subtract, multiply, bitwise_and, bitwise_or, bitwise_xor,
* left_shift, right_shift#
* #OP = +, -,*, &, |, ^, <<, >>#
*/
+
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
if(IS_BINARY_REDUCE) {
- BINARY_REDUCE_LOOP(@s@@type@) {
- io1 @OP@= *(@s@@type@ *)ip2;
+ BINARY_REDUCE_LOOP(@type@) {
+ io1 @OP@= *(@type@ *)ip2;
}
- *((@s@@type@ *)iop1) = io1;
+ *((@type@ *)iop1) = io1;
}
else {
BINARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- const @s@@type@ in2 = *(@s@@type@ *)ip2;
- *((@s@@type@ *)op1) = in1 @OP@ in2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((@type@ *)op1) = in1 @OP@ in2;
}
}
}
-/**end repeat2**/
-/**begin repeat2
+/**end repeat1**/
+
+/**begin repeat1
* #kind = equal, not_equal, greater, greater_equal, less, less_equal,
* logical_and, logical_or#
* #OP = ==, !=, >, >=, <, <=, &&, ||#
*/
+
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- const @s@@type@ in2 = *(@s@@type@ *)ip2;
- *((Bool *)op1) = in1 @OP@ in2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((npy_bool *)op1) = in1 @OP@ in2;
}
}
-/**end repeat2**/
+
+/**end repeat1**/
NPY_NO_EXPORT void
-@S@@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- const @s@@type@ in2 = *(@s@@type@ *)ip2;
- *((Bool *)op1)= (in1 && !in2) || (!in1 && in2);
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((npy_bool *)op1)= (in1 && !in2) || (!in1 && in2);
}
}
-/**begin repeat2
+/**begin repeat1
* #kind = maximum, minimum#
* #OP = >, <#
**/
+
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
if (IS_BINARY_REDUCE) {
- BINARY_REDUCE_LOOP(@s@@type@) {
- const @s@@type@ in2 = *(@type@ *)ip2;
+ BINARY_REDUCE_LOOP(@type@) {
+ const @type@ in2 = *(@type@ *)ip2;
io1 = (io1 @OP@ in2) ? io1 : in2;
}
- *((@s@@type@ *)iop1) = io1;
+ *((@type@ *)iop1) = io1;
}
else {
BINARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- const @s@@type@ in2 = *(@s@@type@ *)ip2;
- *((@s@@type@ *)op1) = (in1 @OP@ in2) ? in1 : in2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((@type@ *)op1) = (in1 @OP@ in2) ? in1 : in2;
}
}
}
-/**end repeat2**/
+
+/**end repeat1**/
NPY_NO_EXPORT void
-@S@@TYPE@_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const double in1 = (double)(*(@s@@type@ *)ip1);
- const double in2 = (double)(*(@s@@type@ *)ip2);
+ const double in1 = (double)(*(@type@ *)ip1);
+ const double in2 = (double)(*(@type@ *)ip2);
*((double *)op1) = in1/in2;
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @ftype@ in1 = (@ftype@)*(@s@@type@ *)ip1;
- const @ftype@ in2 = (@ftype@)*(@s@@type@ *)ip2;
- *((@s@@type@ *)op1) = (@s@@type@) pow(in1, in2);
+ const @ftype@ in1 = (@ftype@)*(@type@ *)ip1;
+ const @ftype@ in2 = (@ftype@)*(@type@ *)ip2;
+ *((@type@ *)op1) = (@type@) pow(in1, in2);
}
}
NPY_NO_EXPORT void
-@S@@TYPE@_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @s@@type@ in1 = *(@s@@type@ *)ip1;
- const @s@@type@ in2 = *(@s@@type@ *)ip2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
if (in2 == 0) {
npy_set_floatstatus_divbyzero();
- *((@s@@type@ *)op1) = 0;
+ *((@type@ *)op1) = 0;
}
else {
- *((@s@@type@ *)op1)= in1 % in2;
+ *((@type@ *)op1)= in1 % in2;
}
}
}
-/**end repeat1**/
+/**end repeat**/
-NPY_NO_EXPORT void
-U@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
-{
- UNARY_LOOP {
- const u@type@ in1 = *(u@type@ *)ip1;
- *((u@type@ *)op1) = in1;
- }
-}
+/**begin repeat
+ * #TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
+ * #type = npy_byte, npy_short, npy_int, npy_long, npy_longlong#
+ */
NPY_NO_EXPORT void
@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
@@ -836,15 +835,6 @@ NPY_NO_EXPORT void
}
NPY_NO_EXPORT void
-U@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
-{
- UNARY_LOOP {
- const u@type@ in1 = *(u@type@ *)ip1;
- *((u@type@ *)op1) = in1 > 0 ? 1 : 0;
- }
-}
-
-NPY_NO_EXPORT void
@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
@@ -880,23 +870,55 @@ NPY_NO_EXPORT void
}
NPY_NO_EXPORT void
-U@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const u@type@ in1 = *(u@type@ *)ip1;
- const u@type@ in2 = *(u@type@ *)ip2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
if (in2 == 0) {
npy_set_floatstatus_divbyzero();
- *((u@type@ *)op1) = 0;
+ *((@type@ *)op1) = 0;
}
else {
- *((u@type@ *)op1)= in1/in2;
+ /* handle mixed case the way Python does */
+ const @type@ rem = in1 % in2;
+ if ((in1 > 0) == (in2 > 0) || rem == 0) {
+ *((@type@ *)op1) = rem;
+ }
+ else {
+ *((@type@ *)op1) = rem + in2;
+ }
}
}
}
+/**end repeat**/
+
+/**begin repeat
+ * #TYPE = UBYTE, USHORT, UINT, ULONG, ULONGLONG#
+ * #type = npy_ubyte, npy_ushort, npy_uint, npy_ulong, npy_ulonglong#
+ */
+
NPY_NO_EXPORT void
-@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+{
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = in1;
+ }
+}
+
+NPY_NO_EXPORT void
+@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+{
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = in1 > 0 ? 1 : 0;
+ }
+}
+
+NPY_NO_EXPORT void
+@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
const @type@ in1 = *(@type@ *)ip1;
@@ -906,24 +928,17 @@ NPY_NO_EXPORT void
*((@type@ *)op1) = 0;
}
else {
- /* handle mixed case the way Python does */
- const @type@ rem = in1 % in2;
- if ((in1 > 0) == (in2 > 0) || rem == 0) {
- *((@type@ *)op1) = rem;
- }
- else {
- *((@type@ *)op1) = rem + in2;
- }
+ *((@type@ *)op1)= in1/in2;
}
}
}
NPY_NO_EXPORT void
-U@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const u@type@ in1 = *(u@type@ *)ip1;
- const u@type@ in2 = *(u@type@ *)ip2;
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
if (in2 == 0) {
npy_set_floatstatus_divbyzero();
*((@type@ *)op1) = 0;
@@ -980,7 +995,7 @@ TIMEDELTA_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNU
}
/**begin repeat
- * #type = datetime, timedelta#
+ * #type = npy_datetime, npy_timedelta#
* #TYPE = DATETIME, TIMEDELTA#
*/
@@ -1045,8 +1060,8 @@ NPY_NO_EXPORT void
DATETIME_Mm_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
BINARY_LOOP {
- const datetime in1 = *(datetime *)ip1;
- const timedelta in2 = *(timedelta *)ip2;
+ const npy_datetime in1 = *(npy_datetime *)ip1;
+ const npy_timedelta in2 = *(npy_timedelta *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_datetime *)op1) = NPY_DATETIME_NAT;
}
@@ -1060,8 +1075,8 @@ NPY_NO_EXPORT void
DATETIME_mM_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const timedelta in1 = *(timedelta *)ip1;
- const datetime in2 = *(datetime *)ip2;
+ const npy_timedelta in1 = *(npy_timedelta *)ip1;
+ const npy_datetime in2 = *(npy_datetime *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_datetime *)op1) = NPY_DATETIME_NAT;
}
@@ -1075,8 +1090,8 @@ NPY_NO_EXPORT void
TIMEDELTA_mm_m_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const timedelta in1 = *(timedelta *)ip1;
- const timedelta in2 = *(timedelta *)ip2;
+ const npy_timedelta in1 = *(npy_timedelta *)ip1;
+ const npy_timedelta in2 = *(npy_timedelta *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_timedelta *)op1) = NPY_DATETIME_NAT;
}
@@ -1090,8 +1105,8 @@ NPY_NO_EXPORT void
DATETIME_Mm_M_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const datetime in1 = *(datetime *)ip1;
- const timedelta in2 = *(timedelta *)ip2;
+ const npy_datetime in1 = *(npy_datetime *)ip1;
+ const npy_timedelta in2 = *(npy_timedelta *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_datetime *)op1) = NPY_DATETIME_NAT;
}
@@ -1105,8 +1120,8 @@ NPY_NO_EXPORT void
DATETIME_MM_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const datetime in1 = *(datetime *)ip1;
- const datetime in2 = *(datetime *)ip2;
+ const npy_datetime in1 = *(npy_datetime *)ip1;
+ const npy_datetime in2 = *(npy_datetime *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_timedelta *)op1) = NPY_DATETIME_NAT;
}
@@ -1120,8 +1135,8 @@ NPY_NO_EXPORT void
TIMEDELTA_mm_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const timedelta in1 = *(timedelta *)ip1;
- const timedelta in2 = *(timedelta *)ip2;
+ const npy_timedelta in1 = *(npy_timedelta *)ip1;
+ const npy_timedelta in2 = *(npy_timedelta *)ip2;
if (in1 == NPY_DATETIME_NAT || in2 == NPY_DATETIME_NAT) {
*((npy_timedelta *)op1) = NPY_DATETIME_NAT;
}
@@ -1254,7 +1269,7 @@ TIMEDELTA_mm_d_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *
/**begin repeat
* Float types
- * #type = float, double, longdouble#
+ * #type = npy_float, npy_double, npy_longdouble#
* #TYPE = FLOAT, DOUBLE, LONGDOUBLE#
* #c = f, , l#
* #C = F, , L#
@@ -1296,7 +1311,7 @@ NPY_NO_EXPORT void
BINARY_LOOP {
const @type@ in1 = *(@type@ *)ip1;
const @type@ in2 = *(@type@ *)ip2;
- *((Bool *)op1) = in1 @OP@ in2;
+ *((npy_bool *)op1) = in1 @OP@ in2;
}
}
/**end repeat1**/
@@ -1307,7 +1322,7 @@ NPY_NO_EXPORT void
BINARY_LOOP {
const @type@ in1 = *(@type@ *)ip1;
const @type@ in2 = *(@type@ *)ip2;
- *((Bool *)op1)= (in1 && !in2) || (!in1 && in2);
+ *((npy_bool *)op1)= (in1 && !in2) || (!in1 && in2);
}
}
@@ -1316,7 +1331,7 @@ NPY_NO_EXPORT void
{
UNARY_LOOP {
const @type@ in1 = *(@type@ *)ip1;
- *((Bool *)op1) = !in1;
+ *((npy_bool *)op1) = !in1;
}
}
@@ -1329,7 +1344,7 @@ NPY_NO_EXPORT void
{
UNARY_LOOP {
const @type@ in1 = *(@type@ *)ip1;
- *((Bool *)op1) = @func@(in1) != 0;
+ *((npy_bool *)op1) = @func@(in1) != 0;
}
}
/**end repeat1**/
@@ -1539,8 +1554,8 @@ NPY_NO_EXPORT void
@TYPE@_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
/*
- * Additional loop to handle long integer inputs (cf. #866, #1633).
- * long != int on many 64-bit platforms, so we need this second loop
+ * Additional loop to handle npy_long integer inputs (cf. #866, #1633).
+ * npy_long != npy_int on many 64-bit platforms, so we need this second loop
* to handle the default integer type.
*/
BINARY_LOOP {
@@ -1552,8 +1567,8 @@ NPY_NO_EXPORT void
}
else {
/*
- * Outside int range -- also ldexp will overflow in this case,
- * given that exponent has less bits than int.
+ * Outside npy_int range -- also ldexp will overflow in this case,
+ * given that exponent has less bits than npy_int.
*/
if (in2 > 0) {
*((@type@ *)op1) = ldexp@c@(in1, NPY_MAX_INT);
@@ -1606,9 +1621,10 @@ HALF_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
#define _HALF_LOGICAL_AND(a,b) (!npy_half_iszero(a) && !npy_half_iszero(b))
#define _HALF_LOGICAL_OR(a,b) (!npy_half_iszero(a) || !npy_half_iszero(b))
/**begin repeat
- * #kind = equal, not_equal, less, less_equal, greater, greater_equal,
- * logical_and, logical_or#
- * #OP = npy_half_eq, npy_half_ne, npy_half_lt, npy_half_le, npy_half_gt, npy_half_ge, _HALF_LOGICAL_AND, _HALF_LOGICAL_OR#
+ * #kind = equal, not_equal, less, less_equal, greater,
+ * greater_equal, logical_and, logical_or#
+ * #OP = npy_half_eq, npy_half_ne, npy_half_lt, npy_half_le, npy_half_gt,
+ * npy_half_ge, _HALF_LOGICAL_AND, _HALF_LOGICAL_OR#
*/
NPY_NO_EXPORT void
HALF_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
@@ -1616,7 +1632,7 @@ HALF_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
BINARY_LOOP {
const npy_half in1 = *(npy_half *)ip1;
const npy_half in2 = *(npy_half *)ip2;
- *((Bool *)op1) = @OP@(in1, in2);
+ *((npy_bool *)op1) = @OP@(in1, in2);
}
}
/**end repeat**/
@@ -1629,7 +1645,7 @@ HALF_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_U
BINARY_LOOP {
const int in1 = !npy_half_iszero(*(npy_half *)ip1);
const int in2 = !npy_half_iszero(*(npy_half *)ip2);
- *((Bool *)op1)= (in1 && !in2) || (!in1 && in2);
+ *((npy_bool *)op1)= (in1 && !in2) || (!in1 && in2);
}
}
@@ -1638,7 +1654,7 @@ HALF_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_U
{
UNARY_LOOP {
const npy_half in1 = *(npy_half *)ip1;
- *((Bool *)op1) = npy_half_iszero(in1);
+ *((npy_bool *)op1) = npy_half_iszero(in1);
}
}
@@ -1651,7 +1667,7 @@ HALF_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
{
UNARY_LOOP {
const npy_half in1 = *(npy_half *)ip1;
- *((Bool *)op1) = @func@(in1) != 0;
+ *((npy_bool *)op1) = @func@(in1) != 0;
}
}
/**end repeat**/
@@ -1846,8 +1862,8 @@ NPY_NO_EXPORT void
HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
/*
- * Additional loop to handle long integer inputs (cf. #866, #1633).
- * long != int on many 64-bit platforms, so we need this second loop
+ * Additional loop to handle npy_long integer inputs (cf. #866, #1633).
+ * npy_long != npy_int on many 64-bit platforms, so we need this second loop
* to handle the default integer type.
*/
BINARY_LOOP {
@@ -1859,8 +1875,8 @@ HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UN
}
else {
/*
- * Outside int range -- also ldexp will overflow in this case,
- * given that exponent has less bits than int.
+ * Outside npy_int range -- also ldexp will overflow in this case,
+ * given that exponent has less bits than npy_int.
*/
if (in2 > 0) {
*((npy_half *)op1) = npy_float_to_half(ldexpf(in1, NPY_MAX_INT));
@@ -1895,8 +1911,8 @@ HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UN
/**begin repeat
* complex types
- * #type = float, double, longdouble#
- * #TYPE = FLOAT, DOUBLE, LONGDOUBLE#
+ * #TYPE = CFLOAT, CDOUBLE, CLONGDOUBLE#
+ * #ftype = npy_float, npy_double, npy_longdouble#
* #c = f, , l#
* #C = F, , L#
*/
@@ -1907,81 +1923,81 @@ HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UN
* #OP = +, -#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- ((@type@ *)op1)[0] = in1r @OP@ in2r;
- ((@type@ *)op1)[1] = in1i @OP@ in2i;
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ ((@ftype@ *)op1)[0] = in1r @OP@ in2r;
+ ((@ftype@ *)op1)[1] = in1i @OP@ in2i;
}
}
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- ((@type@ *)op1)[0] = in1r*in2r - in1i*in2i;
- ((@type@ *)op1)[1] = in1r*in2i + in1i*in2r;
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ ((@ftype@ *)op1)[0] = in1r*in2r - in1i*in2i;
+ ((@ftype@ *)op1)[1] = in1r*in2i + in1i*in2r;
}
}
NPY_NO_EXPORT void
-C@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- const @type@ in2r_abs = npy_fabs@c@(in2r);
- const @type@ in2i_abs = npy_fabs@c@(in2i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ const @ftype@ in2r_abs = npy_fabs@c@(in2r);
+ const @ftype@ in2i_abs = npy_fabs@c@(in2i);
if (in2r_abs >= in2i_abs) {
if (in2r_abs == 0 && in2i_abs == 0) {
/* divide by zero should yield a complex inf or nan */
- ((@type@ *)op1)[0] = in1r/in2r_abs;
- ((@type@ *)op1)[1] = in1i/in2i_abs;
+ ((@ftype@ *)op1)[0] = in1r/in2r_abs;
+ ((@ftype@ *)op1)[1] = in1i/in2i_abs;
}
else {
- const @type@ rat = in2i/in2r;
- const @type@ scl = 1.0@c@/(in2r + in2i*rat);
- ((@type@ *)op1)[0] = (in1r + in1i*rat)*scl;
- ((@type@ *)op1)[1] = (in1i - in1r*rat)*scl;
+ const @ftype@ rat = in2i/in2r;
+ const @ftype@ scl = 1.0@c@/(in2r + in2i*rat);
+ ((@ftype@ *)op1)[0] = (in1r + in1i*rat)*scl;
+ ((@ftype@ *)op1)[1] = (in1i - in1r*rat)*scl;
}
}
else {
- const @type@ rat = in2r/in2i;
- const @type@ scl = 1.0@c@/(in2i + in2r*rat);
- ((@type@ *)op1)[0] = (in1r*rat + in1i)*scl;
- ((@type@ *)op1)[1] = (in1i*rat - in1r)*scl;
+ const @ftype@ rat = in2r/in2i;
+ const @ftype@ scl = 1.0@c@/(in2i + in2r*rat);
+ ((@ftype@ *)op1)[0] = (in1r*rat + in1i)*scl;
+ ((@ftype@ *)op1)[1] = (in1i*rat - in1r)*scl;
}
}
}
NPY_NO_EXPORT void
-C@TYPE@_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
if (npy_fabs@c@(in2r) >= npy_fabs@c@(in2i)) {
- const @type@ rat = in2i/in2r;
- ((@type@ *)op1)[0] = npy_floor@c@((in1r + in1i*rat)/(in2r + in2i*rat));
- ((@type@ *)op1)[1] = 0;
+ const @ftype@ rat = in2i/in2r;
+ ((@ftype@ *)op1)[0] = npy_floor@c@((in1r + in1i*rat)/(in2r + in2i*rat));
+ ((@ftype@ *)op1)[1] = 0;
}
else {
- const @type@ rat = in2r/in2i;
- ((@type@ *)op1)[0] = npy_floor@c@((in1r*rat + in1i)/(in2i + in2r*rat));
- ((@type@ *)op1)[1] = 0;
+ const @ftype@ rat = in2r/in2i;
+ ((@ftype@ *)op1)[0] = npy_floor@c@((in1r*rat + in1i)/(in2i + in2r*rat));
+ ((@ftype@ *)op1)[1] = 0;
}
}
}
@@ -1991,14 +2007,14 @@ C@TYPE@_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *N
* #OP = CGT, CGE, CLT, CLE, CEQ, CNE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- *((Bool *)op1) = @OP@(in1r,in1i,in2r,in2i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ *((npy_bool *)op1) = @OP@(in1r,in1i,in2r,in2i);
}
}
/**end repeat1**/
@@ -2009,39 +2025,39 @@ C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNU
#OP2 = &&, ||#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- *((Bool *)op1) = (in1r @OP1@ in1i) @OP2@ (in2r @OP1@ in2i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ *((npy_bool *)op1) = (in1r @OP1@ in1i) @OP2@ (in2r @OP1@ in2i);
}
}
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
- const Bool tmp1 = (in1r || in1i);
- const Bool tmp2 = (in2r || in2i);
- *((Bool *)op1) = (tmp1 && !tmp2) || (!tmp1 && tmp2);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
+ const npy_bool tmp1 = (in1r || in1i);
+ const npy_bool tmp2 = (in2r || in2i);
+ *((npy_bool *)op1) = (tmp1 && !tmp2) || (!tmp1 && tmp2);
}
}
NPY_NO_EXPORT void
-C@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- *((Bool *)op1) = !(in1r || in1i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ *((npy_bool *)op1) = !(in1r || in1i);
}
}
@@ -2051,97 +2067,97 @@ C@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NP
* #OP = ||, ||, &&#
**/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- *((Bool *)op1) = @func@(in1r) @OP@ @func@(in1i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ *((npy_bool *)op1) = @func@(in1r) @OP@ @func@(in1i);
}
}
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- ((@type@ *)op1)[0] = in1r*in1r - in1i*in1i;
- ((@type@ *)op1)[1] = in1r*in1i + in1i*in1r;
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ ((@ftype@ *)op1)[0] = in1r*in1r - in1i*in1i;
+ ((@ftype@ *)op1)[1] = in1r*in1i + in1i*in1r;
}
}
NPY_NO_EXPORT void
-C@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
if (npy_fabs@c@(in1i) <= npy_fabs@c@(in1r)) {
- const @type@ r = in1i/in1r;
- const @type@ d = in1r + in1i*r;
- ((@type@ *)op1)[0] = 1/d;
- ((@type@ *)op1)[1] = -r/d;
+ const @ftype@ r = in1i/in1r;
+ const @ftype@ d = in1r + in1i*r;
+ ((@ftype@ *)op1)[0] = 1/d;
+ ((@ftype@ *)op1)[1] = -r/d;
} else {
- const @type@ r = in1r/in1i;
- const @type@ d = in1r*r + in1i;
- ((@type@ *)op1)[0] = r/d;
- ((@type@ *)op1)[1] = -1/d;
+ const @ftype@ r = in1r/in1i;
+ const @ftype@ d = in1r*r + in1i;
+ ((@ftype@ *)op1)[0] = r/d;
+ ((@ftype@ *)op1)[1] = -1/d;
}
}
}
NPY_NO_EXPORT void
-C@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
+@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data))
{
OUTPUT_LOOP {
- ((@type@ *)op1)[0] = 1;
- ((@type@ *)op1)[1] = 0;
+ ((@ftype@ *)op1)[0] = 1;
+ ((@ftype@ *)op1)[1] = 0;
}
}
NPY_NO_EXPORT void
-C@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func)) {
+@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func)) {
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- ((@type@ *)op1)[0] = in1r;
- ((@type@ *)op1)[1] = -in1i;
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ ((@ftype@ *)op1)[0] = in1r;
+ ((@ftype@ *)op1)[1] = -in1i;
}
}
NPY_NO_EXPORT void
-C@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- *((@type@ *)op1) = npy_hypot@c@(in1r, in1i);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ *((@ftype@ *)op1) = npy_hypot@c@(in1r, in1i);
}
}
NPY_NO_EXPORT void
-C@TYPE@__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- *((@type@ *)op1) = npy_atan2@c@(in1i, in1r);
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ *((@ftype@ *)op1) = npy_atan2@c@(in1i, in1r);
}
}
NPY_NO_EXPORT void
-C@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
/* fixme: sign of nan is currently 0 */
UNARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- ((@type@ *)op1)[0] = CGT(in1r, in1i, 0.0, 0.0) ? 1 :
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ ((@ftype@ *)op1)[0] = CGT(in1r, in1i, 0.0, 0.0) ? 1 :
(CLT(in1r, in1i, 0.0, 0.0) ? -1 :
(CEQ(in1r, in1i, 0.0, 0.0) ? 0 : NPY_NAN@C@));
- ((@type@ *)op1)[1] = 0;
+ ((@ftype@ *)op1)[1] = 0;
}
}
@@ -2150,20 +2166,20 @@ C@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSE
* #OP = CGE, CLE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
if (@OP@(in1r, in1i, in2r, in2i) || npy_isnan(in1r) || npy_isnan(in1i)) {
- ((@type@ *)op1)[0] = in1r;
- ((@type@ *)op1)[1] = in1i;
+ ((@ftype@ *)op1)[0] = in1r;
+ ((@ftype@ *)op1)[1] = in1i;
}
else {
- ((@type@ *)op1)[0] = in2r;
- ((@type@ *)op1)[1] = in2i;
+ ((@ftype@ *)op1)[0] = in2r;
+ ((@ftype@ *)op1)[1] = in2i;
}
}
}
@@ -2174,26 +2190,26 @@ C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNU
* #OP = CGE, CLE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
BINARY_LOOP {
- const @type@ in1r = ((@type@ *)ip1)[0];
- const @type@ in1i = ((@type@ *)ip1)[1];
- const @type@ in2r = ((@type@ *)ip2)[0];
- const @type@ in2i = ((@type@ *)ip2)[1];
+ const @ftype@ in1r = ((@ftype@ *)ip1)[0];
+ const @ftype@ in1i = ((@ftype@ *)ip1)[1];
+ const @ftype@ in2r = ((@ftype@ *)ip2)[0];
+ const @ftype@ in2i = ((@ftype@ *)ip2)[1];
if (@OP@(in1r, in1i, in2r, in2i) || npy_isnan(in2r) || npy_isnan(in2i)) {
- ((@type@ *)op1)[0] = in1r;
- ((@type@ *)op1)[1] = in1i;
+ ((@ftype@ *)op1)[0] = in1r;
+ ((@ftype@ *)op1)[1] = in1i;
}
else {
- ((@type@ *)op1)[0] = in2r;
- ((@type@ *)op1)[1] = in2i;
+ ((@ftype@ *)op1)[0] = in2r;
+ ((@ftype@ *)op1)[1] = in2i;
}
}
}
/**end repeat1**/
-#define C@TYPE@_true_divide C@TYPE@_divide
+#define @TYPE@_true_divide @TYPE@_divide
/**end repeat**/
@@ -2225,7 +2241,7 @@ OBJECT_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUS
if (ret == -1) {
return;
}
- *((Bool *)op1) = (Bool)ret;
+ *((npy_bool *)op1) = (npy_bool)ret;
}
}
/**end repeat**/
diff --git a/numpy/core/src/umath/loops.h b/numpy/core/src/umath/loops.h
index 192297a29..c2123459b 100644
--- a/numpy/core/src/umath/loops.h
+++ b/numpy/core/src/umath/loops.h
@@ -49,119 +49,119 @@
#line 46
NPY_NO_EXPORT void
-BOOL_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 46
NPY_NO_EXPORT void
-BOOL_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 55
NPY_NO_EXPORT void
-BOOL_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 55
NPY_NO_EXPORT void
-BOOL_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 63
NPY_NO_EXPORT void
-BOOL_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#line 63
NPY_NO_EXPORT void
-BOOL_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BOOL__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
/*
*****************************************************************************
@@ -169,1370 +169,1370 @@ BOOL__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(dat
*****************************************************************************
*/
-#line 81
+#line 79
-#line 87
+#line 85
#define BYTE_floor_divide BYTE_divide
#define BYTE_fmax BYTE_maximum
#define BYTE_fmin BYTE_minimum
NPY_NO_EXPORT void
-BYTE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+BYTE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-BYTE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+BYTE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-BYTE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+BYTE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-BYTE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-BYTE_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-BYTE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-BYTE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-BYTE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 87
+#line 85
#define UBYTE_floor_divide UBYTE_divide
#define UBYTE_fmax UBYTE_maximum
#define UBYTE_fmin UBYTE_minimum
NPY_NO_EXPORT void
-UBYTE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UBYTE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UBYTE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UBYTE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UBYTE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UBYTE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UBYTE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UBYTE_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UBYTE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-UBYTE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-UBYTE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-BYTE_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BYTE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UBYTE_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UBYTE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 81
+#line 79
-#line 87
+#line 85
#define SHORT_floor_divide SHORT_divide
#define SHORT_fmax SHORT_maximum
#define SHORT_fmin SHORT_minimum
NPY_NO_EXPORT void
-SHORT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+SHORT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-SHORT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+SHORT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-SHORT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+SHORT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-SHORT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-SHORT_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-SHORT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-SHORT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-SHORT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 87
+#line 85
#define USHORT_floor_divide USHORT_divide
#define USHORT_fmax USHORT_maximum
#define USHORT_fmin USHORT_minimum
NPY_NO_EXPORT void
-USHORT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+USHORT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-USHORT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+USHORT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-USHORT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+USHORT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-USHORT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-USHORT_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-USHORT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-USHORT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-USHORT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-SHORT_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+SHORT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-USHORT_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+USHORT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 81
+#line 79
-#line 87
+#line 85
#define INT_floor_divide INT_divide
#define INT_fmax INT_maximum
#define INT_fmin INT_minimum
NPY_NO_EXPORT void
-INT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+INT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-INT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+INT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-INT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+INT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-INT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-INT_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-INT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-INT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-INT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 87
+#line 85
#define UINT_floor_divide UINT_divide
#define UINT_fmax UINT_maximum
#define UINT_fmin UINT_minimum
NPY_NO_EXPORT void
-UINT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UINT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UINT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UINT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UINT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+UINT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-UINT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-UINT_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-UINT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-UINT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-UINT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-INT_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+INT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-UINT_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+UINT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 81
+#line 79
-#line 87
+#line 85
#define LONG_floor_divide LONG_divide
#define LONG_fmax LONG_maximum
#define LONG_fmin LONG_minimum
NPY_NO_EXPORT void
-LONG__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONG_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONG_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONG_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONG_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONG_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-LONG_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-LONG_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 87
+#line 85
#define ULONG_floor_divide ULONG_divide
#define ULONG_fmax ULONG_maximum
#define ULONG_fmin ULONG_minimum
NPY_NO_EXPORT void
-ULONG__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONG_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONG_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONG_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONG_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONG_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-ULONG_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-ULONG_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONG_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONG_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 81
+#line 79
-#line 87
+#line 85
#define LONGLONG_floor_divide LONGLONG_divide
#define LONGLONG_fmax LONGLONG_maximum
#define LONGLONG_fmin LONGLONG_minimum
NPY_NO_EXPORT void
-LONGLONG__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGLONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGLONG_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGLONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGLONG_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGLONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGLONG_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-LONGLONG_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-LONGLONG_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-LONGLONG_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-LONGLONG_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 87
+#line 85
#define ULONGLONG_floor_divide ULONGLONG_divide
#define ULONGLONG_fmax ULONGLONG_maximum
#define ULONGLONG_fmin ULONGLONG_minimum
NPY_NO_EXPORT void
-ULONGLONG__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONGLONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONGLONG_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONGLONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONGLONG_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+ULONGLONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-ULONGLONG_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_bitwise_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_bitwise_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_bitwise_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_left_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 119
+#line 117
NPY_NO_EXPORT void
-ULONGLONG_right_shift(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 129
+#line 127
NPY_NO_EXPORT void
-ULONGLONG_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-ULONGLONG_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 140
+#line 138
NPY_NO_EXPORT void
-ULONGLONG_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGLONG_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGLONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-ULONGLONG_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+ULONGLONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/*
@@ -1542,617 +1542,617 @@ ULONGLONG_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED
*/
-#line 194
+#line 191
-#line 201
+#line 198
NPY_NO_EXPORT void
-HALF_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-HALF_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-HALF_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-HALF_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-HALF_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_signbit(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_copysign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_nextafter(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-HALF_spacing(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-HALF_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-HALF_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-HALF_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-HALF_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+HALF_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-HALF_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+HALF_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-HALF__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+HALF__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-HALF_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#ifdef HAVE_FREXPF
NPY_NO_EXPORT void
-HALF_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#ifdef HAVE_LDEXPF
NPY_NO_EXPORT void
-HALF_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-HALF_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#define HALF_true_divide HALF_divide
-#line 194
+#line 191
-#line 201
+#line 198
NPY_NO_EXPORT void
-FLOAT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-FLOAT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-FLOAT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-FLOAT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-FLOAT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_signbit(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_copysign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_nextafter(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-FLOAT_spacing(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-FLOAT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-FLOAT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-FLOAT_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-FLOAT_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+FLOAT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-FLOAT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+FLOAT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-FLOAT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+FLOAT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-FLOAT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#ifdef HAVE_FREXPF
NPY_NO_EXPORT void
-FLOAT_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#ifdef HAVE_LDEXPF
NPY_NO_EXPORT void
-FLOAT_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-FLOAT_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+FLOAT_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#define FLOAT_true_divide FLOAT_divide
-#line 194
+#line 191
-#line 201
+#line 198
NPY_NO_EXPORT void
-DOUBLE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-DOUBLE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-DOUBLE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-DOUBLE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-DOUBLE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_signbit(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_copysign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_nextafter(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-DOUBLE_spacing(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-DOUBLE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-DOUBLE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-DOUBLE_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-DOUBLE_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-DOUBLE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-DOUBLE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-DOUBLE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#ifdef HAVE_FREXP
NPY_NO_EXPORT void
-DOUBLE_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#ifdef HAVE_LDEXP
NPY_NO_EXPORT void
-DOUBLE_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DOUBLE_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DOUBLE_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#define DOUBLE_true_divide DOUBLE_divide
-#line 194
+#line 191
-#line 201
+#line 198
NPY_NO_EXPORT void
-LONGDOUBLE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-LONGDOUBLE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-LONGDOUBLE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 201
+#line 198
NPY_NO_EXPORT void
-LONGDOUBLE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 210
+#line 207
NPY_NO_EXPORT void
-LONGDOUBLE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_signbit(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_copysign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_nextafter(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 224
+#line 221
NPY_NO_EXPORT void
-LONGDOUBLE_spacing(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-LONGDOUBLE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 232
+#line 229
NPY_NO_EXPORT void
-LONGDOUBLE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-LONGDOUBLE_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 240
+#line 237
NPY_NO_EXPORT void
-LONGDOUBLE_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGDOUBLE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGDOUBLE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+LONGDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-LONGDOUBLE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#ifdef HAVE_FREXPL
NPY_NO_EXPORT void
-LONGDOUBLE_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#ifdef HAVE_LDEXPL
NPY_NO_EXPORT void
-LONGDOUBLE_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-LONGDOUBLE_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+LONGDOUBLE_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#define LONGDOUBLE_true_divide LONGDOUBLE_divide
@@ -2173,349 +2173,349 @@ LONGDOUBLE_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUS
#define CEQ(xr,xi,yr,yi) (xr == yr && xi == yi);
#define CNE(xr,xi,yr,yi) (xr != yr || xi != yi);
-#line 314
+#line 310
-#line 320
+#line 316
NPY_NO_EXPORT void
-CFLOAT_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 320
+#line 316
NPY_NO_EXPORT void
-CFLOAT_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CFLOAT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CFLOAT_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CFLOAT_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
-#line 361
+CFLOAT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
+#line 357
NPY_NO_EXPORT void
-CFLOAT_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CFLOAT_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CFLOAT_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CFLOAT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CFLOAT_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CFLOAT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CFLOAT__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CFLOAT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CFLOAT_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT__arg(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CFLOAT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CFLOAT_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CFLOAT_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CFLOAT_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CFLOAT_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CFLOAT_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#define CFLOAT_true_divide CFLOAT_divide
-#line 314
+#line 310
-#line 320
+#line 316
NPY_NO_EXPORT void
-CDOUBLE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 320
+#line 316
NPY_NO_EXPORT void
-CDOUBLE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CDOUBLE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CDOUBLE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CDOUBLE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
-#line 361
+CDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
+#line 357
NPY_NO_EXPORT void
-CDOUBLE_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CDOUBLE_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CDOUBLE_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CDOUBLE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CDOUBLE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CDOUBLE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE__arg(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CDOUBLE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CDOUBLE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CDOUBLE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CDOUBLE_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CDOUBLE_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#define CDOUBLE_true_divide CDOUBLE_divide
-#line 314
+#line 310
-#line 320
+#line 316
NPY_NO_EXPORT void
-CLONGDOUBLE_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 320
+#line 316
NPY_NO_EXPORT void
-CLONGDOUBLE_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 338
+#line 334
NPY_NO_EXPORT void
-CLONGDOUBLE_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CLONGDOUBLE_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 347
+#line 343
NPY_NO_EXPORT void
-CLONGDOUBLE_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
-#line 361
+CLONGDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
+#line 357
NPY_NO_EXPORT void
-CLONGDOUBLE_isnan(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CLONGDOUBLE_isinf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 361
+#line 357
NPY_NO_EXPORT void
-CLONGDOUBLE_isfinite(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CLONGDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CLONGDOUBLE_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CLONGDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CLONGDOUBLE__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+CLONGDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-CLONGDOUBLE_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE__arg(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-CLONGDOUBLE_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CLONGDOUBLE_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 390
+#line 386
NPY_NO_EXPORT void
-CLONGDOUBLE_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CLONGDOUBLE_fmax(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 398
+#line 394
NPY_NO_EXPORT void
-CLONGDOUBLE_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+CLONGDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#define CLONGDOUBLE_true_divide CLONGDOUBLE_divide
@@ -2536,133 +2536,133 @@ CLONGDOUBLE_fmin(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(fu
*/
NPY_NO_EXPORT void
-TIMEDELTA_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 432
+#line 427
NPY_NO_EXPORT void
-DATETIME__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DATETIME__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-DATETIME_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 448
+#line 443
NPY_NO_EXPORT void
-DATETIME_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 448
+#line 443
NPY_NO_EXPORT void
-DATETIME_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 432
+#line 427
NPY_NO_EXPORT void
-TIMEDELTA__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+TIMEDELTA__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 440
+#line 435
NPY_NO_EXPORT void
-TIMEDELTA_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 448
+#line 443
NPY_NO_EXPORT void
-TIMEDELTA_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 448
+#line 443
NPY_NO_EXPORT void
-TIMEDELTA_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DATETIME_Mm_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DATETIME_Mm_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-DATETIME_mM_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_mM_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_m_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_m_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DATETIME_Mm_M_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_Mm_M_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DATETIME_MM_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_MM_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mq_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mq_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_qm_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_qm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_md_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_md_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_dm_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_dm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mq_m_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mq_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_md_m_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_md_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_d_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_d_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/* Special case equivalents to above functions */
@@ -2671,7 +2671,7 @@ TIMEDELTA_mm_d_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUS
#define TIMEDELTA_mm_d_true_divide TIMEDELTA_mm_d_divide
#define TIMEDELTA_mq_m_floor_divide TIMEDELTA_mq_m_divide
#define TIMEDELTA_md_m_floor_divide TIMEDELTA_md_m_divide
-#define TIMEDELTA_mm_d_floor_divide TIMEDELTA_mm_d_divide
+/* #define TIMEDELTA_mm_d_floor_divide TIMEDELTA_mm_d_divide */
#define TIMEDELTA_fmin TIMEDELTA_minimum
#define TIMEDELTA_fmax TIMEDELTA_maximum
#define DATETIME_fmin DATETIME_minimum
@@ -2683,33 +2683,33 @@ TIMEDELTA_mm_d_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUS
*****************************************************************************
*/
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 516
+#line 511
NPY_NO_EXPORT void
-OBJECT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-OBJECT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/*
*****************************************************************************
diff --git a/numpy/core/src/umath/loops.h.src b/numpy/core/src/umath/loops.h.src
index 24b21aa8d..87b47a754 100644
--- a/numpy/core/src/umath/loops.h.src
+++ b/numpy/core/src/umath/loops.h.src
@@ -45,7 +45,7 @@
**/
NPY_NO_EXPORT void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat**/
/**begin repeat
@@ -53,7 +53,7 @@ BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
* #OP = >, <#
**/
NPY_NO_EXPORT void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat**/
/**begin repeat
@@ -61,11 +61,11 @@ BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
* #OP = !=, ==#
**/
NPY_NO_EXPORT void
-BOOL_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat**/
NPY_NO_EXPORT void
-BOOL__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
/*
*****************************************************************************
@@ -74,9 +74,7 @@ BOOL__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(dat
*/
/**begin repeat
- * #type = byte, short, int, long, longlong#
* #TYPE = BYTE, SHORT, INT, LONG, LONGLONG#
- * #ftype = float, float, double, double, double#
*/
/**begin repeat1
@@ -90,25 +88,25 @@ BOOL__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(dat
#define @S@@TYPE@_fmin @S@@TYPE@_minimum
NPY_NO_EXPORT void
-@S@@TYPE@__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@S@@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@S@@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@S@@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@S@@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@S@@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@S@@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@S@@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@S@@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@S@@TYPE@_invert(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat2
* Arithmetic
@@ -117,7 +115,7 @@ NPY_NO_EXPORT void
* #OP = +, -,*, &, |, ^, <<, >>#
*/
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat2**/
@@ -127,54 +125,54 @@ NPY_NO_EXPORT void
* #OP = ==, !=, >, >=, <, <=, &&, ||#
*/
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat2**/
NPY_NO_EXPORT void
-@S@@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat2
* #kind = maximum, minimum#
* #OP = >, <#
**/
NPY_NO_EXPORT void
-@S@@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat2**/
NPY_NO_EXPORT void
-@S@@TYPE@_true_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@S@@TYPE@_power(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@S@@TYPE@_fmod(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@S@@TYPE@_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-U@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+U@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-U@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+U@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-U@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+U@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+U@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat**/
/*
@@ -186,7 +184,6 @@ U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(f
/**begin repeat
* Float types
- * #type = npy_half, float, double, longdouble#
* #TYPE = HALF, FLOAT, DOUBLE, LONGDOUBLE#
* #c = f, f, , l#
* #C = F, F, , L#
@@ -199,7 +196,7 @@ U@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(f
* # OP = +, -, *, /#
*/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -208,21 +205,21 @@ NPY_NO_EXPORT void
* #OP = ==, !=, <, <=, >, >=, &&, ||#
*/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat1
* #kind = isnan, isinf, isfinite, signbit, copysign, nextafter, spacing#
* #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit, npy_copysign, nextafter, spacing#
**/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -230,7 +227,7 @@ NPY_NO_EXPORT void
* #OP = >=, <=#
**/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -238,52 +235,52 @@ NPY_NO_EXPORT void
* #OP = >=, <=#
**/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_remainder(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@TYPE@__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_modf(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#ifdef HAVE_FREXP@C@
NPY_NO_EXPORT void
-@TYPE@_frexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#ifdef HAVE_LDEXP@C@
NPY_NO_EXPORT void
-@TYPE@_ldexp(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-@TYPE@_ldexp_long(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
#endif
#define @TYPE@_true_divide @TYPE@_divide
@@ -306,7 +303,6 @@ NPY_NO_EXPORT void
/**begin repeat
* complex types
- * #type = float, double, longdouble#
* #TYPE = FLOAT, DOUBLE, LONGDOUBLE#
* #c = f, , l#
* #C = F, , L#
@@ -318,25 +314,25 @@ NPY_NO_EXPORT void
* #OP = +, -#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@_floor_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat1
* #kind= greater, greater_equal, less, less_equal, equal, not_equal#
* #OP = CGT, CGE, CLT, CLE, CEQ, CNE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -345,50 +341,50 @@ C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func
#OP2 = &&, ||#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat1
* #kind = isnan, isinf, isfinite#
* #func = npy_isnan, npy_isinf, npy_isfinite#
* #OP = ||, ||, &&#
**/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
NPY_NO_EXPORT void
-C@TYPE@_square(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+C@TYPE@_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-C@TYPE@_reciprocal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+C@TYPE@_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-C@TYPE@__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+C@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-C@TYPE@_conjugate(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@__arg(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-C@TYPE@_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat1
* #kind = maximum, minimum#
* #OP = CGE, CLE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -396,7 +392,7 @@ C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func
* #OP = CGE, CLE#
*/
NPY_NO_EXPORT void
-C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+C@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
#define C@TYPE@_true_divide C@TYPE@_divide
@@ -417,28 +413,27 @@ C@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func
*/
NPY_NO_EXPORT void
-TIMEDELTA_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**begin repeat
- * #type = datetime, timedelta#
* #TYPE = DATETIME, TIMEDELTA#
*/
NPY_NO_EXPORT void
-@TYPE@__ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+@TYPE@__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
/**begin repeat1
* #kind = equal, not_equal, greater, greater_equal, less, less_equal#
* #OP = ==, !=, >, >=, <, <=#
*/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**begin repeat1
@@ -446,49 +441,49 @@ NPY_NO_EXPORT void
* #OP = >, <#
**/
NPY_NO_EXPORT void
-@TYPE@_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat1**/
/**end repeat**/
NPY_NO_EXPORT void
-DATETIME_Mm_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data));
+DATETIME_Mm_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
NPY_NO_EXPORT void
-DATETIME_mM_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_mM_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_m_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_m_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DATETIME_Mm_M_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_Mm_M_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-DATETIME_MM_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+DATETIME_MM_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mq_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mq_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_qm_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_qm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_md_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_md_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_dm_m_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_dm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mq_m_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mq_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_md_m_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_md_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
NPY_NO_EXPORT void
-TIMEDELTA_mm_d_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+TIMEDELTA_mm_d_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/* Special case equivalents to above functions */
@@ -514,11 +509,11 @@ TIMEDELTA_mm_d_divide(char **args, intp *dimensions, intp *steps, void *NPY_UNUS
* #OP = EQ, NE, GT, GE, LT, LE#
*/
NPY_NO_EXPORT void
-OBJECT_@kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/**end repeat**/
NPY_NO_EXPORT void
-OBJECT_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func));
+OBJECT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
/*
*****************************************************************************
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 0c7f6b3db..f9906823c 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -36,7 +36,7 @@
#include "numpy/npy_3kcompat.h"
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "lowlevel_strided_loops.h"
#include "ufunc_type_resolution.h"
@@ -91,9 +91,9 @@ _error_handler(int method, PyObject *errobj, char *errtype, int retstatus, int *
PyObject *pyfunc, *ret, *args;
char *name = PyBytes_AS_STRING(PyTuple_GET_ITEM(errobj,0));
char msg[100];
- ALLOW_C_API_DEF;
+ NPY_ALLOW_C_API_DEF;
- ALLOW_C_API;
+ NPY_ALLOW_C_API;
switch(method) {
case UFUNC_ERR_WARN:
PyOS_snprintf(msg, sizeof(msg), "%s encountered in %s", errtype, name);
@@ -153,11 +153,11 @@ _error_handler(int method, PyObject *errobj, char *errtype, int retstatus, int *
}
break;
}
- DISABLE_C_API;
+ NPY_DISABLE_C_API;
return 0;
fail:
- DISABLE_C_API;
+ NPY_DISABLE_C_API;
return -1;
}
@@ -377,8 +377,8 @@ _extract_pyvals(PyObject *ref, char *name, int *bufsize,
*errobj = NULL;
if (!PyList_Check(ref) || (PyList_GET_SIZE(ref)!=3)) {
- PyErr_Format(PyExc_TypeError, "%s must be a length 3 list.",
- UFUNC_PYVALS_NAME);
+ PyErr_Format(PyExc_TypeError,
+ "%s must be a length 3 list.", UFUNC_PYVALS_NAME);
return -1;
}
@@ -386,14 +386,14 @@ _extract_pyvals(PyObject *ref, char *name, int *bufsize,
if ((*bufsize == -1) && PyErr_Occurred()) {
return -1;
}
- if ((*bufsize < NPY_MIN_BUFSIZE)
- || (*bufsize > NPY_MAX_BUFSIZE)
- || (*bufsize % 16 != 0)) {
+ if ((*bufsize < NPY_MIN_BUFSIZE) ||
+ (*bufsize > NPY_MAX_BUFSIZE) ||
+ (*bufsize % 16 != 0)) {
PyErr_Format(PyExc_ValueError,
- "buffer size (%d) is not in range "
- "(%"INTP_FMT" - %"INTP_FMT") or not a multiple of 16",
- *bufsize, (intp) NPY_MIN_BUFSIZE,
- (intp) NPY_MAX_BUFSIZE);
+ "buffer size (%d) is not in range "
+ "(%"NPY_INTP_FMT" - %"NPY_INTP_FMT") or not a multiple of 16",
+ *bufsize, (npy_intp) NPY_MIN_BUFSIZE,
+ (npy_intp) NPY_MAX_BUFSIZE);
return -1;
}
@@ -4710,7 +4710,7 @@ ufunc_outer(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
}
for (i = 0; i < PyArray_NDIM(ap1); i++) {
PyTuple_SET_ITEM(shape1, i,
- PyLong_FromLongLong((longlong)PyArray_DIMS(ap1)[i]));
+ PyLong_FromLongLong((npy_longlong)PyArray_DIMS(ap1)[i]));
}
shape2 = PyTuple_New(PyArray_NDIM(ap2));
for (i = 0; i < PyArray_NDIM(ap2); i++) {
diff --git a/numpy/core/src/umath/umath_tests.c.src b/numpy/core/src/umath/umath_tests.c.src
index 3234f8bb1..1e0adc15c 100644
--- a/numpy/core/src/umath/umath_tests.c.src
+++ b/numpy/core/src/umath/umath_tests.c.src
@@ -5,6 +5,8 @@
** INCLUDES **
*****************************************************************************
*/
+#define NPY_NO_DEPRECATED_API
+
#include "Python.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
@@ -19,24 +21,22 @@
*****************************************************************************
*/
-typedef npy_intp intp;
-
#define INIT_OUTER_LOOP_1 \
- intp dN = *dimensions++; \
- intp N_; \
- intp s0 = *steps++;
+ npy_intp dN = *dimensions++;\
+ npy_intp N_; \
+ npy_intp s0 = *steps++;
#define INIT_OUTER_LOOP_2 \
INIT_OUTER_LOOP_1 \
- intp s1 = *steps++;
+ npy_intp s1 = *steps++;
#define INIT_OUTER_LOOP_3 \
INIT_OUTER_LOOP_2 \
- intp s2 = *steps++;
+ npy_intp s2 = *steps++;
#define INIT_OUTER_LOOP_4 \
INIT_OUTER_LOOP_3 \
- intp s3 = *steps++;
+ npy_intp s3 = *steps++;
#define BEGIN_OUTER_LOOP_3 \
for (N_ = 0; N_ < dN; N_++, args[0] += s0, args[1] += s1, args[2] += s2) {
@@ -66,12 +66,12 @@ char *inner1d_signature = "(i),(i)->()";
* out[n] = sum_i { in1[n, i] * in2[n, i] }.
*/
static void
-@TYPE@_inner1d(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+@TYPE@_inner1d(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
INIT_OUTER_LOOP_3
- intp di = dimensions[0];
- intp i;
- intp is1=steps[0], is2=steps[1];
+ npy_intp di = dimensions[0];
+ npy_intp i;
+ npy_intp is1=steps[0], is2=steps[1];
BEGIN_OUTER_LOOP_3
char *ip1=args[0], *ip2=args[1], *op=args[2];
@typ@ sum = 0;
@@ -101,12 +101,12 @@ char *innerwt_signature = "(i),(i),(i)->()";
*/
static void
-@TYPE@_innerwt(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+@TYPE@_innerwt(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
INIT_OUTER_LOOP_4
- intp di = dimensions[0];
- intp i;
- intp is1=steps[0], is2=steps[1], is3=steps[2];
+ npy_intp di = dimensions[0];
+ npy_intp i;
+ npy_intp is1=steps[0], is2=steps[1], is3=steps[2];
BEGIN_OUTER_LOOP_4
char *ip1=args[0], *ip2=args[1], *ip3=args[2], *op=args[3];
@typ@ sum = 0;
@@ -137,20 +137,20 @@ char *matrix_multiply_signature = "(m,n),(n,p)->(m,p)";
static void
-@TYPE@_matrix_multiply(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func))
+@TYPE@_matrix_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
/* no BLAS is available */
INIT_OUTER_LOOP_3
- intp dm = dimensions[0];
- intp dn = dimensions[1];
- intp dp = dimensions[2];
- intp m,n,p;
- intp is1_m=steps[0], is1_n=steps[1], is2_n=steps[2], is2_p=steps[3],
+ npy_intp dm = dimensions[0];
+ npy_intp dn = dimensions[1];
+ npy_intp dp = dimensions[2];
+ npy_intp m,n,p;
+ npy_intp is1_m=steps[0], is1_n=steps[1], is2_n=steps[2], is2_p=steps[3],
os_m=steps[4], os_p=steps[5];
- intp ib1_n = is1_n*dn;
- intp ib2_n = is2_n*dn;
- intp ib2_p = is2_p*dp;
- intp ob_p = os_p *dp;
+ npy_intp ib1_n = is1_n*dn;
+ npy_intp ib2_n = is2_n*dn;
+ npy_intp ib2_p = is2_p*dp;
+ npy_intp ob_p = os_p *dp;
BEGIN_OUTER_LOOP_3
char *ip1=args[0], *ip2=args[1], *op=args[2];
for (m = 0; m < dm; m++) {
diff --git a/numpy/core/src/umath/umathmodule.c.src b/numpy/core/src/umath/umathmodule.c
index bd3907731..7ac1ecaf8 100644
--- a/numpy/core/src/umath/umathmodule.c.src
+++ b/numpy/core/src/umath/umathmodule.c
@@ -25,7 +25,7 @@
#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
#endif
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "abstract.h"
@@ -292,12 +292,15 @@ InitOtherOperators(PyObject *dictionary) {
/*static PyTypeObject PyUFunc_Type;*/
static struct PyMethodDef methods[] = {
- {"frompyfunc", (PyCFunction) ufunc_frompyfunc,
- METH_VARARGS | METH_KEYWORDS, NULL},
- {"seterrobj", (PyCFunction) ufunc_seterr,
- METH_VARARGS, NULL},
- {"geterrobj", (PyCFunction) ufunc_geterr,
- METH_VARARGS, NULL},
+ {"frompyfunc",
+ (PyCFunction) ufunc_frompyfunc,
+ METH_VARARGS | METH_KEYWORDS, NULL},
+ {"seterrobj",
+ (PyCFunction) ufunc_seterr,
+ METH_VARARGS, NULL},
+ {"geterrobj",
+ (PyCFunction) ufunc_geterr,
+ METH_VARARGS, NULL},
{NULL, NULL, 0, NULL} /* sentinel */
};
diff --git a/numpy/f2py/doc/multiarray/array_from_pyobj.c b/numpy/f2py/doc/multiarray/array_from_pyobj.c
index 5a700eecf..03d4aacf6 100644
--- a/numpy/f2py/doc/multiarray/array_from_pyobj.c
+++ b/numpy/f2py/doc/multiarray/array_from_pyobj.c
@@ -113,7 +113,7 @@ PyArrayObject* array_from_pyobj(const int type_num,
if (intent & F2PY_INTENT_OUT) {
if ((!(intent & F2PY_INTENT_C)) && (rank>1)) {
lazy_transpose(arr);
- arr->flags &= ~CONTIGUOUS;
+ arr->flags &= ~NPY_CONTIGUOUS;
}
Py_INCREF(arr);
}
@@ -155,7 +155,7 @@ PyArrayObject* array_from_pyobj(const int type_num,
if ((rank>1) && (! (intent & F2PY_INTENT_C))) {
lazy_transpose(arr);
lazy_transpose(tmp_arr);
- tmp_arr->flags &= ~CONTIGUOUS;
+ tmp_arr->flags &= ~NPY_CONTIGUOUS;
}
arr = tmp_arr;
}
@@ -172,7 +172,7 @@ PyArrayObject* array_from_pyobj(const int type_num,
if (intent & F2PY_INTENT_OUT) {
if ((!(intent & F2PY_INTENT_C)) && (rank>1)) {
lazy_transpose(arr);
- arr->flags &= ~CONTIGUOUS;
+ arr->flags &= ~NPY_CONTIGUOUS;
}
Py_INCREF(arr);
}
@@ -192,13 +192,13 @@ PyArrayObject* array_from_pyobj(const int type_num,
if ((rank>1) && (! (intent & F2PY_INTENT_C))) {
PyArrayObject *tmp_arr = NULL;
lazy_transpose(arr);
- arr->flags &= ~CONTIGUOUS;
+ arr->flags &= ~NPY_CONTIGUOUS;
tmp_arr = (PyArrayObject *) PyArray_CopyFromObject((PyObject *)arr,type_num,0,0);
Py_DECREF(arr);
arr = tmp_arr;
ARR_IS_NULL(arr,"CopyFromObject(Array) failed: intent(fortran)\n");
lazy_transpose(arr);
- arr->flags &= ~CONTIGUOUS;
+ arr->flags &= ~NPY_CONTIGUOUS;
}
if (intent & F2PY_INTENT_OUT)
Py_INCREF(arr);
@@ -238,7 +238,7 @@ void lazy_transpose(PyArrayObject* arr) {
Changes the order of array strides and dimensions. This
corresponds to the lazy transpose of a Numeric array in-situ.
Note that this function is assumed to be used even times for a
- given array. Otherwise, the caller should set flags &= ~CONTIGUOUS.
+ given array. Otherwise, the caller should set flags &= ~NPY_CONTIGUOUS.
*/
int rank,i,s,j;
rank = arr->nd;
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c
index 536b048f5..82343fc35 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/lib/src/_compiled_base.c
@@ -1,7 +1,7 @@
#define NPY_NO_DEPRECATED_API
#include "Python.h"
#include "structmember.h"
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#include "numpy/npy_3kcompat.h"
#include "npy_config.h"
#include "numpy/ufuncobject.h"
@@ -1378,7 +1378,7 @@ pack_or_unpack_bits(PyObject *input, int axis, int unpack)
PyArrayObject *inp;
PyArrayObject *new = NULL;
PyArrayObject *out = NULL;
- npy_intp outdims[MAX_DIMS];
+ npy_intp outdims[NPY_MAXDIMS];
int i;
void (*thefunc)(void *, int, npy_intp, npy_intp, void *, npy_intp, npy_intp);
PyArrayIterObject *it, *ot;
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index e83d0f228..f302deb9d 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -4,7 +4,7 @@ More modifications by Jeff Whitaker
*/
#include "Python.h"
-#include "numpy/noprefix.h"
+#include "numpy/arrayobject.h"
#ifdef NO_APPEND_FORTRAN
# define FNAME(x) x
@@ -105,7 +105,7 @@ check_object(PyObject *ob, int t, char *obname,
"Expected an array for parameter %s in lapack_lite.%s",
obname, funname);
return 0;
- } else if (!(((PyArrayObject *)ob)->flags & CONTIGUOUS)) {
+ } else if (!(((PyArrayObject *)ob)->flags & NPY_CONTIGUOUS)) {
PyErr_Format(LapackError,
"Parameter %s is not contiguous in lapack_lite.%s",
obname, funname);
@@ -450,21 +450,21 @@ lapack_lite_dgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
Change it to the maximum of the minimum and the optimal.
*/
long work0 = (long) *DDATA(work);
- int mn = MIN(m,n);
- int mx = MAX(m,n);
+ int mn = PyArray_MIN(m,n);
+ int mx = PyArray_MAX(m,n);
switch(jobz){
case 'N':
- work0 = MAX(work0,3*mn + MAX(mx,6*mn)+500);
+ work0 = PyArray_MAX(work0,3*mn + PyArray_MAX(mx,6*mn)+500);
break;
case 'O':
- work0 = MAX(work0,3*mn*mn + \
- MAX(mx,5*mn*mn+4*mn+500));
+ work0 = PyArray_MAX(work0,3*mn*mn + \
+ PyArray_MAX(mx,5*mn*mn+4*mn+500));
break;
case 'S':
case 'A':
- work0 = MAX(work0,3*mn*mn + \
- MAX(mx,4*mn*(mn+1))+500);
+ work0 = PyArray_MAX(work0,3*mn*mn + \
+ PyArray_MAX(mx,4*mn*(mn+1))+500);
break;
}
*DDATA(work) = (double) work0;