From: Uwe Hermann Date: Tue, 31 Dec 2013 18:22:16 +0000 (+0100) Subject: teleinfo: Fix a compiler warning (clang). X-Git-Tag: libsigrok-0.3.0~355 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=162a48bfc7e94598fb15911001f84f8b1c1bd77b;p=libsigrok.git teleinfo: Fix a compiler warning (clang). CC libsigrok_hw_teleinfo_la-protocol.lo protocol.c:62:41: warning: missing field 'num_samples' initializer [-Wmissing-field-initializers] struct sr_datafeed_analog analog = { 0 }; ^ --- diff --git a/hardware/teleinfo/protocol.c b/hardware/teleinfo/protocol.c index 0d7e6ce5..746d43c0 100644 --- a/hardware/teleinfo/protocol.c +++ b/hardware/teleinfo/protocol.c @@ -57,14 +57,18 @@ static struct sr_probe *teleinfo_find_probe(struct sr_dev_inst *sdi, static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *probe_name, float value, int mq, int unit) { - struct dev_context *devc = sdi->priv; + struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog = { 0 }; - struct sr_probe *probe = teleinfo_find_probe(sdi, probe_name); + struct sr_datafeed_analog analog; + struct sr_probe *probe; + + devc = sdi->priv; + probe = teleinfo_find_probe(sdi, probe_name); if (!probe || !probe->enabled) return; + memset(&analog, 0, sizeof(struct sr_datafeed_analog)); analog.probes = g_slist_append(analog.probes, probe); analog.num_samples = 1; analog.mq = mq;