From: Uwe Hermann Date: Thu, 8 Jun 2017 21:16:18 +0000 (+0200) Subject: Fix various clang warnings. X-Git-Tag: sigrok-cli-0.7.0~1 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=81f781288ab8ce19c46d2f090a16428d28fe0435;p=sigrok-cli.git Fix various clang warnings. ../show.c:668:30: warning: variable 'q' is uninitialized when used here [-Wuninitialized] s = sr_period_string(p, q); ^ ../show.c:324:30: note: initialize the variable 'q' to silence this warning const uint64_t *uint64, p, q, low, high; ^ = 0 ../show.c:668:27: warning: variable 'p' is uninitialized when used here [-Wuninitialized] s = sr_period_string(p, q); ^ ../show.c:324:27: note: initialize the variable 'p' to silence this warning const uint64_t *uint64, p, q, low, high; ^ = 0 ../show.c:458:58: warning: variable 'high' is uninitialized when used here [-Wuninitialized] printf(" Maximum number of samples: %"PRIu64"\n", high); ^~~~ ../show.c:324:41: CC input.o note: initialize the variable 'high' to silence this warning const uint64_t *uint64, p, q, low, high; ^ = 0 ../show.c:589:33: warning: variable 'low' is uninitialized when used here [-Wuninitialized] printf("%"PRIu64"-%"PRIu64, low, high); ^~~ ../show.c:324:35: note: initialize the variable 'low' to silence this warning const uint64_t *uint64, p, q, low, high; ^ = 0 --- diff --git a/show.c b/show.c index 9491110..533ab1e 100644 --- a/show.c +++ b/show.c @@ -321,7 +321,7 @@ void show_dev_detail(void) GVariant *gvar_dict, *gvar_list, *gvar; gsize num_elements; double dlow, dhigh, dcur_low, dcur_high; - const uint64_t *uint64, p, q, low, high; + const uint64_t *uint64, p = 0, q = 0, low = 0, high = 0; uint64_t tmp_uint64, mask, cur_low, cur_high, cur_p, cur_q; GArray *opts; const int32_t *int32;