From: Uwe Hermann Date: Sat, 11 Feb 2012 21:38:17 +0000 (+0100) Subject: srd: Every callback should have a 'void *' parameter. X-Git-Tag: sigrok-cli-0.3.0~38 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7cb9889f780a78f728c10717625e288a20ea69cb;p=sigrok-cli.git 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. --- 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; }