diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-15 09:12:01 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-15 09:12:01 +0000 |
commit | 07c29e74e9ca2ef0003069b212b3c1ac382abf5a (patch) | |
tree | 2a97b9386cf4ebaf03438290b8bdd392e717d6de /epan/dissectors/packet-enttec.c | |
parent | eda53fd1b729d42dc26d05e7636299b65936e140 (diff) |
Convert a few more dissectors to wmem API
svn path=/trunk/; revision=52052
Diffstat (limited to 'epan/dissectors/packet-enttec.c')
-rw-r--r-- | epan/dissectors/packet-enttec.c | 22 |
1 files changed, 12 insertions, 10 deletions
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 <epan/addr_resolv.h> #include <epan/prefs.h> #include <epan/strutil.h> +#include <epan/wmem/wmem.h> /* * 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, |