Use explicit casts.

svn path=/trunk/; revision=48048
This commit is contained in:
Anders Broman 2013-03-04 07:25:57 +00:00
parent 67d195080b
commit e12ac388b0
3 changed files with 19 additions and 19 deletions

View File

@ -1287,7 +1287,7 @@ looks_like_valid_sccp(guint32 frame_num _U_, tvbuff_t *tvb, guint8 my_mtp3_stand
static sccp_assoc_info_t *
new_assoc(guint32 calling, guint32 called)
{
sccp_assoc_info_t *a = se_alloc0(sizeof(sccp_assoc_info_t));
sccp_assoc_info_t *a = se_new0(sccp_assoc_info_t);
a->id = next_assoc_id++;
a->calling_dpc = calling;
@ -1336,7 +1336,7 @@ get_sccp_assoc(packet_info *pinfo, guint offset, guint32 src_lr, guint32 dst_lr,
{0, NULL}
};
if (! ( assoc = se_tree_lookup32_array(assocs,bw_key) ) && ! PINFO_FD_VISITED(pinfo) ) {
if (! ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs,bw_key) ) && ! PINFO_FD_VISITED(pinfo) ) {
assoc = new_assoc(opck, dpck);
se_tree_insert32_array(assocs, bw_key, assoc);
assoc->has_bw_key = TRUE;
@ -1355,11 +1355,11 @@ get_sccp_assoc(packet_info *pinfo, guint offset, guint32 src_lr, guint32 dst_lr,
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
if ( ( assoc = se_tree_lookup32_array(assocs, bw_key) ) ) {
if ( ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) ) {
goto got_assoc;
}
if ( (assoc = se_tree_lookup32_array(assocs, fw_key) ) ) {
if ( (assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, fw_key) ) ) {
goto got_assoc;
}
@ -1389,11 +1389,11 @@ get_sccp_assoc(packet_info *pinfo, guint offset, guint32 src_lr, guint32 dst_lr,
emem_tree_key_t fw_key[] = {
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
if ( ( assoc = se_tree_lookup32_array(assocs, bw_key) ) ) {
if ( ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) ) {
goto got_assoc_rlc;
}
if ( (assoc = se_tree_lookup32_array(assocs, fw_key) ) ) {
if ( (assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, fw_key) ) ) {
goto got_assoc_rlc;
}
@ -1420,7 +1420,7 @@ get_sccp_assoc(packet_info *pinfo, guint offset, guint32 src_lr, guint32 dst_lr,
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
assoc = se_tree_lookup32_array(assocs, key);
assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, key);
if (assoc) {
if (assoc->calling_dpc == dpck) {
@ -1545,7 +1545,7 @@ dissect_sccp_gt_address_information(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *digits_tree;
char *gt_digits;
gt_digits = ep_alloc0(GT_MAX_SIGNALS+1);
gt_digits = (char *)ep_alloc0(GT_MAX_SIGNALS+1);
while (offset < length) {
odd_signal = tvb_get_guint8(tvb, offset) & GT_ODD_SIGNAL_MASK;
@ -2662,7 +2662,7 @@ dissect_sccp_optional_parameters(tvbuff_t *tvb, packet_info *pinfo,
static sccp_msg_info_t *
new_ud_msg(packet_info *pinfo, guint32 msg_type _U_)
{
sccp_msg_info_t *m = ep_alloc0(sizeof(sccp_msg_info_t));
sccp_msg_info_t *m = ep_new0(sccp_msg_info_t);
m->framenum = PINFO_FD_NUM(pinfo);
m->data.ud.calling_gt = NULL;
m->data.ud.called_gt = NULL;
@ -3415,7 +3415,7 @@ static struct _sccp_ul {
static void
sccp_users_update_cb(void *r, const char **err _U_)
{
sccp_user_t *u = r;
sccp_user_t *u = (sccp_user_t *)r;
struct _sccp_ul *c;
for (c=user_list; c->handlep; c++) {
@ -3433,8 +3433,8 @@ sccp_users_update_cb(void *r, const char **err _U_)
static void *
sccp_users_copy_cb(void *n, const void *o, size_t siz _U_)
{
const sccp_user_t *u = o;
sccp_user_t *un = n;
const sccp_user_t *u = (const sccp_user_t *)o;
sccp_user_t *un = (sccp_user_t *)n;
un->ni = u->ni;
un->user = u->user;
@ -3452,7 +3452,7 @@ sccp_users_copy_cb(void *n, const void *o, size_t siz _U_)
static void
sccp_users_free_cb(void *r)
{
sccp_user_t *u = r;
sccp_user_t *u = (sccp_user_t *)r;
if (u->called_pc) g_free(u->called_pc);
if (u->called_ssn) g_free(u->called_ssn);
}

View File

@ -450,9 +450,9 @@ wcp_window_t *get_wcp_window_ptr( packet_info *pinfo){
circuit = circuit_new( pinfo->ctype, pinfo->circuit_id,
pinfo->fd->num);
}
wcp_circuit_data = circuit_get_proto_data(circuit, proto_wcp);
wcp_circuit_data = (wcp_circuit_data_t *)circuit_get_proto_data(circuit, proto_wcp);
if ( !wcp_circuit_data){
wcp_circuit_data = se_alloc(sizeof(wcp_circuit_data_t));
wcp_circuit_data = se_new(wcp_circuit_data_t);
wcp_circuit_data->recv.buf_cur = wcp_circuit_data->recv.buffer;
wcp_circuit_data->send.buf_cur = wcp_circuit_data->send.buffer;
circuit_add_proto_data(circuit, proto_wcp, wcp_circuit_data);
@ -495,7 +495,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin
return NULL;
}
src = tvb_memcpy(src_tvb, src_buf, offset, cnt - offset);
src = (guint8 *)tvb_memcpy(src_tvb, src_buf, offset, cnt - offset);
dst = buf_ptr->buf_cur;
len = 0;
i = -1;
@ -573,7 +573,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin
if ( pinfo->fd->flags.visited){ /* if not first pass */
/* get uncompressed data */
pdata_ptr = p_get_proto_data( pinfo->fd, proto_wcp);
pdata_ptr = (wcp_pdata_t *)p_get_proto_data( pinfo->fd, proto_wcp);
if ( !pdata_ptr) { /* exit if no data */
REPORT_DISSECTOR_BUG("Can't find uncompressed data");
@ -583,7 +583,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin
} else {
/* save the new data as per packet data */
pdata_ptr = se_alloc(sizeof(wcp_pdata_t));
pdata_ptr = se_new(wcp_pdata_t);
memcpy( &pdata_ptr->buffer, buf_ptr->buf_cur, len);
pdata_ptr->len = len;

View File

@ -126,7 +126,7 @@ tvb_unmasked(tvbuff_t *tvb, const guint offset, guint payload_length, const guin
const guint8 *data_mask;
guint unmasked_length = payload_length > MAX_UNMASKED_LEN ? MAX_UNMASKED_LEN : payload_length;
data_unmask = g_malloc(unmasked_length);
data_unmask = (gchar *)g_malloc(unmasked_length);
data_mask = tvb_get_ptr(tvb, offset, unmasked_length);
/* Unmasked(XOR) Data... */
for(i=0; i < unmasked_length; i++){