From d538319ebc9ba1b1931a7ced1a1af7bd33896107 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Dec 2018 11:10:40 +0100 Subject: [PATCH] s4:pyparam: Use C99 initializer for PyGetSetDef Signed-off-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- source4/param/pyparam.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index e71bb469eeef..9801b0cb01a4 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -464,10 +464,16 @@ static PyObject *py_lp_ctx_config_file(PyObject *self, void *closure) } static PyGetSetDef py_lp_ctx_getset[] = { - { discard_const_p(char, "default_service"), (getter)py_lp_ctx_default_service, NULL, NULL }, - { discard_const_p(char, "configfile"), (getter)py_lp_ctx_config_file, NULL, - discard_const_p(char, "Name of last config file that was loaded.") }, - { NULL } + { + .name = discard_const_p(char, "default_service"), + .get = (getter)py_lp_ctx_default_service, + }, + { + .name = discard_const_p(char, "configfile"), + .get = (getter)py_lp_ctx_config_file, + .doc = discard_const_p(char, "Name of last config file that was loaded.") + }, + { .name = NULL } }; static PyObject *py_lp_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) -- 2.34.1