X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=controller.c;h=9267ded40e653a14423c9446b23f8994e5366542;hp=7987ea172b8d2270d9fc221246b57e84ab71f0fc;hb=2994587f98f205bb8847554bd28483532b277f2c;hpb=845f0d4031780220451037e87885e1ff79670976 diff --git a/controller.c b/controller.c index 7987ea1..9267ded 100644 --- a/controller.c +++ b/controller.c @@ -965,22 +965,21 @@ SRD_API int srd_pd_output_callback_add(int output_type, } /** @private */ -SRD_PRIV void *srd_pd_output_callback_find(int output_type) +SRD_PRIV struct srd_pd_callback *srd_pd_output_callback_find(int output_type) { GSList *l; - struct srd_pd_callback *pd_cb; - void *(cb); + struct srd_pd_callback *tmp, *pd_cb; - cb = NULL; + pd_cb = NULL; for (l = callbacks; l; l = l->next) { - pd_cb = l->data; - if (pd_cb->output_type == output_type) { - cb = pd_cb->cb; + tmp = l->data; + if (tmp->output_type == output_type) { + pd_cb = tmp; break; } } - return cb; + return pd_cb; } /* This is the backend function to Python sigrokdecode.add() call. */