static Py_ssize_t array_getwritebuf(PyArrayObject *self, Py_ssize_t segment, void **ptrptr) { if (PyArray_FailUnlessWriteable(self, "buffer source array") < 0) { return -1; } return array_getreadbuf(self, segment, (void **) ptrptr); }
static Py_ssize_t array_getwritebuf(PyArrayObject *self, Py_ssize_t segment, void **ptrptr) { if (PyArray_CHKFLAGS(self, NPY_ARRAY_WRITEABLE)) { return array_getreadbuf(self, segment, (void **) ptrptr); } else { PyErr_SetString(PyExc_ValueError, "array cannot be " "accessed as a writeable buffer"); return -1; } }
static Py_ssize_t array_getcharbuf(PyArrayObject *self, Py_ssize_t segment, constchar **ptrptr) { return array_getreadbuf(self, segment, (void **) ptrptr); }