libsigrok.git commit
193691ae1590eb31025d943ffbb0ea5c1047e6ca changes
the API of sr_driver_init() to take a struct sr_context * parameter as
allocated by sr_init().
Move our struct sr_context *sr_ctx out of main() into file global scope
so that it can be used easily in all calls to sr_driver_init().
// Initialize all libsigrok drivers
sr_dev_driver **const drivers = sr_driver_list();
for (sr_dev_driver **driver = drivers; *driver; driver++) {
- if (sr_driver_init(*driver) != SR_OK) {
+ if (sr_driver_init(sr_ctx, *driver) != SR_OK) {
qDebug("Failed to initialize driver %s",
(*driver)->name);
ret = 1;