Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  ...
  • Loading branch information...
commit ca258fc430fbcba6a3824dd3834f8e14259a62c8 2 parents 096b436 + 87214fb
@charris charris authored
Showing with 3,585 additions and 3,041 deletions.
  1. +0 −2  numpy/core/SConscript
  2. +1 −1  numpy/core/blasdot/_dotblas.c
  3. +1 −2  numpy/core/bscript
  4. +3 −2 numpy/core/include/numpy/arrayobject.h
  5. +3 −3 numpy/core/include/numpy/ndarraytypes.h
  6. +9 −2 numpy/core/include/numpy/noprefix.h
  7. +12 −2 numpy/core/include/numpy/npy_common.h
  8. +9 −9 numpy/core/include/numpy/npy_interrupt.h
  9. +2 −3 numpy/core/setup.py
  10. +20 −21 numpy/core/src/multiarray/arrayobject.c
  11. +654 −449 numpy/core/src/multiarray/arraytypes.c.src
  12. +1 −2  numpy/core/src/multiarray/buffer.c
  13. +5 −6 numpy/core/src/multiarray/calculation.c
  14. +18 −19 numpy/core/src/multiarray/common.c
  15. +73 −74 numpy/core/src/multiarray/conversion_utils.c
  16. +4 −4 numpy/core/src/multiarray/conversion_utils.h
  17. +2 −3 numpy/core/src/multiarray/convert.c
  18. +3 −4 numpy/core/src/multiarray/convert_datatype.c
  19. +11 −11 numpy/core/src/multiarray/ctors.c
  20. +10 −10 numpy/core/src/multiarray/ctors.h
  21. +46 −47 numpy/core/src/multiarray/descriptor.c
  22. +1 −1  numpy/core/src/multiarray/dtype_transfer.c
  23. +128 −124 numpy/core/src/multiarray/einsum.c.src
  24. +4 −5 numpy/core/src/multiarray/flagsobject.c
  25. +20 −21 numpy/core/src/multiarray/getset.c
  26. +1 −1  numpy/core/src/multiarray/hashdescr.c
  27. +86 −87 numpy/core/src/multiarray/item_selection.c
  28. +19 −20 numpy/core/src/multiarray/iterators.c
  29. +3 −3 numpy/core/src/multiarray/iterators.h
  30. +41 −21 numpy/core/src/multiarray/lowlevel_strided_loops.c.src
  31. +15 −16 numpy/core/src/multiarray/mapping.c
  32. +4 −4 numpy/core/src/multiarray/mapping.h
  33. +18 −18 numpy/core/src/multiarray/methods.c
  34. +14 −8 numpy/core/src/multiarray/multiarray_tests.c.src
  35. +19 −20 numpy/core/src/multiarray/multiarraymodule.c
  36. +1 −1  numpy/core/src/multiarray/nditer_impl.h
  37. +1 −1  numpy/core/src/multiarray/nditer_pywrap.c
  38. +1 −2  numpy/core/src/multiarray/number.c
  39. +0 −1  numpy/core/src/multiarray/numpymemoryview.c
  40. +0 −1  numpy/core/src/multiarray/numpyos.c
  41. +3 −4 numpy/core/src/multiarray/refcount.c
  42. +8 −9 numpy/core/src/multiarray/scalarapi.c
  43. +197 −137 numpy/core/src/multiarray/scalartypes.c.src
  44. +1 −1  numpy/core/src/multiarray/scalartypes.h
  45. +2 −3 numpy/core/src/multiarray/sequence.c
  46. +8 −9 numpy/core/src/multiarray/shape.c
  47. +19 −20 numpy/core/src/multiarray/ucsnarrow.c
  48. +3 −4 numpy/core/src/multiarray/usertypes.c
  49. +1 −1  numpy/core/src/npymath/ieee754.c.src
  50. +3 −3 numpy/core/src/npymath/npy_math.c.src
  51. +2 −2 numpy/core/src/npymath/npy_math_complex.c.src
  52. +511 −269 numpy/core/src/scalarmathmodule.c.src
  53. +72 −70 numpy/core/src/umath/funcs.inc.src
  54. +335 −319 numpy/core/src/umath/loops.c.src
  55. +1,004 −1,004 numpy/core/src/umath/loops.h
  56. +85 −90 numpy/core/src/umath/loops.h.src
  57. +15 −15 numpy/core/src/umath/ufunc_object.c
  58. +26 −26 numpy/core/src/umath/umath_tests.c.src
  59. +10 −7 numpy/core/src/umath/{umathmodule.c.src → umathmodule.c}
  60. +6 −6 numpy/f2py/doc/multiarray/array_from_pyobj.c
  61. +2 −2 numpy/lib/src/_compiled_base.c
  62. +9 −9 numpy/linalg/lapack_litemodule.c
View
2  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',
View
2  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
View
3  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:
View
5 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
View
6 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*/
View
11 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
View
14 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)
View
18 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 */
View
5 numpy/core/setup.py
@@ -829,8 +829,7 @@ def generate_umath_templated_sources(ext, build_dir):
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 generate_umath_c(ext, build_dir):
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'),
View
41 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;
}
View
1,103 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: