• Home
  • Raw
  • Download

Lines Matching refs:start

117 PySlice_New(PyObject *start, PyObject *stop, PyObject *step)  in PySlice_New()  argument
132 if (start == NULL) start = Py_None; in PySlice_New()
133 Py_INCREF(start); in PySlice_New()
138 obj->start = start; in PySlice_New()
148 PyObject *start, *end, *slice; in _PySlice_FromIndices() local
149 start = PyLong_FromSsize_t(istart); in _PySlice_FromIndices()
150 if (!start) in _PySlice_FromIndices()
154 Py_DECREF(start); in _PySlice_FromIndices()
158 slice = PySlice_New(start, end, NULL); in _PySlice_FromIndices()
159 Py_DECREF(start); in _PySlice_FromIndices()
166 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) in PySlice_GetIndices() argument
176 if (r->start == Py_None) { in PySlice_GetIndices()
177 *start = *step < 0 ? length-1 : 0; in PySlice_GetIndices()
179 if (!PyLong_Check(r->start)) return -1; in PySlice_GetIndices()
180 *start = PyLong_AsSsize_t(r->start); in PySlice_GetIndices()
181 if (*start < 0) *start += length; in PySlice_GetIndices()
191 if (*start >= length) return -1; in PySlice_GetIndices()
198 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) in PySlice_Unpack() argument
224 if (r->start == Py_None) { in PySlice_Unpack()
225 *start = *step < 0 ? PY_SSIZE_T_MAX : 0; in PySlice_Unpack()
228 if (!_PyEval_SliceIndex(r->start, start)) return -1; in PySlice_Unpack()
243 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step) in PySlice_AdjustIndices() argument
250 if (*start < 0) { in PySlice_AdjustIndices()
251 *start += length; in PySlice_AdjustIndices()
252 if (*start < 0) { in PySlice_AdjustIndices()
253 *start = (step < 0) ? -1 : 0; in PySlice_AdjustIndices()
256 else if (*start >= length) { in PySlice_AdjustIndices()
257 *start = (step < 0) ? length - 1 : length; in PySlice_AdjustIndices()
271 if (*stop < *start) { in PySlice_AdjustIndices()
272 return (*start - *stop - 1) / (-step) + 1; in PySlice_AdjustIndices()
276 if (*start < *stop) { in PySlice_AdjustIndices()
277 return (*stop - *start - 1) / step + 1; in PySlice_AdjustIndices()
287 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, in PySlice_GetIndicesEx() argument
290 if (PySlice_Unpack(_r, start, stop, step) < 0) in PySlice_GetIndicesEx()
292 *slicelength = PySlice_AdjustIndices(length, start, stop, *step); in PySlice_GetIndicesEx()
299 PyObject *start, *stop, *step; in slice_new() local
301 start = stop = step = NULL; in slice_new()
306 if (!PyArg_UnpackTuple(args, "slice", 1, 3, &start, &stop, &step)) in slice_new()
312 stop = start; in slice_new()
313 start = NULL; in slice_new()
315 return PySlice_New(start, stop, step); in slice_new()
329 Py_DECREF(r->start); in slice_dealloc()
340 return PyUnicode_FromFormat("slice(%R, %R, %R)", r->start, r->stop, r->step); in slice_repr()
344 {"start", T_OBJECT, offsetof(PySliceObject, start), READONLY},
376 PyObject *start=NULL, *stop=NULL, *step=NULL; in _PySlice_GetLongIndices() local
418 if (self->start == Py_None) { in _PySlice_GetLongIndices()
419 start = step_is_negative ? upper : lower; in _PySlice_GetLongIndices()
420 Py_INCREF(start); in _PySlice_GetLongIndices()
423 start = evaluate_slice_index(self->start); in _PySlice_GetLongIndices()
424 if (start == NULL) in _PySlice_GetLongIndices()
427 if (_PyLong_Sign(start) < 0) { in _PySlice_GetLongIndices()
429 PyObject *tmp = PyNumber_Add(start, length); in _PySlice_GetLongIndices()
430 Py_DECREF(start); in _PySlice_GetLongIndices()
431 start = tmp; in _PySlice_GetLongIndices()
432 if (start == NULL) in _PySlice_GetLongIndices()
435 cmp_result = PyObject_RichCompareBool(start, lower, Py_LT); in _PySlice_GetLongIndices()
440 Py_DECREF(start); in _PySlice_GetLongIndices()
441 start = lower; in _PySlice_GetLongIndices()
445 cmp_result = PyObject_RichCompareBool(start, upper, Py_GT); in _PySlice_GetLongIndices()
450 Py_DECREF(start); in _PySlice_GetLongIndices()
451 start = upper; in _PySlice_GetLongIndices()
495 *start_ptr = start; in _PySlice_GetLongIndices()
504 Py_XDECREF(start); in _PySlice_GetLongIndices()
517 PyObject *start, *stop, *step; in slice_indices() local
533 error = _PySlice_GetLongIndices(self, length, &start, &stop, &step); in slice_indices()
538 return Py_BuildValue("(NNN)", start, stop, step); in slice_indices()
552 return Py_BuildValue("O(OOO)", Py_TYPE(self), self->start, self->stop, self->step); in slice_reduce()
591 ((PySliceObject *)v)->start, in slice_richcompare()
599 ((PySliceObject *)w)->start, in slice_richcompare()
616 Py_VISIT(v->start); in slice_traverse()