Lines Matching refs:index
2283 lookup_dimension(const Py_buffer *view, char *ptr, int dim, Py_ssize_t index)
2291 if (index < 0) {
2292 index += nitems;
2294 if (index < 0 || index >= nitems) {
2296 "index out of bounds on dimension %d", dim + 1);
2300 ptr += view->strides[dim] * index;
2307 /* Get the pointer to the item at index. */
2309 ptr_from_index(const Py_buffer *view, Py_ssize_t index)
2312 return lookup_dimension(view, ptr, 0, index);
2324 "cannot index %zd-dimension view with %zd-element tuple",
2330 Py_ssize_t index;
2331 index = PyNumber_AsSsize_t(PyTuple_GET_ITEM(tup, dim),
2333 if (index == -1 && PyErr_Occurred())
2335 ptr = lookup_dimension(view, ptr, (int)dim, index);
2342 /* Return the item at index. In a one-dimensional view, this is an object
2346 memory_item(PyMemoryViewObject *self, Py_ssize_t index)
2362 char *ptr = ptr_from_index(view, index);
2497 Py_ssize_t index;
2498 index = PyNumber_AsSsize_t(key, PyExc_IndexError);
2499 if (index == -1 && PyErr_Occurred())
2501 return memory_item(self, index);
2568 Py_ssize_t index;
2574 index = PyNumber_AsSsize_t(key, PyExc_IndexError);
2575 if (index == -1 && PyErr_Occurred())
2577 ptr = ptr_from_index(view, index);