aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-01-04 05:22:43 +0000
committerMichael Mann <mmann78@netscape.net>2013-01-04 05:22:43 +0000
commit86d690880fb63891d223aa663ca5901c790b74af (patch)
tree47187c5da15e3c239e9bf40c79601c196ac0f114 /wiretap
parentd36b4c8525161167a32eac3b1feb98f8f5d6184e (diff)
replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned int" instead.
bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825) svn path=/trunk/; revision=46928
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file_wrappers.c32
-rw-r--r--wiretap/file_wrappers.h2
-rw-r--r--wiretap/mpeg.c4
-rw-r--r--wiretap/visual.c4
4 files changed, 21 insertions, 21 deletions
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index 4cb2c36eff..45b8f8f3cc 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -109,12 +109,12 @@ struct wtap_reader {
int fd; /* file descriptor */
gint64 raw_pos; /* current position in file (just to not call lseek()) */
gint64 pos; /* current position in uncompressed data */
- unsigned size; /* buffer size */
+ guint size; /* buffer size */
unsigned char *in; /* input buffer */
unsigned char *out; /* output buffer (double-sized when reading) */
unsigned char *next; /* next output data to deliver or write */
- unsigned have; /* amount of output data unused at next */
+ guint have; /* amount of output data unused at next */
int eof; /* true if end of input file reached */
gint64 start; /* where the gzip data started, for rewinding */
gint64 raw; /* where the raw data started, for seeking */
@@ -148,7 +148,7 @@ struct wtap_reader {
#endif
static int /* gz_load */
-raw_read(FILE_T state, unsigned char *buf, unsigned int count, unsigned *have)
+raw_read(FILE_T state, unsigned char *buf, unsigned int count, guint *have)
{
ssize_t ret;
@@ -176,7 +176,7 @@ fill_in_buffer(FILE_T state)
if (state->err)
return -1;
if (state->eof == 0) {
- if (raw_read(state, state->in, state->size, (unsigned *)&(state->avail_in)) == -1)
+ if (raw_read(state, state->in, state->size, (guint *)&(state->avail_in)) == -1)
return -1;
state->next_in = state->in;
}
@@ -513,7 +513,7 @@ zlib_read(FILE_T state, unsigned char *buf, unsigned int count)
unsigned int ready = count2 - strm->avail_out;
if (ready < ZLIB_WINSIZE) {
- unsigned left = ZLIB_WINSIZE - cur->pos;
+ guint left = ZLIB_WINSIZE - cur->pos;
if (ready >= left) {
memcpy(cur->window + cur->pos, buf2, left);
@@ -729,7 +729,7 @@ fill_out_buffer(FILE_T state)
static int
gz_skip(FILE_T state, gint64 len)
{
- unsigned n;
+ guint n;
/* skip over len bytes or reach end-of-file, whichever comes first */
while (len)
@@ -913,7 +913,7 @@ gint64
file_seek(FILE_T file, gint64 offset, int whence, int *err)
{
struct fast_seek_point *here;
- unsigned n;
+ guint n;
/* can only seek from start or relative to current position */
if (whence != SEEK_SET && whence != SEEK_CUR) {
@@ -937,7 +937,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
* To squelch compiler warnings, we cast the
* result.
*/
- unsigned had = (unsigned)(file->next - file->out);
+ guint had = (unsigned)(file->next - file->out);
if (-offset <= had) {
/*
* Offset is negative, so -offset is
@@ -951,7 +951,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
* would want, so we cast -offset
* instead.)
*/
- unsigned adjustment = (unsigned)(-offset);
+ guint adjustment = (unsigned)(-offset);
file->have += adjustment;
file->next -= adjustment;
file->pos -= adjustment;
@@ -1140,7 +1140,7 @@ file_iscompressed(FILE_T stream)
int
file_read(void *buf, unsigned int len, FILE_T file)
{
- unsigned got, n;
+ guint got, n;
/* if len is zero, avoid unnecessary operations */
if (len == 0)
@@ -1219,7 +1219,7 @@ file_getc(FILE_T file)
char *
file_gets(char *buf, int len, FILE_T file)
{
- unsigned left, n;
+ guint left, n;
char *str;
unsigned char *eol;
@@ -1364,8 +1364,8 @@ file_close(FILE_T file)
struct wtap_writer {
int fd; /* file descriptor */
gint64 pos; /* current position in uncompressed data */
- unsigned size; /* buffer size, zero if not allocated yet */
- unsigned want; /* requested buffer size, default is GZBUFSIZE */
+ guint size; /* buffer size, zero if not allocated yet */
+ guint want; /* requested buffer size, default is GZBUFSIZE */
unsigned char *in; /* input buffer */
unsigned char *out; /* output buffer (double-sized when reading) */
unsigned char *next; /* next output data to deliver or write */
@@ -1534,10 +1534,10 @@ gz_comp(GZWFILE_T state, int flush)
failure or on an attempt to write 0 bytes (in which case state->err
is Z_OK); return the number of bytes written on success. */
unsigned
-gzwfile_write(GZWFILE_T state, const void *buf, unsigned len)
+gzwfile_write(GZWFILE_T state, const void *buf, guint len)
{
- unsigned put = len;
- unsigned n;
+ guint put = len;
+ guint n;
z_streamp strm;
strm = &(state->strm);
diff --git a/wiretap/file_wrappers.h b/wiretap/file_wrappers.h
index e95f857fe5..fcc320599b 100644
--- a/wiretap/file_wrappers.h
+++ b/wiretap/file_wrappers.h
@@ -51,7 +51,7 @@ typedef struct wtap_writer *GZWFILE_T;
extern GZWFILE_T gzwfile_open(const char *path);
extern GZWFILE_T gzwfile_fdopen(int fd);
-extern unsigned gzwfile_write(GZWFILE_T state, const void *buf, unsigned len);
+extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
extern int gzwfile_flush(GZWFILE_T state);
extern int gzwfile_close(GZWFILE_T state);
extern int gzwfile_geterr(GZWFILE_T state);
diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c
index dfb8dd6846..17db40ba8a 100644
--- a/wiretap/mpeg.c
+++ b/wiretap/mpeg.c
@@ -178,9 +178,9 @@ mpeg_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
(bytes >> 43 & 0x0007) << 30 |
(bytes >> 27 & 0x7fff) << 15 |
(bytes >> 11 & 0x7fff) << 0;
- unsigned ext = (unsigned)((bytes >> 1) & 0x1ff);
+ guint ext = (guint)((bytes >> 1) & 0x1ff);
guint64 cr = 300 * ts_val + ext;
- unsigned rem = (unsigned)(cr % SCRHZ);
+ guint rem = (guint)(cr % SCRHZ);
mpeg->now.secs
= mpeg->t0 + (time_t)(cr / SCRHZ);
mpeg->now.nsecs
diff --git a/wiretap/visual.c b/wiretap/visual.c
index 1c35a35ad0..33fe043f7d 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -151,7 +151,7 @@ struct visual_read_info
/* Additional information for writing Visual files */
struct visual_write_info
{
- unsigned start_time; /* Capture start time in seconds */
+ guint 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 */
@@ -702,7 +702,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
struct visual_write_info * visual = (struct visual_write_info *)wdh->priv;
struct visual_pkt_hdr vpkt_hdr;
size_t hdr_size = sizeof vpkt_hdr;
- unsigned delta_msec;
+ guint delta_msec;
guint32 packet_status;
/* If the visual structure was never allocated then nothing useful