From: Aurelien Jacobs Date: Thu, 12 Feb 2015 16:08:33 +0000 (+0100) Subject: show: pass NULL parameter to config_key_has_cap() instead of uninitialized cg. X-Git-Tag: sigrok-cli-0.6.0~41 X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=15db66c6a90ea967264b66b80d381b89847e3afa;ds=sidebyside show: pass NULL parameter to config_key_has_cap() instead of uninitialized cg. It doesn't make sense to pass a cg to this config_key_has_cap() call as it is trying to retrieve the device's global SR_CONF_LIMIT_SAMPLES. This fixes the following warning: show.c: In function ‘show_dev_detail’: show.c:392:8: warning: ‘cg’ may be used uninitialized in this function [-Wmaybe-uninitialized] && config_key_has_cap(driver, sdi, cg, key, SR_CONF_LIST)) { ^ --- diff --git a/show.c b/show.c index a5999a2..d43c716 100644 --- a/show.c +++ b/show.c @@ -389,7 +389,7 @@ void show_dev_detail(void) g_variant_unref(gvar_list); } else if (key == SR_CONF_LIMIT_SAMPLES - && config_key_has_cap(driver, sdi, cg, key, SR_CONF_LIST)) { + && config_key_has_cap(driver, sdi, NULL, key, SR_CONF_LIST)) { /* If implemented in config_list(), this denotes the * maximum number of samples a device can send. This * really applies only to logic analyzers, and then