| | | | |
| Offset 2617, 21 lines modified | Offset 2617, 14 lines modified |
| | |
| 2617 | /*·TypeInfoToFormat.proto·*/ | 2617 | /*·TypeInfoToFormat.proto·*/ |
| 2618 | struct·__pyx_typeinfo_string·{ | 2618 | struct·__pyx_typeinfo_string·{ |
| 2619 | ····char·string[3]; | 2619 | ····char·string[3]; |
| 2620 | }; | 2620 | }; |
| 2621 | static·struct·__pyx_typeinfo_string·__Pyx_TypeInfoToFormat(const·__Pyx_TypeInfo·*type); | 2621 | static·struct·__pyx_typeinfo_string·__Pyx_TypeInfoToFormat(const·__Pyx_TypeInfo·*type); |
| | |
| 2622 | /*·MemviewSliceCopy.proto·*/ | |
| 2623 | static·__Pyx_memviewslice | |
| 2624 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, | |
| 2625 | ·································const·char·*mode,·int·ndim, | |
| 2626 | ·································size_t·sizeof_dtype,·int·contig_flag, | |
| 2627 | ·································int·dtype_is_object); | |
| | |
| 2628 | /*·BufferFormatCheck.proto·(used·by·MemviewSliceValidateAndInit)·*/ | 2622 | /*·BufferFormatCheck.proto·(used·by·MemviewSliceValidateAndInit)·*/ |
| 2629 | static·const·char*·__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context*·ctx,·const·char*·ts); | 2623 | static·const·char*·__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context*·ctx,·const·char*·ts); |
| 2630 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, | 2624 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, |
| 2631 | ······························__Pyx_BufFmt_StackElem*·stack, | 2625 | ······························__Pyx_BufFmt_StackElem*·stack, |
| 2632 | ······························const·__Pyx_TypeInfo*·type); | 2626 | ······························const·__Pyx_TypeInfo*·type); |
| | |
| 2633 | /*·TypeInfoCompare.proto·(used·by·MemviewSliceValidateAndInit)·*/ | 2627 | /*·TypeInfoCompare.proto·(used·by·MemviewSliceValidateAndInit)·*/ |
| Offset 2644, 14 lines modified | Offset 2637, 21 lines modified |
| 2644 | ················int·buf_flags, | 2637 | ················int·buf_flags, |
| 2645 | ················int·ndim, | 2638 | ················int·ndim, |
| 2646 | ················const·__Pyx_TypeInfo·*dtype, | 2639 | ················const·__Pyx_TypeInfo·*dtype, |
| 2647 | ················__Pyx_BufFmt_StackElem·stack[], | 2640 | ················__Pyx_BufFmt_StackElem·stack[], |
| 2648 | ················__Pyx_memviewslice·*memviewslice, | 2641 | ················__Pyx_memviewslice·*memviewslice, |
| 2649 | ················PyObject·*original_obj); | 2642 | ················PyObject·*original_obj); |
| | |
| | 2643 | /*·MemviewSliceCopy.proto·*/ |
| | 2644 | static·__Pyx_memviewslice |
| | 2645 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, |
| | 2646 | ·································const·char·*mode,·int·ndim, |
| | 2647 | ·································size_t·sizeof_dtype,·int·contig_flag, |
| | 2648 | ·································int·dtype_is_object); |
| | |
| 2650 | /*·UpdateUnpickledDict.proto·*/ | 2649 | /*·UpdateUnpickledDict.proto·*/ |
| 2651 | static·int·__Pyx_UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index); | 2650 | static·int·__Pyx_UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index); |
| | |
| 2652 | /*·CheckUnpickleChecksum.proto·*/ | 2651 | /*·CheckUnpickleChecksum.proto·*/ |
| 2653 | static·CYTHON_INLINE·int·__Pyx_CheckUnpickleChecksum(long·checksum,·long·checksum1,·long·checksum2,·long·checksum3,·const·char·*members); | 2652 | static·CYTHON_INLINE·int·__Pyx_CheckUnpickleChecksum(long·checksum,·long·checksum1,·long·checksum2,·long·checksum3,·const·char·*members); |
| | |
| 2654 | /*·CIntFromPy.proto·*/ | 2653 | /*·CIntFromPy.proto·*/ |
| Offset 22541, 84 lines modified | Offset 22541, 14 lines modified |
| 22541 | ············else | 22541 | ············else |
| 22542 | ················*buf·=·'g'; | 22542 | ················*buf·=·'g'; |
| 22543 | ············break; | 22543 | ············break; |
| 22544 | ····} | 22544 | ····} |
| 22545 | ····return·result; | 22545 | ····return·result; |
| 22546 | } | 22546 | } |
| | |
| 22547 | /*·MemviewSliceCopy·*/ | |
| 22548 | static·__Pyx_memviewslice | |
| 22549 | __pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, | |
| 22550 | ·································const·char·*mode,·int·ndim, | |
| 22551 | ·································size_t·sizeof_dtype,·int·contig_flag, | |
| 22552 | ·································int·dtype_is_object) | |
| 22553 | { | |
| 22554 | ····__Pyx_RefNannyDeclarations | |
| 22555 | ····int·i; | |
| 22556 | ····__Pyx_memviewslice·new_mvs·=·__Pyx_MEMSLICE_INIT; | |
| 22557 | ····struct·__pyx_memoryview_obj·*from_memview·=·from_mvs->memview; | |
| 22558 | ····Py_buffer·*buf·=·&from_memview->view; | |
| 22559 | ····PyObject·*shape_tuple·=·NULL; | |
| 22560 | ····struct·__pyx_array_obj·*array_obj·=·NULL; | |
| 22561 | ····struct·__pyx_memoryview_obj·*memview_obj·=·NULL; | |
| 22562 | ····__Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig",·0); | |
| 22563 | ····for·(i·=·0;·i·<·ndim;·i++)·{ | |
| 22564 | ········if·(unlikely(from_mvs->suboffsets[i]·>=·0))·{ | |
| 22565 | ············PyErr_Format(PyExc_ValueError,·"Cannot·copy·memoryview·slice·with·" | |
| 22566 | ···········································"indirect·dimensions·(axis·%d)",·i); | |
| 22567 | ············goto·fail; | |
| 22568 | ········} | |
| 22569 | ····} | |
| 22570 | ····shape_tuple·=·PyTuple_New(ndim); | |
| 22571 | ····if·(unlikely(!shape_tuple))·{ | |
| 22572 | ········goto·fail; | |
| 22573 | ····} | |
| 22574 | ····__Pyx_GOTREF(shape_tuple); | |
| 22575 | ····for(i·=·0;·i·<·ndim;·i++)·{ | |
| 22576 | ········PyObject·*temp_int·=·PyLong_FromSsize_t(from_mvs->shape[i]); | |
| 22577 | ········if(unlikely(!temp_int))·{ | |
| 22578 | ············goto·fail; | |
| 22579 | ········}·else·{ | |
| 22580 | #if·CYTHON_ASSUME_SAFE_MACROS | |
| 22581 | ············PyTuple_SET_ITEM(shape_tuple,·i,·temp_int); | |
| 22582 | #else | |
| 22583 | ············if·(PyTuple_SetItem(shape_tuple,·i,·temp_int)·<·0)·{ | |
| 22584 | ················goto·fail; | |
| 22585 | ············} | |
| 22586 | #endif | |
| 22587 | ········} | |
| 22588 | ····} | |
| 22589 | ····array_obj·=·__pyx_array_new(shape_tuple,·sizeof_dtype,·buf->format,·mode,·NULL); | |
| 22590 | ····if·(unlikely(!array_obj))·{ | |
| 22591 | ········goto·fail; | |
| 22592 | ····} | |
| 22593 | ····__Pyx_GOTREF(array_obj); | |
| 22594 | ····memview_obj·=·(struct·__pyx_memoryview_obj·*)·__pyx_memoryview_new( | |
| 22595 | ····································(PyObject·*)·array_obj,·contig_flag, | |
| 22596 | ····································dtype_is_object, | |
| 22597 | ····································from_mvs->memview->typeinfo); | |
| 22598 | ····if·(unlikely(!memview_obj)) | |
| 22599 | ········goto·fail; | |
| 22600 | ····if·(unlikely(__Pyx_init_memviewslice(memview_obj,·ndim,·&new_mvs,·1)·<·0)) | |
| 22601 | ········goto·fail; | |
| 22602 | ····if·(unlikely(__pyx_memoryview_copy_contents(*from_mvs,·new_mvs,·ndim,·ndim, | |
| 22603 | ················································dtype_is_object)·<·0)) | |
| 22604 | ········goto·fail; | |
| 22605 | ····goto·no_fail; | |
| 22606 | fail: | |
| 22607 | ····__Pyx_XDECREF((PyObject·*)·new_mvs.memview); | |
| 22608 | ····new_mvs.memview·=·NULL; | |
| 22609 | ····new_mvs.data·=·NULL; | |
| 22610 | no_fail: | |
| 22611 | ····__Pyx_XDECREF(shape_tuple); | |
| 22612 | ····__Pyx_XDECREF((PyObject·*)·array_obj); | |
| 22613 | ····__Pyx_RefNannyFinishContext(); | |
| 22614 | ····return·new_mvs; | |
| 22615 | } | |
| | |
| 22616 | /*·BufferFormatCheck·(used·by·MemviewSliceValidateAndInit)·*/ | 22547 | /*·BufferFormatCheck·(used·by·MemviewSliceValidateAndInit)·*/ |
| 22617 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, | 22548 | static·void·__Pyx_BufFmt_Init(__Pyx_BufFmt_Context*·ctx, |
| 22618 | ······························__Pyx_BufFmt_StackElem*·stack, | 22549 | ······························__Pyx_BufFmt_StackElem*·stack, |
| 22619 | ······························const·__Pyx_TypeInfo*·type)·{ | 22550 | ······························const·__Pyx_TypeInfo*·type)·{ |
| 22620 | ··stack[0].field·=·&ctx->root; | 22551 | ··stack[0].field·=·&ctx->root; |
| 22621 | ··stack[0].parent_offset·=·0; | 22552 | ··stack[0].parent_offset·=·0; |
| 22622 | ··ctx->root.type·=·type; | 22553 | ··ctx->root.type·=·type; |
| Offset 23334, 14 lines modified | Offset 23264, 84 lines modified |
| 23334 | ······Py_XDECREF((PyObject*)new_memview); | 23264 | ······Py_XDECREF((PyObject*)new_memview); |
| 23335 | ······retval·=·-1; | 23265 | ······retval·=·-1; |
| 23336 | ··no_fail: | 23266 | ··no_fail: |
| 23337 | ······__Pyx_RefNannyFinishContext(); | 23267 | ······__Pyx_RefNannyFinishContext(); |
| 23338 | ······return·retval; | 23268 | ······return·retval; |
| 23339 | ··} | 23269 | ··} |
| 23340 | ·· | 23270 | ·· |
| | 23271 | /*·MemviewSliceCopy·*/ |
| | 23272 | ··static·__Pyx_memviewslice |
| | 23273 | ··__pyx_memoryview_copy_new_contig(const·__Pyx_memviewslice·*from_mvs, |
| | 23274 | ···································const·char·*mode,·int·ndim, |
| | 23275 | ···································size_t·sizeof_dtype,·int·contig_flag, |
| | 23276 | ···································int·dtype_is_object) |
| | 23277 | ··{ |
| | 23278 | ······__Pyx_RefNannyDeclarations |
| | 23279 | ······int·i; |
| | 23280 | ······__Pyx_memviewslice·new_mvs·=·__Pyx_MEMSLICE_INIT; |
| | 23281 | ······struct·__pyx_memoryview_obj·*from_memview·=·from_mvs->memview; |
| | 23282 | ······Py_buffer·*buf·=·&from_memview->view; |
| | 23283 | ······PyObject·*shape_tuple·=·NULL; |
| | 23284 | ······struct·__pyx_array_obj·*array_obj·=·NULL; |
| | 23285 | ······struct·__pyx_memoryview_obj·*memview_obj·=·NULL; |
| | 23286 | ······__Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig",·0); |
| | 23287 | ······for·(i·=·0;·i·<·ndim;·i++)·{ |
| | 23288 | ··········if·(unlikely(from_mvs->suboffsets[i]·>=·0))·{ |
| | 23289 | ··············PyErr_Format(PyExc_ValueError,·"Cannot·copy·memoryview·slice·with·" |
| | 23290 | ·············································"indirect·dimensions·(axis·%d)",·i); |
| | 23291 | ··············goto·fail; |
| | 23292 | ··········} |
| | 23293 | ······} |
| | 23294 | ······shape_tuple·=·PyTuple_New(ndim); |
| | 23295 | ······if·(unlikely(!shape_tuple))·{ |
| | 23296 | ··········goto·fail; |
| | 23297 | ······} |
| | 23298 | ······__Pyx_GOTREF(shape_tuple); |
| | 23299 | ······for(i·=·0;·i·<·ndim;·i++)·{ |
| | 23300 | ··········PyObject·*temp_int·=·PyLong_FromSsize_t(from_mvs->shape[i]); |
| | 23301 | ··········if(unlikely(!temp_int))·{ |
| | 23302 | ··············goto·fail; |
| | 23303 | ··········}·else·{ |
| | 23304 | ··#if·CYTHON_ASSUME_SAFE_MACROS |
| | 23305 | ··············PyTuple_SET_ITEM(shape_tuple,·i,·temp_int); |
| | 23306 | ··#else |
| | 23307 | ··············if·(PyTuple_SetItem(shape_tuple,·i,·temp_int)·<·0)·{ |
| | 23308 | ··················goto·fail; |
| | 23309 | ··············} |
| | 23310 | ··#endif |
| | 23311 | ··········} |
| | 23312 | ······} |
| | 23313 | ······array_obj·=·__pyx_array_new(shape_tuple,·sizeof_dtype,·buf->format,·mode,·NULL); |
| | 23314 | ······if·(unlikely(!array_obj))·{ |
| | 23315 | ··········goto·fail; |
| | 23316 | ······} |
| | 23317 | ······__Pyx_GOTREF(array_obj); |
| | 23318 | ······memview_obj·=·(struct·__pyx_memoryview_obj·*)·__pyx_memoryview_new( |
| | 23319 | ······································(PyObject·*)·array_obj,·contig_flag, |
| | 23320 | ······································dtype_is_object, |
| | 23321 | ······································from_mvs->memview->typeinfo); |
| | 23322 | ······if·(unlikely(!memview_obj)) |
| | 23323 | ··········goto·fail; |
| | 23324 | ······if·(unlikely(__Pyx_init_memviewslice(memview_obj,·ndim,·&new_mvs,·1)·<·0)) |
| | 23325 | ··········goto·fail; |
| | 23326 | ······if·(unlikely(__pyx_memoryview_copy_contents(*from_mvs,·new_mvs,·ndim,·ndim, |
| | 23327 | ··················································dtype_is_object)·<·0)) |
| | 23328 | ··········goto·fail; |
| | 23329 | ······goto·no_fail; |
| | 23330 | ··fail: |
| | 23331 | ······__Pyx_XDECREF((PyObject·*)·new_mvs.memview); |
| | 23332 | ······new_mvs.memview·=·NULL; |
| | 23333 | ······new_mvs.data·=·NULL; |
| | 23334 | ··no_fail: |
| | 23335 | ······__Pyx_XDECREF(shape_tuple); |
| | 23336 | ······__Pyx_XDECREF((PyObject·*)·array_obj); |
| | 23337 | ······__Pyx_RefNannyFinishContext(); |
| | 23338 | ······return·new_mvs; |
| | 23339 | ··} |
| | 23340 | ·· |
| 23341 | /*·UpdateUnpickledDict·*/ | 23341 | /*·UpdateUnpickledDict·*/ |
| 23342 | ··static·int·__Pyx__UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index)·{ | 23342 | ··static·int·__Pyx__UpdateUnpickledDict(PyObject·*obj,·PyObject·*state,·Py_ssize_t·index)·{ |
| 23343 | ······PyObject·*state_dict·=·__Pyx_PySequence_ITEM(state,·index); | 23343 | ······PyObject·*state_dict·=·__Pyx_PySequence_ITEM(state,·index); |
| 23344 | ······if·(unlikely(!state_dict))·{ | 23344 | ······if·(unlikely(!state_dict))·{ |
| 23345 | ··········return·-1; | 23345 | ··········return·-1; |
| 23346 | ······} | 23346 | ······} |
| 23347 | ······int·non_empty·=·PyObject_IsTrue(state_dict); | 23347 | ······int·non_empty·=·PyObject_IsTrue(state_dict); |