summaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpy_planobject.c
diff options
context:
space:
mode:
authorPeter Eisentraut2018-08-29 06:36:30 +0000
committerPeter Eisentraut2018-09-07 09:40:03 +0000
commit98afa68d935215e8ab2c7de7fb45972a03e3da26 (patch)
treeded48d64b8a9e943a5ea82de6675952d7050aa45 /src/pl/plpython/plpy_planobject.c
parent75f7855369ec56d4a8e7d6eae98aff1182b85cac (diff)
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
Diffstat (limited to 'src/pl/plpython/plpy_planobject.c')
-rw-r--r--src/pl/plpython/plpy_planobject.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/pl/plpython/plpy_planobject.c b/src/pl/plpython/plpy_planobject.c
index 390b4e90d45..96ea24cbcf5 100644
--- a/src/pl/plpython/plpy_planobject.c
+++ b/src/pl/plpython/plpy_planobject.c
@@ -34,37 +34,12 @@ static PyMethodDef PLy_plan_methods[] = {
static PyTypeObject PLy_PlanType = {
PyVarObject_HEAD_INIT(NULL, 0)
- "PLyPlan", /* tp_name */
- sizeof(PLyPlanObject), /* tp_size */
- 0, /* tp_itemsize */
-
- /*
- * methods
- */
- PLy_plan_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_plan_doc, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- PLy_plan_methods, /* tp_tpmethods */
+ .tp_name = "PLyPlan",
+ .tp_basicsize = sizeof(PLyPlanObject),
+ .tp_dealloc = PLy_plan_dealloc,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .tp_doc = PLy_plan_doc,
+ .tp_methods = PLy_plan_methods,
};
void