X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Ffloat.c;h=5c9631f4b2844007b90f094523a769a30b8f8656;hb=40578aa487f6624db787289e4f254af14deee102;hp=850b5d435444e8df64eea2fd9186b2158d8c1fec;hpb=d27e406e13d1247a7839698d3643b8ebae7143af;p=libsigrok.git diff --git a/output/float.c b/output/float.c index 850b5d43..5c9631f4 100644 --- a/output/float.c +++ b/output/float.c @@ -21,8 +21,8 @@ #include #include #include "config.h" -#include "sigrok.h" -#include "sigrok-internal.h" +#include "libsigrok.h" +#include "libsigrok-internal.h" struct context { unsigned int num_enabled_probes; @@ -38,10 +38,10 @@ static int init(struct sr_output *o) if (!o) return SR_ERR_ARG; - if (!o->dev) + if (!o->sdi) return SR_ERR_ARG; - if (!o->dev->driver) + if (!o->sdi->driver) return SR_ERR_ARG; if (!(ctx = g_try_malloc0(sizeof(struct context)))) @@ -51,7 +51,7 @@ static int init(struct sr_output *o) /* Get the number of probes and their names. */ ctx->probelist = g_ptr_array_new(); - for (l = o->dev->probes; l; l = l->next) { + for (l = o->sdi->probes; l; l = l->next) { probe = l->data; if (!probe || !probe->enabled) continue; @@ -126,7 +126,7 @@ static int data(struct sr_output *o, const uint8_t *data_in, max = length_in / sizeof(float); for (i = 0; i < max;) { for (j = 0; j < ctx->num_enabled_probes; j++) { - g_string_append_printf(outstr, "%s: %f\n", + g_string_append_printf(outstr, "%s: %.12f\n", (char *)g_ptr_array_index(ctx->probelist, j), fdata[i++]); }