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>
This commit is contained in:
Your Name 2016-12-19 22:05:36 -05:00 committed by Michael Mann
parent 795f4eb106
commit 98d350aedd
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);