aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-18 19:47:33 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-18 19:47:33 +0000
commit434aae5245f83f69bf3eb49ad34966c442117385 (patch)
treec019f96e779796615f7384e37d2dd01256216925
parenta4cb525bad04b057528d1035da74718a831e7b8a (diff)
From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48396
-rw-r--r--epan/dissectors/packet-bat.c26
-rw-r--r--epan/dissectors/packet-bthci_acl.c26
-rw-r--r--epan/dissectors/packet-btobex.c26
-rw-r--r--epan/dissectors/packet-h223.c26
-rw-r--r--epan/dissectors/packet-iso7816.c16
-rw-r--r--ui/export_object_smb.c26
6 files changed, 73 insertions, 73 deletions
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c
index 7fdca98d2b..ba3f0b2f3d 100644
--- a/epan/dissectors/packet-bat.c
+++ b/epan/dissectors/packet-bat.c
@@ -240,7 +240,7 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo,
tvbuff_t *next_tvb;
- batman_packeth = ep_alloc(sizeof(struct batman_packet_v5));
+ batman_packeth = ep_new(struct batman_packet_v5);
batman_packeth->version = tvb_get_guint8(tvb, offset+0);
batman_packeth->flags = tvb_get_guint8(tvb, offset+1);
@@ -267,7 +267,7 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (PTREE_DATA(tree)->visible) {
ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE,
"B.A.T.M.A.N., Orig: %s (%s)",
- get_hostname(orig), ip_to_str(batman_packeth->orig.data));
+ get_hostname(orig), ip_to_str((const guint8 *)batman_packeth->orig.data));
} else {
ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE, ENC_NA);
}
@@ -366,7 +366,7 @@ static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint length_remaining;
int offset = 0;
- gw_packeth = ep_alloc(sizeof(struct gw_packet));
+ gw_packeth = ep_new(struct gw_packet);
gw_packeth->type = tvb_get_guint8(tvb, 0);
switch (gw_packeth->type) {
@@ -467,7 +467,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
guint length_remaining, i;
int offset = 0;
- vis_packeth = ep_alloc(sizeof(struct vis_packet_v22));
+ vis_packeth = ep_new(struct vis_packet_v22);
sender_ip_addr = tvb_get_ptr(tvb, 0, 4);
sender_ip = tvb_get_ipv4(tvb, 0);
@@ -481,7 +481,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
- get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
+ get_hostname(sender_ip), ip_to_str((const guint8 *)vis_packeth->sender_ip.data));
/* Set tree info */
if (tree) {
@@ -490,7 +490,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (PTREE_DATA(tree)->visible) {
ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V22_SIZE,
"B.A.T.M.A.N. Vis, Src: %s (%s)",
- get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
+ get_hostname(sender_ip), ip_to_str((const guint8 *)vis_packeth->sender_ip.data));
} else {
ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V22_SIZE, ENC_NA);
}
@@ -549,7 +549,7 @@ static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
const guint8 *ip_addr;
guint32 ip;
- vis_datah = ep_alloc(sizeof(struct vis_data_v22));
+ vis_datah = ep_new(struct vis_data_v22);
vis_datah->type = tvb_get_guint8(tvb, 0);
vis_datah->data = tvb_get_ntohs(tvb, 1);
ip_addr = tvb_get_ptr(tvb, 3, 4);
@@ -566,7 +566,7 @@ static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7,
"VIS Entry: [%s] %s (%s)",
val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"),
- get_hostname(ip), ip_to_str(vis_datah->ip.data));
+ get_hostname(ip), ip_to_str((const guint8 *)vis_datah->ip.data));
} else {
ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, 0, 7, ENC_NA);
}
@@ -600,7 +600,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
guint length_remaining, i;
int offset = 0;
- vis_packeth = ep_alloc(sizeof(struct vis_packet_v23));
+ vis_packeth = ep_new(struct vis_packet_v23);
sender_ip_addr = tvb_get_ptr(tvb, 0, 4);
sender_ip = tvb_get_ipv4(tvb, 0);
@@ -614,7 +614,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
/* Set info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s (%s)",
- get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
+ get_hostname(sender_ip), ip_to_str((const guint8 *)vis_packeth->sender_ip.data));
/* Set tree info */
if (tree) {
@@ -623,7 +623,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (PTREE_DATA(tree)->visible) {
ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V23_SIZE,
"B.A.T.M.A.N. Vis, Src: %s (%s)",
- get_hostname(sender_ip), ip_to_str(vis_packeth->sender_ip.data));
+ get_hostname(sender_ip), ip_to_str((const guint8 *)vis_packeth->sender_ip.data));
} else {
ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, 0, VIS_PACKET_V23_SIZE, ENC_NA);
}
@@ -682,7 +682,7 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
const guint8 *ip_addr;
guint32 ip;
- vis_datah = ep_alloc(sizeof(struct vis_data_v23));
+ vis_datah = ep_new(struct vis_data_v23);
vis_datah->type = tvb_get_guint8(tvb, 0);
vis_datah->data = tvb_get_guint8(tvb, 1);
ip_addr = tvb_get_ptr(tvb, 2, 4);
@@ -699,7 +699,7 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7,
"VIS Entry: [%s] %s (%s)",
val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"),
- get_hostname(ip), ip_to_str(vis_datah->ip.data));
+ get_hostname(ip), ip_to_str((const guint8 *)vis_datah->ip.data));
} else {
ti = proto_tree_add_item(tree, proto_bat_plugin, tvb, 0, 7, ENC_NA);
}
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index e405307201..ee1fc0963b 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -132,7 +132,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
hci_data = (hci_data_t *) pinfo->private_data;
- acl_data = ep_alloc(sizeof(bthci_acl_data_t));
+ acl_data = ep_new(bthci_acl_data_t);
acl_data->interface_id = hci_data->interface_id;
acl_data->adapter_id = hci_data->adapter_id;
@@ -158,7 +158,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[4].key = NULL;
/* remote bdaddr and name */
- remote_bdaddr = se_tree_lookup32_array_le(hci_data->chandle_to_bdaddr_table, key);
+ remote_bdaddr = (remote_bdaddr_t *)se_tree_lookup32_array_le(hci_data->chandle_to_bdaddr_table, key);
if (remote_bdaddr && remote_bdaddr->interface_id == hci_data->interface_id &&
remote_bdaddr->adapter_id == hci_data->adapter_id &&
remote_bdaddr->chandle == (flags & 0x0fff)) {
@@ -188,7 +188,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[3].length = 0;
key[3].key = NULL;
- device_name = se_tree_lookup32_array_le(hci_data->bdaddr_to_name_table, key);
+ device_name = (device_name_t *)se_tree_lookup32_array_le(hci_data->bdaddr_to_name_table, key);
if (device_name && device_name->bd_addr_oui == bd_addr_oui && device_name->bd_addr_id == bd_addr_id)
remote_name = device_name->name;
else
@@ -196,7 +196,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
remote_ether_addr = get_ether_name(remote_bdaddr->bd_addr);
remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1);
- remote_addr_name = wmem_alloc(pinfo->pool, remote_length);
+ remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length);
g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name);
@@ -236,14 +236,14 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[3].key = NULL;
- localhost_bdaddr_entry = se_tree_lookup32_array_le(hci_data->localhost_bdaddr, key);
+ localhost_bdaddr_entry = (localhost_bdaddr_entry_t *)se_tree_lookup32_array_le(hci_data->localhost_bdaddr, key);
if (localhost_bdaddr_entry && localhost_bdaddr_entry->interface_id == hci_data->interface_id &&
localhost_bdaddr_entry->adapter_id == hci_data->adapter_id)
localhost_ether_addr = get_ether_name(localhost_bdaddr_entry->bd_addr);
else
localhost_ether_addr = "localhost";
- localhost_name_entry = se_tree_lookup32_array_le(hci_data->localhost_name, key);
+ localhost_name_entry = (localhost_name_entry_t *)se_tree_lookup32_array_le(hci_data->localhost_name, key);
if (localhost_name_entry && localhost_name_entry->interface_id == hci_data->interface_id &&
localhost_name_entry->adapter_id == hci_data->adapter_id)
localhost_name = localhost_name_entry->name;
@@ -251,7 +251,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
localhost_name = "";
localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1);
- localhost_addr_name = wmem_alloc(pinfo->pool, localhost_length);
+ localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length);
g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name);
@@ -282,7 +282,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[4].length = 0;
key[4].key = NULL;
- chandle_data = se_tree_lookup32_array_le(chandle_tree, key);
+ chandle_data = (chandle_data_t *)se_tree_lookup32_array_le(chandle_tree, key);
if (!(chandle_data && chandle_data->interface_id == hci_data->interface_id &&
chandle_data->adapter_id == hci_data->adapter_id &&
chandle_data->chandle == (flags & 0x0fff))) {
@@ -302,7 +302,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[4].length = 0;
key[4].key = NULL;
- chandle_data = se_alloc(sizeof(chandle_data_t));
+ chandle_data = (chandle_data_t *)se_alloc(sizeof(chandle_data_t));
chandle_data->start_fragments = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "bthci_acl fragment starts");
chandle_data->interface_id = hci_data->interface_id;
chandle_data->adapter_id = hci_data->adapter_id;
@@ -349,11 +349,11 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!(pb_flag & 0x01)) { /* first fragment */
if (!pinfo->fd->flags.visited) {
- mfp = se_alloc(sizeof(multi_fragment_pdu_t));
+ mfp = se_new(multi_fragment_pdu_t);
mfp->first_frame = pinfo->fd->num;
mfp->last_frame = 0;
mfp->tot_len = l2cap_length + 4;
- mfp->reassembled = se_alloc(mfp->tot_len);
+ mfp->reassembled = (char *)se_alloc(mfp->tot_len);
len = tvb_length_remaining(tvb, offset);
if (len <= mfp->tot_len) {
tvb_memcpy(tvb, (guint8 *) mfp->reassembled, offset, len);
@@ -361,7 +361,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
se_tree_insert32(chandle_data->start_fragments, pinfo->fd->num, mfp);
}
} else {
- mfp = se_tree_lookup32(chandle_data->start_fragments, pinfo->fd->num);
+ mfp = (multi_fragment_pdu_t *)se_tree_lookup32(chandle_data->start_fragments, pinfo->fd->num);
}
if (mfp != NULL && mfp->last_frame) {
proto_item *item;
@@ -372,7 +372,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if (pb_flag == 0x01) { /* continuation fragment */
- mfp = se_tree_lookup32_le(chandle_data->start_fragments, pinfo->fd->num);
+ mfp = (multi_fragment_pdu_t *)se_tree_lookup32_le(chandle_data->start_fragments, pinfo->fd->num);
if (!pinfo->fd->flags.visited) {
len = tvb_length_remaining(tvb, offset);
if (mfp != NULL && !mfp->last_frame && (mfp->tot_len >= mfp->cur_off + len)) {
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c
index 582c50e8d0..a2aa907e02 100644
--- a/epan/dissectors/packet-btobex.c
+++ b/epan/dissectors/packet-btobex.c
@@ -593,7 +593,7 @@ display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, char **data)
* Allocate a buffer for the string; "len" is the length in
* bytes, not the length in characters.
*/
- str = ep_alloc(len/2);
+ str = (char *)ep_alloc(len/2);
/* - this assumes the string is just ISO 8859-1 */
charoffset = offset;
@@ -1163,7 +1163,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
if (is_obex_over_l2cap) {
btl2cap_data_t *l2cap_data;
- l2cap_data = pinfo->private_data;
+ l2cap_data = (btl2cap_data_t *)pinfo->private_data;
interface_id = l2cap_data->interface_id;
adapter_id = l2cap_data->adapter_id;
chandle = l2cap_data->chandle;
@@ -1171,7 +1171,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
} else {
btrfcomm_data_t *rfcomm_data;
- rfcomm_data = pinfo->private_data;
+ rfcomm_data = (btrfcomm_data_t *)pinfo->private_data;
interface_id = rfcomm_data->interface_id;
adapter_id = rfcomm_data->adapter_id;
chandle = rfcomm_data->chandle;
@@ -1197,7 +1197,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
key[5].length = 0;
key[5].key = NULL;
- obex_profile_data = se_alloc(sizeof(obex_profile_data_t));
+ obex_profile_data = se_new(obex_profile_data_t);
obex_profile_data->interface_id = interface_id;
obex_profile_data->adapter_id = adapter_id;
obex_profile_data->chandle = chandle;
@@ -1279,7 +1279,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (is_obex_over_l2cap) {
btl2cap_data_t *l2cap_data;
- l2cap_data = pinfo->private_data;
+ l2cap_data = (btl2cap_data_t *)pinfo->private_data;
interface_id = l2cap_data->interface_id;
adapter_id = l2cap_data->adapter_id;
chandle = l2cap_data->chandle;
@@ -1287,7 +1287,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
btrfcomm_data_t *rfcomm_data;
- rfcomm_data = pinfo->private_data;
+ rfcomm_data = (btrfcomm_data_t *)pinfo->private_data;
interface_id = rfcomm_data->interface_id;
adapter_id = rfcomm_data->adapter_id;
chandle = rfcomm_data->chandle;
@@ -1313,7 +1313,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[5].length = 0;
key[5].key = NULL;
- obex_profile_data = se_tree_lookup32_array_le(obex_profile, key);
+ obex_profile_data = (obex_profile_data_t *)se_tree_lookup32_array_le(obex_profile, key);
if (obex_profile_data && obex_profile_data->interface_id == interface_id &&
obex_profile_data->adapter_id == adapter_id &&
obex_profile_data->chandle == chandle &&
@@ -1414,7 +1414,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (is_obex_over_l2cap) {
btl2cap_data_t *l2cap_data;
- l2cap_data = pinfo->private_data;
+ l2cap_data = (btl2cap_data_t *)pinfo->private_data;
interface_id = l2cap_data->interface_id;
adapter_id = l2cap_data->adapter_id;
chandle = l2cap_data->chandle;
@@ -1422,7 +1422,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
btrfcomm_data_t *rfcomm_data;
- rfcomm_data = pinfo->private_data;
+ rfcomm_data = (btrfcomm_data_t *)pinfo->private_data;
interface_id = rfcomm_data->interface_id;
adapter_id = rfcomm_data->adapter_id;
chandle = rfcomm_data->chandle;
@@ -1451,7 +1451,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[6].length = 0;
key[6].key = NULL;
- obex_last_opcode_data = se_alloc(sizeof(obex_last_opcode_data_t));
+ obex_last_opcode_data = se_new(obex_last_opcode_data_t);
obex_last_opcode_data->interface_id = interface_id;
obex_last_opcode_data->adapter_id = adapter_id;
obex_last_opcode_data->chandle = chandle;
@@ -1508,7 +1508,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (is_obex_over_l2cap) {
btl2cap_data_t *l2cap_data;
- l2cap_data = pinfo->private_data;
+ l2cap_data = (btl2cap_data_t *)pinfo->private_data;
interface_id = l2cap_data->interface_id;
adapter_id = l2cap_data->adapter_id;
chandle = l2cap_data->chandle;
@@ -1516,7 +1516,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
btrfcomm_data_t *rfcomm_data;
- rfcomm_data = pinfo->private_data;
+ rfcomm_data = (btrfcomm_data_t *)pinfo->private_data;
interface_id = rfcomm_data->interface_id;
adapter_id = rfcomm_data->adapter_id;
chandle = rfcomm_data->chandle;
@@ -1545,7 +1545,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[6].length = 0;
key[6].key = NULL;
- obex_last_opcode_data = se_tree_lookup32_array_le(obex_last_opcode, key);
+ obex_last_opcode_data = (obex_last_opcode_data_t *)se_tree_lookup32_array_le(obex_last_opcode, key);
if (obex_last_opcode_data && obex_last_opcode_data->interface_id == interface_id &&
obex_last_opcode_data->adapter_id == adapter_id &&
obex_last_opcode_data->chandle == chandle &&
diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c
index 330cdefeb0..cfa197a165 100644
--- a/epan/dissectors/packet-h223.c
+++ b/epan/dissectors/packet-h223.c
@@ -209,7 +209,7 @@ circuit_chain_lookup(const h223_call_info* call_info, guint32 child_vc)
key.vc = child_vc;
circuit_id = GPOINTER_TO_UINT(g_hash_table_lookup( circuit_chain_hashtable, &key ));
if( circuit_id == 0 ) {
- new_key = se_alloc(sizeof(circuit_chain_key));
+ new_key = se_new(circuit_chain_key);
*new_key = key;
circuit_id = ++circuit_chain_count;
g_hash_table_insert(circuit_chain_hashtable, new_key, GUINT_TO_POINTER(circuit_id));
@@ -292,7 +292,7 @@ add_h223_mux_element(h223_call_direction_data *direct, guint8 mc, h223_mux_eleme
DISSECTOR_ASSERT(mc < 16);
- li = se_alloc(sizeof(h223_mux_element_listitem));
+ li = se_new(h223_mux_element_listitem);
old_li_ptr = &(direct->mux_table[mc]);
old_li = *old_li_ptr;
if( !old_li ) {
@@ -339,7 +339,7 @@ find_h223_mux_element(h223_call_direction_data* direct, guint8 mc, guint32 frame
static void
add_h223_lc_params(h223_vc_info* vc_info, int direction, h223_lc_params *lc_params, guint32 framenum )
{
- h223_lc_params_listitem *li = se_alloc(sizeof(h223_lc_params_listitem));
+ h223_lc_params_listitem *li = se_new(h223_lc_params_listitem);
h223_lc_params_listitem **old_li_ptr = &(vc_info->lc_params[direction ? 0 : 1]);
h223_lc_params_listitem *old_li = *old_li_ptr;
if( !old_li ) {
@@ -386,7 +386,7 @@ init_direction_data(h223_call_direction_data *direct)
direct->mux_table[i] = NULL;
/* set up MC 0 to contain just VC 0 */
- mc0_element = se_alloc(sizeof(h223_mux_element));
+ mc0_element = se_new(h223_mux_element);
add_h223_mux_element( direct, 0, mc0_element, 0 );
mc0_element->sublist = NULL;
mc0_element->vc = 0;
@@ -397,7 +397,7 @@ init_direction_data(h223_call_direction_data *direct)
static h223_vc_info*
h223_vc_info_new( h223_call_info* call_info )
{
- h223_vc_info *vc_info = se_alloc(sizeof(h223_vc_info));
+ h223_vc_info *vc_info = se_new(h223_vc_info);
vc_info->lc_params[0] = vc_info->lc_params[1] = NULL;
vc_info->call_info = call_info;
return vc_info;
@@ -419,7 +419,7 @@ init_logical_channel( guint32 start_frame, h223_call_info* call_info, int vc, in
vc_info = h223_vc_info_new( call_info );
circuit_add_proto_data( subcircuit, proto_h223, vc_info );
} else {
- vc_info = circuit_get_proto_data( subcircuit, proto_h223 );
+ vc_info = (h223_vc_info *)circuit_get_proto_data( subcircuit, proto_h223 );
}
add_h223_lc_params( vc_info, direction, params, start_frame );
}
@@ -431,7 +431,7 @@ create_call_info( guint32 start_frame )
h223_call_info *datax;
h223_lc_params *vc0_params;
- datax = se_alloc(sizeof(h223_call_info));
+ datax = se_new(h223_call_info);
/* initialise the call info */
init_direction_data(&datax -> direction_data[0]);
@@ -440,7 +440,7 @@ create_call_info( guint32 start_frame )
/* FIXME shouldn't this be figured out dynamically? */
datax -> h223_level = 2;
- vc0_params = se_alloc(sizeof(h223_lc_params));
+ vc0_params = se_new(h223_lc_params);
vc0_params->al_type = al1Framed;
vc0_params->al_params = NULL;
vc0_params->segmentable = TRUE;
@@ -580,7 +580,7 @@ h223_set_mc( packet_info* pinfo, guint8 mc, h223_mux_element* me )
/* if this h245 pdu packet came from an h223 circuit, add the details on
* the new mux entry */
if(circ) {
- vc_info = circuit_get_proto_data(circ, proto_h223);
+ vc_info = (h223_vc_info *)circuit_get_proto_data(circ, proto_h223);
add_h223_mux_element( &(vc_info->call_info->direction_data[pinfo->p2p_dir ? 0 : 1]), mc, me, pinfo->fd->num );
}
}
@@ -595,7 +595,7 @@ h223_add_lc( packet_info* pinfo, guint16 lc, h223_lc_params* params )
/* if this h245 pdu packet came from an h223 circuit, add the details on
* the new channel */
if(circ) {
- vc_info = circuit_get_proto_data(circ, proto_h223);
+ vc_info = (h223_vc_info *)circuit_get_proto_data(circ, proto_h223);
init_logical_channel( pinfo->fd->num, vc_info->call_info, lc, pinfo->p2p_dir, params );
}
}
@@ -767,7 +767,7 @@ dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo,
g_message( "Frame %d: Subcircuit id %d not found for call %p VC %d", pinfo->fd->num,
pinfo->circuit_id, (void *)call_info, vc );
} else {
- vc_info = circuit_get_proto_data(subcircuit, proto_h223);
+ vc_info = (h223_vc_info *)circuit_get_proto_data(subcircuit, proto_h223);
if( vc_info != NULL ) {
lc_params = find_h223_lc_params( vc_info, pinfo->p2p_dir, pinfo->fd->num );
}
@@ -818,7 +818,7 @@ dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo,
/* restore the original circuit details for future PDUs */
FINALLY {
- pinfo->ctype=orig_ctype;
+ pinfo->ctype=(circuit_type)orig_ctype;
pinfo->circuit_id=orig_circuit;
}
ENDTRY;
@@ -1369,7 +1369,7 @@ dissect_h223_bitswapped (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint i;
len = tvb_length(tvb);
- datax = g_malloc(len);
+ datax = (guint8 *)g_malloc(len);
for( i=0; i<len; i++)
datax[i]=BIT_SWAP(tvb_get_guint8(tvb,i));
diff --git a/epan/dissectors/packet-iso7816.c b/epan/dissectors/packet-iso7816.c
index a40e52d866..c707f01878 100644
--- a/epan/dissectors/packet-iso7816.c
+++ b/epan/dissectors/packet-iso7816.c
@@ -343,7 +343,7 @@ dissect_iso7816_class(tvbuff_t *tvb, gint offset,
gint ret_fct = 1;
proto_item *class_item;
proto_tree *class_tree;
- guint8 class;
+ guint8 dev_class;
proto_item *enc_item;
guint8 channel;
proto_item *ch_item;
@@ -352,34 +352,34 @@ dissect_iso7816_class(tvbuff_t *tvb, gint offset,
tvb, offset, 1, ENC_BIG_ENDIAN);
class_tree = proto_item_add_subtree(class_item, ett_iso7816_class);
- class = tvb_get_guint8(tvb, offset);
+ dev_class = tvb_get_guint8(tvb, offset);
- if (class>=0x10 && class<=0x7F) {
+ if (dev_class>=0x10 && dev_class<=0x7F) {
enc_item = proto_tree_add_text(class_tree,
tvb, offset, 1, "reserved for future use");
}
- else if (class>=0xD0 && class<=0xFE) {
+ else if (dev_class>=0xD0 && dev_class<=0xFE) {
enc_item = proto_tree_add_text(class_tree,
tvb, offset, 1, "proprietary structure and coding");
ret_fct = -1;
}
- else if (class==0xFF) {
+ else if (dev_class==0xFF) {
enc_item = proto_tree_add_text(class_tree,
tvb, offset, 1, "reserved for Protocol Type Selection");
}
else {
enc_item = proto_tree_add_text(class_tree, tvb, offset, 1,
"structure and coding according to ISO/IEC 7816");
- if (class>=0xA0 && class<=0xAF) {
+ if (dev_class>=0xA0 && dev_class<=0xAF) {
proto_item_append_text(enc_item,
" unless specified otherwise by the application context");
}
- if (class<=0x0F || (class>=0x80 && class<=0xAF)) {
+ if (dev_class<=0x0F || (dev_class>=0x80 && dev_class<=0xAF)) {
proto_tree_add_item(class_tree, hf_iso7816_cla_sm,
tvb, offset, 1, ENC_BIG_ENDIAN);
- channel = class & 0x03;
+ channel = dev_class & 0x03;
ch_item = proto_tree_add_item(class_tree, hf_iso7816_cla_channel,
tvb, offset, 1, ENC_BIG_ENDIAN);
if (channel==0)
diff --git a/ui/export_object_smb.c b/ui/export_object_smb.c
index 2e15795a47..bd2752db8c 100644
--- a/ui/export_object_smb.c
+++ b/ui/export_object_smb.c
@@ -129,7 +129,7 @@ gpointer dest_memory_addr;
if ((file->data_gathered == 0) && (nfreechunks == 0)) {
/* If this is the first entry for this file, we first
create an initial free chunk */
- new_free_chunk = g_malloc(sizeof(free_chunk));
+ new_free_chunk = (free_chunk *)g_malloc(sizeof(free_chunk));
new_free_chunk->start_offset = 0;
new_free_chunk->end_offset = MAX(file->file_length, chunk_end_offset+1) - 1;
file->free_chunk_list = NULL;
@@ -137,7 +137,7 @@ gpointer dest_memory_addr;
nfreechunks += 1;
} else {
if (chunk_end_offset > file->file_length-1) {
- new_free_chunk = g_malloc(sizeof(free_chunk));
+ new_free_chunk = (free_chunk *)g_malloc(sizeof(free_chunk));
new_free_chunk->start_offset = file->file_length;
new_free_chunk->end_offset = chunk_end_offset;
file->free_chunk_list = g_slist_append(file->free_chunk_list, new_free_chunk);
@@ -148,7 +148,7 @@ gpointer dest_memory_addr;
/* Recalculate each free chunk according with the incoming data chunk */
for (i=0; i<nfreechunks; i++) {
- current_free_chunk = g_slist_nth_data(file->free_chunk_list, i);
+ current_free_chunk = (free_chunk *)g_slist_nth_data(file->free_chunk_list, i);
/* 1. data chunk before the free chunk? */
/* -> free chunk is not altered and no new data gathered */
if (chunk_end_offset<current_free_chunk->start_offset) {
@@ -178,7 +178,7 @@ gpointer dest_memory_addr;
/* 4. data chunk is inside the free chunk */
/* -> free chunk is splitted into two */
if (chunk_offset>current_free_chunk->start_offset && chunk_end_offset<current_free_chunk->end_offset) {
- new_free_chunk = g_malloc(sizeof(free_chunk));
+ new_free_chunk = (free_chunk *)g_malloc(sizeof(free_chunk));
new_free_chunk->start_offset = chunk_end_offset + 1;
new_free_chunk->end_offset = current_free_chunk->end_offset;
current_free_chunk->end_offset = chunk_offset-1;
@@ -214,7 +214,7 @@ gpointer dest_memory_addr;
*/
entry->payload_data = NULL;
} else {
- entry->payload_data = g_try_malloc((gsize)calculated_size);
+ entry->payload_data = (guint8 *)g_try_malloc((gsize)calculated_size);
entry->payload_len = calculated_size;
}
if (!entry->payload_data) {
@@ -246,7 +246,7 @@ gpointer dest_memory_addr;
entry->payload_data = NULL;
entry->payload_len = 0;
} else {
- entry->payload_data = dest_memory_addr;
+ entry->payload_data = (guint8 *)dest_memory_addr;
entry->payload_len = calculated_size;
}
}
@@ -271,7 +271,7 @@ find_incoming_file(GSList *GSL_active_files_p, active_file *incoming_file)
/* We lookup in reverse order because it is more likely that the file
is one of the latest */
for (i=last; i>=0; i--) {
- in_list_file = g_slist_nth_data(GSL_active_files_p, i);
+ in_list_file = (active_file *)g_slist_nth_data(GSL_active_files_p, i);
/* The best-working criteria of two identical files is that the file
that is the same of the file that we are analyzing is the last one
in the list that has the same tid and the same fid */
@@ -292,8 +292,8 @@ find_incoming_file(GSList *GSL_active_files_p, active_file *incoming_file)
gboolean
eo_smb_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data)
{
-export_object_list_t *object_list = tapdata;
-const smb_eo_t *eo_info = data;
+export_object_list_t *object_list = (export_object_list_t *)tapdata;
+const smb_eo_t *eo_info = (const smb_eo_t *)data;
export_object_entry_t *entry;
export_object_entry_t *current_entry;
@@ -354,10 +354,10 @@ gchar *aux_smb_fid_type_string;
if (active_row == -1) { /* This is a new-tracked file */
/* Construct the entry in the list of active files */
- entry = g_malloc(sizeof(export_object_entry_t));
+ entry = (export_object_entry_t *)g_malloc(sizeof(export_object_entry_t));
entry->payload_data = NULL;
entry->payload_len = 0;
- new_file = g_malloc(sizeof(active_file));
+ new_file = (active_file *)g_malloc(sizeof(active_file));
new_file->tid = incoming_file.tid;
new_file->uid = incoming_file.uid;
new_file->fid = incoming_file.fid;
@@ -403,7 +403,7 @@ gchar *aux_smb_fid_type_string;
GSL_active_files = g_slist_append(GSL_active_files, new_file);
}
else if (is_supported_filetype) {
- current_file = g_slist_nth_data(GSL_active_files, active_row);
+ current_file = (active_file *)g_slist_nth_data(GSL_active_files, active_row);
/* Recalculate the current file flags */
current_file->flag_contains = current_file->flag_contains|contains;
current_entry = object_list_get_entry(object_list, active_row);
@@ -448,7 +448,7 @@ active_file *in_list_file;
last = g_slist_length(GSL_active_files);
if (GSL_active_files) {
for (i=last-1; i>=0; i--) {
- in_list_file = g_slist_nth_data(GSL_active_files, i);
+ in_list_file = (active_file *)g_slist_nth_data(GSL_active_files, i);
if (in_list_file->free_chunk_list) {
g_slist_free(in_list_file->free_chunk_list);
in_list_file->free_chunk_list = NULL;