From 7cb9889f780a78f728c10717625e288a20ea69cb Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 11 Feb 2012 22:38:17 +0100 Subject: [PATCH] srd: Every callback should have a 'void *' parameter. This is required in various situations and for various lib users, especially so GUIs which might want to pass specific info via this mechanism. --- sigrok-cli.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sigrok-cli.c b/sigrok-cli.c index 86ac278..fc6884b 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -510,11 +510,14 @@ err_out: return 0; } -void show_pd_annotation(struct srd_proto_data *pdata) +void show_pd_annotation(struct srd_proto_data *pdata, void *data) { int i; char **annotations; + /* 'data' is not used in this specific callback. */ + (void)data; + if (pdata->ann_format != 0) { /* CLI only shows the default annotation format. */ return; @@ -1012,7 +1015,7 @@ int main(int argc, char **argv) return 1; } if (srd_register_callback(SRD_OUTPUT_ANN, - show_pd_annotation) != SRD_OK) { + show_pd_annotation, NULL) != SRD_OK) { printf("Failed to register protocol decoder callback\n"); return 1; } -- 2.30.2