]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
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 0a9c7cc086b98659eb8dfc154acf5c353d1ecf72..e3b716bc11fc71682ce4bf9980450e83f0b9f45d 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 739d7a440baec5ec783f00dbc859d7b2b2da3c22..01be0894a1a4fdcf38dfdf5320a6ea291fbcc35f 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 9ee50671b98bc674a9255ee81e0c77467910f3df..c74baaed5d9e3c213be5104e4c5b12746fc96d82 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 a15f77e8cffd8e9cb2ea92070bd329eb298a227f..9e980035f93fdfeeaa9cb77310bc1e31af292f6f 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,
 };