X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Finput%2Fvcd.c;h=0ca7705a08bd6afb441c7f51848aee0968105972;hp=429dd616a47f13c899b49e17bb4c68a18730ac52;hb=c1aae90038456a61d0f9313d34e6107c3440d3e7;hpb=aac29cc192ccf82b64e77b5e6b11b411da32deed diff --git a/src/input/vcd.c b/src/input/vcd.c index 429dd616..0ca7705a 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -61,7 +61,7 @@ #include #include #include -#include "libsigrok.h" +#include #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; @@ -569,6 +566,7 @@ SR_PRIV struct sr_input_module input_vcd = { .id = "vcd", .name = "VCD", .desc = "Value Change Dump", + .exts = (const char*[]){"vcd", NULL}, .metadata = { SR_INPUT_META_HEADER | SR_INPUT_META_REQUIRED }, .options = get_options, .format_match = format_match,