[Numpy-svn] r3057 - in trunk/numpy/core: include/numpy src

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Aug 24 10:55:21 CDT 2006


Author: oliphant
Date: 2006-08-24 10:55:15 -0500 (Thu, 24 Aug 2006)
New Revision: 3057

Modified:
   trunk/numpy/core/include/numpy/npy_interrupt.h
   trunk/numpy/core/src/arraytypes.inc.src
   trunk/numpy/core/src/multiarraymodule.c
Log:
Fixed issues with ticket #267

Modified: trunk/numpy/core/include/numpy/npy_interrupt.h
===================================================================
--- trunk/numpy/core/include/numpy/npy_interrupt.h	2006-08-24 08:36:48 UTC (rev 3056)
+++ trunk/numpy/core/include/numpy/npy_interrupt.h	2006-08-24 15:55:15 UTC (rev 3057)
@@ -78,6 +78,8 @@
            
 #ifndef NPY_NO_SIGNAL
 
+#include <setjmp.h>
+
 #ifndef sigsetjmp
 
 #define SIGSETJMP(arg1, arg2) setjmp(arg1)

Modified: trunk/numpy/core/src/arraytypes.inc.src
===================================================================
--- trunk/numpy/core/src/arraytypes.inc.src	2006-08-24 08:36:48 UTC (rev 3056)
+++ trunk/numpy/core/src/arraytypes.inc.src	2006-08-24 15:55:15 UTC (rev 3057)
@@ -1035,14 +1035,16 @@
                         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_ at fsize@);
-                _strided_byte_swap(dst + SIZEOF_ at fsize@, dstride, n, SIZEOF_ at fsize@);
+                _strided_byte_swap(((char *)dst + SIZEOF_ at fsize@), dstride, 
+                                   n, SIZEOF_ at fsize@);
         }
 }
 

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2006-08-24 08:36:48 UTC (rev 3056)
+++ trunk/numpy/core/src/multiarraymodule.c	2006-08-24 15:55:15 UTC (rev 3057)
@@ -5456,7 +5456,7 @@
                    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 @@
 }
 
 
-
-
 #ifndef NPY_NO_SIGNAL
 
 static PyObject *



More information about the Numpy-svn mailing list