diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index 30d7fe6e38..d419276a50 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -579,13 +579,13 @@ lowpan_context_find(guint8 cid, guint16 pan) /* Lookup the context from the table. */ key.pan = pan; key.cid = cid; - data = g_hash_table_lookup(lowpan_context_table, &key); + data = (lowpan_context_data *)g_hash_table_lookup(lowpan_context_table, &key); if (data) return data; /* If we didn't find a match, try again with the broadcast PAN. */ if (pan != IEEE802154_BCAST_PAN) { key.pan = IEEE802154_BCAST_PAN; - data = g_hash_table_lookup(lowpan_context_table, &key); + data = (lowpan_context_data *)g_hash_table_lookup(lowpan_context_table, &key); if (data) return data; } @@ -625,7 +625,7 @@ lowpan_context_insert(guint8 cid, guint16 pan, guint8 plen, struct e_in6_addr *p key.cid = cid; if (g_hash_table_lookup_extended(lowpan_context_table, &key, &pkey, &pdata)) { /* Context already exists. */ - data = pdata; + data = (lowpan_context_data *)pdata; if ( (data->plen == plen) && (memcmp(&data->prefix, prefix, (plen+7)/8) == 0) ) { /* Context already exists with no change. */ return; @@ -636,7 +636,7 @@ lowpan_context_insert(guint8 cid, guint16 pan, guint8 plen, struct e_in6_addr *p } /* Create a new context */ - data = se_alloc(sizeof(lowpan_context_data)); + data = se_new(lowpan_context_data); data->frame = frame; data->plen = plen; memset(&data->prefix, 0, sizeof(struct e_in6_addr)); /* Ensure zero paddeding */ diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c index cf1e9016c0..fbb170b62e 100644 --- a/epan/dissectors/packet-amqp.c +++ b/epan/dissectors/packet-amqp.c @@ -1867,7 +1867,7 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) conv = find_or_create_conversation(pinfo); conn = (amqp_conv *)conversation_get_proto_data(conv, proto_amqp); if (conn == NULL) { - conn = se_alloc0(sizeof(amqp_conv)); + conn = se_new0(amqp_conv); conversation_add_proto_data(conv, proto_amqp, conn); } check_amqp_version(tvb, conn); diff --git a/epan/dissectors/packet-ancp.c b/epan/dissectors/packet-ancp.c index 946897f667..6e2f9a3036 100644 --- a/epan/dissectors/packet-ancp.c +++ b/epan/dissectors/packet-ancp.c @@ -560,7 +560,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANCP"); col_clear(pinfo->cinfo, COL_INFO); - ancp_info = ep_alloc(sizeof(struct ancp_tap_t)); + ancp_info = ep_new(struct ancp_tap_t); ancp_info->ancp_mtype = 0; ancp_info->ancp_adjcode = 0; diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c index f3dbed4060..ee8fec8616 100644 --- a/epan/dissectors/packet-assa_r3.c +++ b/epan/dissectors/packet-assa_r3.c @@ -5062,7 +5062,7 @@ static void dissect_r3_cmd_response (tvbuff_t *tvb, guint32 start_offset, guint32 length, packet_info *pinfo, proto_tree *tree) { guint8 responseLen = tvb_get_guint8 (tvb, start_offset + 0); - responseType_e responseType = tvb_get_guint8 (tvb, start_offset + 2); + responseType_e responseType = (responseType_e)tvb_get_guint8 (tvb, start_offset + 2); tvbuff_t *payload_tvb = tvb_new_subset (tvb, start_offset, responseLen, responseLen); if (tree) diff --git a/epan/dissectors/packet-auto_rp.c b/epan/dissectors/packet-auto_rp.c index b05cbb08f3..3f7261e145 100644 --- a/epan/dissectors/packet-auto_rp.c +++ b/epan/dissectors/packet-auto_rp.c @@ -179,7 +179,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree) /* sizeof map header + n * sizeof encoded group addresses */ ti = proto_tree_add_text(auto_rp_tree, tvb, offset, 6 + group_count * 6, - "RP %s: %u group%s", ip_to_str((void *)&rp_addr), + "RP %s: %u group%s", ip_to_str((guint8 *)&rp_addr), group_count, plurality(group_count, "", "s")); map_tree = proto_item_add_subtree(ti, ett_auto_rp_map); @@ -200,7 +200,7 @@ static int do_auto_rp_map(tvbuff_t *tvb, int offset, proto_tree *auto_rp_tree) mask_len = tvb_get_guint8(tvb, offset + 1); group_addr = tvb_get_ipv4(tvb, offset + 2); gi = proto_tree_add_text(map_tree, tvb, offset, 6, "Group %s/%u (%s)", - ip_to_str((void *)&group_addr), mask_len, + ip_to_str((guint8 *)&group_addr), mask_len, val_to_str_const(sign&AUTO_RP_SIGN_MASK, auto_rp_mask_sign_vals, "")); grp_tree = proto_item_add_subtree(gi, ett_auto_rp_group); diff --git a/epan/dissectors/packet-beep.c b/epan/dissectors/packet-beep.c index fcbaf92246..5bd40119e3 100644 --- a/epan/dissectors/packet-beep.c +++ b/epan/dissectors/packet-beep.c @@ -867,7 +867,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * elsewhere for other frames */ - beep_frame_data = se_alloc(sizeof(struct beep_proto_data)); + beep_frame_data = se_new(struct beep_proto_data); beep_frame_data->pl_left = pl_left; beep_frame_data->pl_size = 0; diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index ab2f6b122c..4cc2f9f7fc 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -346,10 +346,10 @@ dissect_bencoding_str(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item(tree, hf_bittorrent_bstr, tvb, offset+used, stringlen, ENC_ASCII|ENC_NA); if (treeadd==1) { - proto_item_append_text(ti, " Key: %s", format_text(ep_tvb_memdup(tvb, offset+used, stringlen), stringlen)); + proto_item_append_text(ti, " Key: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen)); } if (treeadd==2) { - proto_item_append_text(ti, " Value: %s", format_text(ep_tvb_memdup(tvb, offset+used, stringlen), stringlen)); + proto_item_append_text(ti, " Value: %s", format_text((guchar *)ep_tvb_memdup(tvb, offset+used, stringlen), stringlen)); } } return used+stringlen; diff --git a/epan/dissectors/packet-dcom-remunkn.c b/epan/dissectors/packet-dcom-remunkn.c index c4e9a36a11..877f54cbe3 100644 --- a/epan/dissectors/packet-dcom-remunkn.c +++ b/epan/dissectors/packet-dcom-remunkn.c @@ -143,7 +143,7 @@ dissect_remunk_remqueryinterface_resp(tvbuff_t *tvb, int offset, e_uuid_t iid; e_uuid_t iid_null = DCERPC_UUID_NULL; dcerpc_info *info = (dcerpc_info *) pinfo->private_data; - remunk_remqueryinterface_call_t *call = info->call_data->private_data; + remunk_remqueryinterface_call_t *call = (remunk_remqueryinterface_call_t *)info->call_data->private_data; guint64 oxid; guint64 oid; e_uuid_t ipid; @@ -185,7 +185,7 @@ dissect_remunk_remqueryinterface_resp(tvbuff_t *tvb, int offset, /* add interface instance to database (we currently only handle IPv4) */ if(pinfo->net_src.type == AT_IPv4) { dcom_interface_new(pinfo, - pinfo->net_src.data, + (guint8 *)pinfo->net_src.data, &iid, oxid, oid, &ipid); } diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index f4976063e7..a47f186259 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -1655,7 +1655,7 @@ static void dmp_add_seq_ack_analysis (tvbuff_t *tvb, packet_info *pinfo, static gchar *dissect_7bit_string (tvbuff_t *tvb, gint offset, gint length) { guchar *encoded = tvb_get_ephemeral_string (tvb, offset, length); - guchar *decoded = ep_alloc0 ((size_t)(length * 1.2) + 1); + guchar *decoded = (guchar *)ep_alloc0 ((size_t)(length * 1.2) + 1); guchar rest = 0, bits = 1; gint len = 0, i; @@ -1725,7 +1725,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, gchar *sic = NULL; key = tvb_get_guint8 (tvb, offset); - sic = ep_alloc (MAX_SIC_LEN); + sic = (gchar *)ep_alloc (MAX_SIC_LEN); if (key <= 0xB6) { /* 2 bytes, single 3-character SIC, characters [A-Z0-9] only */ @@ -4970,7 +4970,7 @@ void proto_register_dmp (void) sizeof(dmp_security_class_t), "dmp_security_classifications", TRUE, - (void*) &dmp_security_classes, + (void**) &dmp_security_classes, &num_dmp_security_classes, UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ "ChDMPSecurityClassifications", diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 5298519aa4..354a75c845 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -830,7 +830,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset, * to put the dissector into a loop. Instead we throw an exception */ maxname=MAXDNAME; - np=ep_alloc(maxname); + np=(guchar *)ep_alloc(maxname); *name=np; maxname--; /* reserve space for the trailing '\0' */ diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 5e2beeaee5..2c31f793cf 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -1426,7 +1426,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ERF_TYPE_COLOR_HDLC_POS: case ERF_TYPE_DSM_COLOR_HDLC_POS: case ERF_TYPE_COLOR_MC_HDLC_POS: - hdlc_type = erf_hdlc_type; + hdlc_type = (erf_hdlc_type_vals)erf_hdlc_type; if (hdlc_type == ERF_HDLC_GUESS) { /* Try to guess the type. */ diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c index 8479b4a4e6..621606bd8f 100644 --- a/epan/dissectors/packet-etsi_card_app_toolkit.c +++ b/epan/dissectors/packet-etsi_card_app_toolkit.c @@ -763,7 +763,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 g8; guint16 tag; guint32 len; - void *ptr = NULL; + guint8 *ptr = NULL; unsigned int i; tag = tvb_get_guint8(tvb, pos++) & 0x7f; diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index e608f942ae..6b754d2236 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -136,8 +136,8 @@ static dissector_handle_t data_handle; static gint fcdns_equal(gconstpointer v, gconstpointer w) { - const fcdns_conv_key_t *v1 = v; - const fcdns_conv_key_t *v2 = w; + const fcdns_conv_key_t *v1 = (const fcdns_conv_key_t *)v; + const fcdns_conv_key_t *v2 = (const fcdns_conv_key_t *)w; return (v1->conv_idx == v2->conv_idx); } @@ -145,7 +145,7 @@ fcdns_equal(gconstpointer v, gconstpointer w) static guint fcdns_hash (gconstpointer v) { - const fcdns_conv_key_t *key = v; + const fcdns_conv_key_t *key = (const fcdns_conv_key_t *)v; guint val; val = key->conv_idx; @@ -1506,10 +1506,10 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_alloc (sizeof(fcdns_conv_key_t)); + req_key = se_new(fcdns_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_alloc (sizeof(fcdns_conv_data_t)); + cdata = se_new(fcdns_conv_data_t); cdata->opcode = opcode; g_hash_table_insert (fcdns_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c index f7b32b6dc4..d3cb2db466 100644 --- a/epan/dissectors/packet-fcfcs.c +++ b/epan/dissectors/packet-fcfcs.c @@ -96,8 +96,8 @@ static dissector_handle_t data_handle; static gint fcfcs_equal(gconstpointer v, gconstpointer w) { - const fcfcs_conv_key_t *v1 = v; - const fcfcs_conv_key_t *v2 = w; + const fcfcs_conv_key_t *v1 = (const fcfcs_conv_key_t *)v; + const fcfcs_conv_key_t *v2 = (const fcfcs_conv_key_t *)w; return (v1->conv_idx == v2->conv_idx); } @@ -105,7 +105,7 @@ fcfcs_equal(gconstpointer v, gconstpointer w) static guint fcfcs_hash (gconstpointer v) { - const fcfcs_conv_key_t *key = v; + const fcfcs_conv_key_t *key = (const fcfcs_conv_key_t *)v; guint val; val = key->conv_idx; @@ -817,10 +817,10 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_alloc (sizeof(fcfcs_conv_key_t)); + req_key = se_new(fcfcs_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_alloc (sizeof(fcfcs_conv_data_t)); + cdata = se_new(fcfcs_conv_data_t); cdata->opcode = opcode; g_hash_table_insert (fcfcs_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c index 73240d8db2..030200134f 100644 --- a/epan/dissectors/packet-fcfzs.c +++ b/epan/dissectors/packet-fcfzs.c @@ -89,8 +89,8 @@ static dissector_handle_t data_handle; static gint fcfzs_equal(gconstpointer v, gconstpointer w) { - const fcfzs_conv_key_t *v1 = v; - const fcfzs_conv_key_t *v2 = w; + const fcfzs_conv_key_t *v1 = (const fcfzs_conv_key_t *)v; + const fcfzs_conv_key_t *v2 = (const fcfzs_conv_key_t *)w; return (v1->conv_idx == v2->conv_idx); } @@ -98,7 +98,7 @@ fcfzs_equal(gconstpointer v, gconstpointer w) static guint fcfzs_hash(gconstpointer v) { - const fcfzs_conv_key_t *key = v; + const fcfzs_conv_key_t *key = (const fcfzs_conv_key_t *)v; guint val; val = key->conv_idx; @@ -657,10 +657,10 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_alloc(sizeof(fcfzs_conv_key_t)); + req_key = se_new(fcfzs_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_alloc(sizeof(fcfzs_conv_data_t)); + cdata = se_new(fcfzs_conv_data_t); cdata->opcode = opcode; g_hash_table_insert(fcfzs_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-ff.c b/epan/dissectors/packet-ff.c index 0cd78ef053..46deb7fe5e 100644 --- a/epan/dissectors/packet-ff.c +++ b/epan/dissectors/packet-ff.c @@ -1822,9 +1822,9 @@ static const true_false_string tfs_do_not_clear_clear = { "Do not clear", "Clear static const true_false_string tfs_confirmed_unconfirmed = { "Confirmed", "Unconfirmed" }; static const char * -val_to_str_err_code(guint8 class, guint8 code) +val_to_str_err_code(guint8 errclass, guint8 code) { - switch (class) { + switch (errclass) { case 1: return (val_to_str_const(code, names_err_code_vfd_state, "Unknown")); diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c index 79f5c88e4a..6d80e7d90b 100644 --- a/epan/dissectors/packet-fix.c +++ b/epan/dissectors/packet-fix.c @@ -317,15 +317,15 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (fix_fields[i].type) { case 1: /* strings */ proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value, - "%s (%s)", value, str_to_str(value, fix_fields[i].table, "unknown %s")); + "%s (%s)", value, str_to_str(value, (string_string *)fix_fields[i].table, "unknown %s")); break; case 2: /* char */ proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value, - "%s (%s)", value, val_to_str(*value, fix_fields[i].table, "unknown %d")); + "%s (%s)", value, val_to_str(*value, (value_string *)fix_fields[i].table, "unknown %d")); break; default: proto_tree_add_string_format_value(fix_tree, fix_fields[i].hf_id, tvb, field_offset, tag->field_len, value, - "%s (%s)", value, val_to_str(atoi(value), fix_fields[i].table, "unknown %d")); + "%s (%s)", value, val_to_str(atoi(value), (value_string *)fix_fields[i].table, "unknown %d")); break; } } diff --git a/epan/dissectors/packet-fmp_notify.c b/epan/dissectors/packet-fmp_notify.c index d59a9c0f36..0cb91e424f 100644 --- a/epan/dissectors/packet-fmp_notify.c +++ b/epan/dissectors/packet-fmp_notify.c @@ -84,7 +84,7 @@ dissect_fmp_notify_status(tvbuff_t *tvb, int offset, proto_tree *tree, int *rval { fmpStat status; - status = tvb_get_ntohl(tvb, offset); + status = (fmpStat)tvb_get_ntohl(tvb, offset); switch (status) { case FMP_OK: @@ -168,7 +168,7 @@ dissect_revokeHandleListReason(tvbuff_t *tvb, int offset, proto_tree *tree) revokeHandleListReason reason; if (tree) { - reason = tvb_get_ntohl(tvb, offset); + reason = (revokeHandleListReason)tvb_get_ntohl(tvb, offset); switch (reason) { case FMP_LIST_USER_QUOTA_EXCEEDED: proto_tree_add_text(tree, tvb, offset, 4, "Reason: %s", diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 749989f8a0..54eadfd934 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -434,7 +434,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } if(pinfo->fd->color_filter != NULL) { - const color_filter_t *color_filter = pinfo->fd->color_filter; + const color_filter_t *color_filter = (const color_filter_t *)pinfo->fd->color_filter; item = proto_tree_add_string(fh_tree, hf_frame_color_filter_name, tvb, 0, 0, color_filter->filter_name); PROTO_ITEM_SET_GENERATED(item); diff --git a/epan/dissectors/packet-fw1.c b/epan/dissectors/packet-fw1.c index af8e7080c8..4b904ab814 100644 --- a/epan/dissectors/packet-fw1.c +++ b/epan/dissectors/packet-fw1.c @@ -157,7 +157,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (fw1_with_uuid) iface_len = 6; - interface_name=ep_alloc(iface_len+1); + interface_name=(char *)ep_alloc(iface_len+1); tvb_get_nstringz0(tvb, 2, iface_len+1, interface_name); /* Known interface name - if not, remember it */ diff --git a/epan/dissectors/packet-gadu-gadu.c b/epan/dissectors/packet-gadu-gadu.c index 3499b6493e..364ad65ee7 100644 --- a/epan/dissectors/packet-gadu-gadu.c +++ b/epan/dissectors/packet-gadu-gadu.c @@ -419,7 +419,7 @@ gadu_gadu_create_conversation(packet_info *pinfo, guint32 uin) struct gadu_gadu_conv_data *gg_conv; conv = find_or_create_conversation(pinfo); - gg_conv = conversation_get_proto_data(conv, proto_gadu_gadu); + gg_conv = (struct gadu_gadu_conv_data *)conversation_get_proto_data(conv, proto_gadu_gadu); if (!gg_conv) { gg_conv = se_new(struct gadu_gadu_conv_data); gg_conv->uin = uin; @@ -437,7 +437,7 @@ gadu_gadu_get_conversation_data(packet_info *pinfo) conv = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); if (conv) - return conversation_get_proto_data(conv, proto_gadu_gadu); + return (struct gadu_gadu_conv_data *)conversation_get_proto_data(conv, proto_gadu_gadu); return NULL; } diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c index d95e592698..f522bd2cb3 100644 --- a/epan/dissectors/packet-gmr1_bcch.c +++ b/epan/dissectors/packet-gmr1_bcch.c @@ -1047,7 +1047,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* SI1 or SI2 */ if (is_si1) { SystemInformation1_t *data; - data = ep_alloc(sizeof(SystemInformation1_t)); + data = ep_new(SystemInformation1_t); csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation1_t), tvb, data, ett_gmr1_bcch); col_append_fstr( pinfo->cinfo, COL_INFO, @@ -1056,7 +1056,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ); } else { SystemInformation2_t *data; - data = ep_alloc(sizeof(SystemInformation2_t)); + data = ep_new(SystemInformation2_t); csnStreamDissector(bcch_tree, &ar, CSNDESCR(SystemInformation2_t), tvb, data, ett_gmr1_bcch); col_append_fstr( pinfo->cinfo, COL_INFO, diff --git a/epan/dissectors/packet-gmr1_dtap.c b/epan/dissectors/packet-gmr1_dtap.c index bd34b2c00a..c1377035ed 100644 --- a/epan/dissectors/packet-gmr1_dtap.c +++ b/epan/dissectors/packet-gmr1_dtap.c @@ -89,7 +89,7 @@ dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Get message parameters */ oct[1] = tvb_get_guint8(tvb, offset); - gmr1_get_msg_params(pd, oct[1], &msg_str, &ett_tree, &hf_idx, &msg_func); + gmr1_get_msg_params((gmr1_pd_e)pd, oct[1], &msg_str, &ett_tree, &hf_idx, &msg_func); /* Create protocol tree */ if (msg_str == NULL) diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index e8405e39e0..a3bf04e8bf 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -2950,7 +2950,7 @@ static guint16 de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint fac_len, gchar *add_string _U_, int string_len _U_) { guint saved_offset; - gint8 class; + gint8 appclass; gboolean pc; gboolean ind = FALSE; guint32 component_len = 0; @@ -2972,7 +2972,7 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, /* Get the length of the component there can be more than one component in a facility message */ - header_end_offset = get_ber_identifier(tvb, offset, &class, &pc, &comp_type_tag); + header_end_offset = get_ber_identifier(tvb, offset, &appclass, &pc, &comp_type_tag); header_end_offset = get_ber_length(tvb, header_end_offset, &component_len, &ind); header_len = header_end_offset - offset; component_len = header_len + component_len; @@ -6615,7 +6615,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP; tap_p->message_type = (nsd ? (oct & 0x3f) : oct); - tap_p->protocol_disc = pd; + tap_p->protocol_disc = (gsm_a_pd_str_e)pd; tap_queue_packet(gsm_a_tap, pinfo, tap_p); diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c index 8acaf6b9d4..158ae80f19 100644 --- a/epan/dissectors/packet-gsm_a_rr.c +++ b/epan/dissectors/packet-gsm_a_rr.c @@ -10626,7 +10626,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tap_p->pdu_type = GSM_A_PDU_TYPE_DTAP; tap_p->message_type = (nsd ? (oct & 0x3f) : oct); - tap_p->protocol_disc = pd; + tap_p->protocol_disc = (gsm_a_pd_str_e)pd; tap_queue_packet(gsm_a_tap, pinfo, tap_p); @@ -10780,7 +10780,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tap_p->pdu_type = GSM_A_PDU_TYPE_SACCH; tap_p->message_type = mess_type; - tap_p->protocol_disc = short_pd; + tap_p->protocol_disc = (gsm_a_pd_str_e)short_pd; tap_queue_packet(gsm_a_tap, pinfo, tap_p); diff --git a/epan/dissectors/packet-gsm_abis_om2000.c b/epan/dissectors/packet-gsm_abis_om2000.c index b4c523c272..784657ee6a 100644 --- a/epan/dissectors/packet-gsm_abis_om2000.c +++ b/epan/dissectors/packet-gsm_abis_om2000.c @@ -948,11 +948,11 @@ dissect_om2k_attrs(tvbuff_t *tvb, gint offset, proto_tree *tree) static guint dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree) { - guint8 class = tvb_get_guint8(tvb, offset); + guint8 mo_class = tvb_get_guint8(tvb, offset); guint8 inst = tvb_get_guint8(tvb, offset+3); col_append_fstr(pinfo->cinfo, COL_INFO, ", (%-4s %u)", - val_to_str(class, om2k_mo_class_short_vals, + val_to_str(mo_class, om2k_mo_class_short_vals, "0x%02x"), inst); if (tree) { proto_item *ti; @@ -972,7 +972,7 @@ dissect_om2k_mo(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree proto_tree_add_item(mo_tree, hf_om2k_mo_instance, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", Class: %s, Sub: %02x/%02x, Instance: %u", - val_to_str(class, om2k_mo_class_vals, "0x%02x"), + val_to_str(mo_class, om2k_mo_class_vals, "0x%02x"), sub1, sub2, inst); } return 4; diff --git a/epan/dissectors/packet-gsm_bsslap.c b/epan/dissectors/packet-gsm_bsslap.c index b9bae1be48..88ca2fb9c5 100644 --- a/epan/dissectors/packet-gsm_bsslap.c +++ b/epan/dissectors/packet-gsm_bsslap.c @@ -514,9 +514,7 @@ typedef enum } bsslap_elem_idx_t; */ -elem_fcn bsslap_elem_fcn[]; - -guint16 (*bsslap_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string, int string_len) = { +elem_fcn bsslap_elem_fcn[] = { /* BSS LAP Elements 5 */ NULL, /* Reserved */ de_ta, /* Timing Advance */ diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c index b0d406cede..c434db154a 100644 --- a/epan/dissectors/packet-gsm_rlcmac.c +++ b/epan/dissectors/packet-gsm_rlcmac.c @@ -7702,7 +7702,7 @@ dissect_gsm_rlcmac_downlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) RlcMacDownlink_t * data; /* allocate a data structure and guess the coding scheme */ - data = ep_alloc(sizeof(RlcMacDownlink_t)); + data = ep_new(RlcMacDownlink_t); if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER)) { @@ -7752,7 +7752,7 @@ dissect_gsm_rlcmac_uplink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) RlcMacUplink_t *data; /* allocate a data structure and set the coding scheme */ - data = ep_alloc(sizeof(RlcMacUplink_t)); + data = ep_new(RlcMacUplink_t); if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER)) { diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 38a7eb12fb..ba4a91beae 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -439,7 +439,7 @@ dis_field_addr(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p, const gchar * addrstr = gsm_sms_chars_to_utf8(addrbuf, i); break; default: - addrstr = ep_alloc(numdigocts*2 + 1); + addrstr = (gchar *)ep_alloc(numdigocts*2 + 1); for (i = 0; i < numdigocts; i++) { oct = tvb_get_guint8(tvb, offset + i); @@ -1748,7 +1748,7 @@ gsm_sms_chars_to_utf8(const unsigned char* src, int len) } /* Now allocate a buffer for the output string and fill it in */ - outbuf = ep_alloc(outlen + 1); + outbuf = (gchar *)ep_alloc(outlen + 1); for (i = 0, j = 0; j < len; j++) { if (char_is_escape(src[j])) { @@ -2703,7 +2703,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb } /* Store udl and length for later decoding of reassembled SMS */ - p_frag_params = se_alloc0(sizeof(sm_fragment_params)); + p_frag_params = se_new0(sm_fragment_params); p_frag_params->udl = udl; p_frag_params->length = length; g_hash_table_insert(g_sm_fragment_params_table, diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index 1d42dde485..23596de211 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -7859,12 +7859,12 @@ dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* * Do we already know this conversation? */ - gtp_info = conversation_get_proto_data(conversation, proto_gtp); + gtp_info = (gtp_conv_info_t *)conversation_get_proto_data(conversation, proto_gtp); if (gtp_info == NULL) { /* No. Attach that information to the conversation, and add * it to the list of information structures. */ - gtp_info = g_malloc(sizeof(gtp_conv_info_t)); + gtp_info = (gtp_conv_info_t *)g_malloc(sizeof(gtp_conv_info_t)); /*Request/response matching tables*/ gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched); gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched); diff --git a/epan/dissectors/packet-h248_3gpp.c b/epan/dissectors/packet-h248_3gpp.c index 1d6b5ec02b..013b6cb029 100644 --- a/epan/dissectors/packet-h248_3gpp.c +++ b/epan/dissectors/packet-h248_3gpp.c @@ -294,14 +294,14 @@ static gint ett_h248_3GTFO_codec = -1; static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) { tvbuff_t* sub_tvb = NULL; - gint8 class; + gint8 appclass; gboolean pc; gint32 tag; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - get_ber_identifier(tvb, 0, &class, &pc, &tag); + get_ber_identifier(tvb, 0, &appclass, &pc, &tag); /* XXX: is this enough to guess it? */ if (tag==BER_UNI_TAG_OCTETSTRING) { @@ -319,14 +319,14 @@ static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_inf static void dissect_3GTFO_codec_list(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) { tvbuff_t* sub_tvb = NULL; - gint8 class; + gint8 appclass; gboolean pc; gint32 tag; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - get_ber_identifier(tvb, 0, &class, &pc, &tag); + get_ber_identifier(tvb, 0, &appclass, &pc, &tag); if (tag==BER_UNI_TAG_OCTETSTRING) { dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, 0, hfid, &sub_tvb ); diff --git a/epan/dissectors/packet-h248_q1950.c b/epan/dissectors/packet-h248_q1950.c index f01abcbece..a9c202b8f6 100644 --- a/epan/dissectors/packet-h248_q1950.c +++ b/epan/dissectors/packet-h248_q1950.c @@ -287,14 +287,14 @@ static gint ett_h248_pkg_bt_bit= -1; static void dissect_bt_tunneled_proto(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* i _U_, void* d _U_) { tvbuff_t* bctp_tvb = NULL; - gint8 class; + gint8 appclass; gboolean pc; gint32 tag; asn1_ctx_t asn1_ctx; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - get_ber_identifier(tvb, 0, &class, &pc, &tag); + get_ber_identifier(tvb, 0, &appclass, &pc, &tag); /* XXX: is this enough to guess it? */ if (tag==BER_UNI_TAG_OCTETSTRING) { diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c index 49dbe65b7a..59cabef7fa 100644 --- a/epan/dissectors/packet-h264.c +++ b/epan/dissectors/packet-h264.c @@ -398,7 +398,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint bit_offset = *start_bit_offset; /* prepare the string */ - str = ep_alloc(256); + str = (char *)ep_alloc(256); str[0] = '\0'; for (bit=0; bit<((int)(bit_offset&0x07)); bit++) { if (bit && (!(bit%4))) { @@ -1062,7 +1062,7 @@ dissect_h265_unescap_nal_unit(tvbuff_t *tvb, packet_info *pinfo, int offset) int i; gchar *buff; - buff = g_malloc(length); + buff = (gchar *)g_malloc(length); for (i = 0; i < length; i++) { if ((i + 2 < length) && (tvb_get_ntoh24(tvb, offset) == 0x000003)) { buff[NumBytesInRBSP++] = tvb_get_guint8(tvb, offset); diff --git a/epan/dissectors/packet-hartip.c b/epan/dissectors/packet-hartip.c index 4a84d82c7d..e344858b94 100644 --- a/epan/dissectors/packet-hartip.c +++ b/epan/dissectors/packet-hartip.c @@ -268,7 +268,7 @@ static int hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { - const hartip_tap_info *tapinfo = p; + const hartip_tap_info *tapinfo = (const hartip_tap_info *)p; const gchar *message_type_node_str, *message_id_node_str; int message_type_node; @@ -385,7 +385,7 @@ dissect_string(proto_tree *tree, int hf, const char *name, int len, proto_item *ti; char *str; - str = ep_alloc(256); + str = (char *)ep_alloc(256); ti = proto_tree_add_item(tree, hf, tvb, offset, len, ENC_NA); if (len < 256) { @@ -411,12 +411,12 @@ dissect_packAscii(proto_tree *tree, int hf, const char *name, int len, guint8 *tmp; char *str = NULL; - str = ep_alloc(256+1); + str = (char *)ep_alloc(256+1); ti = proto_tree_add_item(tree, hf, tvb, offset, len, ENC_NA); DISSECTOR_ASSERT(len < 3 * (256/4)); - tmp = ep_alloc0(len); + tmp = (guint8 *)ep_alloc0(len); tvb_memcpy(tvb, tmp, offset, len); iIndex = 0; @@ -877,7 +877,7 @@ dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset++; /* Setup statistics for tap. */ - tapinfo = ep_alloc(sizeof(hartip_tap_info)); + tapinfo = ep_new(hartip_tap_info); tapinfo->message_type = message_type; tapinfo->message_id = message_id; tap_queue_packet(hartip_tap, pinfo, tapinfo); diff --git a/epan/dissectors/packet-hclnfsd.c b/epan/dissectors/packet-hclnfsd.c index c1cf0153dd..87b28b4f1c 100644 --- a/epan/dissectors/packet-hclnfsd.c +++ b/epan/dissectors/packet-hclnfsd.c @@ -150,7 +150,7 @@ hclnfsd_decode_obscure(const char *ident, int ident_len) char *ident_decoded, *ident_out; int j, x, y; - ident_decoded = ep_alloc(ident_len); + ident_decoded = (char *)ep_alloc(ident_len); ident_out = ident_decoded; for (x = -1, j = 0; j < ident_len; j++) { diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c index 527488f221..9865fb9bd6 100644 --- a/epan/dissectors/packet-hip.c +++ b/epan/dissectors/packet-hip.c @@ -481,9 +481,9 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Checksum - this is the same algorithm from UDP, ICMPv6 */ if (!pinfo->fragmented) { /* IPv4 or IPv6 addresses */ - cksum_vec[0].ptr = pinfo->src.data; + cksum_vec[0].ptr = (guint8 *)pinfo->src.data; cksum_vec[0].len = pinfo->src.len; - cksum_vec[1].ptr = pinfo->dst.data; + cksum_vec[1].ptr = (guint8 *)pinfo->dst.data; cksum_vec[1].len = pinfo->dst.len; /* the rest of the pseudo-header */ diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c index a355684e4c..5eb13f77bf 100644 --- a/epan/dissectors/packet-icq.c +++ b/epan/dissectors/packet-icq.c @@ -1477,7 +1477,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ rounded_size = ((((capturedsize - ICQ5_CL_SESSIONID) + 3)/4)*4) + ICQ5_CL_SESSIONID; /* rounded_size might exceed the tvb bounds so we can't just use tvb_memdup here. */ - decr_pd = g_malloc(rounded_size); + decr_pd = (guint8 *)g_malloc(rounded_size); tvb_memcpy(tvb, decr_pd, 0, capturedsize); decrypt_v5(decr_pd, rounded_size, key); diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c index ab04a742d2..bdd0e8dc1d 100644 --- a/epan/dissectors/packet-iec104.c +++ b/epan/dissectors/packet-iec104.c @@ -1067,7 +1067,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr col_set_str(pinfo->cinfo, COL_PROTOCOL, "104asdu"); col_clear(pinfo->cinfo, COL_INFO); - asduh = ep_alloc(sizeof(struct asduheader)); + asduh = ep_new(struct asduheader); res = ep_strbuf_new_label(NULL); /*** *** START: Common to 'Packet List' and 'Packet Details' *** ***/ @@ -1521,7 +1521,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr col_set_str(pinfo->cinfo, COL_PROTOCOL, "104apci"); col_clear(pinfo->cinfo, COL_INFO); - apcih = ep_alloc(sizeof(struct apciheader)); + apcih = ep_new(struct apciheader); /*** *** START: Common to 'Packet List' and 'Packet Details' *** ***/ Start = 0; diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c index 117849f4d0..d2225cfa48 100644 --- a/epan/dissectors/packet-ieee802a.c +++ b/epan/dissectors/packet-ieee802a.c @@ -60,7 +60,7 @@ ieee802a_add_oui(guint32 oui, const char *table_name, const char *table_ui_name, { oui_info_t *new_info; - new_info = g_malloc(sizeof (oui_info_t)); + new_info = (oui_info_t *)g_malloc(sizeof (oui_info_t)); new_info->table = register_dissector_table(table_name, table_ui_name, FT_UINT16, BASE_HEX); new_info->field_info = hf_item; @@ -113,7 +113,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Do we have information for this OUI? */ if (oui_info_table != NULL && - (oui_info = g_hash_table_lookup(oui_info_table, + (oui_info = (oui_info_t *)g_hash_table_lookup(oui_info_table, GUINT_TO_POINTER(oui))) != NULL) { /* * Yes - use it. @@ -164,7 +164,7 @@ proto_register_ieee802a(void) static void register_hf(gpointer key _U_, gpointer value, gpointer user_data _U_) { - oui_info_t *info = value; + oui_info_t *info = (oui_info_t *)value; proto_register_field_array(proto_ieee802a, info->field_info, 1); } diff --git a/epan/dissectors/packet-igrp.c b/epan/dissectors/packet-igrp.c index 87396ddca4..23a104d00e 100644 --- a/epan/dissectors/packet-igrp.c +++ b/epan/dissectors/packet-igrp.c @@ -101,7 +101,7 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* this is a ugly hack to find the first byte of the IP source address */ if (pinfo->net_src.type == AT_IPv4) { - ipsrc = pinfo->net_src.data; + ipsrc = (guint8 *)pinfo->net_src.data; network = ipsrc[0]; } else network = 0; /* XXX - shouldn't happen */ diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c index 8480f9dc87..c191c730a4 100644 --- a/epan/dissectors/packet-imap.c +++ b/epan/dissectors/packet-imap.c @@ -78,8 +78,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int iter; int commandlen; - tokenbuf = ep_alloc(MAX_BUFFER); - command_token = ep_alloc(MAX_BUFFER); + tokenbuf = (guchar *)ep_alloc(MAX_BUFFER); + command_token = (guchar *)ep_alloc(MAX_BUFFER); memset(tokenbuf, '\0', MAX_BUFFER); memset(command_token, '\0', MAX_BUFFER); commandlen = 0; diff --git a/epan/dissectors/packet-infiniband_sdp.c b/epan/dissectors/packet-infiniband_sdp.c index 16ce732099..cfa269ff66 100644 --- a/epan/dissectors/packet-infiniband_sdp.c +++ b/epan/dissectors/packet-infiniband_sdp.c @@ -225,7 +225,7 @@ dissect_ib_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ return 0; /* no infiniband handle? can't get our proto-data; sorry, can't help you without this */ proto_infiniband = dissector_handle_get_protocol_index(infiniband_handle); } - convo_data = conversation_get_proto_data(conv, proto_infiniband); + convo_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband); if (!(convo_data->service_id & SERVICE_ID_MASK)) return 0; /* the service id doesn't match that of SDP - nothing for us to do here */ diff --git a/epan/dissectors/packet-ipars.c b/epan/dissectors/packet-ipars.c index 5c11821a27..62c7df2d88 100644 --- a/epan/dissectors/packet-ipars.c +++ b/epan/dissectors/packet-ipars.c @@ -58,7 +58,7 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) int offset = 0; gchar *eom_msg; - eom_msg = ep_alloc(MAX_EOM_MSG_SIZE); + eom_msg = (gchar *)ep_alloc(MAX_EOM_MSG_SIZE); eom_msg[0] = 0; col_clear(pinfo->cinfo, COL_INFO); diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 4c387d47a1..12584b38cd 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -1768,7 +1768,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(decrypt_ok && (decrypted_len > esp_iv_len)) { - tvb_decrypted = tvb_new_child_real_data(tvb, g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len, + tvb_decrypted = tvb_new_child_real_data(tvb, (guint8 *)g_memdup(decrypted_data+sizeof(guint8)*esp_iv_len, decrypted_len - esp_iv_len), decrypted_len - esp_iv_len, decrypted_len - esp_iv_len); g_free(decrypted_data); @@ -2167,7 +2167,7 @@ proto_register_ipsec(void) sizeof(uat_esp_sa_record_t), /* record size */ "esp_sa", /* filename */ TRUE, /* from_profile */ - (void*) &uat_esp_sa_records, /* data_ptr */ + (void**) &uat_esp_sa_records, /* data_ptr */ &num_sa_uat, /* numitems_ptr */ UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */ NULL, /* help */ diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 79d79cc62d..d9fa90b063 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -1808,7 +1808,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if (tvb_get_guint8(tvb, offset + IP6H_SRC + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_SRC + 11) == 0xfffe) { /* RFC 4291 appendix A */ - mac_addr = ep_alloc(6); + mac_addr = (guint8 *)ep_alloc(6); tvb_memcpy(tvb, mac_addr, offset + IP6H_SRC + 8, 3); tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_SRC + 13, 3); mac_addr[0] &= ~0x02; @@ -1895,7 +1895,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if (tvb_get_guint8(tvb, offset + IP6H_DST + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_DST + 11) == 0xfffe) { /* RFC 4291 appendix A */ - mac_addr = ep_alloc(6); + mac_addr = (guint8 *)ep_alloc(6); tvb_memcpy(tvb, mac_addr, offset + IP6H_DST + 8, 3); tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_DST + 13, 3); mac_addr[0] &= ~0x02; diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index cd455ce48f..ce8dd28119 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -564,7 +564,7 @@ iscsi_dissect_TargetAddress(packet_info *pinfo, proto_tree *tree _U_,char *val) *pgt++ = 0; } - addr = ep_alloc(sizeof(address)); + addr = ep_new(address); addr->type = AT_IPv4; addr->len = 4; addr->data = ep_alloc(4); @@ -744,7 +744,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off /* XXX we need a way to handle replayed iscsi itt here */ cdata=(iscsi_conv_data_t *)se_tree_lookup32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16)); if(!cdata){ - cdata = se_alloc (sizeof(iscsi_conv_data_t)); + cdata = se_new(iscsi_conv_data_t); cdata->itlq.lun=0xffff; cdata->itlq.scsi_opcode=0xffff; cdata->itlq.task_flags=0; @@ -814,7 +814,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off itl=(itl_nexus_t *)se_tree_lookup32(iscsi_session->itl, lun); if(!itl){ - itl=se_alloc(sizeof(itl_nexus_t)); + itl=se_new(itl_nexus_t); itl->cmdset=0xff; itl->conversation=conversation; se_tree_insert32(iscsi_session->itl, lun, itl); @@ -1595,7 +1595,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off /* We have a variable length CDB where bytes >16 is transported * in the AHS. */ - cdb_buf=g_malloc(16+ahs_cdb_length); + cdb_buf=(guint8 *)g_malloc(16+ahs_cdb_length); /* the 16 first bytes of the cdb */ tvb_memcpy(tvb, cdb_buf, cdb_offset, 16); /* the remainder of the cdb from the ahs */ @@ -2344,9 +2344,9 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec /* make sure we have a conversation for this session */ conversation = find_or_create_conversation(pinfo); - iscsi_session=conversation_get_proto_data(conversation, proto_iscsi); + iscsi_session=(iscsi_session_t *)conversation_get_proto_data(conversation, proto_iscsi); if(!iscsi_session){ - iscsi_session=se_alloc(sizeof(iscsi_session_t)); + iscsi_session=se_new(iscsi_session_t); iscsi_session->header_digest=ISCSI_HEADER_DIGEST_AUTO; iscsi_session->itlq=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "iSCSI ITLQ"); iscsi_session->itl=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "iSCSI ITL"); diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c index 96be40c0ce..6bd4242580 100644 --- a/epan/dissectors/packet-iuup.c +++ b/epan/dissectors/packet-iuup.c @@ -324,7 +324,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in DISSECTOR_ASSERT(bit_offset < 8); - shifted_buffer = ep_tvb_memdup(tvb,offset,len+1); + shifted_buffer = (guint8 *)ep_tvb_memdup(tvb,offset,len+1); for(i = 0; i < len; i++) { shifted_buffer[i] <<= bit_offset; @@ -355,7 +355,7 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr if ( ! dissect_fields ) { return; } else if ( ! pinfo->circuit_id - || ! ( iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)) ) ) { + || ! ( iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)) ) ) { proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN); return; } @@ -409,7 +409,7 @@ static guint dissect_rfcis(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tr guint i; do { - iuup_rfci_t *rfci = se_alloc0(sizeof(iuup_rfci_t)); + iuup_rfci_t *rfci = se_new0(iuup_rfci_t); guint len = 0; DISSECTOR_ASSERT(c < 64); @@ -474,15 +474,15 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre iuup_circuit_t* iuup_circuit = NULL; if (pinfo->circuit_id) { - iuup_circuit = g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)); + iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)); if (iuup_circuit) { g_hash_table_remove(circuits,GUINT_TO_POINTER(pinfo->circuit_id)); } - iuup_circuit = se_alloc0(sizeof(iuup_circuit_t)); + iuup_circuit = se_new0(iuup_circuit_t); } else { - iuup_circuit = ep_alloc0(sizeof(iuup_circuit_t)); + iuup_circuit = ep_new0(iuup_circuit_t); } iuup_circuit->id = pinfo->circuit_id; diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c index 66cfd6bba2..e5c94983db 100644 --- a/epan/dissectors/packet-iwarp-mpa.c +++ b/epan/dissectors/packet-iwarp-mpa.c @@ -306,7 +306,7 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset, /* allocate memory for the marker-free buffer */ mfree_buff_length = orig_length - (MPA_MARKER_LEN * num_markers); - mfree_buff = g_malloc(mfree_buff_length); + mfree_buff = (guint8 *)g_malloc(mfree_buff_length); tot_copy = 0; source_offset = 0; @@ -801,7 +801,7 @@ dissect_iwarp_mpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat /* FPDU */ if (tvb_length(tvb) >= MPA_SMALLEST_FPDU_LEN && is_mpa_fpdu(pinfo)) { - tcpinfo = pinfo->private_data; + tcpinfo = (struct tcpinfo *)pinfo->private_data; conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c index 39c0dd0665..b6df22575e 100644 --- a/epan/dissectors/packet-ixveriwave.c +++ b/epan/dissectors/packet-ixveriwave.c @@ -507,11 +507,11 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Calculate the IFG */ /* Check for an existing ifg value associated with the frame */ - p_ifg_info = p_get_proto_data(pinfo->fd, proto_ixveriwave); + p_ifg_info = (ifg_info *)p_get_proto_data(pinfo->fd, proto_ixveriwave); if (!p_ifg_info) { /* allocate the space */ - p_ifg_info = se_alloc0(sizeof(struct ifg_info)); + p_ifg_info = se_new0(struct ifg_info); /* Doesn't exist, so we need to calculate the value */ if (previous_frame_data.previous_frame_num !=0 && (pinfo->fd->num - previous_frame_data.previous_frame_num == 1)) diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c index 859d6d373d..83cdf28a15 100644 --- a/epan/dissectors/packet-json.c +++ b/epan/dissectors/packet-json.c @@ -354,7 +354,7 @@ static void after_value(void *tvbparse_data, const void *wanted_data _U_, tvbpar json_token_type_t value_id = JSON_TOKEN_INVALID; if (tok->sub) - value_id = tok->sub->id; + value_id = (json_token_type_t)tok->sub->id; switch (value_id) { case JSON_TOKEN_STRING: diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index fefad5149f..f8e6bfcb48 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -693,7 +693,7 @@ static jxta_stream_conversation_data *get_tpt_conversation(packet_info * pinfo) tpt_conv_data = (jxta_stream_conversation_data *) conversation_get_proto_data(tpt_conversation, proto_jxta); if (NULL == tpt_conv_data) { - tpt_conv_data = se_alloc(sizeof(jxta_stream_conversation_data)); + tpt_conv_data = se_new(jxta_stream_conversation_data); tpt_conv_data->tpt_ptype = pinfo->ptype; SE_COPY_ADDRESS(&tpt_conv_data->initiator_tpt_address, &pinfo->src); @@ -1257,7 +1257,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree } if ((AT_URI == pinfo->src.type) && (AT_URI == pinfo->dst.type)) { - jxta_tap_header *tap_header = se_alloc(sizeof(jxta_tap_header)); + jxta_tap_header *tap_header = se_new(jxta_tap_header); tap_header->src_address = pinfo->src; tap_header->dest_address = pinfo->dst; @@ -1367,7 +1367,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree proto_tree_add_uint(jxta_msg_tree, hf_jxta_message_names_count, tvb, tree_offset, (int)sizeof(guint16), msg_names_count); tree_offset += (int)sizeof(guint16); - names_table = ep_alloc((msg_names_count + 2) * sizeof(const gchar *)); + names_table = (const gchar **)ep_alloc((msg_names_count + 2) * sizeof(const gchar *)); names_table[0] = ""; names_table[1] = "jxta"; diff --git a/epan/dissectors/packet-kingfisher.c b/epan/dissectors/packet-kingfisher.c index cba2c79010..88829e4546 100644 --- a/epan/dissectors/packet-kingfisher.c +++ b/epan/dissectors/packet-kingfisher.c @@ -219,7 +219,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean - kfp=ep_alloc(sizeof(kingfisher_packet_t)); + kfp=ep_new(kingfisher_packet_t); /* Verify that it looks like kingfisher */ /* the packet must be at least 9 bytes */