]> sigrok.org Git - libsigrok.git/blobdiff - src/input/vcd.c
Build: Set local include directories in Makefile.am
[libsigrok.git] / src / input / vcd.c
index e14215712b75c56477342a4706de8cecee5e0cf1..0ca7705a08bd6afb441c7f51848aee0968105972 100644 (file)
@@ -61,7 +61,7 @@
 #include <glib.h>
 #include <stdio.h>
 #include <string.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
 #define LOG_PREFIX "input/vcd"
@@ -87,7 +87,6 @@ struct vcd_channel {
        gchar *identifier;
 };
 
-
 /*
  * Reads a single VCD section from input file and parses it to name/contents.
  * e.g. $timescale 1ps $end  => "timescale" "1ps"
@@ -404,7 +403,6 @@ static void parse_contents(const struct sr_input *in, char *data)
 
 static int init(struct sr_input *in, GHashTable *options)
 {
-       struct sr_channel *ch;
        int num_channels, i;
        char name[16];
        struct context *inc;
@@ -434,8 +432,7 @@ static int init(struct sr_input *in, GHashTable *options)
 
        for (i = 0; i < num_channels; i++) {
                snprintf(name, 16, "%d", i);
-               ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, name);
-               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
+               sr_channel_new(in->sdi, i, SR_CHANNEL_LOGIC, TRUE, name);
        }
 
        return SR_OK;
@@ -503,7 +500,7 @@ static int receive(struct sr_input *in, GString *buf)
        if (!inc->got_header) {
                if (!have_header(in->buf))
                        return SR_OK;
-               if (!parse_header(in, in->buf) != SR_OK)
+               if (!parse_header(in, in->buf))
                        /* There was a header in there, but it was malformed. */
                        return SR_ERR;