From 98afa68d935215e8ab2c7de7fb45972a03e3da26 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 29 Aug 2018 08:36:30 +0200 Subject: Use C99 designated initializers for some structs These are just a few particularly egregious cases that were hard to read and write, and error prone because of many similar adjacent types. Discussion: https://www.postgresql.org/message-id/flat/4c9f01be-9245-2148-b569-61a8562ef190%402ndquadrant.com --- src/pl/plpython/plpy_subxactobject.c | 37 ++++++------------------------------ 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'src/pl/plpython/plpy_subxactobject.c') diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c index 331d2b859c0..53fd36edba1 100644 --- a/src/pl/plpython/plpy_subxactobject.c +++ b/src/pl/plpython/plpy_subxactobject.c @@ -38,37 +38,12 @@ static PyMethodDef PLy_subtransaction_methods[] = { static PyTypeObject PLy_SubtransactionType = { PyVarObject_HEAD_INIT(NULL, 0) - "PLySubtransaction", /* tp_name */ - sizeof(PLySubtransactionObject), /* tp_size */ - 0, /* tp_itemsize */ - - /* - * methods - */ - PLy_subtransaction_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - PLy_subtransaction_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - PLy_subtransaction_methods, /* tp_tpmethods */ + .tp_name = "PLySubtransaction", + .tp_basicsize = sizeof(PLySubtransactionObject), + .tp_dealloc = PLy_subtransaction_dealloc, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + .tp_doc = PLy_subtransaction_doc, + .tp_methods = PLy_subtransaction_methods, }; -- cgit v1.2.3