X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fbackend.c;h=637f7de99aaf3dbfc4696b6894c39f94095821d1;hb=bc96d5f08fe59ea7c51799b148946f5003c90927;hp=e6297f54527e81245bfc2cc9e96c35aabb264795;hpb=d4c937749a92ce6defa2f0095b34692181afe597;p=libsigrok.git diff --git a/src/backend.c b/src/backend.c index e6297f54..637f7de9 100644 --- a/src/backend.c +++ b/src/backend.c @@ -215,7 +215,7 @@ static int sanity_check_all_drivers(void) static int sanity_check_all_input_modules(void) { int i, errors, ret = SR_OK; - struct sr_input_module **inputs; + const struct sr_input_module **inputs; const char *d; sr_spew("Sanity-checking all input modules."); @@ -230,20 +230,24 @@ static int sanity_check_all_input_modules(void) sr_err("No ID in module %d ('%s').", i, d); errors++; } - if (!inputs[i]->description) { - sr_err("No description in module %d ('%s').", i, d); + if (!inputs[i]->name) { + sr_err("No name in module %d ('%s').", i, d); errors++; } - if (!inputs[i]->format_match) { - sr_err("No format_match in module %d ('%s').", i, d); + if (!inputs[i]->desc) { + sr_err("No description in module %d ('%s').", i, d); errors++; } if (!inputs[i]->init) { sr_err("No init in module %d ('%s').", i, d); errors++; } - if (!inputs[i]->loadfile) { - sr_err("No loadfile in module %d ('%s').", i, d); + if (!inputs[i]->receive) { + sr_err("No receive in module %d ('%s').", i, d); + errors++; + } + if (!inputs[i]->end) { + sr_err("No end in module %d ('%s').", i, d); errors++; } @@ -344,12 +348,7 @@ SR_API int sr_init(struct sr_context **ctx) } /* + 1 to handle when struct sr_context has no members. */ - context = g_try_malloc0(sizeof(struct sr_context) + 1); - - if (!context) { - ret = SR_ERR_MALLOC; - goto done; - } + context = g_malloc0(sizeof(struct sr_context) + 1); #ifdef HAVE_LIBUSB_1_0 ret = libusb_init(&context->libusb_ctx);