diff options
author | Jarrod Millman <millman@berkeley.edu> | 2008-02-08 09:48:31 +0000 |
---|---|---|
committer | Jarrod Millman <millman@berkeley.edu> | 2008-02-08 09:48:31 +0000 |
commit | fb3f711f1a1eafb2895a84a80f88814d7fb9a465 (patch) | |
tree | aab6281c88fd6bed7c74df03562c197d934edd83 /numpy/core/src | |
parent | 2f3f1a8ef977fd04fc40d12ffd05903eb88c8635 (diff) | |
parent | 964727a2c475a7e48e262efc52b51345f51f2522 (diff) | |
download | numpy-fb3f711f1a1eafb2895a84a80f88814d7fb9a465.tar.gz |
Merge revisions 4721:4771 from the trunk
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/arraytypes.inc.src | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarraymodule.c | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src index cecf54bed..dbee57c33 100644 --- a/numpy/core/src/arraytypes.inc.src +++ b/numpy/core/src/arraytypes.inc.src @@ -935,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 bcfed19d1..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; |