diff options
author | Your Name <you@example.com> | 2016-12-19 22:05:36 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-20 19:17:51 +0000 |
commit | 98d350aeddfd85a1479dae133a2912e0b2313184 (patch) | |
tree | 9b87de480b56eacd63ef33c1d0a272aef46096f5 | |
parent | 795f4eb106d877ba6f2bd30524cc871404e9e42a (diff) | |
download | wireshark-98d350aeddfd85a1479dae133a2912e0b2313184.tar.gz |
Cast larger types to time_t
Resolves truncation warnings on the x86 clang build
Change-Id: I14ebbe39b8235bd1b909c488c0402b77deb6dde1
Reviewed-on: https://code.wireshark.org/review/19354
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-cisco-ttag.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-erf.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-kafka.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-cisco-ttag.c b/epan/dissectors/packet-cisco-ttag.c index f96abeec56..c6b62b6488 100644 --- a/epan/dissectors/packet-cisco-ttag.c +++ b/epan/dissectors/packet-cisco-ttag.c @@ -59,7 +59,7 @@ dissect_ttag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ttag_tree = proto_item_add_subtree(ti, ett_ttag); timestamp_value = tvb_get_guint48(tvb, offset, ENC_BIG_ENDIAN); - timestamp.secs = timestamp_value / G_GUINT64_CONSTANT(1000000000); + timestamp.secs = (time_t) (timestamp_value / G_GUINT64_CONSTANT(1000000000)); timestamp.nsecs = (guint32)(timestamp_value - (timestamp.secs * G_GUINT64_CONSTANT(1000000000))); proto_item_append_text(ti, ", Timestamp: %lu.%d seconds", timestamp.secs, timestamp.nsecs); diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 576a63c0e9..fe380722f8 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -2088,7 +2088,7 @@ static proto_item *dissect_ptp_timeinterval(proto_tree *tree, const int hfindex, ti += (ti & 0x8000) << 1; /* rounding */ ti_ns = ti >> 16; - t.secs = ti_ns / NS_PER_S; + t.secs = (time_t) (ti_ns / NS_PER_S); t.nsecs = (guint32)(ti_ns % NS_PER_S); if (t.nsecs >= NS_PER_S) { t.nsecs -= NS_PER_S; diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c index 08b301794a..e85a208e7e 100644 --- a/epan/dissectors/packet-kafka.c +++ b/epan/dissectors/packet-kafka.c @@ -546,7 +546,7 @@ dissect_kafka_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint64 milliseconds; milliseconds = tvb_get_ntoh64(tvb, offset); - nstime.secs = milliseconds / 1000; + nstime.secs = (time_t) (milliseconds / 1000); nstime.nsecs = ((int)milliseconds % 1000) * 1000000; proto_tree_add_time(tree, hf_item, tvb, offset, 8, &nstime); |