mirror of https://github.com/python/cpython
Issue #4822: fix messy indentation in memoryobject.c/.h, before we may backport it to trunk.
Reviewed on IRC by Georg Brandl, with assistance by Benjamin Peterson.
This commit is contained in:
parent
771ed76102
commit
35b7e837ab
|
@ -569,8 +569,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
|
|||
else
|
||||
ptr += view->strides[0] * result;
|
||||
if (view->suboffsets != NULL &&
|
||||
view->suboffsets[0] >= 0)
|
||||
{
|
||||
view->suboffsets[0] >= 0) {
|
||||
ptr = *((char **)ptr) + view->suboffsets[0];
|
||||
}
|
||||
return PyBytes_FromStringAndSize(ptr, view->itemsize);
|
||||
|
@ -783,9 +782,9 @@ memory_clear(PyMemoryViewObject *self)
|
|||
|
||||
/* As mapping */
|
||||
static PyMappingMethods memory_as_mapping = {
|
||||
(lenfunc)memory_length, /*mp_length*/
|
||||
(binaryfunc)memory_subscript, /*mp_subscript*/
|
||||
(objobjargproc)memory_ass_sub, /*mp_ass_subscript*/
|
||||
(lenfunc)memory_length, /* mp_length */
|
||||
(binaryfunc)memory_subscript, /* mp_subscript */
|
||||
(objobjargproc)memory_ass_sub, /* mp_ass_subscript */
|
||||
};
|
||||
|
||||
|
||||
|
@ -817,7 +816,7 @@ PyTypeObject PyMemoryView_Type = {
|
|||
PyObject_GenericGetAttr, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
&memory_as_buffer, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
||||
memory_doc, /* tp_doc */
|
||||
(traverseproc)memory_traverse, /* tp_traverse */
|
||||
(inquiry)memory_clear, /* tp_clear */
|
||||
|
|
Loading…
Reference in New Issue