summaryrefslogtreecommitdiff
path: root/type_decoder.c
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2021-12-25 19:52:30 +0100
committerGerhard Sittig <gerhard.sittig@gmx.net>2021-12-26 13:45:09 +0100
commit7337906cd06569485cbb88ff837b1cfce29cfd48 (patch)
tree903f87019ffc4c9689da6fa881edd60021ba4b85 /type_decoder.c
parent11c6995e4bdaf176e1a38b8ee642217cdb98dfda (diff)
downloadlibsigrokdecode-7337906cd06569485cbb88ff837b1cfce29cfd48.tar.gz
libsigrokdecode-7337906cd06569485cbb88ff837b1cfce29cfd48.zip
type_decoder: use ALL_ZERO for sentinels in method/member tables
Avoid the full listing of all-zero struct members in sentinel items of object methods and class properties tables. Use the ALL_ZERO phrase instead which better reflects what's intended, and reliably silences warnings should structs' lengths differ across Python versions.
Diffstat (limited to 'type_decoder.c')
-rw-r--r--type_decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/type_decoder.c b/type_decoder.c
index d21e92d..38e0a03 100644
--- a/type_decoder.c
+++ b/type_decoder.c
@@ -1196,7 +1196,7 @@ static PyMethodDef Decoder_methods[] = {
Decoder_has_channel, METH_VARARGS,
Decoder_has_channel_doc,
},
- {NULL, NULL, 0, NULL}
+ ALL_ZERO,
};
/**
@@ -1213,7 +1213,7 @@ SRD_PRIV PyObject *srd_Decoder_type_new(void)
{ Py_tp_doc, Decoder_doc },
{ Py_tp_methods, Decoder_methods },
{ Py_tp_new, (void *)&PyType_GenericNew },
- { 0, NULL }
+ ALL_ZERO,
};
PyObject *py_obj;
PyGILState_STATE gstate;