diff options
author | João Valverde <j@v6e.pt> | 2023-01-13 20:20:45 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-01-13 22:41:04 +0000 |
commit | 68704497348663b1eb7ce9b1558a110f11716c07 (patch) | |
tree | 6f072cec1fa556e275d8116a3e32418b7c5e7a6e | |
parent | dfc992466efecc97a44bb0a8b97ce15cafc61d01 (diff) |
MinGW: Fix -Wbool-compare
The return of -1 for negative infinity is glibc specific and
non-portable.
/epan/dissectors/packet-synphasor.c:1634:62: error: comparison of constant '-1' with boolean expression is always false [-Werror=bool-compare]
1634 | if ((isinf(pmu_lat) == 1) || (isinf(pmu_lat) == -1)) {
| ^~
-rw-r--r-- | epan/dissectors/packet-synphasor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c index 4773e470c5..452356d0d6 100644 --- a/epan/dissectors/packet-synphasor.c +++ b/epan/dissectors/packet-synphasor.c @@ -1631,7 +1631,7 @@ static int dissect_config_3_frame(tvbuff_t *tvb, proto_item *config_item) pmu_elev = tvb_get_ntohieee_float(tvb, offset + 8); /* PMU_LAT */ - if ((isinf(pmu_lat) == 1) || (isinf(pmu_lat) == -1)) { + if (isinf(pmu_lat)) { proto_tree_add_float_format_value(wgs84_tree, hf_conf_pmu_lat_unknown, tvb, offset, 4, INFINITY, "%s", unspecified_location); } @@ -1641,7 +1641,7 @@ static int dissect_config_3_frame(tvbuff_t *tvb, proto_item *config_item) offset += 4; /* PMU_LON */ - if ((isinf(pmu_long) == 1) || (isinf(pmu_long) == -1)) { + if (isinf(pmu_long)) { proto_tree_add_float_format_value(wgs84_tree, hf_conf_pmu_lon_unknown, tvb, offset, 4, INFINITY, "%s", unspecified_location); } @@ -1651,7 +1651,7 @@ static int dissect_config_3_frame(tvbuff_t *tvb, proto_item *config_item) offset += 4; /* PMU_ELEV */ - if ((isinf(pmu_elev) == 1) || (isinf(pmu_elev) == -1)) { + if (isinf(pmu_elev)) { proto_tree_add_float_format_value(wgs84_tree, hf_conf_pmu_elev_unknown, tvb, offset, 4, INFINITY, "%s", unspecified_location); } |