diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-05-15 05:28:56 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-05-15 05:28:56 +0000 |
commit | c914d509a026163023ee0b02fb50d14865a81d63 (patch) | |
tree | aab153d2aa268e6c40caa152e658dcb8c2b73fd9 /wiretap/ber.c | |
parent | 2f568ce9eabbb1e7ff8475e420c9f76ccc7bc89f (diff) |
Fix some compiler warnings.
That requires that we define G_GINT64_MODIFIER ourselves if glib.h
doesn't define it for us, as that's what should be used to print 64-bit
integral values in any calls that use any of the GLib printf functions
(directly or indirectly).
svn path=/trunk/; revision=18154
Diffstat (limited to 'wiretap/ber.c')
-rw-r--r-- | wiretap/ber.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/wiretap/ber.c b/wiretap/ber.c index 4bcb6687aa..70183cacb0 100644 --- a/wiretap/ber.c +++ b/wiretap/ber.c @@ -45,6 +45,7 @@ static gboolean ber_read(wtap *wth, int *err, gchar **err_info, long *data_offset) { guint8 *buf; + gint64 file_size; int packet_size; struct stat statb; @@ -56,19 +57,20 @@ static gboolean ber_read(wtap *wth, int *err, gchar **err_info, long *data_offse *data_offset = wth->data_offset; - if((packet_size = wtap_file_size(wth, err)) == -1) + if ((file_size = wtap_file_size(wth, err)) == -1) return FALSE; - if (packet_size > WTAP_MAX_PACKET_SIZE) { + if (file_size > WTAP_MAX_PACKET_SIZE) { /* * Probably a corrupt capture file; don't blow up trying * to allocate space for an immensely-large packet. */ *err = WTAP_ERR_BAD_RECORD; - *err_info = g_strdup_printf("ber: File has %u-byte packet, bigger than maximum of %u", - packet_size, WTAP_MAX_PACKET_SIZE); + *err_info = g_strdup_printf("ber: File has %" G_GINT64_MODIFIER "d-byte packet, bigger than maximum of %u", + file_size, WTAP_MAX_PACKET_SIZE); return FALSE; } + packet_size = (int)file_size; buffer_assure_space(wth->frame_buffer, packet_size); buf = buffer_start_ptr(wth->frame_buffer); @@ -92,7 +94,7 @@ static gboolean ber_read(wtap *wth, int *err, gchar **err_info, long *data_offse return TRUE; } -static gboolean ber_seek_read(wtap *wth, long seek_off, union wtap_pseudo_header *pseudo_header, +static gboolean ber_seek_read(wtap *wth, long seek_off, union wtap_pseudo_header *pseudo_header _U_, guint8 *pd, int length, int *err, gchar **err_info _U_) { int packet_size = length; |