diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-12-13 03:24:08 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-12-13 03:24:08 +0000 |
commit | 746e796e83c949f61483812a6ce5a95ab2fe96b5 (patch) | |
tree | a1f88a7d668a12c677e52428a9830e058e4193a0 /epan | |
parent | afa9f611d7fa18eb2f707b6f3827f42978b62746 (diff) |
(Try to) fix VS Clang Analysis warning:
C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value
svn path=/trunk/; revision=54019
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-bootp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index 02c2361585..15da0e53f2 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -3014,9 +3014,9 @@ rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct return RFC3825_LATITUDE_UNCERTAINTY_OUTOFRANGE; } if (fixpoint->latitude_res > 8 ) { - decimal->latitude_res = (double) 1 / (1 << (fixpoint->latitude_res - 8)); + decimal->latitude_res = (double) 1 / (G_GUINT64_CONSTANT(1) << (fixpoint->latitude_res - 8)); } else { - decimal->latitude_res = 1 << (8 - fixpoint->latitude_res); + decimal->latitude_res = (double) (G_GUINT64_CONSTANT(1) << (8 - fixpoint->latitude_res)); } /* Longitude */ @@ -3030,9 +3030,9 @@ rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct return RFC3825_LONGITUDE_UNCERTAINTY_OUTOFRANGE; } if (fixpoint->longitude_res > 8 ) { - decimal->longitude_res = (double) 1 / (1 << (fixpoint->longitude_res - 8)); + decimal->longitude_res = (double) 1 / (G_GUINT64_CONSTANT(1) << (fixpoint->longitude_res - 8)); } else { - decimal->longitude_res = 1 << (8 - fixpoint->longitude_res); + decimal->longitude_res = (double) (G_GUINT64_CONSTANT(1) << (8 - fixpoint->longitude_res)); } /* Altitude Type */ @@ -3052,9 +3052,9 @@ rfc3825_fixpoint_to_decimal(struct rfc3825_location_fixpoint_t *fixpoint, struct return RFC3825_ALTITUDE_UNCERTAINTY_OUTOFRANGE; } if (fixpoint->altitude_res > 21 ) { - decimal->altitude_res = (double) 1 / (1 << (fixpoint->altitude_res - 21)); + decimal->altitude_res = (double) 1 / (G_GUINT64_CONSTANT(1) << (fixpoint->altitude_res - 21)); } else { - decimal->altitude_res = 1 << (21 - fixpoint->altitude_res); + decimal->altitude_res = (double) (G_GUINT64_CONSTANT(1) << (21 - fixpoint->altitude_res)); } } else if (decimal->altitude_type == 2) { /* Floors */ /* Altitude */ |