From: Markus Heidelberg Date: Mon, 5 Dec 2022 23:51:20 +0000 (+0100) Subject: input/trace32_ad: use u64 instead of u32 for samplerate option X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=77ee3168d0ae88c92a127999d890fff0511ca31e;p=libsigrok.git input/trace32_ad: use u64 instead of u32 for samplerate option The variable type is already u64 so this is consistent now inside of this module and also with the other input parsers using a samplerate option. This also fixes a crash when invoking PulseView with the "samplerate" command line option because u32 is not yet included in C++ bindings: $ pulseview -i /dev/null -I trace32_ad:samplerate=1 Exception: internal error --- diff --git a/src/input/trace32_ad.c b/src/input/trace32_ad.c index 3a4e1cd4..ba89ad2c 100644 --- a/src/input/trace32_ad.c +++ b/src/input/trace32_ad.c @@ -163,7 +163,7 @@ static int init(struct sr_input *in, GHashTable *options) /* Calculate the desired timestamp scaling factor. */ inc->samplerate = 1000000 * - g_variant_get_uint32(g_hash_table_lookup(options, "samplerate")); + g_variant_get_uint64(g_hash_table_lookup(options, "samplerate")); inc->timestamp_scale = ((1 / TIMESTAMP_RESOLUTION) / (double)inc->samplerate); @@ -891,7 +891,7 @@ static const struct sr_option *get_options(void) options[9].def = g_variant_ref_sink(g_variant_new_boolean(FALSE)); options[10].def = g_variant_ref_sink(g_variant_new_boolean(FALSE)); options[11].def = g_variant_ref_sink(g_variant_new_boolean(FALSE)); - options[12].def = g_variant_ref_sink(g_variant_new_uint32(DEFAULT_SAMPLERATE)); + options[12].def = g_variant_ref_sink(g_variant_new_uint64(DEFAULT_SAMPLERATE)); } return options;