]> sigrok.org Git - libsigrok.git/commitdiff
sr: always use uint64_t for samplerate
authorBert Vermeulen <redacted>
Sun, 29 Jul 2012 00:45:40 +0000 (02:45 +0200)
committerBert Vermeulen <redacted>
Sun, 29 Jul 2012 00:45:40 +0000 (02:45 +0200)
input/binary.c

index 3209c038922989c797a20ea030d222167b8184d5..53c0ebb5bf2339793834df4e0c607ed181c0ca8d 100644 (file)
@@ -30,7 +30,7 @@
 #define DEFAULT_NUM_PROBES    8
 
 struct context {
-       int samplerate;
+       uint64_t samplerate;
 };
 
 static int format_match(const char *filename)
@@ -67,10 +67,8 @@ static int init(struct sr_input *in)
 
                param = g_hash_table_lookup(in->param, "samplerate");
                if (param) {
-                       ctx->samplerate = strtoul(param, NULL, 10);
-                       if (ctx->samplerate < 1) {
+                       if (sr_parse_sizestring(param, &ctx->samplerate) != SR_OK)
                                return SR_ERR;
-                       }
                }
        }