From: Peter Stuge Date: Mon, 3 Dec 2012 03:23:37 +0000 (+0100) Subject: Add struct sr_context * to sr_driver_init() calls X-Git-Tag: pulseview-0.1.0~209 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=24ea28e79dfe41eeec311c38f61b8ffe67404b16;p=pulseview.git Add struct sr_context * to sr_driver_init() calls 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(). --- diff --git a/main.cpp b/main.cpp index ba6d6645..98fc9ad5 100644 --- a/main.cpp +++ b/main.cpp @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) // 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;