summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-20 00:48:02 -0700
committerGuy Harris <guy@alum.mit.edu>2015-04-21 02:12:46 +0000
commit53597ca1ed92fa1d5e1b96092e19d153a4ef6040 (patch)
tree699b79e285941b2824820757d51bcdbb08c0e3f8 /wiretap
parent6f8b0ad71d838d96aeeb19a0d1e5d933bf8002bf (diff)
downloadwireshark-53597ca1ed92fa1d5e1b96092e19d153a4ef6040.tar.gz
Make various structure members the right size for time-in-seconds.
I.e., make them time_t's. Change-Id: I102e9f585ae2798927757fe7f0f7a5a3fa251ec2 Reviewed-on: https://code.wireshark.org/review/8134 Reviewed-by: Guy Harris <guy@alum.mit.edu> (cherry picked from commit 3695abdaf9f54dd66abbcb892ef094fb7d19fff0) Reviewed-on: https://code.wireshark.org/review/8159
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/visual.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c
index 1efb915622..462f7ac1e1 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -142,14 +142,14 @@ struct visual_read_info
{
guint32 num_pkts; /* Number of pkts in the file */
guint32 current_pkt; /* Next packet to be read */
- guint32 start_time; /* Capture start time in seconds */
+ time_t start_time; /* Capture start time in seconds */
};
/* Additional information for writing Visual files */
struct visual_write_info
{
- guint start_time; /* Capture start time in seconds */
+ time_t start_time; /* Capture start time in seconds */
int index_table_index; /* Index of the next index entry */
int index_table_size; /* Allocated size of the index table */
guint32 * index_table; /* File offsets for the packets */
@@ -353,7 +353,7 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
/* Set the packet time and length. */
relmsecs = pletoh32(&vpkt_hdr.ts_delta);
- phdr->ts.secs = (guint64)visual->start_time + relmsecs/1000;
+ phdr->ts.secs = visual->start_time + relmsecs/1000;
phdr->ts.nsecs = (relmsecs % 1000)*1000000;
phdr->len = pletoh16(&vpkt_hdr.orig_len);
@@ -697,7 +697,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
if (visual->index_table_index == 0)
{
/* This is the first packet. Save its start time as the file time. */
- visual->start_time = (guint32) phdr->ts.secs;
+ visual->start_time = phdr->ts.secs;
/* Initialize the index table */
visual->index_table = (guint32 *)g_malloc(1024 * sizeof *visual->index_table);
@@ -706,7 +706,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
/* Calculate milliseconds since capture start. */
delta_msec = phdr->ts.nsecs / 1000000;
- delta_msec += ( (guint32) phdr->ts.secs - visual->start_time) * 1000;
+ delta_msec += (guint32)((phdr->ts.secs - visual->start_time) * 1000);
vpkt_hdr.ts_delta = GUINT32_TO_LE(delta_msec);
/* Fill in the length fields. */