summaryrefslogtreecommitdiff
path: root/gdb/dictionary.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-11-24 19:01:49 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-11-24 19:01:49 +0000
commit16072ec1dd19fe5e5c617db032ba8753e0b2b386 (patch)
treebfaca948b2d476a4cc8dff373e0cbe224091dcd1 /gdb/dictionary.c
parente055e88cae3798e2d6b0f8e701ca2e7146d92cc9 (diff)
downloadgdb-16072ec1dd19fe5e5c617db032ba8753e0b2b386.tar.gz
gdb/
Code cleanup. * dictionary.c (struct dict_vector) <iter_match_first, iter_match_next> (iter_match_first_hashed, iter_match_next_hashed) (iter_match_first_linear, iter_match_next_linear) (dict_iter_match_first, dict_iter_match_next, iter_match_first_hashed) (iter_match_next_hashed, iter_match_first_linear) (iter_match_next_linear): Use symbol_compare_ftype. * dictionary.h: Include symfile.h. (dict_iter_match_first, dict_iter_match_next): Use symbol_compare_ftype. * dwarf2read.c (dw2_map_matching_symbols): Likewise. * psymtab.c (match_partial_symbol, match_partial_symbol, map_block) (map_matching_symbols_psymtab): Likewise. * symfile.h (symbol_compare_ftype): New typedef. (struct quick_symbol_functions) <map_matching_symbols): Use symbol_compare_ftype.
Diffstat (limited to 'gdb/dictionary.c')
-rw-r--r--gdb/dictionary.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 9d53ff0e301..6b0f7a959d6 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -118,13 +118,11 @@ struct dict_vector
struct symbol *(*iterator_next) (struct dict_iterator *iterator);
/* Functions to iterate over symbols with a given name. */
struct symbol *(*iter_match_first) (const struct dictionary *dict,
- const char *name,
- int (*equiv) (const char *,
- const char *),
- struct dict_iterator *iterator);
+ const char *name,
+ symbol_compare_ftype *equiv,
+ struct dict_iterator *iterator);
struct symbol *(*iter_match_next) (const char *name,
- int (*equiv) (const char *,
- const char *),
+ symbol_compare_ftype *equiv,
struct dict_iterator *iterator);
/* A size function, for maint print symtabs. */
int (*size) (const struct dictionary *dict);
@@ -243,13 +241,11 @@ static struct symbol *iterator_next_hashed (struct dict_iterator *iterator);
static struct symbol *iter_match_first_hashed (const struct dictionary *dict,
const char *name,
- int (*compare) (const char *,
- const char *),
+ symbol_compare_ftype *compare,
struct dict_iterator *iterator);
static struct symbol *iter_match_next_hashed (const char *name,
- int (*compare) (const char *,
- const char *),
+ symbol_compare_ftype *compare,
struct dict_iterator *iterator);
static unsigned int dict_hash (const char *string);
@@ -277,13 +273,11 @@ static struct symbol *iterator_next_linear (struct dict_iterator *iterator);
static struct symbol *iter_match_first_linear (const struct dictionary *dict,
const char *name,
- int (*compare) (const char *,
- const char *),
+ symbol_compare_ftype *compare,
struct dict_iterator *iterator);
static struct symbol *iter_match_next_linear (const char *name,
- int (*compare) (const char *,
- const char *),
+ symbol_compare_ftype *compare,
struct dict_iterator *iterator);
static int size_linear (const struct dictionary *dict);
@@ -542,16 +536,14 @@ dict_iter_name_next (const char *name, struct dict_iterator *iterator)
struct symbol *
dict_iter_match_first (const struct dictionary *dict,
- const char *name,
- int (*compare) (const char *, const char *),
+ const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (dict))->iter_match_first (dict, name, compare, iterator);
}
struct symbol *
-dict_iter_match_next (const char *name,
- int (*compare) (const char *, const char *),
+dict_iter_match_next (const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
return (DICT_VECTOR (DICT_ITERATOR_DICT (iterator)))
@@ -646,9 +638,8 @@ iterator_hashed_advance (struct dict_iterator *iterator)
}
static struct symbol *
-iter_match_first_hashed (const struct dictionary *dict,
- const char *name,
- int (*compare) (const char *, const char *),
+iter_match_first_hashed (const struct dictionary *dict, const char *name,
+ symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
unsigned int hash_index = dict_hash (name) % DICT_HASHED_NBUCKETS (dict);
@@ -677,8 +668,7 @@ iter_match_first_hashed (const struct dictionary *dict,
}
static struct symbol *
-iter_match_next_hashed (const char *name,
- int (*compare) (const char *, const char *),
+iter_match_next_hashed (const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
struct symbol *next;
@@ -868,8 +858,7 @@ iterator_next_linear (struct dict_iterator *iterator)
static struct symbol *
iter_match_first_linear (const struct dictionary *dict,
- const char *name,
- int (*compare) (const char *, const char *),
+ const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
DICT_ITERATOR_DICT (iterator) = dict;
@@ -879,8 +868,7 @@ iter_match_first_linear (const struct dictionary *dict,
}
static struct symbol *
-iter_match_next_linear (const char *name,
- int (*compare) (const char *, const char *),
+iter_match_next_linear (const char *name, symbol_compare_ftype *compare,
struct dict_iterator *iterator)
{
const struct dictionary *dict = DICT_ITERATOR_DICT (iterator);