From: Frank Stettner Date: Wed, 14 Feb 2018 20:04:09 +0000 (+0100) Subject: dmm: Remove unnecessary casts X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=94b1d5064276df8047fec8cbb61346ede9123f8d;p=libsigrok.git dmm: Remove unnecessary casts --- diff --git a/src/dmm/asycii.c b/src/dmm/asycii.c index 1bb80861..f32cbfef 100644 --- a/src/dmm/asycii.c +++ b/src/dmm/asycii.c @@ -519,7 +519,7 @@ SR_PRIV int sr_asycii_parse(const uint8_t *buf, float *floatval, int ret, exponent; struct asycii_info *info_local; - info_local = (struct asycii_info *)info; + info_local = info; /* Don't print byte 15. That one contains the carriage return. */ sr_dbg("DMM packet: \"%.15s\"", buf); diff --git a/src/dmm/dtm0660.c b/src/dmm/dtm0660.c index b23c04ab..86b6ccf7 100644 --- a/src/dmm/dtm0660.c +++ b/src/dmm/dtm0660.c @@ -373,7 +373,7 @@ SR_PRIV int sr_dtm0660_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct dtm0660_info *info_local; - info_local = (struct dtm0660_info *)info; + info_local = info; if ((ret = parse_value(buf, floatval, &exponent)) != SR_OK) { sr_dbg("Error parsing value: %d.", ret); diff --git a/src/dmm/fs9721.c b/src/dmm/fs9721.c index c13bdbcf..392e37e7 100644 --- a/src/dmm/fs9721.c +++ b/src/dmm/fs9721.c @@ -353,7 +353,7 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; if ((ret = parse_value(buf, floatval, &exponent)) != SR_OK) { sr_dbg("Error parsing value: %d.", ret); @@ -373,7 +373,7 @@ SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info) { struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; /* User-defined FS9721_LP3 flag 'c2c1_00' means temperature (C). */ if (info_local->is_c2c1_00) { @@ -386,7 +386,7 @@ SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info) { struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (C). */ if (info_local->is_c2c1_01) { @@ -399,7 +399,7 @@ SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info) { struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; /* User-defined FS9721_LP3 flag 'c2c1_10' means temperature (C). */ if (info_local->is_c2c1_10) { @@ -412,7 +412,7 @@ SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *i { struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (F). */ if (info_local->is_c2c1_01) { @@ -431,7 +431,7 @@ SR_PRIV void sr_fs9721_max_c_min(struct sr_datafeed_analog *analog, void *info) { struct fs9721_info *info_local; - info_local = (struct fs9721_info *)info; + info_local = info; /* User-defined FS9721_LP3 flag 'c2c1_00' means MAX. */ if (info_local->is_c2c1_00) diff --git a/src/dmm/fs9922.c b/src/dmm/fs9922.c index 292da6b5..06c8b3c4 100644 --- a/src/dmm/fs9922.c +++ b/src/dmm/fs9922.c @@ -359,7 +359,7 @@ SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct fs9922_info *info_local; - info_local = (struct fs9922_info *)info; + info_local = info; if ((ret = parse_value(buf, floatval, &exponent)) != SR_OK) { sr_dbg("Error parsing value: %d.", ret); @@ -379,7 +379,7 @@ SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info) { struct fs9922_info *info_local; - info_local = (struct fs9922_info *)info; + info_local = info; /* User-defined z1 flag means "diode mode". */ if (info_local->is_z1) { diff --git a/src/dmm/metex14.c b/src/dmm/metex14.c index 2f76672f..f15dd4a0 100644 --- a/src/dmm/metex14.c +++ b/src/dmm/metex14.c @@ -389,7 +389,7 @@ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct metex14_info *info_local; - info_local = (struct metex14_info *)info; + info_local = info; /* Don't print byte 13. That one contains the carriage return. */ sr_dbg("DMM packet: \"%.13s\"", buf); diff --git a/src/dmm/ut71x.c b/src/dmm/ut71x.c index 6dbf23a4..ab7ac3a8 100644 --- a/src/dmm/ut71x.c +++ b/src/dmm/ut71x.c @@ -336,7 +336,7 @@ SR_PRIV int sr_ut71x_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct ut71x_info *info_local; - info_local = (struct ut71x_info *)info; + info_local = info; memset(info_local, 0, sizeof(struct ut71x_info)); if (!sr_ut71x_packet_valid(buf)) diff --git a/src/dmm/vc870.c b/src/dmm/vc870.c index 2af7cc99..d9c3d5ac 100644 --- a/src/dmm/vc870.c +++ b/src/dmm/vc870.c @@ -410,7 +410,7 @@ SR_PRIV int sr_vc870_parse(const uint8_t *buf, float *floatval, int ret, exponent = 0; struct vc870_info *info_local; - info_local = (struct vc870_info *)info; + info_local = info; memset(info_local, 0, sizeof(struct vc870_info)); if (!sr_vc870_packet_valid(buf))