]> sigrok.org Git - pulseview.git/commitdiff
Add struct sr_context * to sr_driver_init() calls
authorPeter Stuge <redacted>
Mon, 3 Dec 2012 03:23:37 +0000 (04:23 +0100)
committerPeter Stuge <redacted>
Mon, 3 Dec 2012 03:26:34 +0000 (04:26 +0100)
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().

main.cpp

index ba6d66452c7a6f1a5f2330e6e53f286c473c8c1e..98fc9ad5949c3b7d79bc4f0e6edf52d1d4f9eb3e 100644 (file)
--- 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;