summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-23 02:49:54 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-23 02:49:54 +0000
commit9fa5c5a1d36ff690db92fa4b55fc10172f50a1ad (patch)
treefb6107c4b28c1b82483e2f8f0f026a448916251c /numpy/core/src/arrayobject.c
parent984df2b3aba4e4131d9b58de6e4d880e497ac0bb (diff)
downloadnumpy-9fa5c5a1d36ff690db92fa4b55fc10172f50a1ad.tar.gz
Re-think the byte-swapping unicode tests. They were correct to begin with. Try to fix the new bug on narrow builds.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index e02cff92e..c774ae5a2 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -1378,13 +1378,13 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
byte_swap_vector(destptr, length, 4);
#else
/* need aligned data buffer */
- if ((((intp)data) % descr->alignment) != 0) {
+ if ((swap) || ((((intp)data) % descr->alignment) != 0)) {
buffer = _pya_malloc(itemsize);
if (buffer == NULL)
return PyErr_NoMemory();
alloc = 1;
memcpy(buffer, data, itemsize);
- if (!PyArray_ISNOTSWAPPED(base)) {
+ if (swap) {
byte_swap_vector(buffer,
itemsize >> 2, 4);
}