summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/code_generators/generate_umath.py6
-rw-r--r--numpy/core/src/multiarray/_multiarray_tests.c.src18
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src4
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src14
-rw-r--r--numpy/core/src/umath/_rational_tests.c.src12
-rw-r--r--numpy/core/src/umath/funcs.inc.src4
-rw-r--r--numpy/f2py/cfuncs.py6
7 files changed, 32 insertions, 32 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index 8ef9392d3..dc5c2577a 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -8,12 +8,12 @@ sys.path.insert(0, os.path.dirname(__file__))
import ufunc_docstrings as docstrings
sys.path.pop(0)
-Zero = "PyInt_FromLong(0)"
-One = "PyInt_FromLong(1)"
+Zero = "PyLong_FromLong(0)"
+One = "PyLong_FromLong(1)"
True_ = "(Py_INCREF(Py_True), Py_True)"
False_ = "(Py_INCREF(Py_False), Py_False)"
None_ = object()
-AllOnes = "PyInt_FromLong(-1)"
+AllOnes = "PyLong_FromLong(-1)"
MinusInfinity = 'PyFloat_FromDouble(-NPY_INFINITY)'
ReorderableNone = "(Py_INCREF(Py_None), Py_None)"
diff --git a/numpy/core/src/multiarray/_multiarray_tests.c.src b/numpy/core/src/multiarray/_multiarray_tests.c.src
index fc4b2647a..ce4ddf7b5 100644
--- a/numpy/core/src/multiarray/_multiarray_tests.c.src
+++ b/numpy/core/src/multiarray/_multiarray_tests.c.src
@@ -1733,8 +1733,8 @@ get_struct_alignments(PyObject *NPY_UNUSED(self), PyObject *args) {
/**begin repeat
* #N = 1,2,3#
*/
- alignment = PyInt_FromLong(_ALIGN(struct TestStruct@N@));
- size = PyInt_FromLong(sizeof(struct TestStruct@N@));
+ alignment = PyLong_FromLong(_ALIGN(struct TestStruct@N@));
+ size = PyLong_FromLong(sizeof(struct TestStruct@N@));
val = PyTuple_Pack(2, alignment, size);
Py_DECREF(alignment);
Py_DECREF(size);
@@ -1950,7 +1950,7 @@ run_byteorder_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_SWAP: return PyUnicode_FromString("NPY_SWAP");
case NPY_IGNORE: return PyUnicode_FromString("NPY_IGNORE");
}
- return PyInt_FromLong(byteorder);
+ return PyLong_FromLong(byteorder);
}
static PyObject *
@@ -1965,7 +1965,7 @@ run_sortkind_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_HEAPSORT: return PyUnicode_FromString("NPY_HEAPSORT");
case NPY_STABLESORT: return PyUnicode_FromString("NPY_STABLESORT");
}
- return PyInt_FromLong(kind);
+ return PyLong_FromLong(kind);
}
static PyObject *
@@ -1978,7 +1978,7 @@ run_selectkind_converter(PyObject* NPY_UNUSED(self), PyObject *args)
switch (kind) {
case NPY_INTROSELECT: return PyUnicode_FromString("NPY_INTROSELECT");
}
- return PyInt_FromLong(kind);
+ return PyLong_FromLong(kind);
}
static PyObject *
@@ -1992,7 +1992,7 @@ run_searchside_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_SEARCHLEFT: return PyUnicode_FromString("NPY_SEARCHLEFT");
case NPY_SEARCHRIGHT: return PyUnicode_FromString("NPY_SEARCHRIGHT");
}
- return PyInt_FromLong(side);
+ return PyLong_FromLong(side);
}
static PyObject *
@@ -2008,7 +2008,7 @@ run_order_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_FORTRANORDER: return PyUnicode_FromString("NPY_FORTRANORDER");
case NPY_KEEPORDER: return PyUnicode_FromString("NPY_KEEPORDER");
}
- return PyInt_FromLong(order);
+ return PyLong_FromLong(order);
}
static PyObject *
@@ -2023,7 +2023,7 @@ run_clipmode_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_WRAP: return PyUnicode_FromString("NPY_WRAP");
case NPY_RAISE: return PyUnicode_FromString("NPY_RAISE");
}
- return PyInt_FromLong(mode);
+ return PyLong_FromLong(mode);
}
static PyObject *
@@ -2040,7 +2040,7 @@ run_casting_converter(PyObject* NPY_UNUSED(self), PyObject *args)
case NPY_SAME_KIND_CASTING: return PyUnicode_FromString("NPY_SAME_KIND_CASTING");
case NPY_UNSAFE_CASTING: return PyUnicode_FromString("NPY_UNSAFE_CASTING");
}
- return PyInt_FromLong(casting);
+ return PyLong_FromLong(casting);
}
static PyObject *
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index fa0b94d09..ecaca72a1 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -175,7 +175,7 @@ MyPyLong_AsUnsigned@Type@ (PyObject *obj)
*
* #TYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, LONG, UINT, ULONG,
* LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE#
- * #func1 = PyBool_FromLong, PyInt_FromLong*6, PyLong_FromUnsignedLong*2,
+ * #func1 = PyBool_FromLong, PyLong_FromLong*6, PyLong_FromUnsignedLong*2,
* PyLong_FromLongLong, PyLong_FromUnsignedLongLong,
* MyPyFloat_FromHalf, PyFloat_FromDouble*2#
* #func2 = PyObject_IsTrue, MyPyLong_AsLong*6, MyPyLong_AsUnsignedLong*2,
@@ -4461,7 +4461,7 @@ set_typeinfo(PyObject *dict)
return -1;
}
}
- key = PyInt_FromLong(NPY_@name2@);
+ key = PyLong_FromLong(NPY_@name2@);
if (key == NULL) {
return -1;
}
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 1eb226624..d0efaa2a0 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -1058,7 +1058,7 @@ gentype_richcompare(PyObject *self, PyObject *other, int cmp_op)
static PyObject *
gentype_ndim_get(PyObject *NPY_UNUSED(self))
{
- return PyInt_FromLong(0);
+ return PyLong_FromLong(0);
}
static PyObject *
@@ -1099,7 +1099,7 @@ inttype_numerator_get(PyObject *self)
static PyObject *
inttype_denominator_get(PyObject *self)
{
- return PyInt_FromLong(1);
+ return PyLong_FromLong(1);
}
@@ -1119,7 +1119,7 @@ gentype_itemsize_get(PyObject *self)
typecode = PyArray_DescrFromScalar(self);
elsize = typecode->elsize;
- ret = PyInt_FromLong((long) elsize);
+ ret = PyLong_FromLong((long) elsize);
Py_DECREF(typecode);
return ret;
}
@@ -1127,7 +1127,7 @@ gentype_itemsize_get(PyObject *self)
static PyObject *
gentype_size_get(PyObject *NPY_UNUSED(self))
{
- return PyInt_FromLong(1);
+ return PyLong_FromLong(1);
}
static PyObject *
@@ -1311,7 +1311,7 @@ gentype_imag_get(PyObject *self)
ret = PyObject_GetAttrString(obj, "imag");
if (ret == NULL) {
PyErr_Clear();
- obj = PyInt_FromLong(0);
+ obj = PyLong_FromLong(0);
newtype = PyArray_DescrFromType(NPY_OBJECT);
ret = PyArray_Scalar((char *)&obj, newtype, NULL);
Py_DECREF(newtype);
@@ -2897,7 +2897,7 @@ bool_arrtype_nonzero(PyObject *a)
* ulong, ulonglong#
* #Name = Byte, Short, Int, Long, UByte, UShort, LongLong, UInt,
* ULong, ULongLong#
- * #type = PyInt_FromLong*6, PyLong_FromLongLong*1,
+ * #type = PyLong_FromLong*6, PyLong_FromLongLong*1,
* PyLong_FromUnsignedLong*2, PyLong_FromUnsignedLongLong#
*/
static PyNumberMethods @name@_arrtype_as_number;
@@ -2926,7 +2926,7 @@ bool_index(PyObject *a)
return NULL;
}
else {
- return PyInt_FromLong(PyArrayScalar_VAL(a, Bool));
+ return PyLong_FromLong(PyArrayScalar_VAL(a, Bool));
}
}
diff --git a/numpy/core/src/umath/_rational_tests.c.src b/numpy/core/src/umath/_rational_tests.c.src
index e611a0847..9474f98d0 100644
--- a/numpy/core/src/umath/_rational_tests.c.src
+++ b/numpy/core/src/umath/_rational_tests.c.src
@@ -441,7 +441,7 @@ pyrational_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
return 0;
}
/* Check that we had an exact integer */
- y = PyInt_FromLong(n[i]);
+ y = PyLong_FromLong(n[i]);
if (!y) {
return 0;
}
@@ -487,7 +487,7 @@ pyrational_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
} \
return 0; \
} \
- y_ = PyInt_FromLong(n_); \
+ y_ = PyLong_FromLong(n_); \
if (!y_) { \
return 0; \
} \
@@ -591,7 +591,7 @@ RATIONAL_BINOP_2(floor_divide,
}
RATIONAL_UNOP(negative,rational,rational_negative(x),PyRational_FromRational)
RATIONAL_UNOP(absolute,rational,rational_abs(x),PyRational_FromRational)
-RATIONAL_UNOP(int,long,rational_int(x),PyInt_FromLong)
+RATIONAL_UNOP(int,long,rational_int(x),PyLong_FromLong)
RATIONAL_UNOP(float,double,rational_double(x),PyFloat_FromDouble)
static PyObject*
@@ -647,12 +647,12 @@ static PyNumberMethods pyrational_as_number = {
static PyObject*
pyrational_n(PyObject* self, void* closure) {
- return PyInt_FromLong(((PyRational*)self)->r.n);
+ return PyLong_FromLong(((PyRational*)self)->r.n);
}
static PyObject*
pyrational_d(PyObject* self, void* closure) {
- return PyInt_FromLong(d(((PyRational*)self)->r));
+ return PyLong_FromLong(d(((PyRational*)self)->r));
}
static PyGetSetDef pyrational_getset[] = {
@@ -733,7 +733,7 @@ npyrational_setitem(PyObject* item, void* data, void* arr) {
if (error_converting(n)) {
return -1;
}
- y = PyInt_FromLong(n);
+ y = PyLong_FromLong(n);
if (!y) {
return -1;
}
diff --git a/numpy/core/src/umath/funcs.inc.src b/numpy/core/src/umath/funcs.inc.src
index 273779ee8..9b04dc779 100644
--- a/numpy/core/src/umath/funcs.inc.src
+++ b/numpy/core/src/umath/funcs.inc.src
@@ -26,13 +26,13 @@ Py_square(PyObject *o)
static PyObject *
Py_get_one(PyObject *NPY_UNUSED(o))
{
- return PyInt_FromLong(1);
+ return PyLong_FromLong(1);
}
static PyObject *
Py_reciprocal(PyObject *o)
{
- PyObject *one = PyInt_FromLong(1);
+ PyObject *one = PyLong_FromLong(1);
PyObject *result;
if (!one) {
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index b3a734e3d..17d67acca 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -286,11 +286,11 @@ static int f2py_size(PyArrayObject* var, ...)
"""
cppmacros[
- 'pyobj_from_char1'] = '#define pyobj_from_char1(v) (PyInt_FromLong(v))'
+ 'pyobj_from_char1'] = '#define pyobj_from_char1(v) (PyLong_FromLong(v))'
cppmacros[
- 'pyobj_from_short1'] = '#define pyobj_from_short1(v) (PyInt_FromLong(v))'
+ 'pyobj_from_short1'] = '#define pyobj_from_short1(v) (PyLong_FromLong(v))'
needs['pyobj_from_int1'] = ['signed_char']
-cppmacros['pyobj_from_int1'] = '#define pyobj_from_int1(v) (PyInt_FromLong(v))'
+cppmacros['pyobj_from_int1'] = '#define pyobj_from_int1(v) (PyLong_FromLong(v))'
cppmacros[
'pyobj_from_long1'] = '#define pyobj_from_long1(v) (PyLong_FromLong(v))'
needs['pyobj_from_long_long1'] = ['long_long']