X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Fvcd.c;h=829fcde7722e5d05b2b91a8d4590c72237d91ab4;hb=fe9ac252502fbb90badc84367eea75d6ab027686;hp=98159e9f59a84fd3bf32a69910be1b9a18eba14f;hpb=bbe6e336b3baf86b43f88185f25eab424cbd61f6;p=libsigrok.git diff --git a/output/vcd.c b/output/vcd.c index 98159e9f..829fcde7 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -2,7 +2,7 @@ * This file is part of the sigrok project. * * Copyright (C) 2010 Uwe Hermann - * Copyright (C) 2010-2012 Bert Vermeulen + * Copyright (C) 2013 Bert Vermeulen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ static int init(struct sr_output *o) struct context *ctx; struct sr_probe *probe; GSList *l; - uint64_t *samplerate; + GVariant *gvar; int num_probes, i; char *samplerate_s, *frequency_s, *timestamp; time_t t; @@ -93,17 +93,18 @@ static int init(struct sr_output *o) PACKAGE, PACKAGE_VERSION); if (o->sdi->driver && sr_dev_has_option(o->sdi, SR_CONF_SAMPLERATE)) { - o->sdi->driver->config_get(SR_CONF_SAMPLERATE, - (const void **)&samplerate, o->sdi); - ctx->samplerate = *samplerate; + o->sdi->driver->config_get(SR_CONF_SAMPLERATE, &gvar, o->sdi); + ctx->samplerate = g_variant_get_uint64(gvar); if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) { g_string_free(ctx->header, TRUE); g_free(ctx); + g_variant_unref(gvar); return SR_ERR; } g_string_append_printf(ctx->header, vcd_header_comment, ctx->num_enabled_probes, num_probes, samplerate_s); g_free(samplerate_s); + g_variant_unref(gvar); } /* timescale */