lib:ldb: Use C99 initializer for PyGetSetDef in pyldb
authorAndreas Schneider <asn@samba.org>
Thu, 13 Dec 2018 10:34:37 +0000 (11:34 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:20 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/pyldb.c

index c98ce5d1b2b5b239cd42ca572f9ce8111b6ae180..b2cac8a3497ac6082f9a3cf739a32c2909026f16 100644 (file)
@@ -260,9 +260,16 @@ static PyObject *py_ldb_control_new(PyTypeObject *type, PyObject *args, PyObject
 }
 
 static PyGetSetDef py_ldb_control_getset[] = {
-       { discard_const_p(char, "oid"), (getter)py_ldb_control_get_oid, NULL, NULL },
-       { discard_const_p(char, "critical"), (getter)py_ldb_control_get_critical, (setter)py_ldb_control_set_critical, NULL },
-       { NULL }
+       {
+               .name = discard_const_p(char, "oid"),
+               .get  = (getter)py_ldb_control_get_oid,
+       },
+       {
+               .name = discard_const_p(char, "critical"),
+               .get  = (getter)py_ldb_control_get_critical,
+               .set  = (setter)py_ldb_control_set_critical,
+       },
+       { .name = NULL },
 };
 
 static PyTypeObject PyLdbControl = {
@@ -2367,8 +2374,11 @@ static PyObject *py_ldb_get_firstmodule(PyLdbObject *self, void *closure)
 }
 
 static PyGetSetDef py_ldb_getset[] = {
-       { discard_const_p(char, "firstmodule"), (getter)py_ldb_get_firstmodule, NULL, NULL },
-       { NULL }
+       {
+               .name = discard_const_p(char, "firstmodule"),
+               .get  = (getter)py_ldb_get_firstmodule,
+       },
+       { .name = NULL },
 };
 
 static int py_ldb_contains(PyLdbObject *self, PyObject *obj)
@@ -2483,11 +2493,23 @@ static PyObject *py_ldb_result_get_count(PyLdbResultObject *self, void *closure)
 }
 
 static PyGetSetDef py_ldb_result_getset[] = {
-       { discard_const_p(char, "controls"), (getter)py_ldb_result_get_controls, NULL, NULL },
-       { discard_const_p(char, "msgs"), (getter)py_ldb_result_get_msgs, NULL, NULL },
-       { discard_const_p(char, "referals"), (getter)py_ldb_result_get_referals, NULL, NULL },
-       { discard_const_p(char, "count"), (getter)py_ldb_result_get_count, NULL, NULL },
-       { NULL }
+       {
+               .name = discard_const_p(char, "controls"),
+               .get  = (getter)py_ldb_result_get_controls,
+       },
+       {
+               .name = discard_const_p(char, "msgs"),
+               .get  = (getter)py_ldb_result_get_msgs,
+       },
+       {
+               .name = discard_const_p(char, "referals"),
+               .get  = (getter)py_ldb_result_get_referals,
+       },
+       {
+               .name = discard_const_p(char, "count"),
+               .get  = (getter)py_ldb_result_get_count,
+       },
+       { .name = NULL },
 };
 
 static PyObject *py_ldb_result_iter(PyLdbResultObject *self)
@@ -3241,8 +3263,11 @@ static PyObject *py_ldb_msg_element_get_text(PyObject *self, void *closure)
 }
 
 static PyGetSetDef py_ldb_msg_element_getset[] = {
-       { discard_const_p(char, "text"), (getter)py_ldb_msg_element_get_text, NULL, NULL },
-       { NULL }
+       {
+               .name = discard_const_p(char, "text"),
+               .get  = (getter)py_ldb_msg_element_get_text,
+       },
+       { .name = NULL }
 };
 
 static PyTypeObject PyLdbMessageElement = {
@@ -3625,9 +3650,16 @@ static PyObject *py_ldb_msg_get_text(PyObject *self, void *closure)
 }
 
 static PyGetSetDef py_ldb_msg_getset[] = {
-       { discard_const_p(char, "dn"), (getter)py_ldb_msg_get_dn, (setter)py_ldb_msg_set_dn, NULL },
-       { discard_const_p(char, "text"), (getter)py_ldb_msg_get_text, NULL, NULL },
-       { NULL }
+       {
+               .name = discard_const_p(char, "dn"),
+               .get  = (getter)py_ldb_msg_get_dn,
+               .set  = (setter)py_ldb_msg_set_dn,
+       },
+       {
+               .name = discard_const_p(char, "text"),
+               .get  = (getter)py_ldb_msg_get_text,
+       },
+       { .name = NULL },
 };
 
 static PyObject *py_ldb_msg_repr(PyLdbMessageObject *self)