diff options
-rw-r--r-- | numpy/core/src/multiarray/arraytypes.c.src | 7 | ||||
-rw-r--r-- | numpy/core/src/multiarray/dtype_transfer.c | 14 |
2 files changed, 4 insertions, 17 deletions
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index 217a5ddaa..52b787975 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -3817,9 +3817,9 @@ NPY_NO_EXPORT PyArray_Descr @from@_Descr = { /* type_num */ NPY_@from@, /* elsize */ - @num@*sizeof(@fromtype@), + @num@ * sizeof(@fromtype@), /* alignment */ - _ALIGN(@fromtype@), + @num@ * _ALIGN(@fromtype@), /* subarray */ NULL, /* fields */ @@ -4150,6 +4150,7 @@ set_typeinfo(PyObject *dict) * CFLOAT, CDOUBLE, CLONGDOUBLE# * #Name = Half, Float, Double, LongDouble, * CFloat, CDouble, CLongDouble# + * #num = 1, 1, 1, 1, 2, 2, 2# */ PyDict_SetItemString(infodict, "@name@", @@ -4160,7 +4161,7 @@ set_typeinfo(PyObject *dict) #endif NPY_@name@, NPY_BITSOF_@name@, - _ALIGN(@type@), + @num@ * _ALIGN(@type@), (PyObject *) &Py@Name@ArrType_Type)); Py_DECREF(s); diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c index e964bc265..93fef8495 100644 --- a/numpy/core/src/multiarray/dtype_transfer.c +++ b/numpy/core/src/multiarray/dtype_transfer.c @@ -3574,13 +3574,6 @@ PyArray_GetDTypeTransferFunction(int aligned, PyArray_ISNBO(dst_dtype->byteorder)) { if (PyArray_EquivTypenums(src_type_num, dst_type_num)) { - /* - * For complex numbers, the alignment is smaller than the - * type size, so we turn off the aligned flag then. - */ - if (src_dtype->kind == 'c' || dst_dtype->kind == 'c') { - aligned = 0; - } *out_stransfer = PyArray_GetStridedCopyFn(aligned, src_stride, dst_stride, src_itemsize); @@ -3677,13 +3670,6 @@ PyArray_GetDTypeTransferFunction(int aligned, /* This is a straight copy */ if (src_itemsize == 1 || PyArray_ISNBO(src_dtype->byteorder) == PyArray_ISNBO(dst_dtype->byteorder)) { - /* - * For complex numbers, the alignment is smaller than the - * type size, so we turn off the aligned flag then. - */ - if (src_dtype->kind == 'c' || dst_dtype->kind == 'c') { - aligned = 0; - } *out_stransfer = PyArray_GetStridedCopyFn(aligned, src_stride, dst_stride, src_itemsize); |