Kaydet (Commit) 35b7e837 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

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.
üst 771ed761
...@@ -569,8 +569,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key) ...@@ -569,8 +569,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
else else
ptr += view->strides[0] * result; ptr += view->strides[0] * result;
if (view->suboffsets != NULL && if (view->suboffsets != NULL &&
view->suboffsets[0] >= 0) view->suboffsets[0] >= 0) {
{
ptr = *((char **)ptr) + view->suboffsets[0]; ptr = *((char **)ptr) + view->suboffsets[0];
} }
return PyBytes_FromStringAndSize(ptr, view->itemsize); return PyBytes_FromStringAndSize(ptr, view->itemsize);
...@@ -783,9 +782,9 @@ memory_clear(PyMemoryViewObject *self) ...@@ -783,9 +782,9 @@ memory_clear(PyMemoryViewObject *self)
/* As mapping */ /* As mapping */
static PyMappingMethods memory_as_mapping = { static PyMappingMethods memory_as_mapping = {
(lenfunc)memory_length, /*mp_length*/ (lenfunc)memory_length, /* mp_length */
(binaryfunc)memory_subscript, /*mp_subscript*/ (binaryfunc)memory_subscript, /* mp_subscript */
(objobjargproc)memory_ass_sub, /*mp_ass_subscript*/ (objobjargproc)memory_ass_sub, /* mp_ass_subscript */
}; };
...@@ -817,7 +816,7 @@ PyTypeObject PyMemoryView_Type = { ...@@ -817,7 +816,7 @@ PyTypeObject PyMemoryView_Type = {
PyObject_GenericGetAttr, /* tp_getattro */ PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */ 0, /* tp_setattro */
&memory_as_buffer, /* tp_as_buffer */ &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 */ memory_doc, /* tp_doc */
(traverseproc)memory_traverse, /* tp_traverse */ (traverseproc)memory_traverse, /* tp_traverse */
(inquiry)memory_clear, /* tp_clear */ (inquiry)memory_clear, /* tp_clear */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment