summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-24 15:55:15 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-24 15:55:15 +0000
commitd9650b61184db94ce83187fb1b4be2de4bb5f2b8 (patch)
treeb73929b9ce8b562b8e082f0fa907df92bb406897
parentca059fbcebb498f68ccf5eecd692b4c90a6b4bb7 (diff)
downloadnumpy-d9650b61184db94ce83187fb1b4be2de4bb5f2b8.tar.gz
Fixed issues with ticket #267
-rw-r--r--numpy/core/include/numpy/npy_interrupt.h2
-rw-r--r--numpy/core/src/arraytypes.inc.src8
-rw-r--r--numpy/core/src/multiarraymodule.c4
3 files changed, 8 insertions, 6 deletions
diff --git a/numpy/core/include/numpy/npy_interrupt.h b/numpy/core/include/numpy/npy_interrupt.h
index d288185d8..47a54c65c 100644
--- a/numpy/core/include/numpy/npy_interrupt.h
+++ b/numpy/core/include/numpy/npy_interrupt.h
@@ -78,6 +78,8 @@ Interrupt handling does not work well with threads.
#ifndef NPY_NO_SIGNAL
+#include <setjmp.h>
+
#ifndef sigsetjmp
#define SIGSETJMP(arg1, arg2) setjmp(arg1)
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src
index af2ddf026..47527c43e 100644
--- a/numpy/core/src/arraytypes.inc.src
+++ b/numpy/core/src/arraytypes.inc.src
@@ -1035,14 +1035,16 @@ static void
memcpy(dst, src, n*sizeof(@type@));
}
else {
- _unaligned_strided_byte_copy(dst, dstride, src, sstride,
- n, sizeof(@type@));
+ _unaligned_strided_byte_copy(dst, dstride, src,
+ sstride, n,
+ sizeof(@type@));
}
}
if (swap) {
_strided_byte_swap(dst, dstride, n, SIZEOF_@fsize@);
- _strided_byte_swap(dst + SIZEOF_@fsize@, dstride, n, SIZEOF_@fsize@);
+ _strided_byte_swap(((char *)dst + SIZEOF_@fsize@), dstride,
+ n, SIZEOF_@fsize@);
}
}
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index 99f1e9684..a504e71d1 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -5456,7 +5456,7 @@ PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, intp count)
50% overallocation => 0, 4, 8, 14, 23, 36, 56, 86 ...
*/
elcount = (i >> 1) + (i < 4 ? 4 : 2) + i;
- if (elcount <= ((~(size_t)0) / elsize))
+ if (elcount <= (intp)((~(size_t)0) / elsize))
new_data = PyDataMem_RENEW(ret->data, elcount * elsize);
else
new_data = NULL;
@@ -6430,8 +6430,6 @@ compare_chararrays(PyObject *dummy, PyObject *args, PyObject *kwds)
}
-
-
#ifndef NPY_NO_SIGNAL
static PyObject *