aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-02-10 08:53:18 +0400
committerJoel Brobecker <brobecker@adacore.com>2014-02-10 11:45:55 +0400
commitf0c5f9b2b8438e44abc30d18574a4d2ea44d2f67 (patch)
treedbe28f2dec3587fca4cf2189764cf42912089d77
parented3ef33944c39d9a3cea72b9a7cef3c20f0e3461 (diff)
downloadgdb-f0c5f9b2b8438e44abc30d18574a4d2ea44d2f67.zip
gdb-f0c5f9b2b8438e44abc30d18574a4d2ea44d2f67.tar.gz
gdb-f0c5f9b2b8438e44abc30d18574a4d2ea44d2f67.tar.bz2
struct block parameter constification in ada-lang.c
This patch series constifies a number of struct block * parameters. gdb/ChangeLog: * ada-lang.c (ada_add_block_symbols, add_defn_to_vec) (lookup_cached_symbol, ada_add_local_symbols): Add "const" to struct block * parameter. (ada_lookup_symbol_list_worker): Constify local variable "block". Remove cast which is no longer necessary.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/ada-lang.c18
2 files changed, 16 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 99eb2fb..940c6a2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2014-02-10 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_add_block_symbols, add_defn_to_vec)
+ (lookup_cached_symbol, ada_add_local_symbols): Add "const" to
+ struct block * parameter.
+ (ada_lookup_symbol_list_worker): Constify local variable "block".
+ Remove cast which is no longer necessary.
+
2014-02-10 Doug Evans <xdje42@gmail.com>
Add Guile as an extension language.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index cad480f..269112c 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -109,13 +109,13 @@ static int full_match (const char *, const char *);
static struct value *make_array_descriptor (struct type *, struct value *);
static void ada_add_block_symbols (struct obstack *,
- struct block *, const char *,
+ const struct block *, const char *,
domain_enum, struct objfile *, int);
static int is_nonfunction (struct ada_symbol_info *, int);
static void add_defn_to_vec (struct obstack *, struct symbol *,
- struct block *);
+ const struct block *);
static int num_defns_collected (struct obstack *);
@@ -4250,7 +4250,7 @@ make_array_descriptor (struct type *type, struct value *arr)
static int
lookup_cached_symbol (const char *name, domain_enum namespace,
- struct symbol **sym, struct block **block)
+ struct symbol **sym, const struct block **block)
{
return 0;
}
@@ -4374,7 +4374,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
static void
add_defn_to_vec (struct obstack *obstackp,
struct symbol *sym,
- struct block *block)
+ const struct block *block)
{
int i;
struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
@@ -4932,7 +4932,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
static void
ada_add_local_symbols (struct obstack *obstackp, const char *name,
- struct block *block, domain_enum domain,
+ const struct block *block, domain_enum domain,
int wild_match_p)
{
int block_depth = 0;
@@ -5163,7 +5163,7 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
int full_search)
{
struct symbol *sym;
- struct block *block;
+ const struct block *block;
const char *name;
const int wild_match_p = should_use_wild_match (name0);
int cacheIfUnique;
@@ -5177,9 +5177,7 @@ ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
/* Search specified block and its superiors. */
name = name0;
- block = (struct block *) block0; /* FIXME: No cast ought to be
- needed, but adding const will
- have a cascade effect. */
+ block = block0;
/* Special case: If the user specifies a symbol name inside package
Standard, do a non-wild matching of the symbol name without
@@ -5626,7 +5624,7 @@ full_match (const char *sym_name, const char *search_name)
static void
ada_add_block_symbols (struct obstack *obstackp,
- struct block *block, const char *name,
+ const struct block *block, const char *name,
domain_enum domain, struct objfile *objfile,
int wild)
{