This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[1/8] constify symbol_set_demangled_name


This is the first of a series of relatively minor cleanups.
I found all these while working on a different bug.

The series as a whole was built and regtested on x86-64 Fedora 16.
I didn't regtest the individual patches as there didn't seem to be much
point; but I can do it if someone wants.

This one constifies symbol_set_demangled_name and removes a bogus cast
in the process.

Tom

	* dwarf2read.c (new_symbol_full): Remove cast.
	* symtab.c (symbol_set_demangled_name): Make 'name' const.
	* symtab.h (symbol_set_demangled_name): Update.
---
 gdb/dwarf2read.c |    2 +-
 gdb/symtab.c     |    2 +-
 gdb/symtab.h     |    3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e2088f1..71d8a26 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -15770,7 +15770,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
       if (cu->language == language_fortran
           && symbol_get_demangled_name (&(sym->ginfo)) == NULL)
 	symbol_set_demangled_name (&(sym->ginfo),
-				   (char *) dwarf2_full_name (name, die, cu),
+				   dwarf2_full_name (name, die, cu),
 	                           NULL);
 
       /* Default assumptions.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f4ed8b9..bbba795 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -453,7 +453,7 @@ symbol_init_cplus_specific (struct general_symbol_info *gsymbol,
 
 void
 symbol_set_demangled_name (struct general_symbol_info *gsymbol,
-                           char *name,
+                           const char *name,
                            struct objfile *objfile)
 {
   if (gsymbol->language == language_cplus)
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 78af1a2..089ea19 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -167,7 +167,8 @@ struct general_symbol_info
   struct obj_section *obj_section;
 };
 
-extern void symbol_set_demangled_name (struct general_symbol_info *, char *,
+extern void symbol_set_demangled_name (struct general_symbol_info *,
+				       const char *,
                                        struct objfile *);
 
 extern const char *symbol_get_demangled_name
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]