summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arraytypes.inc.src3
-rw-r--r--numpy/core/src/multiarraymodule.c24
-rw-r--r--numpy/core/src/umathmodule.c.src1
3 files changed, 16 insertions, 12 deletions
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src
index 2499fc059..dbee57c33 100644
--- a/numpy/core/src/arraytypes.inc.src
+++ b/numpy/core/src/arraytypes.inc.src
@@ -1,4 +1,5 @@
/* -*- c -*- */
+#include "config.h"
static longlong
MyPyLong_AsLongLong(PyObject *vv)
@@ -934,7 +935,7 @@ static int
{
@btype@ result;
- result = PyOS_strto@func@(str, endptr, 0);
+ result = PyOS_strto@func@(str, endptr, 10);
*ip = (@type@) result;
return 0;
}
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index 137c81a4d..40b287715 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -3065,23 +3065,25 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2, NPY_SEARCHSIDE side)
PyArrayObject *ap1=NULL;
PyArrayObject *ap2=NULL;
PyArrayObject *ret=NULL;
- int typenum = 0;
+ PyArray_Descr *dtype;
NPY_BEGIN_THREADS_DEF
- typenum = PyArray_ObjectType((PyObject *)op1, 0);
- typenum = PyArray_ObjectType(op2, typenum);
-
+ dtype = PyArray_DescrFromObject((PyObject *)op2, op1->descr);
+
/* need ap1 as contiguous array and of right type */
- ap1 = (PyArrayObject *)PyArray_ContiguousFromAny((PyObject *)op1,
- typenum,
- 1, 1);
- if (ap1 == NULL)
+ Py_INCREF(dtype);
+ ap1 = (PyArrayObject *)PyArray_FromAny((PyObject *)op1, dtype,
+ 1, 1, NPY_DEFAULT, NULL);
+
+ if (ap1 == NULL) {
+ Py_DECREF(dtype);
return NULL;
+ }
/* need ap2 as contiguous array and of right type */
- ap2 = (PyArrayObject *)PyArray_ContiguousFromAny(op2, typenum,
- 0, 0);
+ ap2 = (PyArrayObject *)PyArray_FromAny(op2, dtype, 0, 0, NPY_DEFAULT, NULL);
+
if (ap2 == NULL)
goto fail;
@@ -7267,7 +7269,7 @@ compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds)
}
-#ifndef NPY_NO_SIGNAL
+#ifndef __NPY_PRIVATE_NO_SIGNAL
SIGJMP_BUF _NPY_SIGINT_BUF;
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src
index ec531e0e5..dfb50aba3 100644
--- a/numpy/core/src/umathmodule.c.src
+++ b/numpy/core/src/umathmodule.c.src
@@ -5,6 +5,7 @@
#define _UMATHMODULE
#include "numpy/ufuncobject.h"
#include "abstract.h"
+#include "config.h"
#include <math.h>
/* A whole slew of basic math functions are provided originally