From cad50146e3cf9855525c3712b4c05a0b198afc94 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Wed, 4 Sep 2013 21:14:55 +0000 Subject: Remove what appear to be the last two instances of pe_tree. Could this be the first emem API to die? svn path=/trunk/; revision=51756 --- epan/guid-utils.c | 13 +++++++------ epan/oids.c | 10 +++++----- epan/oids.h | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/epan/guid-utils.c b/epan/guid-utils.c index a382b0cc6e..13d37de202 100644 --- a/epan/guid-utils.c +++ b/epan/guid-utils.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "guid-utils.h" #ifdef _WIN32 @@ -38,7 +39,7 @@ #include #endif -static emem_tree_t *guid_to_name_tree = NULL; +static wmem_tree_t *guid_to_name_tree = NULL; #ifdef _WIN32 @@ -83,7 +84,7 @@ ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len) void guids_add_guid(e_guid_t *guid, const gchar *name) { - emem_tree_key_t guidkey[2]; + wmem_tree_key_t guidkey[2]; guint32 g[4]; g[0]=guid->data1; @@ -112,7 +113,7 @@ guids_add_guid(e_guid_t *guid, const gchar *name) guidkey[0].length=4; guidkey[1].length=0; - pe_tree_insert32_array(guid_to_name_tree, &guidkey[0], (gchar *) name); + wmem_tree_insert32_array(guid_to_name_tree, &guidkey[0], (gchar *) name); } @@ -120,7 +121,7 @@ guids_add_guid(e_guid_t *guid, const gchar *name) const gchar * guids_get_guid_name(e_guid_t *guid) { - emem_tree_key_t guidkey[2]; + wmem_tree_key_t guidkey[2]; guint32 g[4]; char *name; #ifdef _WIN32 @@ -153,7 +154,7 @@ guids_get_guid_name(e_guid_t *guid) guidkey[0].length=4; guidkey[1].length=0; - if((name = (char *)pe_tree_lookup32_array(guid_to_name_tree, &guidkey[0]))){ + if((name = (char *)wmem_tree_lookup32_array(guid_to_name_tree, &guidkey[0]))){ return name; } @@ -173,7 +174,7 @@ guids_get_guid_name(e_guid_t *guid) void guids_init(void) { - guid_to_name_tree=pe_tree_create(EMEM_TREE_TYPE_RED_BLACK, "guid_to_name"); + guid_to_name_tree=wmem_tree_new(wmem_epan_scope()); /* XXX here is a good place to read a config file with wellknown guids */ } diff --git a/epan/oids.c b/epan/oids.c index 43644ac4b1..06111b5054 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -98,7 +98,7 @@ static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_ty debuglevel = debug_env ? (int)strtoul(debug_env,NULL,10) : 0; - oid_root.children = pe_tree_create(EMEM_TREE_TYPE_RED_BLACK,"oid_root"); + oid_root.children = wmem_tree_new(wmem_epan_scope()); /* * make sure we got strings at least in the three root-children oids @@ -112,7 +112,7 @@ static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_ty oid_len--; do { - oid_info_t* n = (oid_info_t *)emem_tree_lookup32((emem_tree_t *)c->children,subids[i]); + oid_info_t* n = (oid_info_t *)wmem_tree_lookup32(c->children,subids[i]); if(n) { if (i == oid_len) { @@ -142,13 +142,13 @@ static oid_info_t* add_oid(const char* name, oid_kind_t kind, const oid_value_ty n = (oid_info_t *)g_malloc(sizeof(oid_info_t)); n->subid = subids[i]; n->kind = kind; - n->children = pe_tree_create(EMEM_TREE_TYPE_RED_BLACK,"oid_children"); + n->children = wmem_tree_new(wmem_epan_scope()); n->value_hfid = -2; n->key = key; n->parent = c; n->bits = NULL; - emem_tree_insert32((emem_tree_t *)c->children,n->subid,n); + wmem_tree_insert32(c->children,n->subid,n); if (i == oid_len) { n->name = g_strdup(name); @@ -995,7 +995,7 @@ oid_info_t* oid_get(guint len, guint32* subids, guint* matched, guint* left) { } for( i=0; i < len; i++) { - oid_info_t* next_oid = (oid_info_t *)emem_tree_lookup32((emem_tree_t *)curr_oid->children,subids[i]); + oid_info_t* next_oid = (oid_info_t *)wmem_tree_lookup32(curr_oid->children,subids[i]); if (next_oid) { curr_oid = next_oid; } else { diff --git a/epan/oids.h b/epan/oids.h index 34a4f543cb..e8221d4241 100644 --- a/epan/oids.h +++ b/epan/oids.h @@ -29,6 +29,7 @@ #include #include +#include #include "ws_symbol_export.h" /** @@ -100,7 +101,7 @@ typedef struct _oid_info_t { guint32 subid; char* name; oid_kind_t kind; - void* children; /**< an emem_tree_t* */ + wmem_tree_t* children; const oid_value_type_t* value_type; int value_hfid; oid_key_t* key; -- cgit v1.2.3