python: Do not use any GNU-style initialisers for structs
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Jan 2019 16:02:57 +0000 (16:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Jan 2019 16:24:54 +0000 (16:24 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/as.c
src/python/database.c
src/python/network.c
src/python/writer.c

index 0a9c7cc..e3b716b 100644 (file)
@@ -145,15 +145,15 @@ static struct PyGetSetDef AS_getsetters[] = {
 
 PyTypeObject ASType = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       tp_name:                "location.AS",
-       tp_basicsize:           sizeof(ASObject),
-       tp_flags:               Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
-       tp_new:                 AS_new,
-       tp_dealloc:             (destructor)AS_dealloc,
-       tp_init:                (initproc)AS_init,
-       tp_doc:                 "AS object",
-       tp_getset:              AS_getsetters,
-       tp_repr:                (reprfunc)AS_repr,
-       tp_str:                 (reprfunc)AS_str,
-       tp_richcompare:         (richcmpfunc)AS_richcompare,
+       .tp_name =               "location.AS",
+       .tp_basicsize =          sizeof(ASObject),
+       .tp_flags =              Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
+       .tp_new =                AS_new,
+       .tp_dealloc =            (destructor)AS_dealloc,
+       .tp_init =               (initproc)AS_init,
+       .tp_doc =                "AS object",
+       .tp_getset =             AS_getsetters,
+       .tp_repr =               (reprfunc)AS_repr,
+       .tp_str =                (reprfunc)AS_str,
+       .tp_richcompare =        (richcmpfunc)AS_richcompare,
 };
index 739d7a4..01be089 100644 (file)
@@ -239,16 +239,16 @@ static struct PyGetSetDef Database_getsetters[] = {
 
 PyTypeObject DatabaseType = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       tp_name:                "location.Database",
-       tp_basicsize:           sizeof(DatabaseObject),
-       tp_flags:               Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
-       tp_new:                 Database_new,
-       tp_dealloc:             (destructor)Database_dealloc,
-       tp_init:                (initproc)Database_init,
-       tp_doc:                 "Database object",
-       tp_methods:             Database_methods,
-       tp_getset:              Database_getsetters,
-       tp_repr:                (reprfunc)Database_repr,
+       .tp_name =               "location.Database",
+       .tp_basicsize =          sizeof(DatabaseObject),
+       .tp_flags =              Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
+       .tp_new =                Database_new,
+       .tp_dealloc =            (destructor)Database_dealloc,
+       .tp_init =               (initproc)Database_init,
+       .tp_doc =                "Database object",
+       .tp_methods =            Database_methods,
+       .tp_getset =             Database_getsetters,
+       .tp_repr =               (reprfunc)Database_repr,
 };
 
 static PyObject* DatabaseEnumerator_new(PyTypeObject* type, PyObject* args, PyObject* kwds) {
@@ -279,12 +279,12 @@ static PyObject* DatabaseEnumerator_next(DatabaseEnumeratorObject* self) {
 
 PyTypeObject DatabaseEnumeratorType = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       tp_name:                "location.DatabaseEnumerator",
-       tp_basicsize:           sizeof(DatabaseEnumeratorObject),
-       tp_flags:               Py_TPFLAGS_DEFAULT,
-       tp_alloc:               PyType_GenericAlloc,
-       tp_new:                 DatabaseEnumerator_new,
-       tp_dealloc:             (destructor)DatabaseEnumerator_dealloc,
-       tp_iter:                PyObject_SelfIter,
-       tp_iternext:            (iternextfunc)DatabaseEnumerator_next,
+       .tp_name =               "location.DatabaseEnumerator",
+       .tp_basicsize =          sizeof(DatabaseEnumeratorObject),
+       .tp_flags =              Py_TPFLAGS_DEFAULT,
+       .tp_alloc =              PyType_GenericAlloc,
+       .tp_new =                DatabaseEnumerator_new,
+       .tp_dealloc =            (destructor)DatabaseEnumerator_dealloc,
+       .tp_iter =               PyObject_SelfIter,
+       .tp_iternext =           (iternextfunc)DatabaseEnumerator_next,
 };
index 9ee5067..c74baae 100644 (file)
@@ -146,14 +146,14 @@ static struct PyGetSetDef Network_getsetters[] = {
 
 PyTypeObject NetworkType = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       tp_name:                "location.Network",
-       tp_basicsize:           sizeof(NetworkObject),
-       tp_flags:               Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
-       tp_new:                 Network_new,
-       tp_dealloc:             (destructor)Network_dealloc,
-       tp_init:                (initproc)Network_init,
-       tp_doc:                 "Network object",
-       tp_getset:              Network_getsetters,
-       tp_repr:                (reprfunc)Network_repr,
-       tp_str:                 (reprfunc)Network_str,
+       .tp_name =               "location.Network",
+       .tp_basicsize =          sizeof(NetworkObject),
+       .tp_flags =              Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
+       .tp_new =                Network_new,
+       .tp_dealloc =            (destructor)Network_dealloc,
+       .tp_init =               (initproc)Network_init,
+       .tp_doc =                "Network object",
+       .tp_getset =             Network_getsetters,
+       .tp_repr =               (reprfunc)Network_repr,
+       .tp_str =                (reprfunc)Network_str,
 };
index a15f77e..9e98003 100644 (file)
@@ -220,13 +220,13 @@ static struct PyGetSetDef Writer_getsetters[] = {
 
 PyTypeObject WriterType = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       tp_name:                "location.Writer",
-       tp_basicsize:           sizeof(WriterObject),
-       tp_flags:               Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
-       tp_new:                 Writer_new,
-       tp_dealloc:             (destructor)Writer_dealloc,
-       tp_init:                (initproc)Writer_init,
-       tp_doc:                 "Writer object",
-       tp_methods:             Writer_methods,
-       tp_getset:              Writer_getsetters,
+       .tp_name =               "location.Writer",
+       .tp_basicsize =          sizeof(WriterObject),
+       .tp_flags =              Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
+       .tp_new =                Writer_new,
+       .tp_dealloc =            (destructor)Writer_dealloc,
+       .tp_init =               (initproc)Writer_init,
+       .tp_doc =                "Writer object",
+       .tp_methods =            Writer_methods,
+       .tp_getset =             Writer_getsetters,
 };