aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-06-02 15:32:34 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-06-02 15:32:34 +0000
commitcd7c20c9d965bc9d9131e431d6b530c6087da68b (patch)
tree9396405b6a4fabff1e6b4f6172566e73ee9f3dc3 /wiretap
parent19507efa88a940ea1fd2c770cbf3f5af3ab3e72c (diff)
Try to squelch warnings
svn path=/trunk/; revision=43000
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/erf.c2
-rw-r--r--wiretap/file_wrappers.c10
-rw-r--r--wiretap/k12.c6
-rw-r--r--wiretap/k12text.l2
-rw-r--r--wiretap/ngsniffer.c14
-rw-r--r--wiretap/pppdump.c2
-rw-r--r--wiretap/visual.c10
7 files changed, 23 insertions, 23 deletions
diff --git a/wiretap/erf.c b/wiretap/erf.c
index d4064c2389..f22f781fa8 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -243,7 +243,7 @@ extern int erf_open(wtap *wth, int *err, gchar **err_info)
*/
return 0;
}
- buffer=g_malloc(packet_size);
+ buffer=(gchar *)g_malloc(packet_size);
r = file_read(buffer, packet_size, wth->fh);
g_free(buffer);
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index 0493a8d1e3..96ca7d603f 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -807,8 +807,8 @@ file_fdopen(int fd)
#endif
/* allocate buffers */
- state->in = g_try_malloc(want);
- state->out = g_try_malloc(want << 1);
+ state->in = (unsigned char *)g_try_malloc(want);
+ state->out = (unsigned char *)g_try_malloc(want << 1);
state->size = want;
if (state->in == NULL || state->out == NULL) {
g_free(state->out);
@@ -1225,7 +1225,7 @@ file_gets(char *buf, int len, FILE_T file)
/* look for end-of-line in current output buffer */
n = file->have > left ? left : file->have;
- eol = memchr(file->next, '\n', n);
+ eol = (unsigned char *)memchr(file->next, '\n', n);
if (eol != NULL)
n = (unsigned)(eol - file->next) + 1;
@@ -1389,8 +1389,8 @@ gz_init(GZWFILE_T state)
z_streamp strm = &(state->strm);
/* allocate input and output buffers */
- state->in = g_try_malloc(state->want);
- state->out = g_try_malloc(state->want);
+ state->in = (unsigned char *)g_try_malloc(state->want);
+ state->out = (unsigned char *)g_try_malloc(state->want);
if (state->in == NULL || state->out == NULL) {
g_free(state->out);
g_free(state->in);
diff --git a/wiretap/k12.c b/wiretap/k12.c
index 6a55f75d55..c8d579039f 100644
--- a/wiretap/k12.c
+++ b/wiretap/k12.c
@@ -796,8 +796,8 @@ int k12_open(wtap *wth, int *err, gchar **err_info) {
Obviously not, as a corrupt file could contain anything
here; the Tektronix document says the strings "must end
with \0", but a bad file could fail to add the \0. */
- rec->input_name = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len, name_len);
- rec->stack_file = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len + name_len, stack_len);
+ rec->input_name = (gchar *)g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len, name_len);
+ rec->stack_file = (gchar *)g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len + name_len, stack_len);
ascii_strdown_inplace (rec->stack_file);
@@ -999,7 +999,7 @@ static gboolean k12_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
} obj;
if (k12->num_of_records == 0) {
- k12_t* file_data = pseudo_header->k12.stuff;
+ k12_t* file_data = (k12_t*)pseudo_header->k12.stuff;
/* XXX: We'll assume that any fwrite errors in k12_dump_src_setting will */
/* repeat during the final k12_dump_record at the end of k12_dump */
/* (and thus cause an error return from k12_dump). */
diff --git a/wiretap/k12text.l b/wiretap/k12text.l
index 40fdd2f4a9..c9854cc01e 100644
--- a/wiretap/k12text.l
+++ b/wiretap/k12text.l
@@ -394,7 +394,7 @@ k12text_dump(wtap_dumper *wdh _U_, const struct wtap_pkthdr *phdr,
return FALSE;
}
- buf = g_malloc(K12BUF_SIZE);
+ buf = (char *)g_malloc(K12BUF_SIZE);
p = buf;
ms = phdr->ts.nsecs / 1000000;
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 9bd91a51b6..604fd30249 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -2454,9 +2454,9 @@ ng_file_read(void *buffer, unsigned int nbytes, wtap *wth, gboolean is_random,
ngsniffer_t *ngsniffer;
FILE_T infile;
ngsniffer_comp_stream_t *comp_stream;
- unsigned int copybytes = nbytes; /* bytes left to be copied */
- gint64 copied_bytes = 0; /* bytes already copied */
- unsigned char *outbuffer = buffer; /* where to write next decompressed data */
+ unsigned int copybytes = nbytes; /* bytes left to be copied */
+ gint64 copied_bytes = 0; /* bytes already copied */
+ unsigned char *outbuffer = (unsigned char *)buffer; /* where to write next decompressed data */
blob_info_t *blob;
unsigned int bytes_to_copy;
unsigned int bytes_left;
@@ -2529,7 +2529,7 @@ ng_file_read(void *buffer, unsigned int nbytes, wtap *wth, gboolean is_random,
*err = WTAP_ERR_CANT_SEEK;
return -1;
}
- blob = ngsniffer->current_blob->data;
+ blob = (blob_info_t *)ngsniffer->current_blob->data;
} else {
/* If we also have a random stream open, add a new element,
for this blob, to the list of blobs; we know the list is
@@ -2712,7 +2712,7 @@ ng_file_seek_rand(wtap *wth, gint64 offset, int *err, gchar **err_info)
break;
}
- next_blob = next_list->data;
+ next_blob = (blob_info_t *)next_list->data;
/* Does the next blob start after the target offset?
If so, the current blob is the one we want. */
if (next_blob->blob_uncomp_offset > offset)
@@ -2732,7 +2732,7 @@ ng_file_seek_rand(wtap *wth, gint64 offset, int *err, gchar **err_info)
while (new_list) {
/* Does this blob start at or before the target offset?
If so, the current blob is the one we want. */
- new_blob = new_list->data;
+ new_blob = (blob_info_t *)new_list->data;
if (new_blob->blob_uncomp_offset <= offset)
break;
@@ -2745,7 +2745,7 @@ ng_file_seek_rand(wtap *wth, gint64 offset, int *err, gchar **err_info)
if (new_list != NULL) {
/* The place to which we're seeking isn't in the current buffer;
move to a new blob. */
- new_blob = new_list->data;
+ new_blob = (blob_info_t *)new_list->data;
/* Seek in the compressed file to the offset in the compressed file
of the beginning of that blob. */
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index e458876bea..fec2d3bbe2 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -299,7 +299,7 @@ pppdump_open(wtap *wth, int *err, gchar **err_info)
wth->subtype_close = pppdump_close;
wth->tsprecision = WTAP_FILE_TSPREC_DSEC;
- state->seek_state = g_malloc(sizeof(pppdump_t));
+ state->seek_state = g_new(pppdump_t,1);
/* If we have a random stream open, we're going to be reading
the file randomly; set up a GPtrArray of pointers to
diff --git a/wiretap/visual.c b/wiretap/visual.c
index 0b0e0aebb5..797d4dd5ae 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -699,7 +699,7 @@ gboolean visual_dump_open(wtap_dumper *wdh, int *err)
static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
const union wtap_pseudo_header *pseudo_header, const guint8 *pd, int *err)
{
- struct visual_write_info * visual = wdh->priv;
+ 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;
@@ -723,7 +723,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
visual->start_time = (guint32) phdr->ts.secs;
/* Initialize the index table */
- visual->index_table = g_malloc(1024 * sizeof *visual->index_table);
+ visual->index_table = (guint32 *)g_malloc(1024 * sizeof *visual->index_table);
visual->index_table_size = 1024;
}
@@ -793,7 +793,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
{
/* End of table reached. Reallocate with a larger size */
visual->index_table_size *= 2;
- visual->index_table = g_realloc(visual->index_table,
+ visual->index_table = (guint32 *)g_realloc(visual->index_table,
visual->index_table_size * sizeof *visual->index_table);
}
visual->index_table[visual->index_table_index] = htolel(visual->next_offset);
@@ -810,7 +810,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
Returns TRUE on success, FALSE on failure. */
static gboolean visual_dump_close(wtap_dumper *wdh, int *err)
{
- struct visual_write_info * visual = wdh->priv;
+ struct visual_write_info * visual = (struct visual_write_info *)wdh->priv;
size_t n_to_write;
struct visual_file_hdr vfile_hdr;
const char *magicp;
@@ -894,7 +894,7 @@ static gboolean visual_dump_close(wtap_dumper *wdh, int *err)
/* Free the memory allocated by a visual file writer. */
static void visual_dump_free(wtap_dumper *wdh)
{
- struct visual_write_info * visual = wdh->priv;
+ struct visual_write_info * visual = (struct visual_write_info *)wdh->priv;
if (visual)
{