diff options
author | Andreas Schneider <asn@samba.org> | 2018-12-13 11:29:09 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-28 10:29:20 +0100 |
commit | 651ee7f205f4a7e31c791f7bb235275816747463 (patch) | |
tree | 2cb99e769799fa98f8bcef732176bab6af0f8fe2 /lib/tdb | |
parent | 0a6f78d736f20bb02719a4f99ce9b6ecb96d0755 (diff) | |
download | samba-651ee7f205f4a7e31c791f7bb235275816747463.tar.gz |
lib:tdb: Use C99 initializer for PyGetSetDef in pytdb
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/tdb')
-rw-r--r-- | lib/tdb/pytdb.c | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c index c9d3a7660e3..babd6071f10 100644 --- a/lib/tdb/pytdb.c +++ b/lib/tdb/pytdb.c @@ -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) |