]> sigrok.org Git - libsigrok.git/commitdiff
input/vcd: Remove debug output from inner loops.
authorDaniel Elstner <redacted>
Tue, 4 Feb 2014 23:25:32 +0000 (00:25 +0100)
committerDaniel Elstner <redacted>
Wed, 5 Feb 2014 00:17:52 +0000 (01:17 +0100)
(parse_contents): Do not call sr_dbg() on every signal change.
This would be excessive even for sr_spew().
(read_until): Do not call ftell() just to be able to show some
number in a debug message later on.

input/vcd.c

index 1cfb75bbc5636d792781470b0a8e837a31893297..66af86643fc06587583be080486a0f16412caa41 100644 (file)
@@ -93,14 +93,15 @@ struct probe {
  */
 static gboolean read_until(FILE *file, GString *dest, char mode)
 {
+       int  c;
        char prev[4] = "";
-       long startpos = ftell(file);
+
        for(;;) {
-               int c = fgetc(file);
+               c = fgetc(file);
 
                if (c == EOF) {
                        if (mode == '$')
-                               sr_err("Unexpected EOF, read started at %ld.", startpos);
+                               sr_err("Unexpected EOF.");
                        return FALSE;
                }
 
@@ -468,8 +469,6 @@ static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct con
                                probe = l->data;
 
                                if (g_strcmp0(token->str, probe->identifier) == 0) {
-                                       sr_dbg("Probe %d new value %d.", i, bit);
-                               
                                        /* Found our probe */
                                        if (bit)
                                                prev_values |= (uint64_t)1 << i;