]> sigrok.org Git - libsigrok.git/commitdiff
input/csv: Use uint64 for samplerate option.
authorBert Vermeulen <redacted>
Sat, 30 Aug 2014 18:16:45 +0000 (20:16 +0200)
committerBert Vermeulen <redacted>
Sat, 30 Aug 2014 18:16:45 +0000 (20:16 +0200)
src/input/csv.c

index 2db908547f39be6d5a6b898c2fe715951d8263c2..e3da2bce5182f1dc6a6faf657e2e52fc7e54d35f 100644 (file)
@@ -429,11 +429,7 @@ static int init(struct sr_input *in, GHashTable *options)
                g_string_truncate(inc->comment, 0);
        }
 
-       s = g_variant_get_string(g_hash_table_lookup(options, "samplerate"), NULL);
-       if (sr_parse_sizestring(s, &inc->samplerate) != SR_OK) {
-               sr_err("Invalid samplerate '%s'.", s);
-               return SR_ERR_ARG;
-       }
+       inc->samplerate = g_variant_get_uint64(g_hash_table_lookup(options, "samplerate"));
 
        inc->first_channel = g_variant_get_int32(g_hash_table_lookup(options, "first-channel"));
 
@@ -778,7 +774,7 @@ static struct sr_option *get_options(void)
                options[2].def = g_variant_ref_sink(g_variant_new_string(","));
                options[3].def = g_variant_ref_sink(g_variant_new_string("bin"));
                options[4].def = g_variant_ref_sink(g_variant_new_string(";"));
-               options[5].def = g_variant_ref_sink(g_variant_new_string("0"));
+               options[5].def = g_variant_ref_sink(g_variant_new_uint64(0));
                options[6].def = g_variant_ref_sink(g_variant_new_int32(0));
                options[7].def = g_variant_ref_sink(g_variant_new_boolean(FALSE));
                options[8].def = g_variant_ref_sink(g_variant_new_int32(1));