sr_analog_to_float(): Fix multiple compiler warnings (-Wshadow).
src/analog.c:205:23: warning: declaration of ‘i’ shadows a previous local [-Wshadow] for (unsigned int i = 0; i < count; i++) { ^ src/analog.c:178:18: note: shadowed declaration is here unsigned int b, i, count; ^ [...]
This commit is contained in:
parent
741bcf503d
commit
0519db864b
|
@ -174,7 +174,7 @@ SR_PRIV int sr_analog_init(struct sr_datafeed_analog *analog,
|
||||||
SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
||||||
float *outbuf)
|
float *outbuf)
|
||||||
{
|
{
|
||||||
unsigned int b, i, count;
|
unsigned int b, count;
|
||||||
gboolean bigendian;
|
gboolean bigendian;
|
||||||
|
|
||||||
if (!analog || !(analog->data) || !(analog->meaning)
|
if (!analog || !(analog->data) || !(analog->meaning)
|
||||||
|
@ -274,7 +274,7 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
||||||
/* The data is already in the right format. */
|
/* The data is already in the right format. */
|
||||||
memcpy(outbuf, analog->data, count * sizeof(float));
|
memcpy(outbuf, analog->data, count * sizeof(float));
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < count; i += analog->encoding->unitsize) {
|
for (unsigned int i = 0; i < count; i += analog->encoding->unitsize) {
|
||||||
for (b = 0; b < analog->encoding->unitsize; b++) {
|
for (b = 0; b < analog->encoding->unitsize; b++) {
|
||||||
if (analog->encoding->is_bigendian == bigendian)
|
if (analog->encoding->is_bigendian == bigendian)
|
||||||
((uint8_t *)outbuf)[i + b] =
|
((uint8_t *)outbuf)[i + b] =
|
||||||
|
|
Loading…
Reference in New Issue