"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "numpy/core/src/multiarray/dtype_transfer.c" between
numpy-1.21.0.tar.gz and numpy-1.21.1.tar.gz

About: NumPy is the fundamental package for scientific computing with Python.

dtype_transfer.c  (numpy-1.21.0):dtype_transfer.c  (numpy-1.21.1)
skipping to change at line 317 skipping to change at line 317
{ {
npy_intp N = dimensions[0]; npy_intp N = dimensions[0];
char *src = args[0], *dst = args[1]; char *src = args[0], *dst = args[1];
npy_intp src_stride = strides[0], dst_stride = strides[1]; npy_intp src_stride = strides[0], dst_stride = strides[1];
_object_to_any_auxdata *data = (_object_to_any_auxdata *)auxdata; _object_to_any_auxdata *data = (_object_to_any_auxdata *)auxdata;
PyObject *src_ref; PyObject *src_ref;
while (N > 0) { while (N > 0) {
memcpy(&src_ref, src, sizeof(src_ref)); memcpy(&src_ref, src, sizeof(src_ref));
if (PyArray_Pack(data->descr, dst, src_ref) < 0) { if (PyArray_Pack(data->descr, dst, src_ref ? src_ref : Py_None) < 0) {
return -1; return -1;
} }
if (data->move_references) { if (data->move_references && src_ref != NULL) {
Py_DECREF(src_ref); Py_DECREF(src_ref);
memset(src, 0, sizeof(src_ref)); memset(src, 0, sizeof(src_ref));
} }
N--; N--;
dst += dst_stride; dst += dst_stride;
src += src_stride; src += src_stride;
} }
return 0; return 0;
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)