diff options
author | Evan Huus <eapache@gmail.com> | 2013-07-28 23:58:30 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-07-28 23:58:30 +0000 |
commit | 851c8bb487a6f33dfee0d62d0095f299aa5b277b (patch) | |
tree | 5c49e070ea6be5e78f551975865aebbbdef9a377 /wiretap | |
parent | 0b796e53cfecb83265b565b4813af6c8b3e24298 (diff) |
Use the portable g_ntohl, also add some casts.
svn path=/trunk/; revision=50997
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/stanag4607.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/stanag4607.c b/wiretap/stanag4607.c index fcd18855b5..1c1bf792cd 100644 --- a/wiretap/stanag4607.c +++ b/wiretap/stanag4607.c @@ -21,7 +21,7 @@ #include "config.h" -#include <arpa/inet.h> +#include <glib.h> #include <errno.h> #ifdef HAVE_SYS_STAT_H @@ -78,7 +78,7 @@ static gboolean stanag4607_read_file(wtap *wth, FILE_T fh, struct wtap_pkthdr *p phdr->presence_flags = WTAP_HAS_TS; /* If no time specified, its the last baseline time */ - phdr->ts.secs = base_secs; + phdr->ts.secs = (time_t)base_secs; phdr->ts.nsecs = 0; millisecs = 0; @@ -103,14 +103,14 @@ static gboolean stanag4607_read_file(wtap *wth, FILE_T fh, struct wtap_pkthdr *p tm.tm_sec = 0; tm.tm_isdst = -1; base_secs = mktime(&tm); - phdr->ts.secs = base_secs; + phdr->ts.secs = (time_t)base_secs; } else if (PLATFORM_LOCATION_SEGMENT == stanag_pkt_hdr[32]) { bytes_read = file_read(&millisecs, sizeof millisecs, fh); if (bytes_read != sizeof millisecs) goto fail; offset += bytes_read; - millisecs = ntohl(millisecs); + millisecs = g_ntohl(millisecs); } else if (DWELL_SEGMENT == stanag_pkt_hdr[32]) { guint8 dseg[19]; @@ -123,7 +123,7 @@ static gboolean stanag4607_read_file(wtap *wth, FILE_T fh, struct wtap_pkthdr *p if (0 != millisecs) { secs = millisecs/1000; nsecs = (millisecs - 1000 * secs) * 1000000; - phdr->ts.secs = base_secs + secs; + phdr->ts.secs = (time_t)(base_secs + secs); phdr->ts.nsecs = nsecs; } |