diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-12-16 18:57:16 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-12-16 18:57:16 +0000 |
commit | b57a636e4b4d23ba89c9d18118ed231500b0de06 (patch) | |
tree | 0f84de7c407e0db84050d712234af6958f96f332 /gdb/symtab.c | |
parent | 2344b8da6ee2fa235bce354c0da505933c055559 (diff) | |
download | gdb-b57a636e4b4d23ba89c9d18118ed231500b0de06.zip gdb-b57a636e4b4d23ba89c9d18118ed231500b0de06.tar.gz gdb-b57a636e4b4d23ba89c9d18118ed231500b0de06.tar.bz2 |
gdb/
Code cleanup.
* breakpoint.c (clear_command): Remove variable sal_name_len and its
initialization, remove it from the compare_filenames_for_search call.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
name_len and its initialization, remove it from the
compare_filenames_for_search calls.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symtab.c (compare_filenames_for_search): Remove the search_len
parameter, update the function comment, new variable search_len
initialized from SEARCH_NAME.
(iterate_over_some_symtabs): Remove variable name_len and its
initialization, remove it from the compare_filenames_for_search calls.
* symtab.h (compare_filenames_for_search): Remove the search_len
parameter,
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 50ba92a..0fd75e5 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -147,15 +147,14 @@ const struct block *block_found; /* See whether FILENAME matches SEARCH_NAME using the rule that we advertise to the user. (The manual's description of linespecs - describes what we advertise). SEARCH_LEN is the length of - SEARCH_NAME. We assume that SEARCH_NAME is a relative path. - Returns true if they match, false otherwise. */ + describes what we advertise). We assume that SEARCH_NAME is + a relative path. Returns true if they match, false otherwise. */ int -compare_filenames_for_search (const char *filename, const char *search_name, - int search_len) +compare_filenames_for_search (const char *filename, const char *search_name) { int len = strlen (filename); + size_t search_len = strlen (search_name); if (len < search_len) return 0; @@ -196,7 +195,6 @@ iterate_over_some_symtabs (const char *name, { struct symtab *s = NULL; const char* base_name = lbasename (name); - int name_len = strlen (name); int is_abs = IS_ABSOLUTE_PATH (name); for (s = first; s != NULL && s != after_last; s = s->next) @@ -208,7 +206,7 @@ iterate_over_some_symtabs (const char *name, return 1; } - if (!is_abs && compare_filenames_for_search (s->filename, name, name_len)) + if (!is_abs && compare_filenames_for_search (s->filename, name)) { if (callback (s, data)) return 1; @@ -233,8 +231,7 @@ iterate_over_some_symtabs (const char *name, return 1; } - if (fp != NULL && !is_abs && compare_filenames_for_search (fp, name, - name_len)) + if (fp != NULL && !is_abs && compare_filenames_for_search (fp, name)) { if (callback (s, data)) return 1; @@ -256,7 +253,7 @@ iterate_over_some_symtabs (const char *name, return 1; } - if (!is_abs && compare_filenames_for_search (rp, name, name_len)) + if (!is_abs && compare_filenames_for_search (rp, name)) { if (callback (s, data)) return 1; |