X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=controller.c;h=9267ded40e653a14423c9446b23f8994e5366542;hb=534ae91250fed49eb22ad7400e8b6c520aadc461;hp=7987ea172b8d2270d9fc221246b57e84ab71f0fc;hpb=b88e336b86493ee3d893f563d1d847d901f8ce07;p=libsigrokdecode.git 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. */