]> sigrok.org Git - libsigrok.git/blobdiff - src/input/csv.c
scpi-pps: Add support for Fluke/Philips PM2800 series.
[libsigrok.git] / src / input / csv.c
index 9af17be0700ab66cec76c91a676218a890263225..180ff3df264c6aaac50f43c69d1f710748e78115 100644 (file)
@@ -506,7 +506,7 @@ static int initial_parse(const struct sr_input *in, GString *buf)
        }
        if (!lines[l]) {
                /* Not enough data for a proper line yet. */
-               ret = SR_OK_CONTINUE;
+               ret = SR_ERR_NA;
                goto out;
        }
 
@@ -557,7 +557,7 @@ static int initial_parse(const struct sr_input *in, GString *buf)
                if (inc->header && inc->multi_column_mode && strlen(columns[i]))
                        g_string_assign(channel_name, columns[i]);
                else
-                       g_string_printf(channel_name, "%lu", i);
+                       g_string_printf(channel_name, "%zu", i);
                ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, channel_name->str);
                in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
@@ -651,6 +651,7 @@ static int process_buffer(struct sr_input *in)
        else
                max_columns = 1;
 
+       ret = SR_OK;
        lines = g_strsplit_set(in->buf->str, "\r\n", 0);
        for (l = 0; lines[l]; l++) {
                inc->line_number++;
@@ -758,7 +759,7 @@ static int end(struct sr_input *in)
        return ret;
 }
 
-static int cleanup(struct sr_input *in)
+static void cleanup(struct sr_input *in)
 {
        struct context *inc;
 
@@ -775,8 +776,6 @@ static int cleanup(struct sr_input *in)
 
        if (inc->sample_buffer)
                g_free(inc->sample_buffer);
-
-       return SR_OK;
 }
 
 static struct sr_option options[] = {