From: Andreas Schneider Date: Thu, 13 Dec 2018 10:34:37 +0000 (+0100) Subject: lib:ldb: Use C99 initializer for PyGetSetDef in pyldb X-Git-Tag: ldb-1.6.1~362 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85a5dc56e34298a60d7ef96f4178ccff20d40c82;p=thirdparty%2Fsamba.git lib:ldb: Use C99 initializer for PyGetSetDef in pyldb Signed-off-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index c98ce5d1b2b..b2cac8a3497 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -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)