From 741bcf503dbfa6c282c17ad1898bcbc74cf63dc6 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 16 May 2018 22:46:34 +0200 Subject: [PATCH] sr_analog_to_float(): Fix a compiler warning (-Wshadow). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/analog.c: In function ‘sr_analog_to_float’: src/analog.c:194:9: warning: declaration of ‘offset’ shadows a previous local [-Wshadow] float offset = analog->encoding->offset.p / (float)analog->encoding->offset.q; ^~~~~~ src/analog.c:177:8: note: shadowed declaration is here float offset; ^~~~~~ --- src/analog.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/analog.c b/src/analog.c index 7dc7c3d0..9b2977e9 100644 --- a/src/analog.c +++ b/src/analog.c @@ -174,7 +174,6 @@ SR_PRIV int sr_analog_init(struct sr_datafeed_analog *analog, SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog, float *outbuf) { - float offset; unsigned int b, i, count; gboolean bigendian; @@ -287,7 +286,7 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog, if (analog->encoding->scale.p != 1 || analog->encoding->scale.q != 1) outbuf[i] = (outbuf[i] * analog->encoding->scale.p) / analog->encoding->scale.q; - offset = ((float)analog->encoding->offset.p / (float)analog->encoding->offset.q); + float offset = ((float)analog->encoding->offset.p / (float)analog->encoding->offset.q); outbuf[i] += offset; } }