aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-18 20:44:36 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-18 20:44:36 +0000
commit84241f46ada962c7b4b9b3cf0f1be134ee99b00c (patch)
tree3108e864be7f7c06df5331f7431cd67f2aee39be /epan
parent81700ec3e08712eef97596828ea054c78af75a41 (diff)
From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48399
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-fc.c24
-rw-r--r--epan/dissectors/packet-fcels.c20
-rw-r--r--epan/dissectors/packet-giop.c26
-rw-r--r--epan/dissectors/packet-gssapi.c24
-rw-r--r--epan/dissectors/packet-multipart.c20
-rw-r--r--epan/dissectors/packet-nbap.c24
-rw-r--r--epan/dissectors/packet-ndmp.c24
-rw-r--r--epan/dissectors/packet-netflow.c22
-rw-r--r--epan/dissectors/packet-ros.c24
-rw-r--r--epan/dissectors/packet-scsi-osd.c24
-rw-r--r--epan/dissectors/packet-sdp.c26
-rw-r--r--epan/dissectors/packet-smb-sidsnooping.c24
-rw-r--r--epan/dissectors/packet-sua.c24
-rw-r--r--epan/uat.c24
14 files changed, 166 insertions, 164 deletions
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 1a16bf27c1..394b6ac774 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -169,8 +169,8 @@ static GHashTable *fcseq_req_hash = NULL;
static gint
fcseq_equal(gconstpointer v, gconstpointer w)
{
- const fcseq_conv_key_t *v1 = v;
- const fcseq_conv_key_t *v2 = w;
+ const fcseq_conv_key_t *v1 = (const fcseq_conv_key_t *)v;
+ const fcseq_conv_key_t *v2 = (const fcseq_conv_key_t *)w;
return (v1->conv_idx == v2->conv_idx);
}
@@ -178,7 +178,7 @@ fcseq_equal(gconstpointer v, gconstpointer w)
static guint
fcseq_hash (gconstpointer v)
{
- const fcseq_conv_key_t *key = v;
+ const fcseq_conv_key_t *key = (const fcseq_conv_key_t *)v;
guint val;
val = key->conv_idx;
@@ -761,9 +761,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* set up a conversation and conversation data */
/* TODO treat the fc address s_id==00.00.00 as a wildcard matching anything */
conversation=find_or_create_conversation(pinfo);
- fc_conv_data=conversation_get_proto_data(conversation, proto_fc);
+ fc_conv_data=(fc_conv_data_t *)conversation_get_proto_data(conversation, proto_fc);
if(!fc_conv_data){
- fc_conv_data=se_alloc(sizeof(fc_conv_data_t));
+ fc_conv_data=se_new(fc_conv_data_t);
fc_conv_data->exchanges=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "FC Exchanges");
conversation_add_proto_data(conversation, proto_fc, fc_conv_data);
}
@@ -774,7 +774,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
*/
fc_ex=(itlq_nexus_t *)se_tree_lookup32(fc_conv_data->exchanges, fchdr.oxid);
if(!fc_ex){
- fc_ex=se_alloc(sizeof(itlq_nexus_t));
+ fc_ex=se_new(itlq_nexus_t);
fc_ex->first_exchange_frame=0;
fc_ex->last_exchange_frame=0;
fc_ex->lun=0xffff;
@@ -959,18 +959,18 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
/* XXX - use "fc_wka_vals[]" on this? */
proto_tree_add_string (fc_tree, hf_fc_did, tvb, offset+1, 3,
- fc_to_str (fchdr.d_id.data));
+ fc_to_str ((const guint8 *)fchdr.d_id.data));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+1, 3,
- fc_to_str (fchdr.d_id.data));
+ fc_to_str ((const guint8 *)fchdr.d_id.data));
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_uint (fc_tree, hf_fc_csctl, tvb, offset+4, 1, fchdr.cs_ctl);
/* XXX - use "fc_wka_vals[]" on this? */
proto_tree_add_string (fc_tree, hf_fc_sid, tvb, offset+5, 3,
- fc_to_str (fchdr.s_id.data));
+ fc_to_str ((const guint8 *)fchdr.s_id.data));
hidden_item = proto_tree_add_string (fc_tree, hf_fc_id, tvb, offset+5, 3,
- fc_to_str (fchdr.s_id.data));
+ fc_to_str ((const guint8 *)fchdr.s_id.data));
PROTO_ITEM_SET_HIDDEN(hidden_item);
if (ftype == FC_FTYPE_LINKCTL) {
@@ -1129,10 +1129,10 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
cdata->seq_cnt = fchdr.seqcnt;
}
else {
- req_key = se_alloc (sizeof(fcseq_conv_key_t));
+ req_key = se_new(fcseq_conv_key_t);
req_key->conv_idx = conversation->index;
- cdata = se_alloc (sizeof(fcseq_conv_data_t));
+ cdata = se_new(fcseq_conv_data_t);
cdata->seq_cnt = fchdr.seqcnt;
g_hash_table_insert (fcseq_req_hash, req_key, cdata);
diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c
index d555fc9765..5df0b1a62a 100644
--- a/epan/dissectors/packet-fcels.c
+++ b/epan/dissectors/packet-fcels.c
@@ -301,8 +301,8 @@ static dissector_handle_t data_handle, fcsp_handle;
static gint
fcels_equal(gconstpointer v, gconstpointer w)
{
- const fcels_conv_key_t *v1 = v;
- const fcels_conv_key_t *v2 = w;
+ const fcels_conv_key_t *v1 = (const fcels_conv_key_t *)v;
+ const fcels_conv_key_t *v2 = (const fcels_conv_key_t *)w;
return (v1->conv_idx == v2->conv_idx);
}
@@ -310,7 +310,7 @@ fcels_equal(gconstpointer v, gconstpointer w)
static guint
fcels_hash (gconstpointer v)
{
- const fcels_conv_key_t *key = v;
+ const fcels_conv_key_t *key = (const fcels_conv_key_t *)v;
guint val;
val = key->conv_idx;
@@ -964,7 +964,7 @@ dissect_fcels_logi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* Set up structures needed to add the protocol subtree and manage it */
int offset = 0,
svcvld = 0,
- class;
+ svcclass;
proto_tree *logi_tree, *cmnsvc_tree;
proto_item *subti;
guint16 flag;
@@ -997,9 +997,9 @@ dissect_fcels_logi (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
/* Add subtree for class paramters */
offset = 36;
- for (class = 1; class < 5; class++) {
+ for (svcclass = 1; svcclass < 5; svcclass++) {
subti = proto_tree_add_text (logi_tree, tvb, offset, 16,
- "Class %d Svc Parameters", class);
+ "Class %d Svc Parameters", svcclass);
cmnsvc_tree = proto_item_add_subtree (subti, ett_fcels_logi_cmnsvc);
flag = tvb_get_ntohs (tvb, offset);
@@ -1978,7 +1978,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
- srcfc = pinfo->src.data;
+ srcfc = (guint8 *)pinfo->src.data;
if (srcfc[2]) {
/* If it is a loop port, we'll need to remember the ALPA */
options = NO_PORT2;
@@ -2012,10 +2012,10 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cdata->opcode = opcode;
}
else {
- req_key = se_alloc (sizeof(fcels_conv_key_t));
+ req_key = se_new(fcels_conv_key_t);
req_key->conv_idx = conversation->index;
- cdata = se_alloc (sizeof(fcels_conv_data_t));
+ cdata = se_new(fcels_conv_data_t);
cdata->opcode = opcode;
g_hash_table_insert (fcels_req_hash, req_key, cdata);
@@ -2042,7 +2042,7 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
- dstfc = pinfo->dst.data;
+ dstfc = (guint8 *)pinfo->dst.data;
addrdata[0] = addrdata[1] = 0;
addrdata[2] = dstfc[2];
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 50ad0a7b0e..bfcd6354a1 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -1021,7 +1021,7 @@ static const char *giop_ior_file = "IOR.txt";
static GList *insert_in_comp_req_list(GList *list, guint32 fn, guint32 reqid, const gchar * op, giop_sub_handle_t *sh ) {
comp_req_list_entry_t * entry;
- entry = se_alloc(sizeof(comp_req_list_entry_t));
+ entry = se_new(comp_req_list_entry_t);
entry->fn = fn;
entry->reqid = reqid;
@@ -1046,7 +1046,7 @@ static comp_req_list_entry_t * find_fn_in_list(guint32 fn) {
element = g_list_last(giop_complete_request_list); /* start from last */
while(element) { /* valid list entry */
- entry_ptr = element->data; /* grab data pointer */
+ entry_ptr = (comp_req_list_entry_t *)element->data; /* grab data pointer */
if (entry_ptr->fn == fn) { /* similar FN */
return entry_ptr;
}
@@ -1123,10 +1123,10 @@ static void insert_in_complete_reply_hash(guint32 fn, guint32 mfn) {
return; /* FN collision */
}
- new_key = se_alloc(sizeof(struct complete_reply_hash_key));
+ new_key = se_new(struct complete_reply_hash_key);
new_key->fn = fn; /* save FN */
- val = se_alloc(sizeof(struct complete_reply_hash_val));
+ val = se_new(struct complete_reply_hash_val);
val->mfn = mfn; /* and MFN */
g_hash_table_insert(giop_complete_reply_hash, new_key, val);
@@ -1186,7 +1186,7 @@ static guint32 get_mfn_from_fn_and_reqid(guint32 fn, guint32 reqid) {
element = g_list_last(giop_complete_request_list); /* get last */
while(element) { /* valid list entry */
- entry_ptr = element->data; /* grab data pointer */
+ entry_ptr = (comp_req_list_entry_t *)element->data; /* grab data pointer */
if (entry_ptr->reqid == reqid) { /* similar reqid */
return entry_ptr->fn; /* return MFN */
}
@@ -1277,12 +1277,12 @@ void register_giop_user_module(giop_sub_dissector_t *sub, const gchar *name, con
printf("giop:register_module: Module sub dissector name is %s \n", name);
#endif
- new_module_key = g_malloc(sizeof(struct giop_module_key));
+ new_module_key = (struct giop_module_key *)g_malloc(sizeof(struct giop_module_key));
new_module_key->module = module; /* save Module or interface name from IDL */
- module_val = g_malloc(sizeof(struct giop_module_val));
+ module_val = (struct giop_module_val *)g_malloc(sizeof(struct giop_module_val));
- module_val->subh = g_malloc(sizeof (giop_sub_handle_t)); /* init subh */
+ module_val->subh = (giop_sub_handle_t *)g_malloc(sizeof (giop_sub_handle_t)); /* init subh */
module_val->subh->sub_name = name; /* save dissector name */
module_val->subh->sub_fn = sub; /* save subdissector*/
@@ -1372,11 +1372,11 @@ static void insert_in_objkey_hash(GHashTable *hash, const gchar *obj, guint32 le
/* So, passed key should NOT exist in hash at this point.*/
- new_objkey_key = se_alloc(sizeof(struct giop_object_key));
+ new_objkey_key = se_new(struct giop_object_key);
new_objkey_key->objkey_len = len; /* save it */
new_objkey_key->objkey = (guint8 *) se_memdup(obj,len); /* copy from object and allocate ptr */
- objkey_val = se_alloc(sizeof(struct giop_object_val));
+ objkey_val = se_new(struct giop_object_val);
objkey_val->repo_id = se_strdup(repoid); /* duplicate and store Respository ID string */
objkey_val->src = src; /* where IOR came from */
@@ -1516,7 +1516,7 @@ static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) {
return;
}
- buf = ep_alloc0(max_iorlen+1); /* input buf */
+ buf = (guchar *)ep_alloc0(max_iorlen+1); /* input buf */
while ((len = giop_getline(fp,buf,max_iorlen+1)) > 0) {
my_offset = 0; /* reset for every IOR read */
@@ -1623,7 +1623,7 @@ void register_giop_user(giop_sub_dissector_t *sub, const gchar *name, int sub_pr
giop_sub_handle_t *subh;
- subh = g_malloc(sizeof (giop_sub_handle_t));
+ subh = (giop_sub_handle_t *)g_malloc(sizeof (giop_sub_handle_t));
subh->sub_name = name;
subh->sub_fn = sub;
@@ -2952,7 +2952,7 @@ void get_CDR_fixed(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, gchar **
printf("giop:get_CDR_fixed(): slen = %.2x \n", slen);
#endif
- tmpbuf = ep_alloc0(slen); /* allocate temp buffer */
+ tmpbuf = (gchar *)ep_alloc0(slen); /* allocate temp buffer */
/* If even , grab 1st dig */
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index 066a61af6c..e6b7c832c9 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -144,7 +144,7 @@ gssapi_init_oid(const char *oid, int proto, int ett, dissector_handle_t handle,
dissector_handle_t wrap_handle, const gchar *comment)
{
char *key = g_strdup(oid);
- gssapi_oid_value *value = g_malloc(sizeof(*value));
+ gssapi_oid_value *value = (gssapi_oid_value *)g_malloc(sizeof(*value));
value->proto = find_protocol_by_id(proto);
value->ett = ett;
@@ -167,7 +167,7 @@ gssapi_lookup_oid_str(const char *oid_key)
if(!oid_key){
return NULL;
}
- value = g_hash_table_lookup(gssapi_oids, oid_key);
+ value = (gssapi_oid_value *)g_hash_table_lookup(gssapi_oids, oid_key);
return value;
}
@@ -185,7 +185,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *oid_tvb;
int len, start_offset, oid_start_offset;
volatile int offset;
- gint8 class;
+ gint8 appclass;
gboolean pc, ind_field;
gint32 tag;
guint32 len1;
@@ -212,9 +212,9 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
conversation = find_or_create_conversation(pinfo);
- gss_info = conversation_get_proto_data(conversation, proto_gssapi);
+ gss_info = (gssapi_conv_info_t *)conversation_get_proto_data(conversation, proto_gssapi);
if (!gss_info) {
- gss_info = se_alloc(sizeof(gssapi_conv_info_t));
+ gss_info = se_new(gssapi_conv_info_t);
gss_info->oid=NULL;
gss_info->do_reassembly=FALSE;
gss_info->frags=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "gssapi_frags");
@@ -250,7 +250,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( (!pinfo->fd->flags.visited)
&& (gss_info->do_reassembly)
&& (gssapi_reassembly) ){
- fi=se_tree_lookup32(gss_info->frags, gss_info->first_frame);
+ fi=(gssapi_frag_info_t *)se_tree_lookup32(gss_info->frags, gss_info->first_frame);
if(!fi){
goto done;
}
@@ -277,7 +277,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
if( (pinfo->fd->flags.visited)
&& (gssapi_reassembly) ){
- fi=se_tree_lookup32(gss_info->frags, pinfo->fd->num);
+ fi=(gssapi_frag_info_t *)se_tree_lookup32(gss_info->frags, pinfo->fd->num);
if(fi){
fd_head=fragment_get(pinfo, fi->first_frame, gssapi_fragment_table);
if(fd_head && (fd_head->flags&FD_DEFRAGMENTED)){
@@ -297,11 +297,11 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Read header */
- offset = get_ber_identifier(gss_tvb, offset, &class, &pc, &tag);
+ offset = get_ber_identifier(gss_tvb, offset, &appclass, &pc, &tag);
offset = get_ber_length(gss_tvb, offset, &len1, &ind_field);
- if (!(class == BER_CLASS_APP && pc && tag == 0)) {
+ if (!(appclass == BER_CLASS_APP && pc && tag == 0)) {
/* It could be NTLMSSP, with no OID. This can happen
for anything that microsoft calls 'Negotiate' or GSS-SPNEGO */
if ((tvb_length_remaining(gss_tvb, start_offset)>7) && (tvb_strneql(gss_tvb, start_offset, "NTLMSSP", 7) == 0)) {
@@ -364,7 +364,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* pointer; it just treats it as an opaque pointer, it
* doesn't dereference it or free what it points to.)
*/
- oidvalue = p_get_proto_data(pinfo->fd, proto_gssapi);
+ oidvalue = (gssapi_oid_value *)p_get_proto_data(pinfo->fd, proto_gssapi);
if (!oidvalue && !pinfo->fd->flags.visited)
{
/* No handle attached to this frame, but it's the first */
@@ -377,7 +377,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_tree_add_text(subtree, gss_tvb, start_offset, 0,
"Unknown header (class=%d, pc=%d, tag=%d)",
- class, pc, tag);
+ appclass, pc, tag);
return_offset = tvb_length(gss_tvb);
goto done;
} else {
@@ -419,7 +419,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
&& (tvb_length(gss_tvb)==tvb_reported_length(gss_tvb))
&& (len1>(guint32)tvb_length_remaining(gss_tvb, oid_start_offset))
&& (gssapi_reassembly) ){
- fi=se_alloc(sizeof(gssapi_frag_info_t));
+ fi=se_new(gssapi_frag_info_t);
fi->first_frame=pinfo->fd->num;
fi->reassembled_in=0;
se_tree_insert32(gss_info->frags, pinfo->fd->num, fi);
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index a3b88dc8be..aeb037034b 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -205,7 +205,7 @@ unfold_and_compact_mime_header(const char *lines, gint *first_colon_offset)
if (! lines) return NULL;
c = *p;
- ret = ep_alloc(strlen(lines) + 1);
+ ret = (char *)ep_alloc(strlen(lines) + 1);
q = ret;
while (c) {
@@ -405,7 +405,7 @@ get_multipart_info(packet_info *pinfo)
}
/* Clean up the parameters */
- parameters = unfold_and_compact_mime_header(pinfo->private_data, &dummy);
+ parameters = unfold_and_compact_mime_header((const char *)pinfo->private_data, &dummy);
start = find_parameter(parameters, "boundary=", &len);
@@ -416,7 +416,7 @@ get_multipart_info(packet_info *pinfo)
/*
* There is a value for the boundary string
*/
- m_info = g_malloc(sizeof(multipart_info_t));
+ m_info = (multipart_info_t *)g_malloc(sizeof(multipart_info_t));
m_info->type = type;
m_info->boundary = g_strndup(start, len);
m_info->boundary_length = len;
@@ -427,7 +427,7 @@ get_multipart_info(packet_info *pinfo)
static void
cleanup_multipart_info(void *data)
{
- multipart_info_t *m_info = data;
+ multipart_info_t *m_info = (multipart_info_t *)data;
if (m_info) {
g_free(m_info->boundary);
g_free(m_info);
@@ -590,7 +590,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
char *content_type_str = NULL;
char *content_encoding_str = NULL;
char *filename = NULL;
- char *typename = NULL;
+ char *mimetypename = NULL;
int len = 0;
gboolean last_field = FALSE;
@@ -671,8 +671,8 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
proto_item_append_text(ti, " (%s)", content_type_str);
/* find the "name" parameter in case we don't find a content disposition "filename" */
- if((typename = find_parameter(parameters, "name=", &len)) != NULL) {
- typename = g_strndup(typename, len);
+ if((mimetypename = find_parameter(parameters, "name=", &len)) != NULL) {
+ mimetypename = g_strndup(mimetypename, len);
}
}
@@ -736,7 +736,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
if(content_encoding_str && remove_base64_encoding) {
if(!g_ascii_strncasecmp(content_encoding_str, "base64", 6))
- tmp_tvb = base64_decode(pinfo, tmp_tvb, filename ? filename : (typename ? typename : content_type_str));
+ tmp_tvb = base64_decode(pinfo, tmp_tvb, filename ? filename : (mimetypename ? mimetypename : content_type_str));
}
@@ -784,13 +784,13 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
}
g_free(filename);
- g_free(typename);
+ g_free(mimetypename);
return boundary_start + boundary_line_len;
}
g_free(filename);
- g_free(typename);
+ g_free(mimetypename);
return -1;
}
diff --git a/epan/dissectors/packet-nbap.c b/epan/dissectors/packet-nbap.c
index ee69e998d3..1a036660d6 100644
--- a/epan/dissectors/packet-nbap.c
+++ b/epan/dissectors/packet-nbap.c
@@ -18234,7 +18234,7 @@ guint32 no_ddi_entries, i;
if(!p_conv)
return offset;
- p_conv_data = conversation_get_proto_data(p_conv, proto_fp);
+ p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp);
if(!p_conv_data)
return offset;
@@ -18496,7 +18496,7 @@ num_items = 1;
/*umts_fp_conversation_info->com_context_id = com_context_id;*/
}else{
nbap_com_context_id_t * cur_val;
- if((cur_val=g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
+ if((cur_val=(nbap_com_context_id_t *)g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
com_context_id= cur_val->crnc_context;
}else{
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Couldn't not find Communication Context-ID, unable to reconfigure this E-DCH flow.");
@@ -18504,7 +18504,7 @@ num_items = 1;
}
/*This should not happen*/
- if( (old_info = g_tree_lookup(edch_flow_port_map, GINT_TO_POINTER((gint)com_context_id))) == NULL ){
+ if(( old_info = (nbap_edch_port_info_t *)g_tree_lookup(edch_flow_port_map, GINT_TO_POINTER((gint)com_context_id))) == NULL ){
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Couldn't not find port information for reconfigured E-DCH flow, unable to reconfigure");
return offset;
}
@@ -18529,7 +18529,7 @@ num_items = 1;
if(!p_conv)
return offset;
- p_conv_data = conversation_get_proto_data(p_conv, proto_fp);
+ p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp);
if(!p_conv_data)
return offset;
@@ -18682,7 +18682,7 @@ BindingID_port = 0;
umts_fp_conversation_info->com_context_id = com_context_id;
}else{
nbap_com_context_id_t * cur_val;
- if((cur_val=g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
+ if((cur_val=(nbap_com_context_id_t *)g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
umts_fp_conversation_info->com_context_id = cur_val->crnc_context;
}else{
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Couldn't not set Communication Context-ID, fragments over reconfigured channels might fail");
@@ -23836,7 +23836,7 @@ dissect_nbap_HSDSCH_FDD_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
umts_fp_conversation_info->hsdsch_entity = hs;
}
}else{
- umts_fp_conversation_info->hsdsch_entity = nbap_hsdsch_channel_info[i].entity;
+ umts_fp_conversation_info->hsdsch_entity = (enum fp_hsdsch_entity)nbap_hsdsch_channel_info[i].entity;
}
umts_fp_conversation_info->rlc_mode = nbap_hsdsch_channel_info[i].rlc_mode;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
@@ -24174,7 +24174,7 @@ dissect_nbap_HSDSCH_Information_to_Modify(tvbuff_t *tvb _U_, int offset _U_, asn
umts_fp_conversation_info->hsdsch_entity = hs;
}
}else{
- umts_fp_conversation_info->hsdsch_entity = nbap_hsdsch_channel_info[i].entity;
+ umts_fp_conversation_info->hsdsch_entity = (enum fp_hsdsch_entity)nbap_hsdsch_channel_info[i].entity;
}
umts_fp_conversation_info->rlc_mode = nbap_hsdsch_channel_info[i].rlc_mode;
@@ -28056,7 +28056,7 @@ nbap_com_context_id_t *cur_val;
/*If both are avaible we can update the map*/
if(crcn_context_present){
- if( (cur_val=g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) == NULL ){
+ if( (cur_val=(nbap_com_context_id_t *)g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) == NULL ){
cur_val = g_new(nbap_com_context_id_t,1);
cur_val->crnc_context = com_context_id;
@@ -28832,7 +28832,7 @@ BindingID_port = 0;
umts_fp_conversation_info->com_context_id = com_context_id;
}else{
nbap_com_context_id_t *cur_val;
- if((cur_val=g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
+ if((cur_val=(nbap_com_context_id_t *)g_tree_lookup(com_context_map, GINT_TO_POINTER((gint)node_b_com_context_id))) != NULL){
umts_fp_conversation_info->com_context_id = cur_val->crnc_context;
}else{
expert_add_info_format(actx->pinfo, NULL, PI_MALFORMED, PI_WARN, "Couldn't not set Communication Context-ID, fragments over reconfigured channels might fail");
@@ -28841,10 +28841,10 @@ BindingID_port = 0;
/* Check if we allready have this context */
- if( (old_info = g_tree_lookup(edch_flow_port_map, GINT_TO_POINTER((gint)com_context_id))) == NULL ){
+ if( (old_info = (nbap_edch_port_info_t *)g_tree_lookup(edch_flow_port_map, GINT_TO_POINTER((gint)com_context_id))) == NULL ){
nbap_edch_port_info_t * nbap_edch_port_info;
- nbap_edch_port_info = g_malloc0(sizeof(nbap_edch_port_info_t));
+ nbap_edch_port_info = (nbap_edch_port_info_t *)g_malloc0(sizeof(nbap_edch_port_info_t));
/*Saving port/flow map based on context id for future reconfigurations*/
nbap_edch_port_info->crnc_port[e_dch_macdflow_id] = BindingID_port;
@@ -55234,7 +55234,7 @@ static void add_hsdsch_bind(packet_info *pinfo, proto_tree * tree){
/*Error*/
expert_add_info_format(pinfo, tree, PI_MALFORMED,PI_ERROR, "HSDSCH Entity not specified!");
}else{
- umts_fp_conversation_info->hsdsch_entity = nbap_hsdsch_channel_info[i].entity;
+ umts_fp_conversation_info->hsdsch_entity = (enum fp_hsdsch_entity)nbap_hsdsch_channel_info[i].entity;
}
umts_fp_conversation_info->rlc_mode = nbap_hsdsch_channel_info[i].rlc_mode;
set_umts_fp_conv_data(conversation, umts_fp_conversation_info);
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index 96b2cfaa7f..3b51cfc8f3 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -331,8 +331,8 @@ get_itl_nexus(packet_info *pinfo, gboolean create_new)
{
itl_nexus_t *itl;
- if(create_new || !(itl=se_tree_lookup32_le(ndmp_conv_data->itl, pinfo->fd->num))){
- itl=se_alloc(sizeof(itl_nexus_t));
+ if(create_new || !(itl=(itl_nexus_t *)se_tree_lookup32_le(ndmp_conv_data->itl, pinfo->fd->num))){
+ itl=se_new(itl_nexus_t);
itl->cmdset=0xff;
itl->conversation=ndmp_conv_data->conversation;
se_tree_insert32(ndmp_conv_data->itl, pinfo->fd->num, itl);
@@ -1405,7 +1405,7 @@ dissect_execute_cdb_cdb(tvbuff_t *tvb, int offset, packet_info *pinfo,
cdb_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
if(ndmp_conv_data->task && !ndmp_conv_data->task->itlq){
- ndmp_conv_data->task->itlq=se_alloc(sizeof(itlq_nexus_t));
+ ndmp_conv_data->task->itlq=se_new(itlq_nexus_t);
ndmp_conv_data->task->itlq->lun=0xffff;
ndmp_conv_data->task->itlq->first_exchange_frame=pinfo->fd->num;
ndmp_conv_data->task->itlq->last_exchange_frame=0;
@@ -3121,9 +3121,9 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
conversation = find_or_create_conversation(pinfo);
- ndmp_conv_data=conversation_get_proto_data(conversation, proto_ndmp);
+ ndmp_conv_data=(ndmp_conv_data_t *)conversation_get_proto_data(conversation, proto_ndmp);
if(!ndmp_conv_data){
- ndmp_conv_data=se_alloc(sizeof(ndmp_conv_data_t));
+ ndmp_conv_data=se_new(ndmp_conv_data_t);
ndmp_conv_data->version=NDMP_PROTOCOL_UNKNOWN;
ndmp_conv_data->tasks=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "NDMP tasks");
ndmp_conv_data->itl=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "NDMP itl");
@@ -3175,7 +3175,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
DISSECTOR_ASSERT((pinfo != NULL) && (pinfo->private_data != NULL));
- tcpinfo = pinfo->private_data;
+ tcpinfo = (struct tcpinfo *)pinfo->private_data;
seq = tcpinfo->seq;
len = (ndmp_rm & RPC_RM_FRAGLEN) + 4;
@@ -3187,7 +3187,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
tcpinfo->seq = nxt;
- nfi = se_tree_lookup32(frags, seq);
+ nfi = (ndmp_frag_info *)se_tree_lookup32(frags, seq);
if (!nfi)
{
@@ -3203,7 +3203,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if ( !(pinfo->fd->flags.visited))
{
- nfi=se_alloc(sizeof(ndmp_frag_info));
+ nfi=se_new(ndmp_frag_info);
nfi->first_seq = seq;
nfi->offset = 1;
se_tree_insert32(frags, nxt, (void *)nfi);
@@ -3236,7 +3236,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if ( !(pinfo->fd->flags.visited))
{
- nfi=se_alloc(sizeof(ndmp_frag_info));
+ nfi=se_new(ndmp_frag_info);
nfi->first_seq = seq;
nfi->offset = frag_num+1;
se_tree_insert32(frags, nxt, (void *)nfi);
@@ -3357,14 +3357,14 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch(nh.type){
case NDMP_MESSAGE_REQUEST:
if(!pinfo->fd->flags.visited){
- ndmp_conv_data->task=se_alloc(sizeof(ndmp_task_data_t));
+ ndmp_conv_data->task=se_new(ndmp_task_data_t);
ndmp_conv_data->task->request_frame=pinfo->fd->num;
ndmp_conv_data->task->response_frame=0;
ndmp_conv_data->task->ndmp_time=pinfo->fd->abs_ts;
ndmp_conv_data->task->itlq=NULL;
se_tree_insert32(ndmp_conv_data->tasks, nh.seq, ndmp_conv_data->task);
} else {
- ndmp_conv_data->task=se_tree_lookup32(ndmp_conv_data->tasks, nh.seq);
+ ndmp_conv_data->task=(ndmp_task_data_t *)se_tree_lookup32(ndmp_conv_data->tasks, nh.seq);
}
if(ndmp_conv_data->task && ndmp_conv_data->task->response_frame){
proto_item *it;
@@ -3374,7 +3374,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
break;
case NDMP_MESSAGE_REPLY:
- ndmp_conv_data->task=se_tree_lookup32(ndmp_conv_data->tasks, nh.rep_seq);
+ ndmp_conv_data->task=(ndmp_task_data_t *)se_tree_lookup32(ndmp_conv_data->tasks, nh.rep_seq);
if(ndmp_conv_data->task && !pinfo->fd->flags.visited){
ndmp_conv_data->task->response_frame=pinfo->fd->num;
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index 3e20189b9f..6d454d6103 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -2229,7 +2229,7 @@ dissect_v9_v10_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int
}
v9_v10_tmplt_build_key(&tmplt_key, pinfo, hdrinfo_p->src_id, id);
- tmplt_p = g_hash_table_lookup(v9_v10_tmplt_table, &tmplt_key);
+ tmplt_p = (v9_v10_tmplt_t *)g_hash_table_lookup(v9_v10_tmplt_table, &tmplt_key);
if ((tmplt_p != NULL) && (tmplt_p->length != 0)) {
int count = 1;
/* Note: If the flow contains variable length fields then */
@@ -5361,7 +5361,7 @@ dissect_v9_v10_options_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p
/* ToDo: expert warning if replacement (changed) and new template ignored. */
/* XXX: Is an Options template with only scope fields allowed for V9 ?? */
- tmplt_p = g_hash_table_lookup(v9_v10_tmplt_table, &tmplt);
+ tmplt_p = (v9_v10_tmplt_t *)g_hash_table_lookup(v9_v10_tmplt_table, &tmplt);
if (!pinfo->fd->flags.visited) { /* cache template info only during first pass */
do {
if ((option_scope_field_count == 0) ||
@@ -5375,8 +5375,8 @@ dissect_v9_v10_options_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p
/* ToDo: Test for changed template ? If so: expert ? */
break; /* Don't allow cacheing of this template */
}
- tmplt.fields_p[TF_SCOPES] = se_alloc0(option_scope_field_count *sizeof(v9_v10_tmplt_entry_t));
- tmplt.fields_p[TF_ENTRIES] = se_alloc0(option_field_count *sizeof(v9_v10_tmplt_entry_t));
+ tmplt.fields_p[TF_SCOPES] = (v9_v10_tmplt_entry_t *)se_alloc0(option_scope_field_count *sizeof(v9_v10_tmplt_entry_t));
+ tmplt.fields_p[TF_ENTRIES] = (v9_v10_tmplt_entry_t *)se_alloc0(option_field_count *sizeof(v9_v10_tmplt_entry_t));
break;
} while (FALSE);
}
@@ -5389,7 +5389,7 @@ dissect_v9_v10_options_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p
if ((tmplt_p == NULL) && (tmplt.fields_p[TF_SCOPES] || tmplt.fields_p[TF_ENTRIES])) {
/* create permanent template copy for storage in template table */
- tmplt_p = se_memdup(&tmplt, sizeof(tmplt));
+ tmplt_p = (v9_v10_tmplt_t *)se_memdup(&tmplt, sizeof(tmplt));
SE_COPY_ADDRESS(&tmplt_p->src_addr, &pinfo->net_src);
SE_COPY_ADDRESS(&tmplt_p->dst_addr, &pinfo->net_dst);
g_hash_table_insert(v9_v10_tmplt_table, tmplt_p, tmplt_p);
@@ -5456,7 +5456,7 @@ dissect_v9_v10_data_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdut
/* been allocated) and thus this template will not be cached after dissection. */
/* ToDo: expert warning if replacement (changed) and new template ignored. */
- tmplt_p = g_hash_table_lookup(v9_v10_tmplt_table, &tmplt);
+ tmplt_p = (v9_v10_tmplt_t *)g_hash_table_lookup(v9_v10_tmplt_table, &tmplt);
if (!pinfo->fd->flags.visited) { /* cache template info only during first pass */
do {
if ((count == 0) ||
@@ -5468,7 +5468,7 @@ dissect_v9_v10_data_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdut
/* ToDo: Test for changed template ? If so: expert ? */
break; /* Don't allow cacheing of this template */
}
- tmplt.fields_p[TF_ENTRIES] = se_alloc0(count * sizeof(v9_v10_tmplt_entry_t));
+ tmplt.fields_p[TF_ENTRIES] = (v9_v10_tmplt_entry_t *)se_alloc0(count * sizeof(v9_v10_tmplt_entry_t));
break;
} while (FALSE);
}
@@ -5477,7 +5477,7 @@ dissect_v9_v10_data_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdut
if ((tmplt_p == NULL) && tmplt.fields_p[TF_ENTRIES]) {
/* create permanent template copy for storage in template table */
- tmplt_p = se_memdup(&tmplt, sizeof(tmplt));
+ tmplt_p = (v9_v10_tmplt_t *)se_memdup(&tmplt, sizeof(tmplt));
SE_COPY_ADDRESS(&tmplt_p->src_addr, &pinfo->net_src);
SE_COPY_ADDRESS(&tmplt_p->dst_addr, &pinfo->net_dst);
g_hash_table_insert(v9_v10_tmplt_table, tmplt_p, tmplt_p);
@@ -5506,8 +5506,8 @@ static v9_v10_tmplt_t *v9_v10_tmplt_build_key(v9_v10_tmplt_t *tmplt_p, packet_in
static gboolean
v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2)
{
- const v9_v10_tmplt_t *ta = k1;
- const v9_v10_tmplt_t *tb = k2;
+ const v9_v10_tmplt_t *ta = (v9_v10_tmplt_t *)k1;
+ const v9_v10_tmplt_t *tb = (v9_v10_tmplt_t *)k2;
return (
(CMP_ADDRESS(&ta->src_addr, &tb->src_addr) == 0) &&
@@ -5522,7 +5522,7 @@ v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2)
static guint
v9_v10_tmplt_table_hash(gconstpointer k)
{
- const v9_v10_tmplt_t *tmplt_p = k;
+ const v9_v10_tmplt_t *tmplt_p = (v9_v10_tmplt_t *)k;
guint32 val;
val = tmplt_p->src_id + (tmplt_p->tmplt_id << 9) + tmplt_p->src_port + tmplt_p->dst_port;
diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c
index 49b81f789c..4782a44f79 100644
--- a/epan/dissectors/packet-ros.c
+++ b/epan/dissectors/packet-ros.c
@@ -286,7 +286,7 @@ call_ros_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
static guint
ros_info_hash_matched(gconstpointer k)
{
- const ros_call_response_t *key = k;
+ const ros_call_response_t *key = (const ros_call_response_t *)k;
return key->invokeId;
}
@@ -294,8 +294,8 @@ ros_info_hash_matched(gconstpointer k)
static gint
ros_info_equal_matched(gconstpointer k1, gconstpointer k2)
{
- const ros_call_response_t *key1 = k1;
- const ros_call_response_t *key2 = k2;
+ const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
+ const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
return 0;
@@ -312,7 +312,7 @@ ros_info_equal_matched(gconstpointer k1, gconstpointer k2)
static guint
ros_info_hash_unmatched(gconstpointer k)
{
- const ros_call_response_t *key = k;
+ const ros_call_response_t *key = (const ros_call_response_t *)k;
return key->invokeId;
}
@@ -320,8 +320,8 @@ ros_info_hash_unmatched(gconstpointer k)
static gint
ros_info_equal_unmatched(gconstpointer k1, gconstpointer k2)
{
- const ros_call_response_t *key1 = k1;
- const ros_call_response_t *key2 = k2;
+ const ros_call_response_t *key1 = (const ros_call_response_t *)k1;
+ const ros_call_response_t *key2 = (const ros_call_response_t *)k2;
return key1->invokeId==key2->invokeId;
}
@@ -345,7 +345,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
rcr.rep_frame=pinfo->fd->num;
}
- rcrp=g_hash_table_lookup(ros_info->matched, &rcr);
+ rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->matched, &rcr);
if(rcrp) {
/* we have found a match */
@@ -363,7 +363,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
rcr.invokeId=invokeId;
- rcrp=g_hash_table_lookup(ros_info->unmatched, &rcr);
+ rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->unmatched, &rcr);
if(rcrp){
g_hash_table_remove(ros_info->unmatched, rcrp);
@@ -371,7 +371,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
/* if we cant reuse the old one, grab a new chunk */
if(!rcrp){
- rcrp=se_alloc(sizeof(ros_call_response_t));
+ rcrp=se_new(ros_call_response_t);
}
rcrp->invokeId=invokeId;
rcrp->req_frame=pinfo->fd->num;
@@ -386,7 +386,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui
/* this is a result - it should be in our unmatched list */
rcr.invokeId=invokeId;
- rcrp=g_hash_table_lookup(ros_info->unmatched, &rcr);
+ rcrp=(ros_call_response_t *)g_hash_table_lookup(ros_info->unmatched, &rcr);
if(rcrp){
@@ -1045,12 +1045,12 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/*
* Do we already have our info
*/
- ros_info = conversation_get_proto_data(conversation, proto_ros);
+ ros_info = (ros_conv_info_t *)conversation_get_proto_data(conversation, proto_ros);
if (ros_info == NULL) {
/* No. Attach that information to the conversation. */
- ros_info = g_malloc(sizeof(ros_conv_info_t));
+ ros_info = (ros_conv_info_t *)g_malloc(sizeof(ros_conv_info_t));
ros_info->matched=g_hash_table_new(ros_info_hash_matched, ros_info_equal_matched);
ros_info->unmatched=g_hash_table_new(ros_info_hash_unmatched, ros_info_equal_unmatched);
diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c
index 3b000de100..6af7f9e657 100644
--- a/epan/dissectors/packet-scsi-osd.c
+++ b/epan/dissectors/packet-scsi-osd.c
@@ -426,7 +426,7 @@ static void
dissect_osd_getsetattrib(tvbuff_t *tvb, int offset, proto_tree *tree, scsi_task_data_t *cdata)
{
if(cdata && cdata->itlq && cdata->itlq->extra_data){
- scsi_osd_extra_data_t *extra_data=cdata->itlq->extra_data;
+ scsi_osd_extra_data_t *extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
extra_data->gsatype=(tvb_get_guint8(tvb, offset)>>4)&0x03;
}
proto_tree_add_item(tree, hf_scsi_osd_getsetattrib, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -468,7 +468,7 @@ dissect_osd_attribute_parameters(tvbuff_t *tvb, int offset, proto_tree *parent_t
}
if(cdata && cdata->itlq && cdata->itlq->extra_data){
- extra_data=cdata->itlq->extra_data;
+ extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
gsatype=extra_data->gsatype;
} else {
return offset;
@@ -538,7 +538,7 @@ dissect_osd_attribute_data_out(packet_info *pinfo, tvbuff_t *tvb, int offset _U_
scsi_osd_extra_data_t *extra_data=NULL;
if(cdata && cdata->itlq && cdata->itlq->extra_data){
- extra_data=cdata->itlq->extra_data;
+ extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
gsatype=extra_data->gsatype;
} else {
return;
@@ -567,7 +567,7 @@ dissect_osd_attribute_data_in(packet_info *pinfo, tvbuff_t *tvb, int offset _U_,
scsi_osd_extra_data_t *extra_data=NULL;
if(cdata && cdata->itlq && cdata->itlq->extra_data){
- extra_data=cdata->itlq->extra_data;
+ extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
gsatype=extra_data->gsatype;
} else {
return;
@@ -894,9 +894,9 @@ dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tr
pikey[0].length=2;
pikey[0].key=partition_id;
pikey[1].length=0;
- part_info=se_tree_lookup32_array(lun_info->partitions, &pikey[0]);
+ part_info=(partition_info_t *)se_tree_lookup32_array(lun_info->partitions, &pikey[0]);
if(!part_info){
- part_info=se_alloc(sizeof(partition_info_t));
+ part_info=se_new(partition_info_t);
part_info->created_in=0;
part_info->removed_in=0;
@@ -2629,16 +2629,16 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
}
/* make sure we have a conversation info for this */
- conv_info=conversation_get_proto_data(cdata->itl->conversation, proto_scsi_osd);
+ conv_info=(scsi_osd_conv_info_t *)conversation_get_proto_data(cdata->itl->conversation, proto_scsi_osd);
if(!conv_info){
- conv_info=se_alloc(sizeof(scsi_osd_conv_info_t));
+ conv_info=se_new(scsi_osd_conv_info_t);
conv_info->luns=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "SCSI OSD luns tree");
conversation_add_proto_data(cdata->itl->conversation, proto_scsi_osd, conv_info);
}
/* make sure we have a lun_info structure for this */
- lun_info=se_tree_lookup32(conv_info->luns, cdata->itlq->lun);
+ lun_info=(scsi_osd_lun_info_t *)se_tree_lookup32(conv_info->luns, cdata->itlq->lun);
if(!lun_info){
- lun_info=se_alloc(sizeof(scsi_osd_lun_info_t));
+ lun_info=se_new(scsi_osd_lun_info_t);
lun_info->partitions=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "SCSI OSD partitions tree");
se_tree_insert32(conv_info->luns, cdata->itlq->lun, (void *)lun_info);
}
@@ -2662,7 +2662,7 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if((!pinfo->fd->flags.visited) && (!cdata->itlq->extra_data)){
scsi_osd_extra_data_t *extra_data;
- extra_data=se_alloc(sizeof(scsi_osd_extra_data_t));
+ extra_data=se_new(scsi_osd_extra_data_t);
extra_data->svcaction=svcaction;
extra_data->gsatype=0;
cdata->itlq->extra_data=extra_data;
@@ -2687,7 +2687,7 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* off to the service action dissector
*/
if(cdata && cdata->itlq && cdata->itlq->extra_data){
- scsi_osd_extra_data_t *extra_data=cdata->itlq->extra_data;
+ scsi_osd_extra_data_t *extra_data=(scsi_osd_extra_data_t *)cdata->itlq->extra_data;
svcaction=extra_data->svcaction;
}
if(check_col(pinfo->cinfo, COL_INFO)){
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index 0bdcddbb13..d65c994bc3 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -800,7 +800,7 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
static tvbuff_t *
ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gint len, gchar *msg)
{
- guint8 *buf = g_malloc(10240);
+ guint8 *buf = (guint8 *)g_malloc(10240);
/* arbitrary maximum length */
if (len < 20480) {
@@ -1201,7 +1201,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
return; /* Invalid */
}
- key = se_alloc(sizeof (gint));
+ key = se_new(gint);
*key = (gint)strtol((char*)payload_type, NULL, 10);
transport_info->encoding_name[pt] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
@@ -1236,7 +1236,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
*/
if (transport_info->media_count < 0) {
for (n = 0; n < SDP_MAX_RTP_CHANNELS; n++) {
- encoding_name_and_rate = se_alloc(sizeof (encoding_name_and_rate_t));
+ encoding_name_and_rate = se_new(encoding_name_and_rate_t);
encoding_name_and_rate->encoding_name = se_strdup(transport_info->encoding_name[pt]);
encoding_name_and_rate->sample_rate = transport_info->sample_rate[pt];
if (n == 0) {
@@ -1244,7 +1244,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
key, encoding_name_and_rate);
} else { /* we create a new key and encoding_name to assign to the other hash tables */
gint *key2;
- key2 = se_alloc(sizeof (gint));
+ key2 = se_new(gint);
*key2 = (gint)strtol((char*)payload_type, NULL, 10);
g_hash_table_insert(transport_info->media[n].rtp_dyn_payload,
key2, encoding_name_and_rate);
@@ -1254,7 +1254,7 @@ static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto
/* if the "a=" is after an "m=", only apply to this "m=" */
} else
/* in case there is an overflow in SDP_MAX_RTP_CHANNELS, we keep always the last "m=" */
- encoding_name_and_rate = se_alloc(sizeof (encoding_name_and_rate_t));
+ encoding_name_and_rate = se_new(encoding_name_and_rate_t);
encoding_name_and_rate->encoding_name = se_strdup(transport_info->encoding_name[pt]);
encoding_name_and_rate->sample_rate = transport_info->sample_rate[pt];
@@ -1719,7 +1719,7 @@ setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type ex
if (request_frame != 0)
transport_info = (transport_info_t*)se_tree_lookup32( sdp_transport_reqs, request_frame );
if (transport_info == NULL) {
- transport_info = se_alloc0(sizeof(transport_info_t));
+ transport_info = se_new0(transport_info_t);
transport_info->media_count = -1;
for (n = 0; n < SDP_NO_OF_PT; n++) {
@@ -1837,7 +1837,7 @@ setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type ex
(transport_info->proto_bitmask[n] & (SDP_IPv4|SDP_IPv6))) {
if (rtp_handle) {
if (transport_info->proto_bitmask[n] & SDP_SRTP_PROTO) {
- srtp_info = se_alloc0(sizeof (struct srtp_info));
+ srtp_info = se_new0(struct srtp_info);
if (transport_info->encryption_algorithm != SRTP_ENC_ALG_NOT_SET) {
srtp_info->encryption_algorithm = transport_info->encryption_algorithm;
srtp_info->auth_algorithm = transport_info->auth_algorithm;
@@ -1872,7 +1872,7 @@ setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type ex
(sprt_handle)) {
guint32 *port2;
- port2 = p_get_proto_data(pinfo->fd, proto_sprt);
+ port2 = (guint32 *)p_get_proto_data(pinfo->fd, proto_sprt);
if (transport_info->media_port[n] == 0 && port2) {
sprt_add_address(pinfo, &transport_info->src_addr[n], *port2,
0, "SDP", pinfo->fd->num); /* will use same port as RTP */
@@ -1981,7 +1981,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct srtp_info *srtp_info = NULL;
/* Initialise packet info for passing to tap */
- sdp_pi = ep_alloc(sizeof (sdp_packet_info));
+ sdp_pi = ep_new(sdp_packet_info);
sdp_pi->summary_str[0] = '\0';
if (!pinfo->fd->flags.visited) {
@@ -2180,7 +2180,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(transport_info->proto_bitmask[n] & (SDP_IPv4|SDP_IPv6))) {
if (rtp_handle) {
if (transport_info->proto_bitmask[n] & SDP_SRTP_PROTO) {
- srtp_info = se_alloc0(sizeof (struct srtp_info));
+ srtp_info = se_new0(struct srtp_info);
if (transport_info->encryption_algorithm != SRTP_ENC_ALG_NOT_SET) {
srtp_info->encryption_algorithm = transport_info->encryption_algorithm;
srtp_info->auth_algorithm = transport_info->auth_algorithm;
@@ -2216,7 +2216,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(sprt_handle)) {
guint32 *port2;
- port2 = p_get_proto_data(pinfo->fd, proto_sprt);
+ port2 = (guint32 *)p_get_proto_data(pinfo->fd, proto_sprt);
if (transport_info->media_port[n] == 0 && port2) {
sprt_add_address(pinfo, &transport_info->src_addr[n], *port2,
0, "SDP", pinfo->fd->num); /* will use same port as RTP */
@@ -2255,7 +2255,9 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* if the payload type is dynamic (96 to 127), check the hash table to add the desc in the SDP summary */
if ((local_transport_info.media[n].pt[i] >= 96) && (local_transport_info.media[n].pt[i] <= 127)) {
encoding_name_and_rate_t *encoding_name_and_rate_pt =
- g_hash_table_lookup(local_transport_info.media[n].rtp_dyn_payload, &local_transport_info.media[n].pt[i]);
+ (encoding_name_and_rate_t *)g_hash_table_lookup(
+ local_transport_info.media[n].rtp_dyn_payload,
+ &local_transport_info.media[n].pt[i]);
if (encoding_name_and_rate_pt) {
if (strlen(sdp_pi->summary_str))
g_strlcat(sdp_pi->summary_str, " ", 50);
diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c
index dc066a014c..9bd40615ac 100644
--- a/epan/dissectors/packet-smb-sidsnooping.c
+++ b/epan/dissectors/packet-smb-sidsnooping.c
@@ -69,7 +69,7 @@ find_sid_name(char *sid)
sid_name old_sn;
old_sn.sid=sid;
- sn=g_hash_table_lookup(sid_name_table, &old_sn);
+ sn=(sid_name *)g_hash_table_lookup(sid_name_table, &old_sn);
if(!sn){
return NULL;
}
@@ -83,12 +83,12 @@ add_sid_name_mapping(char *sid, char *name)
sid_name old_sn;
old_sn.sid=sid;
- sn=g_hash_table_lookup(sid_name_table, &old_sn);
+ sn=(sid_name *)g_hash_table_lookup(sid_name_table, &old_sn);
if(sn){
return;
}
- sn=se_alloc(sizeof(sid_name));
+ sn=se_new(sid_name);
sn->sid=g_strdup(sid);
sn->name=g_strdup(name);
g_hash_table_insert(sid_name_table, sn, sn);
@@ -103,7 +103,7 @@ add_sid_name_mapping(char *sid, char *name)
static int
samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, const void *pri)
{
- const dcerpc_info *ri=pri;
+ const dcerpc_info *ri=(const dcerpc_info *)pri;
void *old_ctx=NULL;
char *pol_name;
char *sid;
@@ -123,7 +123,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co
if(!gp || gp->len!=1){
return 0;
}
- fi=gp->pdata[0];
+ fi=(field_info *)gp->pdata[0];
info_level=fi->value.value.sinteger;
if(info_level!=1){
@@ -141,7 +141,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co
if(!gp || gp->len!=1){
return 0;
}
- fi=gp->pdata[0];
+ fi=(field_info *)gp->pdata[0];
old_ctx=g_hash_table_lookup(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num));
if(old_ctx){
@@ -164,7 +164,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co
return 0;
}
- if (!dcerpc_fetch_polhnd_data(old_ctx, &pol_name, NULL, NULL, NULL, ri->call_data->req_frame)) {
+ if (!dcerpc_fetch_polhnd_data((e_ctx_hnd *)old_ctx, &pol_name, NULL, NULL, NULL, ri->call_data->req_frame)) {
return 0;
}
@@ -206,8 +206,8 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co
if (len > 247)
len = 247;
- fi_rid=gp_rids->pdata[num_rids-1];
- fi_name=gp_names->pdata[num_rids-1];
+ fi_rid=(field_info *)gp_rids->pdata[num_rids-1];
+ fi_name=(field_info *)gp_names->pdata[num_rids-1];
g_strlcpy(sid_name_str, sid, 256);
sid_name_str[len++]='-';
g_snprintf(sid_name_str+len, 256-len, "%d",fi_rid->value.value.sinteger);
@@ -235,7 +235,7 @@ lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t *
if(!gp || gp->len!=1){
return 0;
}
- fi=gp->pdata[0];
+ fi=(field_info *)gp->pdata[0];
info_level=fi->value.value.sinteger;
switch(info_level){
@@ -246,14 +246,14 @@ lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t *
if(!gp || gp->len!=1){
return 0;
}
- fi=gp->pdata[0];
+ fi=(field_info *)gp->pdata[0];
domain=fi->value.value.string;
gp=proto_get_finfo_ptr_array(edt->tree, hf_nt_domain_sid);
if(!gp || gp->len!=1){
return 0;
}
- fi=gp->pdata[0];
+ fi=(field_info *)gp->pdata[0];
sid=fi->value.value.string;
add_sid_name_mapping(sid, domain);
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 8a0d43b36e..334850248b 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -411,7 +411,7 @@ sua_assoc_info_t no_sua_assoc = {
static sua_assoc_info_t *
new_assoc(guint32 calling, guint32 called)
{
- sua_assoc_info_t *a = se_alloc0(sizeof(sua_assoc_info_t));
+ sua_assoc_info_t *a = se_new0(sua_assoc_info_t);
a->assoc_id = next_assoc_id++;
a->calling_routing_ind = 0;
@@ -433,8 +433,8 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds
return &no_sua_assoc;
}
- opck = opc->type == AT_SS7PC ? mtp3_pc_hash(opc->data) : g_str_hash(address_to_str(opc));
- dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash(dpc->data) : g_str_hash(address_to_str(dpc));
+ opck = opc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)opc->data) : g_str_hash(address_to_str(opc));
+ dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)dpc->data) : g_str_hash(address_to_str(dpc));
switch (message_type) {
case MESSAGE_TYPE_CORE:
@@ -447,7 +447,7 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds
{0, NULL}
};
- if ( !(assoc = se_tree_lookup32_array(assocs,bw_key)) && ! pinfo->fd->flags.visited) {
+ if ( !(assoc = (sua_assoc_info_t *)se_tree_lookup32_array(assocs,bw_key)) && ! pinfo->fd->flags.visited) {
assoc = new_assoc(opck, dpck);
se_tree_insert32_array(assocs,bw_key,assoc);
assoc->has_bw_key = TRUE;
@@ -473,10 +473,10 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds
{0,NULL}
};
/*g_warning("MESSAGE_TYPE_COAK dst_rn %u,src_rn %u ",dst_rn,src_rn);*/
- if ( ( assoc = se_tree_lookup32_array(assocs, bw_key) ) ) {
+ if ( ( assoc = (sua_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) ) {
goto got_assoc;
}
- if ( (assoc = se_tree_lookup32_array(assocs, fw_key) ) ) {
+ if ( (assoc = (sua_assoc_info_t *)se_tree_lookup32_array(assocs, fw_key) ) ) {
goto got_assoc;
}
@@ -507,7 +507,7 @@ got_assoc:
{1, &dst_rn},
{0, NULL}
};
- assoc = se_tree_lookup32_array(assocs,key);
+ assoc = (sua_assoc_info_t *)se_tree_lookup32_array(assocs,key);
/* Should a check be made on pinfo->p2p_dir ??? */
break;
}
@@ -1375,7 +1375,7 @@ dissect_global_title_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tr
guint8 number_of_digits;
char *gt_digits;
- gt_digits = ep_alloc0(GT_MAX_SIGNALS+1);
+ gt_digits = (char *)ep_alloc0(GT_MAX_SIGNALS+1);
global_title_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) -
(PARAMETER_HEADER_LENGTH + RESERVED_3_LENGTH + GTI_LENGTH + NO_OF_DIGITS_LENGTH + TRANSLATION_TYPE_LENGTH + NUMBERING_PLAN_LENGTH + NATURE_OF_ADDRESS_LENGTH);
@@ -1432,10 +1432,10 @@ dissect_point_code_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree
if (sua_ri == ROUTE_ON_SSN_PC_ROUTING_INDICATOR) {
if (source) {
- sua_opc->type = mtp3_standard;
+ sua_opc->type = (Standard_Type)mtp3_standard;
sua_opc->pc = pc;
} else {
- sua_dpc->type = mtp3_standard;
+ sua_dpc->type = (Standard_Type)mtp3_standard;
sua_dpc->pc = pc;
}
}
@@ -2144,8 +2144,8 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t
no_sua_assoc.has_bw_key = FALSE;
no_sua_assoc.has_fw_key = FALSE;
- sua_opc = ep_alloc0(sizeof(mtp3_addr_pc_t));
- sua_dpc = ep_alloc0(sizeof(mtp3_addr_pc_t));
+ sua_opc = ep_new0(mtp3_addr_pc_t);
+ sua_dpc = ep_new0(mtp3_addr_pc_t);
sua_source_gt = NULL;
sua_destination_gt = NULL;
diff --git a/epan/uat.c b/epan/uat.c
index adf9988232..2f05fb621f 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -68,7 +68,7 @@ uat_t* uat_new(const char* name,
uat_post_update_cb_t post_update_cb,
uat_field_t* flds_array) {
/* Create new uat */
- uat_t* uat = g_malloc(sizeof(uat_t));
+ uat_t* uat = (uat_t *)g_malloc(sizeof(uat_t));
guint i;
/* Add to global array of uats */
@@ -102,7 +102,7 @@ uat_t* uat_new(const char* name,
uat->flags = flags;
for (i=0;flds_array[i].title;i++) {
- fld_data_t* f = g_malloc(sizeof(fld_data_t));
+ fld_data_t* f = (fld_data_t *)g_malloc(sizeof(fld_data_t));
f->colnum = i+1;
f->rep = NULL;
@@ -191,7 +191,7 @@ uat_t* uat_get_table_by_name(const char* name) {
guint i;
for (i=0; i < all_uats->len; i++) {
- uat_t* u = g_ptr_array_index(all_uats,i);
+ uat_t* u = (uat_t *)g_ptr_array_index(all_uats,i);
if ( g_str_equal(u->name,name) ) {
return (u);
}
@@ -304,7 +304,7 @@ uat_t *uat_find(gchar *name) {
guint i;
for (i=0; i < all_uats->len; i++) {
- uat_t* u = g_ptr_array_index(all_uats,i);
+ uat_t* u = (uat_t *)g_ptr_array_index(all_uats,i);
if (strcmp(u->name, name) == 0 || strcmp(u->filename, name) == 0) {
return u;
@@ -344,7 +344,7 @@ void uat_unload_all(void) {
guint i;
for (i=0; i < all_uats->len; i++) {
- uat_t* u = g_ptr_array_index(all_uats,i);
+ uat_t* u = (uat_t *)g_ptr_array_index(all_uats,i);
/* Do not unload if not in profile */
if (u->from_profile) {
uat_clear(u);
@@ -376,7 +376,7 @@ void uat_load_all(void) {
const gchar* err;
for (i=0; i < all_uats->len; i++) {
- uat_t* u = g_ptr_array_index(all_uats,i);
+ uat_t* u = (uat_t *)g_ptr_array_index(all_uats,i);
err = NULL;
if (!u->loaded)
@@ -477,7 +477,7 @@ gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, guint len, const
gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, guint len, const void* v, const void* u3 _U_, const char** err) {
char* str = ep_strndup(strptr,len);
guint i;
- const value_string* vs = v;
+ const value_string* vs = (const value_string *)v;
for(i=0;vs[i].strptr;i++) {
if (g_str_equal(vs[i].strptr,str)) {
@@ -543,7 +543,7 @@ char* uat_unbinstring(const char* si, guint in_len, guint* len_p) {
return NULL;
}
- buf= g_malloc0(len+1);
+ buf= (guint8 *)g_malloc0(len+1);
if (len_p) *len_p = len;
while(in_len) {
@@ -559,13 +559,13 @@ char* uat_unbinstring(const char* si, guint in_len, guint* len_p) {
}
char* uat_unesc(const char* si, guint in_len, guint* len_p) {
- char* buf = g_malloc0(in_len+1);
+ char* buf = (char *)g_malloc0(in_len+1);
char* p = buf;
guint len = 0;
const char* s;
const char* in_end = si+in_len;
- for (s = (void*)si; s < in_end; s++) {
+ for (s = (const char *)si; s < in_end; s++) {
switch(*s) {
case '\\':
switch(*(++s)) {
@@ -647,11 +647,11 @@ char* uat_undquote(const char* si, guint in_len, guint* len_p) {
char* uat_esc(const char* buf, guint len) {
const guint8* end = ((guint8*)buf)+len;
- char* out = ep_alloc0((4*len)+1);
+ char* out = (char *)ep_alloc0((4*len)+1);
const guint8* b;
char* s = out;
- for (b = (void*)buf; b < end; b++) {
+ for (b = (guint8 *)buf; b < end; b++) {
if (isprint(*b) ) {
*(s++) = (*b);
} else {