]> sigrok.org Git - libsigrok.git/blobdiff - src/output/analog.c
yokogawa-dlm: Minor cosmetics, consistency fixes, typos.
[libsigrok.git] / src / output / analog.c
index 77cf8b1074755f0888417d221a3e7e5dc10ee35c..406d8c6e593c0f8b3f6c0bb2a1707963f7013638 100644 (file)
@@ -47,7 +47,7 @@ static int init(struct sr_output *o, GHashTable *options)
        if (!o || !o->sdi)
                return SR_ERR_ARG;
 
-       o->priv = ctx = g_try_malloc0(sizeof(struct context));
+       o->priv = ctx = g_malloc0(sizeof(struct context));
        s = g_variant_get_string(g_hash_table_lookup(options, "digits"), NULL);
        if (!strcmp(s, "all"))
                ctx->digits = DIGITS_ALL;
@@ -173,7 +173,7 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
                        g_string_append(out, " %oA");
                break;
        case SR_UNIT_CONCENTRATION:
-               g_string_append_printf(out, "%f ppm", value * 1000000);
+               g_string_append_printf(out, "%f ppm", value * (1000 * 1000));
                break;
        case SR_UNIT_REVOLUTIONS_PER_MINUTE:
                si_printf(value, out, "RPM");
@@ -344,6 +344,7 @@ SR_PRIV struct sr_output_module output_analog = {
        .id = "analog",
        .name = "Analog",
        .desc = "Analog data and types",
+       .exts = NULL,
        .options = get_options,
        .init = init,
        .receive = receive,