lib:tdb: Use C99 initializer for PyGetSetDef in pytdb
authorAndreas Schneider <asn@samba.org>
Thu, 13 Dec 2018 10:29:09 +0000 (11:29 +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/tdb/pytdb.c

index c9d3a7660e3fd5489985b4c0825c9187b80e714c..babd6071f107b129d7a412f215f3e34ce75689ff 100644 (file)
@@ -599,24 +599,40 @@ static PyObject *obj_get_text(PyTdbObject *self, void *closure)
 }
 
 static PyGetSetDef tdb_object_getsetters[] = {
-       { discard_const_p(char, "hash_size"),
-         (getter)obj_get_hash_size, NULL, NULL },
-       { discard_const_p(char, "map_size"),
-         (getter)obj_get_map_size, NULL, NULL },
-       { discard_const_p(char, "freelist_size"),
-         (getter)obj_get_freelist_size, NULL, NULL },
-       { discard_const_p(char, "flags"),
-         (getter)obj_get_flags, NULL, NULL },
-       { discard_const_p(char, "max_dead"),
-         NULL, (setter)obj_set_max_dead, NULL },
-       { discard_const_p(char, "filename"),
-         (getter)obj_get_filename, NULL,
-         discard_const_p(char, "The filename of this TDB file.") },
-       { discard_const_p(char, "seqnum"),
-         (getter)obj_get_seqnum, NULL, NULL },
-       { discard_const_p(char, "text"),
-         (getter)obj_get_text, NULL, NULL },
-       { NULL }
+       {
+               .name    = discard_const_p(char, "hash_size"),
+               .get     = (getter)obj_get_hash_size,
+       },
+       {
+               .name    = discard_const_p(char, "map_size"),
+               .get     = (getter)obj_get_map_size,
+       },
+       {
+               .name    = discard_const_p(char, "freelist_size"),
+               .get     = (getter)obj_get_freelist_size,
+       },
+       {
+               .name    = discard_const_p(char, "flags"),
+               .get     = (getter)obj_get_flags,
+       },
+       {
+               .name    = discard_const_p(char, "max_dead"),
+               .set     = (setter)obj_set_max_dead,
+       },
+       {
+               .name    = discard_const_p(char, "filename"),
+               .get     = (getter)obj_get_filename,
+               .doc     = discard_const_p(char, "The filename of this TDB file."),
+       },
+       {
+               .name    = discard_const_p(char, "seqnum"),
+               .get     = (getter)obj_get_seqnum,
+       },
+       {
+               .name    = discard_const_p(char, "text"),
+               .get     = (getter)obj_get_text,
+       },
+       { .name = NULL }
 };
 
 static PyObject *tdb_object_repr(PyTdbObject *self)