From: Uwe Hermann Date: Sat, 4 Apr 2015 17:34:06 +0000 (+0200) Subject: Update due to sr_driver_list() now taking a context. X-Git-Tag: sigrok-cli-0.6.0~32 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=59e421bbda22512122660aee370d31b88f8ccdf4;p=sigrok-cli.git Update due to sr_driver_list() now taking a context. --- diff --git a/device.c b/device.c index 17505e2..2d63cab 100644 --- a/device.c +++ b/device.c @@ -22,8 +22,6 @@ #include "sigrok-cli.h" #include "config.h" -extern struct sr_context *sr_ctx; - static void free_drvopts(struct sr_config *src) { g_variant_unref(src->data); @@ -44,7 +42,7 @@ GSList *device_scan(void) } else { /* No driver specified, let them all scan on their own. */ devices = NULL; - drivers = sr_driver_list(); + drivers = sr_driver_list(sr_ctx); for (i = 0; drivers[i]; i++) { driver = drivers[i]; if (sr_driver_init(sr_ctx, driver) != SR_OK) { diff --git a/parsers.c b/parsers.c index f7d03bc..d788532 100644 --- a/parsers.c +++ b/parsers.c @@ -24,8 +24,6 @@ #include #include "sigrok-cli.h" -extern struct sr_context *sr_ctx; - struct sr_channel *find_channel(GSList *channellist, const char *channelname) { struct sr_channel *ch; @@ -415,7 +413,7 @@ int parse_driver(char *arg, struct sr_dev_driver **driver, GSList **drvopts) drvname = g_strdup(g_hash_table_lookup(drvargs, "sigrok_key")); g_hash_table_remove(drvargs, "sigrok_key"); *driver = NULL; - drivers = sr_driver_list(); + drivers = sr_driver_list(sr_ctx); for (i = 0; drivers[i]; i++) { if (strcmp(drivers[i]->name, drvname)) continue; diff --git a/show.c b/show.c index 88a272f..aec61f1 100644 --- a/show.c +++ b/show.c @@ -78,7 +78,7 @@ void show_version(void) #endif printf("Supported hardware drivers:\n"); - drivers = sr_driver_list(); + drivers = sr_driver_list(sr_ctx); for (sl = NULL, i = 0; drivers[i]; i++) sl = g_slist_append(sl, drivers[i]); sl = g_slist_sort(sl, sort_drivers); diff --git a/sigrok-cli.h b/sigrok-cli.h index ac86669..f05a169 100644 --- a/sigrok-cli.h +++ b/sigrok-cli.h @@ -31,7 +31,7 @@ #define SAVE_CHUNK_SIZE (512 * 1024) /* main.c */ -struct sr_context *sr_ctx; +extern struct sr_context *sr_ctx; int select_channels(struct sr_dev_inst *sdi); gboolean config_key_has_cap(struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, struct sr_channel_group *cg,