This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] delete unneeded last argument to calls to lookup_symbol
- From: David Carlton <carlton at math dot stanford dot edu>
- To: gdb-patches at sources dot redhat dot com
- Date: 02 Jun 2003 11:10:37 -0700
- Subject: [commit] delete unneeded last argument to calls to lookup_symbol
There are a few places in GDB that pass a non-NULL last argument to
lookup_symbol even though the caller doesn't use the value stored in
that argument. This patch replaces those arguments by a NULL
argument; this makes it a little bit easier to see that linespec.c is
the only place that uses that last argument.
Tested on GCC 3.1, DWARF 2, i686-pc-linux-gnu; committed as obvious.
David Carlton
carlton@math.stanford.edu
2003-06-02 David Carlton <carlton@math.stanford.edu>
* objc-lang.c (find_imps): Delete unneeded variable 'sym_symtab'.
* c-valprint.c (c_val_print): Delete unneeded variable 's'.
* p-valprint.c (pascal_val_print): Ditto.
* ada-lang.c (standard_lookup): Delete unneded variable 'symtab'.
Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.25
diff -u -p -r1.25 objc-lang.c
--- objc-lang.c 30 May 2003 02:45:21 -0000 1.25
+++ objc-lang.c 2 Jun 2003 17:31:26 -0000
@@ -1421,7 +1421,6 @@ char *find_imps (struct symtab *symtab,
if (tmp == NULL) {
- struct symtab *sym_symtab = NULL;
struct symbol *sym = NULL;
struct minimal_symbol *msym = NULL;
@@ -1431,7 +1430,7 @@ char *find_imps (struct symtab *symtab,
if (tmp == NULL)
return NULL;
- sym = lookup_symbol (selector, block, VAR_DOMAIN, 0, &sym_symtab);
+ sym = lookup_symbol (selector, block, VAR_DOMAIN, 0, NULL);
if (sym != NULL)
{
if (syms)
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.19
diff -u -p -r1.19 c-valprint.c
--- c-valprint.c 14 May 2003 17:43:16 -0000 1.19
+++ c-valprint.c 2 Jun 2003 17:31:40 -0000
@@ -213,13 +213,12 @@ c_val_print (struct type *type, char *va
struct value *vt_val;
struct symbol *wsym = (struct symbol *) NULL;
struct type *wtype;
- struct symtab *s;
struct block *block = (struct block *) NULL;
int is_this_fld;
if (msymbol != NULL)
wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
- VAR_DOMAIN, &is_this_fld, &s);
+ VAR_DOMAIN, &is_this_fld, NULL);
if (wsym)
{
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.19
diff -u -p -r1.19 p-valprint.c
--- p-valprint.c 24 May 2003 03:21:42 -0000 1.19
+++ p-valprint.c 2 Jun 2003 17:31:48 -0000
@@ -222,13 +222,12 @@ pascal_val_print (struct type *type, cha
struct value *vt_val;
struct symbol *wsym = (struct symbol *) NULL;
struct type *wtype;
- struct symtab *s;
struct block *block = (struct block *) NULL;
int is_this_fld;
if (msymbol != NULL)
wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block,
- VAR_DOMAIN, &is_this_fld, &s);
+ VAR_DOMAIN, &is_this_fld, NULL);
if (wsym)
{
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.26
diff -u -p -r1.26 ada-lang.c
--- ada-lang.c 20 May 2003 01:55:17 -0000 1.26
+++ ada-lang.c 2 Jun 2003 17:31:54 -0000
@@ -3181,8 +3181,7 @@ static struct symbol *
standard_lookup (const char *name, domain_enum domain)
{
struct symbol *sym;
- struct symtab *symtab;
- sym = lookup_symbol (name, (struct block *) NULL, domain, 0, &symtab);
+ sym = lookup_symbol (name, (struct block *) NULL, domain, 0, NULL);
return sym;
}