]> sigrok.org Git - sigrok-cli.git/commitdiff
srd: Every callback should have a 'void *' parameter.
authorUwe Hermann <redacted>
Sat, 11 Feb 2012 21:38:17 +0000 (22:38 +0100)
committerUwe Hermann <redacted>
Sat, 11 Feb 2012 21:41:33 +0000 (22:41 +0100)
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

index 86ac278250d6425d2be440f3b2adc315f1e0539c..fc6884be07b349df565b2bd1d6382394df7d9e55 100644 (file)
@@ -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;
                }