[Numpy-svn] r3180 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Sep 18 15:51:05 CDT 2006


Author: oliphant
Date: 2006-09-18 15:50:10 -0500 (Mon, 18 Sep 2006)
New Revision: 3180

Modified:
   trunk/numpy/core/src/arraytypes.inc.src
Log:
Fix copyswap for VOID arrays when src is NULL

Modified: trunk/numpy/core/src/arraytypes.inc.src
===================================================================
--- trunk/numpy/core/src/arraytypes.inc.src	2006-09-18 20:36:43 UTC (rev 3179)
+++ trunk/numpy/core/src/arraytypes.inc.src	2006-09-18 20:50:10 UTC (rev 3180)
@@ -1234,9 +1234,13 @@
                 descr = arr->descr;
                 while (PyDict_Next(descr->fields, &pos, &key, &value)) {
                         if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset,
-                                              &title)) {arr->descr=descr;return;}
+                                              &title)) {
+                                arr->descr=descr;return;
+                        }
                         arr->descr = new;
-                        new->f->copyswapn(dst+offset, dstride, src+offset, sstride, n, swap, arr);
+                        new->f->copyswapn(dst+offset, dstride, 
+                                          (src != NULL ? src+offset : NULL),
+                                          sstride, n, swap, arr);
                 }
                 arr->descr = descr;
                 return;
@@ -1258,9 +1262,13 @@
                 descr = arr->descr;  /* Save it */
                 while (PyDict_Next(descr->fields, &pos, &key, &value)) {
                         if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset,
-                                              &title)) {arr->descr=descr;return;}
+                                              &title)) {
+                                arr->descr=descr;return;
+                        }
                         arr->descr = new;
-                        new->f->copyswap(dst+offset, src+offset, swap, arr);
+                        new->f->copyswap(dst+offset, 
+                                         (src != NULL ? src+offset : NULL), 
+                                         swap, arr);
                 }
                 arr->descr = descr;
                 return;



More information about the Numpy-svn mailing list