diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-03-17 17:52:26 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-03-17 17:52:26 +0000 |
commit | 3e3847517636caa23cfa71981d79962e9e7c58a2 (patch) | |
tree | b3f141b4c44c1239f4a0d3d48088b948f8955905 /epan/dissectors/packet-h245.c | |
parent | 81e80f2c0b43144a020ded42a2c5b8e9b66c6b2a (diff) |
From beroset:
remove C++ incompatibilities
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416
svn path=/trunk/; revision=48356
Diffstat (limited to 'epan/dissectors/packet-h245.c')
-rw-r--r-- | epan/dissectors/packet-h245.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index 8195b9f3e3..89c22dd3bf 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -485,17 +485,17 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha /* (S)RTP, (S)RTCP */ if (upcoming_channel_lcl->rfc2198 > 0) { - encoding_name_and_rate_t *encoding_name_and_rate = se_alloc( sizeof(encoding_name_and_rate_t)); + encoding_name_and_rate_t *encoding_name_and_rate = se_new(encoding_name_and_rate_t); rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal); encoding_name_and_rate->encoding_name = se_strdup("red"); encoding_name_and_rate->sample_rate = 8000; - key = se_alloc(sizeof(gint)); + key = se_new(gint); *key = upcoming_channel_lcl->rfc2198; g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate); } if (upcoming_channel_lcl->srtp_flag) { - dummy_srtp_info = se_alloc0(sizeof(struct srtp_info)); + dummy_srtp_info = se_new0(struct srtp_info); } /* DEBUG g_warning("h245_setup_channels media_addr.addr.type %u port %u",upcoming_channel_lcl->media_addr.addr.type, upcoming_channel_lcl->media_addr.port ); @@ -3709,7 +3709,7 @@ dissect_h245_T_booleanArray(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx gefx = gef_ctx_get(actx->private_data); if (gefx) { - buf = ep_alloc(sizeof(guint8)); + buf = ep_new(guint8); buf[0] = value; value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint8), sizeof(guint8)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ @@ -3736,7 +3736,7 @@ dissect_h245_T_unsignedMin(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ gefx = gef_ctx_get(actx->private_data); if (gefx) { - buf = ep_alloc(sizeof(guint16)); + buf = (guint8 *)ep_new(guint16); phtons(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ @@ -3763,7 +3763,7 @@ dissect_h245_T_unsignedMax(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ gefx = gef_ctx_get(actx->private_data); if (gefx) { - buf = ep_alloc(sizeof(guint16)); + buf = (guint8 *)ep_new(guint16); phtons(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ @@ -3790,7 +3790,7 @@ dissect_h245_T_unsigned32Min(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx gefx = gef_ctx_get(actx->private_data); if (gefx) { - buf = ep_alloc(sizeof(guint32)); + buf = (guint8 *)ep_new(guint32); phtonl(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ @@ -3817,7 +3817,7 @@ dissect_h245_T_unsigned32Max(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx gefx = gef_ctx_get(actx->private_data); if (gefx) { - buf = ep_alloc(sizeof(guint32)); + buf = (guint8 *)ep_new(guint32); phtonl(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ @@ -7390,7 +7390,7 @@ dissect_h245_T_h223_al_type_al3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a #line 315 "../../asn1/h245/h245.cnf" if(h223_lc_params_temp) { h223_lc_params_temp->al_type = al3; - h223_lc_params_temp->al_params = se_alloc(sizeof(h223_al3_params)); + h223_lc_params_temp->al_params = se_new(h223_al3_params); } offset = dissect_h245_Al3(tvb, offset, actx, tree, hf_index); @@ -7800,7 +7800,7 @@ dissect_h245_H223LogicalChannelParameters(tvbuff_t *tvb _U_, int offset _U_, asn static int dissect_h245_OLC_fw_h223_params(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 186 "../../asn1/h245/h245.cnf" - h223_fw_lc_params = se_alloc(sizeof(h223_lc_params)); + h223_fw_lc_params = se_new(h223_lc_params); h223_fw_lc_params->al_type = al_nonStandard; h223_fw_lc_params->al_params = NULL; h223_fw_lc_params->segmentable = 0; @@ -8431,7 +8431,7 @@ dissect_h245_T_forwardLogicalChannelParameters(tvbuff_t *tvb _U_, int offset _U_ static int dissect_h245_OLC_rev_h223_params(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 207 "../../asn1/h245/h245.cnf" - h223_rev_lc_params = se_alloc(sizeof(h223_lc_params)); + h223_rev_lc_params = se_new(h223_lc_params); h223_rev_lc_params->al_type = al_nonStandard; h223_rev_lc_params->al_params = NULL; h223_rev_lc_params->segmentable = 0; @@ -8694,7 +8694,7 @@ dissect_h245_OpenLogicalChannel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a #line 130 "../../asn1/h245/h245.cnf" gint32 temp; - upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_alloc0(sizeof(olc_info_t)) : NULL; + upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_new0(olc_info_t) : NULL; h223_fw_lc_num = 0; h223_lc_params_temp = NULL; @@ -8704,7 +8704,7 @@ dissect_h245_OpenLogicalChannel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a if(h223_fw_lc_num != 0 && h223_fw_lc_params) { - h223_pending_olc *pending = se_alloc(sizeof(h223_pending_olc)); + h223_pending_olc *pending = se_new(h223_pending_olc); pending->fw_channel_params = h223_fw_lc_params; pending->rev_channel_params = h223_rev_lc_params; temp = h223_fw_lc_num; @@ -8980,7 +8980,7 @@ static int dissect_h245_MultiplexElement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 83 "../../asn1/h245/h245.cnf" /*MultiplexElement*/ - h223_mux_element* me = se_alloc(sizeof(h223_mux_element)); + h223_mux_element* me = se_new(h223_mux_element); h223_me->next = me; h223_me = me; h223_me->next = NULL; @@ -11050,7 +11050,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t const gchar *olc_key; olc_info_t *olc_req; - upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_alloc0(sizeof(olc_info_t)) : NULL; + upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_new0(olc_info_t) : NULL; h223_fw_lc_num = 0; h223_rev_lc_num = 0; @@ -11066,7 +11066,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t actx->pinfo->p2p_dir = P2P_DIR_RECV; else actx->pinfo->p2p_dir = P2P_DIR_SENT; - pend = g_hash_table_lookup( h223_pending_olc_reqs[actx->pinfo->p2p_dir], GINT_TO_POINTER(temp) ); + pend = (h223_pending_olc *)g_hash_table_lookup( h223_pending_olc_reqs[actx->pinfo->p2p_dir], GINT_TO_POINTER(temp) ); if (pend) { DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params) || (!h223_rev_lc_num && !pend->rev_channel_params) ); @@ -11082,7 +11082,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t if (upcoming_olc) { olc_key = gen_olc_key(upcoming_olc->fwd_lc_num, &actx->pinfo->src, &actx->pinfo->dst); - olc_req = g_hash_table_lookup(h245_pending_olc_reqs, olc_key); + olc_req = (olc_info_t *)g_hash_table_lookup(h245_pending_olc_reqs, olc_key); if (olc_req) { update_unicast_addr(&olc_req->fwd_lc.media_addr, &upcoming_olc->fwd_lc.media_addr); update_unicast_addr(&olc_req->fwd_lc.media_control_addr, &upcoming_olc->fwd_lc.media_control_addr); @@ -14527,7 +14527,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* assume that whilst there is more tvb data, there are more h245 commands */ while ( tvb_length_remaining( tvb, offset>>3 )>0 ){ CLEANUP_PUSH(reset_h245_pi, NULL); - h245_pi=ep_alloc(sizeof(h245_packet_info)); + h245_pi=ep_new(h245_packet_info); init_h245_packet_info(h245_pi); asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo); offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn1_ctx, tr, hf_h245_pdu_type); |