X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoder.c;h=8ad0c5a132e1bac021184bab8c9ee60e28aa5ff6;hb=e500b376b5cf74f4862688f310b9b8008bfc3eea;hp=eba5a287f4176008aed1568d465a13018c6be866;hpb=6069768266f3bdd8cddd64ba33666f05e7fff55b;p=libsigrokdecode.git diff --git a/decoder.c b/decoder.c index eba5a28..8ad0c5a 100644 --- a/decoder.c +++ b/decoder.c @@ -682,8 +682,8 @@ SRD_API int srd_decoder_load(const char *module_name) * PDs of different API versions are incompatible and cannot work. */ apiver = srd_decoder_apiver(d); - if (apiver != 2) { - srd_exception_catch("Only PD API version 2 is supported, " + if (apiver != 2 && apiver != 3) { + srd_exception_catch("Only PD API version 2/3 is supported, " "decoder %s has version %ld", module_name, apiver); fail_txt = "API version mismatch"; goto err_out; @@ -992,13 +992,7 @@ SRD_API int srd_decoder_load_all(void) */ SRD_API int srd_decoder_unload_all(void) { - GSList *l; - struct srd_decoder *dec; - - for (l = pd_list; l; l = l->next) { - dec = l->data; - srd_decoder_unload(dec); - } + g_slist_foreach(pd_list, (GFunc)srd_decoder_unload, NULL); g_slist_free(pd_list); pd_list = NULL;