diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-12 10:03:17 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-08-12 10:03:17 +0000 |
commit | 44e326cf17e0c143bf09dfc3cbfae647e2553211 (patch) | |
tree | cc9b9a9eae8395066bd94aeecf6a8fdb0121f502 /epan | |
parent | ccc72e47f09c5d3cee175d591a116710d49f30f6 (diff) |
remove some unused variables from scsi
change two gmemchunks in smtp to se_alloc() and remove one now redundant init routine.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15308 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-scsi.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-smtp.c | 28 |
2 files changed, 3 insertions, 29 deletions
diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index 3ae0455832..1d2164988f 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -3516,7 +3516,6 @@ dissect_mmc4_reportkey (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, { guint8 flags, agid, key_format, key_class; - char *str; if (tree && isreq && iscdb) { proto_tree_add_item (tree, hf_scsi_lba, tvb, offset+1, @@ -3578,7 +3577,6 @@ dissect_mmc4_setstreaming (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr { guint8 flags, type; - char *str; if (tree && isreq && iscdb) { type=tvb_get_guint8(tvb, offset+7); @@ -3697,7 +3695,6 @@ dissect_mmc4_getconfiguration (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree { guint8 flags; gint32 len; - char *str; guint old_offset; if (tree && isreq && iscdb) { @@ -3841,7 +3838,6 @@ dissect_mmc4_readtocpmaatip (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * { guint8 flags, format; gint16 len; - char *str; if (tree && isreq && iscdb) { format=tvb_get_guint8(tvb, offset+1)&0x0f; diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c index f3f5503d11..7c58f11de6 100644 --- a/epan/dissectors/packet-smtp.c +++ b/epan/dissectors/packet-smtp.c @@ -39,6 +39,7 @@ #include <epan/addr_resolv.h> #include <epan/prefs.h> #include <epan/strutil.h> +#include <epan/emem.h> #define TCP_PORT_SMTP 25 @@ -70,8 +71,6 @@ struct smtp_proto_data { guint16 pdu_type; }; -static int smtp_packet_init_count = 100; - /* * State information stored with a conversation. */ @@ -80,26 +79,6 @@ struct smtp_request_val { guint16 crlf_seen; /* Have we seen a CRLF on the end of a packet */ }; -static GMemChunk *smtp_request_vals = NULL; -static GMemChunk *smtp_packet_infos = NULL; - -static void -smtp_init_protocol(void) -{ - if (smtp_request_vals) - g_mem_chunk_destroy(smtp_request_vals); - if (smtp_packet_infos) - g_mem_chunk_destroy(smtp_packet_infos); - - smtp_request_vals = g_mem_chunk_new("smtp_request_vals", - sizeof(struct smtp_request_val), - smtp_packet_init_count * sizeof(struct smtp_request_val), G_ALLOC_AND_FREE); - smtp_packet_infos = g_mem_chunk_new("smtp_packet_infos", - sizeof(struct smtp_proto_data), - smtp_packet_init_count * sizeof(struct smtp_proto_data), G_ALLOC_AND_FREE); - -} - static void dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -195,7 +174,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * No - create one and attach it. */ - request_val = g_mem_chunk_alloc(smtp_request_vals); + request_val = se_alloc(sizeof(struct smtp_request_val)); request_val->reading_data = FALSE; request_val->crlf_seen = 0; @@ -246,7 +225,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (request) { - frame_data = g_mem_chunk_alloc(smtp_packet_infos); + frame_data = se_alloc(sizeof(struct smtp_proto_data)); if (request_val->reading_data) { /* @@ -577,7 +556,6 @@ proto_register_smtp(void) proto_register_field_array(proto_smtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_init_routine(&smtp_init_protocol); smtp_module = prefs_register_protocol(proto_smtp, NULL); prefs_register_bool_preference(smtp_module, "desegment_lines", |