Skip to content

Commit 74ea971

Browse files
committed
Add comments to Python structures to avoid wrapping on a single line when formatting with clang-format
1 parent 6cd6596 commit 74ea971

11 files changed

+32
-32
lines changed

src/PythonQt.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,15 +1819,15 @@ static PyMethodDef PythonQtMethods[] = {
18191819
};
18201820

18211821
static PyModuleDef PythonQtModuleDef = {
1822-
PyModuleDef_HEAD_INIT,
1823-
"",
1824-
nullptr,
1825-
-1,
1826-
PythonQtMethods,
1827-
nullptr,
1828-
nullptr,
1829-
nullptr,
1830-
nullptr
1822+
PyModuleDef_HEAD_INIT, /* m_base */
1823+
"", /* m_name */
1824+
nullptr, /* m_doc */
1825+
-1, /* m_size */
1826+
PythonQtMethods, /* m_methods */
1827+
nullptr, /* m_slots */
1828+
nullptr, /* m_traverse */
1829+
nullptr, /* m_clear */
1830+
nullptr /* m_free */
18311831
};
18321832

18331833
void PythonQt::initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName)

src/PythonQtBoolResult.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ static PyNumberMethods PythonQtBoolResult_as_number = {
103103
};
104104

105105
PyTypeObject PythonQtBoolResult_Type = {
106-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
107-
"BoolResult",
108-
sizeof(PythonQtBoolResultObject),
109-
0,
106+
PyVarObject_HEAD_INIT(&PyType_Type, 0) /*tp_base*/
107+
"BoolResult", /* tp_name */
108+
sizeof(PythonQtBoolResultObject), /* tp_basicsize */
109+
0, /* tp_itemsize */
110110
nullptr, /* tp_dealloc */
111111
0, /* tp_vectorcall_offset */
112112
nullptr, /* tp_getattr */
113113
nullptr, /* tp_setattr */
114-
nullptr,
114+
nullptr, /* tp_as_async */
115115
(reprfunc)PythonQtBoolResult_repr, /* tp_repr */
116116
&PythonQtBoolResult_as_number, /* tp_as_number */
117117
nullptr, /* tp_as_sequence */

src/PythonQtClassWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static PyObject * PythonQtClassWrapper_repr(PyObject * obj)
594594
*/
595595

596596
PyTypeObject PythonQtClassWrapper_Type = {
597-
PyVarObject_HEAD_INIT(nullptr, 0)
597+
PyVarObject_HEAD_INIT(nullptr, 0) /*tp_base*/
598598
"PythonQt.PythonQtClassWrapper", /*tp_name*/
599599
sizeof(PythonQtClassWrapper), /*tp_basicsize*/
600600
0, /*tp_itemsize*/

src/PythonQtImporter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ Create a new PythonQtImporter instance. 'path' must be a valid path on disk/or i
495495
#define DEFERRED_ADDRESS(ADDR) nullptr
496496

497497
PyTypeObject PythonQtImporter_Type = {
498-
PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0)
499-
"PythonQtImport.PythonQtImporter",
500-
sizeof(PythonQtImporter),
498+
PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) /*tp_base*/
499+
"PythonQtImport.PythonQtImporter", /* tp_name */
500+
sizeof(PythonQtImporter), /* tp_basicsize */
501501
0, /* tp_itemsize */
502502
(destructor)PythonQtImporter_dealloc, /* tp_dealloc */
503503
0, /* tp_vectorcall_offset */
@@ -878,7 +878,7 @@ PyDoc_STRVAR(mlabimport_doc,
878878
"Imports python files into PythonQt, completely replaces internal python import");
879879

880880
static struct PyModuleDef PythonQtImport_def = {
881-
PyModuleDef_HEAD_INIT,
881+
PyModuleDef_HEAD_INIT, /* m_base */
882882
"PythonQtImport", /* m_name */
883883
mlabimport_doc, /* m_doc */
884884
-1, /* m_size */

src/PythonQtInstanceWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static PyNumberMethods PythonQtInstanceWrapper_as_number = {
903903
};
904904

905905
PyTypeObject PythonQtInstanceWrapper_Type = {
906-
PyVarObject_HEAD_INIT(&PythonQtClassWrapper_Type, 0)
906+
PyVarObject_HEAD_INIT(&PythonQtClassWrapper_Type, 0) /*tp_base*/
907907
"PythonQt.PythonQtInstanceWrapper", /*tp_name*/
908908
sizeof(PythonQtInstanceWrapper), /*tp_basicsize*/
909909
0, /*tp_itemsize*/

src/PythonQtProperty.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ PyDoc_STRVAR(PythonQtProperty_doc,
194194
" constant=False, final=False, notify=None) -> Property\n");
195195

196196
PyTypeObject PythonQtProperty_Type = {
197-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
197+
PyVarObject_HEAD_INIT(&PyType_Type, 0) /*tp_base*/
198198
"PythonQt.QtCore.Property", /*tp_name*/
199199
sizeof(PythonQtProperty), /*tp_basicsize*/
200200
0, /*tp_itemsize*/

src/PythonQtSignal.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ PyDoc_STRVAR(PythonQtSignalFunction_doc,
394394
"Signal(*types) -> Signal\n");
395395

396396
PyTypeObject PythonQtSignalFunction_Type = {
397-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
398-
"QtCore.Signal",
399-
sizeof(PythonQtSignalFunctionObject),
400-
0,
397+
PyVarObject_HEAD_INIT(&PyType_Type, 0) /*tp_base*/
398+
"QtCore.Signal", /* tp_name */
399+
sizeof(PythonQtSignalFunctionObject), /* tp_basicsize */
400+
0, /* tp_itemsize */
401401
(destructor)meth_dealloc, /* tp_dealloc */
402402
0, /* tp_vectorcall_offset */
403403
nullptr, /* tp_getattr */

src/PythonQtSlot.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,10 @@ meth_descr_get(PyObject *descr, PyObject *obj, PyObject* type)
813813
}
814814

815815
PyTypeObject PythonQtSlotFunction_Type = {
816-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
817-
"builtin_qt_slot",
818-
sizeof(PythonQtSlotFunctionObject),
819-
0,
816+
PyVarObject_HEAD_INIT(&PyType_Type, 0) /*tp_base*/
817+
"builtin_qt_slot", /* tp_itemsize */
818+
sizeof(PythonQtSlotFunctionObject), /* tp_basicsize */
819+
0, /* tp_itemsize */
820820
(destructor)meth_dealloc, /* tp_dealloc */
821821
0, /* tp_vectorcall_offset */
822822
nullptr, /* tp_getattr */

src/PythonQtSlotDecorator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ PyDoc_STRVAR(PythonQtSlotDecorator_doc,
127127
"Slot(*types, result=type) -> Slot\n");
128128

129129
PyTypeObject PythonQtSlotDecorator_Type = {
130-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
130+
PyVarObject_HEAD_INIT(&PyType_Type, 0) /*tp_base*/
131131
"PythonQt.QtCore.Slot", /*tp_name*/
132132
sizeof(PythonQtSlotDecorator), /*tp_basicsize*/
133133
0, /*tp_itemsize*/

src/PythonQtStdIn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static PyMemberDef PythonQtStdInRedirect_members[] = {
8686
};
8787

8888
PyTypeObject PythonQtStdInRedirectType = {
89-
PyVarObject_HEAD_INIT(nullptr, 0)
89+
PyVarObject_HEAD_INIT(nullptr, 0) /*tp_base*/
9090
"PythonQtStdInRedirect", /*tp_name*/
9191
sizeof(PythonQtStdInRedirect), /*tp_basicsize*/
9292
0, /*tp_itemsize*/

0 commit comments

Comments
 (0)