From 07c29e74e9ca2ef0003069b212b3c1ac382abf5a Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sun, 15 Sep 2013 09:12:01 +0000 Subject: Convert a few more dissectors to wmem API svn path=/trunk/; revision=52052 --- epan/dissectors/packet-enttec.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'epan/dissectors/packet-enttec.c') diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c index 83817caaa2..32da615680 100644 --- a/epan/dissectors/packet-enttec.c +++ b/epan/dissectors/packet-enttec.c @@ -34,6 +34,7 @@ #include #include #include +#include /* * See @@ -191,9 +192,9 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) "%3u: %s" }; - guint8 *dmx_data = (guint8 *)ep_alloc(512 * sizeof(guint8)); - guint16 *dmx_data_offset = (guint16 *)ep_alloc(513 * sizeof(guint16)); /* 1 extra for last offset */ - emem_strbuf_t *dmx_epstr; + guint8 *dmx_data = (guint8 *)wmem_alloc(wmem_packet_scope(), 512 * sizeof(guint8)); + guint16 *dmx_data_offset = (guint16 *)wmem_alloc(wmem_packet_scope(), 513 * sizeof(guint16)); /* 1 extra for last offset */ + wmem_strbuf_t *dmx_epstr; proto_tree *hi,*si; proto_item *item; @@ -277,22 +278,22 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) si = proto_item_add_subtree(hi, ett_enttec); row_count = (ui/global_disp_col_count) + ((ui%global_disp_col_count) == 0 ? 0 : 1); - dmx_epstr = ep_strbuf_new_label(NULL); + dmx_epstr = wmem_strbuf_new_label(wmem_packet_scope()); for (r=0; r < row_count;r++) { for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) { if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) { - ep_strbuf_append_c(dmx_epstr, ' '); + wmem_strbuf_append_c(dmx_epstr, ' '); } v = dmx_data[(r*global_disp_col_count)+c]; if (global_disp_chan_val_type == 0) { v = (v * 100) / 255; if (v == 100) { - ep_strbuf_append(dmx_epstr, "FL "); + wmem_strbuf_append(dmx_epstr, "FL "); } else { - ep_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); + wmem_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); } } else { - ep_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); + wmem_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); } } @@ -302,8 +303,9 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) proto_tree_add_none_format(si,hf_enttec_dmx_data_dmx_data, tvb, offset+start_offset, end_offset-start_offset, - string_format[global_disp_chan_nr_type], (r*global_disp_col_count)+1, dmx_epstr->str); - ep_strbuf_truncate(dmx_epstr, 0); + string_format[global_disp_chan_nr_type], (r*global_disp_col_count)+1, + wmem_strbuf_get_str(dmx_epstr)); + wmem_strbuf_truncate(dmx_epstr, 0); } item = proto_tree_add_item(si, hf_enttec_dmx_data_data_filter, tvb, -- cgit v1.2.3