| | | | |
| Offset 2628, 14 lines modified | Offset 2628, 21 lines modified |
| | |
| 2628 | /*·TypeInfoToFormat.proto·*/ | 2628 | /*·TypeInfoToFormat.proto·*/ |
| 2629 | struct·__pyx_typeinfo_string·{ | 2629 | struct·__pyx_typeinfo_string·{ |
| 2630 | ····char·string[3]; | 2630 | ····char·string[3]; |
| 2631 | }; | 2631 | }; |
| 2632 | static·struct·__pyx_typeinfo_string·__Pyx_TypeInfoToFormat(const·__Pyx_TypeInfo·*type); | 2632 | static·struct·__pyx_typeinfo_string·__Pyx_TypeInfoToFormat(const·__Pyx_TypeInfo·*type); |
| | |
| | 2633 | /*·MemviewSliceCopy.proto·*/ |
| | 2634 | static·__Pyx_memviewslice |
| | 2635 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, |
| | 2636 | ·································const·char·*mode,·int·ndim, |
| | 2637 | ·································size_t·sizeof_dtype,·int·contig_flag, |
| | 2638 | ·································int·dtype_is_object); |
| | |
| 2633 | /*·BufferFormatCheck.proto·(used·by·MemviewSliceValidateAndInit)·*/ | 2639 | /*·BufferFormatCheck.proto·(used·by·MemviewSliceValidateAndInit)·*/ |
| 2634 | static·const·char*·__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context*·ctx,·const·char*·ts); | 2640 | static·const·char*·__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context*·ctx,·const·char*·ts); |
| 2635 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, | 2641 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, |
| 2636 | ······························__Pyx_BufFmt_StackElem*·stack, | 2642 | ······························__Pyx_BufFmt_StackElem*·stack, |
| 2637 | ······························const·__Pyx_TypeInfo*·type); | 2643 | ······························const·__Pyx_TypeInfo*·type); |
| | |
| 2638 | /*·TypeInfoCompare.proto·(used·by·MemviewSliceValidateAndInit)·*/ | 2644 | /*·TypeInfoCompare.proto·(used·by·MemviewSliceValidateAndInit)·*/ |
| Offset 2648, 21 lines modified | Offset 2655, 14 lines modified |
| 2648 | ················int·buf_flags, | 2655 | ················int·buf_flags, |
| 2649 | ················int·ndim, | 2656 | ················int·ndim, |
| 2650 | ················const·__Pyx_TypeInfo·*dtype, | 2657 | ················const·__Pyx_TypeInfo·*dtype, |
| 2651 | ················__Pyx_BufFmt_StackElem·stack[], | 2658 | ················__Pyx_BufFmt_StackElem·stack[], |
| 2652 | ················__Pyx_memviewslice·*memviewslice, | 2659 | ················__Pyx_memviewslice·*memviewslice, |
| 2653 | ················PyObject·*original_obj); | 2660 | ················PyObject·*original_obj); |
| | |
| 2654 | /*·MemviewSliceCopy.proto·*/ | |
| 2655 | static·__Pyx_memviewslice | |
| 2656 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, | |
| 2657 | ·································const·char·*mode,·int·ndim, | |
| 2658 | ·································size_t·sizeof_dtype,·int·contig_flag, | |
| 2659 | ·································int·dtype_is_object); | |
| | |
| 2660 | /*·UpdateUnpickledDict.proto·*/ | 2661 | /*·UpdateUnpickledDict.proto·*/ |
| 2661 | static·int·__Pyx_UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index); | 2662 | static·int·__Pyx_UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index); |
| | |
| 2662 | /*·CheckUnpickleChecksum.proto·*/ | 2663 | /*·CheckUnpickleChecksum.proto·*/ |
| 2663 | static·CYTHON_INLINE·int·__Pyx_CheckUnpickleChecksum(long·checksum,·long·checksum1,·long·checksum2,·long·checksum3,·const·char·*members); | 2664 | static·CYTHON_INLINE·int·__Pyx_CheckUnpickleChecksum(long·checksum,·long·checksum1,·long·checksum2,·long·checksum3,·const·char·*members); |
| | |
| 2664 | /*·CIntFromPy.proto·*/ | 2665 | /*·CIntFromPy.proto·*/ |
| Offset 22589, 14 lines modified | Offset 22589, 84 lines modified |
| 22589 | ············else | 22589 | ············else |
| 22590 | ················*buf·=·'g'; | 22590 | ················*buf·=·'g'; |
| 22591 | ············break; | 22591 | ············break; |
| 22592 | ····} | 22592 | ····} |
| 22593 | ····return·result; | 22593 | ····return·result; |
| 22594 | } | 22594 | } |
| | |
| | 22595 | /*·MemviewSliceCopy·*/ |
| | 22596 | static·__Pyx_memviewslice |
| | 22597 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, |
| | 22598 | ·································const·char·*mode,·int·ndim, |
| | 22599 | ·································size_t·sizeof_dtype,·int·contig_flag, |
| | 22600 | ·································int·dtype_is_object) |
| | 22601 | { |
| | 22602 | ····__Pyx_RefNannyDeclarations |
| | 22603 | ····int·i; |
| | 22604 | ····__Pyx_memviewslice·new_mvs·=·__Pyx_MEMSLICE_INIT; |
| | 22605 | ····struct·__pyx_memoryview_obj·*from_memview·=·from_mvs->memview; |
| | 22606 | ····Py_buffer·*buf·=·&from_memview->view; |
| | 22607 | ····PyObject·*shape_tuple·=·NULL; |
| | 22608 | ····struct·__pyx_array_obj·*array_obj·=·NULL; |
| | 22609 | ····struct·__pyx_memoryview_obj·*memview_obj·=·NULL; |
| | 22610 | ····__Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig",·0); |
| | 22611 | ····for·(i·=·0;·i·<·ndim;·i++)·{ |
| | 22612 | ········if·(unlikely(from_mvs->suboffsets[i]·>=·0))·{ |
| | 22613 | ············PyErr_Format(PyExc_ValueError,·"Cannot·copy·memoryview·slice·with·" |
| | 22614 | ···········································"indirect·dimensions·(axis·%d)",·i); |
| | 22615 | ············goto·fail; |
| | 22616 | ········} |
| | 22617 | ····} |
| | 22618 | ····shape_tuple·=·PyTuple_New(ndim); |
| | 22619 | ····if·(unlikely(!shape_tuple))·{ |
| | 22620 | ········goto·fail; |
| | 22621 | ····} |
| | 22622 | ····__Pyx_GOTREF(shape_tuple); |
| | 22623 | ····for(i·=·0;·i·<·ndim;·i++)·{ |
| | 22624 | ········PyObject·*temp_int·=·PyLong_FromSsize_t(from_mvs->shape[i]); |
| | 22625 | ········if(unlikely(!temp_int))·{ |
| | 22626 | ············goto·fail; |
| | 22627 | ········}·else·{ |
| | 22628 | #if·CYTHON_ASSUME_SAFE_MACROS |
| | 22629 | ············PyTuple_SET_ITEM(shape_tuple,·i,·temp_int); |
| | 22630 | #else |
| | 22631 | ············if·(PyTuple_SetItem(shape_tuple,·i,·temp_int)·<·0)·{ |
| | 22632 | ················goto·fail; |
| | 22633 | ············} |
| | 22634 | #endif |
| | 22635 | ········} |
| | 22636 | ····} |
| | 22637 | ····array_obj·=·__pyx_array_new(shape_tuple,·sizeof_dtype,·buf->format,·mode,·NULL); |
| | 22638 | ····if·(unlikely(!array_obj))·{ |
| | 22639 | ········goto·fail; |
| | 22640 | ····} |
| | 22641 | ····__Pyx_GOTREF(array_obj); |
| | 22642 | ····memview_obj·=·(struct·__pyx_memoryview_obj·*)·__pyx_memoryview_new( |
| | 22643 | ····································(PyObject·*)·array_obj,·contig_flag, |
| | 22644 | ····································dtype_is_object, |
| | 22645 | ····································from_mvs->memview->typeinfo); |
| | 22646 | ····if·(unlikely(!memview_obj)) |
| | 22647 | ········goto·fail; |
| | 22648 | ····if·(unlikely(__Pyx_init_memviewslice(memview_obj,·ndim,·&new_mvs,·1)·<·0)) |
| | 22649 | ········goto·fail; |
| | 22650 | ····if·(unlikely(__pyx_memoryview_copy_contents(*from_mvs,·new_mvs,·ndim,·ndim, |
| | 22651 | ················································dtype_is_object)·<·0)) |
| | 22652 | ········goto·fail; |
| | 22653 | ····goto·no_fail; |
| | 22654 | fail: |
| | 22655 | ····__Pyx_XDECREF((PyObject·*)·new_mvs.memview); |
| | 22656 | ····new_mvs.memview·=·NULL; |
| | 22657 | ····new_mvs.data·=·NULL; |
| | 22658 | no_fail: |
| | 22659 | ····__Pyx_XDECREF(shape_tuple); |
| | 22660 | ····__Pyx_XDECREF((PyObject·*)·array_obj); |
| | 22661 | ····__Pyx_RefNannyFinishContext(); |
| | 22662 | ····return·new_mvs; |
| | 22663 | } |
| | |
| 22595 | /*·BufferFormatCheck·(used·by·MemviewSliceValidateAndInit)·*/ | 22664 | /*·BufferFormatCheck·(used·by·MemviewSliceValidateAndInit)·*/ |
| 22596 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, | 22665 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, |
| 22597 | ······························__Pyx_BufFmt_StackElem*·stack, | 22666 | ······························__Pyx_BufFmt_StackElem*·stack, |
| 22598 | ······························const·__Pyx_TypeInfo*·type)·{ | 22667 | ······························const·__Pyx_TypeInfo*·type)·{ |
| 22599 | ··stack[0].field·=·&ctx->root; | 22668 | ··stack[0].field·=·&ctx->root; |
| 22600 | ··stack[0].parent_offset·=·0; | 22669 | ··stack[0].parent_offset·=·0; |
| 22601 | ··ctx->root.type·=·type; | 22670 | ··ctx->root.type·=·type; |
| Offset 23312, 84 lines modified | Offset 23382, 14 lines modified |
| 23312 | ······Py_XDECREF((PyObject*)new_memview); | 23382 | ······Py_XDECREF((PyObject*)new_memview); |
| 23313 | ······retval·=·-1; | 23383 | ······retval·=·-1; |
| 23314 | ··no_fail: | 23384 | ··no_fail: |
| 23315 | ······__Pyx_RefNannyFinishContext(); | 23385 | ······__Pyx_RefNannyFinishContext(); |
| 23316 | ······return·retval; | 23386 | ······return·retval; |
| 23317 | ··} | 23387 | ··} |
| 23318 | ·· | 23388 | ·· |
| 23319 | /*·MemviewSliceCopy·*/ | |
| 23320 | ··static·__Pyx_memviewslice | |
| 23321 | ··__pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, | |
| 23322 | ···································const·char·*mode,·int·ndim, | |
| 23323 | ···································size_t·sizeof_dtype,·int·contig_flag, | |
| 23324 | ···································int·dtype_is_object) | |
| 23325 | ··{ | |
| 23326 | ······__Pyx_RefNannyDeclarations | |
| 23327 | ······int·i; | |
| 23328 | ······__Pyx_memviewslice·new_mvs·=·__Pyx_MEMSLICE_INIT; | |
| 23329 | ······struct·__pyx_memoryview_obj·*from_memview·=·from_mvs->memview; | |
| 23330 | ······Py_buffer·*buf·=·&from_memview->view; | |
| 23331 | ······PyObject·*shape_tuple·=·NULL; | |
| 23332 | ······struct·__pyx_array_obj·*array_obj·=·NULL; | |
| 23333 | ······struct·__pyx_memoryview_obj·*memview_obj·=·NULL; | |
| 23334 | ······__Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig",·0); | |
| 23335 | ······for·(i·=·0;·i·<·ndim;·i++)·{ | |
| 23336 | ··········if·(unlikely(from_mvs->suboffsets[i]·>=·0))·{ | |
| 23337 | ··············PyErr_Format(PyExc_ValueError,·"Cannot·copy·memoryview·slice·with·" | |
| 23338 | ·············································"indirect·dimensions·(axis·%d)",·i); | |
| 23339 | ··············goto·fail; | |
| 23340 | ··········} | |
| 23341 | ······} | |
| 23342 | ······shape_tuple·=·PyTuple_New(ndim); | |
| 23343 | ······if·(unlikely(!shape_tuple))·{ | |
| 23344 | ··········goto·fail; | |
| 23345 | ······} | |
| 23346 | ······__Pyx_GOTREF(shape_tuple); | |
| 23347 | ······for(i·=·0;·i·<·ndim;·i++)·{ | |
| 23348 | ··········PyObject·*temp_int·=·PyLong_FromSsize_t(from_mvs->shape[i]); | |
| 23349 | ··········if(unlikely(!temp_int))·{ | |
| 23350 | ··············goto·fail; | |
| 23351 | ··········}·else·{ | |
| 23352 | ··#if·CYTHON_ASSUME_SAFE_MACROS | |
| 23353 | ··············PyTuple_SET_ITEM(shape_tuple,·i,·temp_int); | |
| 23354 | ··#else | |
| 23355 | ··············if·(PyTuple_SetItem(shape_tuple,·i,·temp_int)·<·0)·{ | |
| 23356 | ··················goto·fail; | |
| 23357 | ··············} | |
| 23358 | ··#endif | |
| 23359 | ··········} | |
| 23360 | ······} | |
| 23361 | ······array_obj·=·__pyx_array_new(shape_tuple,·sizeof_dtype,·buf->format,·mode,·NULL); | |
| 23362 | ······if·(unlikely(!array_obj))·{ | |
| 23363 | ··········goto·fail; | |
| 23364 | ······} | |
| 23365 | ······__Pyx_GOTREF(array_obj); | |
| 23366 | ······memview_obj·=·(struct·__pyx_memoryview_obj·*)·__pyx_memoryview_new( | |
| 23367 | ······································(PyObject·*)·array_obj,·contig_flag, | |
| 23368 | ······································dtype_is_object, | |
| 23369 | ······································from_mvs->memview->typeinfo); | |
| 23370 | ······if·(unlikely(!memview_obj)) | |
| 23371 | ··········goto·fail; | |
| 23372 | ······if·(unlikely(__Pyx_init_memviewslice(memview_obj,·ndim,·&new_mvs,·1)·<·0)) | |
| 23373 | ··········goto·fail; | |
| 23374 | ······if·(unlikely(__pyx_memoryview_copy_contents(*from_mvs,·new_mvs,·ndim,·ndim, | |
| 23375 | ··················································dtype_is_object)·<·0)) | |
| 23376 | ··········goto·fail; | |
| 23377 | ······goto·no_fail; | |
| 23378 | ··fail: | |
| 23379 | ······__Pyx_XDECREF((PyObject·*)·new_mvs.memview); | |
| 23380 | ······new_mvs.memview·=·NULL; | |
| 23381 | ······new_mvs.data·=·NULL; | |
| 23382 | ··no_fail: | |
| 23383 | ······__Pyx_XDECREF(shape_tuple); | |
| 23384 | ······__Pyx_XDECREF((PyObject·*)·array_obj); | |
| 23385 | ······__Pyx_RefNannyFinishContext(); | |
| 23386 | ······return·new_mvs; | |
| 23387 | ··} | |
| 23388 | ·· | |
| 23389 | /*·UpdateUnpickledDict·*/ | 23389 | /*·UpdateUnpickledDict·*/ |
| 23390 | ··static·int·__Pyx__UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index)·{ | 23390 | ··static·int·__Pyx__UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index)·{ |
| 23391 | ······PyObject·*state_dict·=·__Pyx_PySequence_ITEM(state,·index); | 23391 | ······PyObject·*state_dict·=·__Pyx_PySequence_ITEM(state,·index); |
| 23392 | ······if·(unlikely(!state_dict))·{ | 23392 | ······if·(unlikely(!state_dict))·{ |
| 23393 | ··········return·-1; | 23393 | ··········return·-1; |
| 23394 | ······} | 23394 | ······} |
| 23395 | ······int·non_empty·=·PyObject_IsTrue(state_dict); | 23395 | ······int·non_empty·=·PyObject_IsTrue(state_dict); |