Home
last modified time | relevance | path

Searched refs:slicelen (Results 1 – 11 of 11) sorted by relevance

/external/python/cpython3/Include/
Dsliceobject.h50 #define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \ argument
52 ((*(slicelen) = 0), -1) : \
53 ((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
/external/python/cpython2/Modules/
Dmmapmodule.c785 Py_ssize_t start, stop, step, slicelen; in mmap_subscript() local
790 slicelen = _PySlice_AdjustIndices(self->size, &start, &stop, step); in mmap_subscript()
792 if (slicelen <= 0) in mmap_subscript()
796 slicelen); in mmap_subscript()
798 char *result_buf = (char *)PyMem_Malloc(slicelen); in mmap_subscript()
804 for (cur = start, i = 0; i < slicelen; in mmap_subscript()
809 slicelen); in mmap_subscript()
922 Py_ssize_t start, stop, step, slicelen; in mmap_ass_subscript() local
927 slicelen = _PySlice_AdjustIndices(self->size, &start, &stop, step); in mmap_ass_subscript()
938 if (PyString_Size(value) != slicelen) { in mmap_ass_subscript()
[all …]
D_elementtree.c1365 Py_ssize_t start, stop, step, slicelen, cur, i; local
1374 slicelen = _PySlice_AdjustIndices(self->extra->length, &start, &stop,
1377 if (slicelen <= 0)
1380 list = PyList_New(slicelen);
1384 for (cur = start, i = 0; i < slicelen;
1422 Py_ssize_t start, stop, step, slicelen, newlen, cur, i; local
1433 slicelen = _PySlice_AdjustIndices(self->extra->length, &start, &stop,
1435 assert(slicelen <= self->extra->length);
1451 if (step != 1 && newlen != slicelen)
1458 (int)newlen, (int)slicelen
[all …]
/external/python/cpython3/Modules/
Dmmapmodule.c883 Py_ssize_t start, stop, step, slicelen; in mmap_subscript() local
888 slicelen = PySlice_AdjustIndices(self->size, &start, &stop, step); in mmap_subscript()
890 if (slicelen <= 0) in mmap_subscript()
894 slicelen); in mmap_subscript()
896 char *result_buf = (char *)PyMem_Malloc(slicelen); in mmap_subscript()
903 for (cur = start, i = 0; i < slicelen; in mmap_subscript()
908 slicelen); in mmap_subscript()
991 Py_ssize_t start, stop, step, slicelen; in mmap_ass_subscript() local
997 slicelen = PySlice_AdjustIndices(self->size, &start, &stop, step); in mmap_ass_subscript()
1005 if (vbuf.len != slicelen) { in mmap_ass_subscript()
[all …]
D_elementtree.c1740 Py_ssize_t start, stop, step, slicelen, i; in element_subscr() local
1750 slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop, in element_subscr()
1753 if (slicelen <= 0) in element_subscr()
1756 list = PyList_New(slicelen); in element_subscr()
1760 for (cur = start, i = 0; i < slicelen; in element_subscr()
1793 Py_ssize_t start, stop, step, slicelen, newlen, i; in element_ass_subscr() local
1807 slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop, in element_ass_subscr()
1815 if (slicelen <= 0) in element_ass_subscr()
1823 start = stop + step * (slicelen - 1) - 1; in element_ass_subscr()
1827 assert((size_t)slicelen <= SIZE_MAX / sizeof(PyObject *)); in element_ass_subscr()
[all …]
/external/python/cpython2/Objects/
Dstructseq.c114 Py_ssize_t start, stop, step, slicelen, cur, i; in structseq_subscript() local
120 slicelen = _PySlice_AdjustIndices(VISIBLE_SIZE(self), &start, &stop, in structseq_subscript()
122 if (slicelen <= 0) in structseq_subscript()
124 result = PyTuple_New(slicelen); in structseq_subscript()
127 for (cur = start, i = 0; i < slicelen; in structseq_subscript()
Dbytearrayobject.c610 Py_ssize_t start, stop, step, slicelen, needed; in bytearray_ass_subscript() local
632 slicelen = 1; in bytearray_ass_subscript()
646 slicelen = _PySlice_AdjustIndices(PyByteArray_GET_SIZE(self), &start, in bytearray_ass_subscript()
684 if (slicelen != needed) { in bytearray_ass_subscript()
687 if (slicelen > needed) { in bytearray_ass_subscript()
698 Py_SIZE(self) + needed - slicelen) < 0) in bytearray_ass_subscript()
700 if (slicelen < needed) { in bytearray_ass_subscript()
727 start = stop + step * (slicelen - 1) - 1; in bytearray_ass_subscript()
731 i < slicelen; cur += step, i++) { in bytearray_ass_subscript()
741 cur = start + slicelen*step; in bytearray_ass_subscript()
[all …]
/external/python/cpython3/Objects/
Dbytearrayobject.c609 Py_ssize_t start, stop, step, slicelen, needed; in bytearray_ass_subscript() local
632 slicelen = 1; in bytearray_ass_subscript()
646 slicelen = PySlice_AdjustIndices(PyByteArray_GET_SIZE(self), &start, in bytearray_ass_subscript()
697 if (slicelen == 0) in bytearray_ass_subscript()
703 start = stop + step * (slicelen - 1) - 1; in bytearray_ass_subscript()
707 i < slicelen; cur += step, i++) { in bytearray_ass_subscript()
717 cur = start + (size_t)slicelen*step; in bytearray_ass_subscript()
719 memmove(buf + cur - slicelen, in bytearray_ass_subscript()
724 PyByteArray_GET_SIZE(self) - slicelen) < 0) in bytearray_ass_subscript()
734 if (needed != slicelen) { in bytearray_ass_subscript()
[all …]
/external/python/cpython3/Modules/_ctypes/
D_ctypes.c4617 Py_ssize_t start, stop, step, slicelen, i; in Array_subscript() local
4623 slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step); in Array_subscript()
4636 if (slicelen <= 0) in Array_subscript()
4640 slicelen); in Array_subscript()
4642 dest = (char *)PyMem_Malloc(slicelen); in Array_subscript()
4647 for (cur = start, i = 0; i < slicelen; in Array_subscript()
4652 np = PyBytes_FromStringAndSize(dest, slicelen); in Array_subscript()
4661 if (slicelen <= 0) in Array_subscript()
4665 slicelen); in Array_subscript()
4668 dest = PyMem_New(wchar_t, slicelen); in Array_subscript()
[all …]
/external/python/cpython2/Modules/_ctypes/
D_ctypes.c4532 Py_ssize_t start, stop, step, slicelen, cur, i; in Array_subscript() local
4545 slicelen = _PySlice_AdjustIndices(self->b_length, &start, &stop, step); in Array_subscript()
4550 if (slicelen <= 0) in Array_subscript()
4554 slicelen); in Array_subscript()
4556 dest = (char *)PyMem_Malloc(slicelen); in Array_subscript()
4561 for (cur = start, i = 0; i < slicelen; in Array_subscript()
4566 np = PyString_FromStringAndSize(dest, slicelen); in Array_subscript()
4575 if (slicelen <= 0) in Array_subscript()
4579 slicelen); in Array_subscript()
4582 dest = PyMem_New(wchar_t, slicelen); in Array_subscript()
[all …]
/external/python/cpython3/Lib/test/
Dtest_buffer.py550 def randslice_from_slicelen(slicelen, listlen): argument
552 maxstart = listlen - slicelen
554 maxstep = (listlen - start) // slicelen if slicelen else 1
556 stop = start + slicelen * step
559 if control != slicelen:
570 slicelen = randrange(1, l+1) if l > 0 else 0
571 lslices[n] = randslice_from_slicelen(slicelen, l)
572 rslices[n] = randslice_from_slicelen(slicelen, l)
602 _, _, _, slicelen = slice_indices(s_small, small)
604 slicelen = randrange(1, small+1) if small > 0 else 0
[all …]