summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-12-13 11:34:37 +0100
committerStefan Metzmacher <metze@samba.org>2019-02-26 13:00:11 +0100
commit7d0902c2a2bba7fc290d963cb771173adf8b5715 (patch)
treef3adc4afa4f1b9978a1e6e8fcb7f2cd434756717 /lib
parent0da2d830806da2ae092d9a094820861ffd3254a0 (diff)
downloadsamba-7d0902c2a2bba7fc290d963cb771173adf8b5715.tar.gz
lib:ldb: Use C99 initializer for PyGetSetDef in pyldb
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> (cherry picked from commit 85a5dc56e34298a60d7ef96f4178ccff20d40c82)
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/pyldb.c62
1 files changed, 47 insertions, 15 deletions
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)