(deduce_language_from_filename): Argument type now const.
* symtab.h (find_main_filename): Update.
(deduce_language_from_filename): Update.
* symtab.c (find_main_filename): Make result const.
* dwarf2read.c (dw2_find_symbol_file): Change return type.
* psymtab.c (find_symbol_file_from_partial): Change return type.
* symfile.h (struct quick_symbol_functions) <find_symbol_file>:
Make result const.
+2010-07-13 Tom Tromey <tromey@redhat.com>
+
+ * symfile.c (set_initial_language): Update.
+ (deduce_language_from_filename): Argument type now const.
+ * symtab.h (find_main_filename): Update.
+ (deduce_language_from_filename): Update.
+ * symtab.c (find_main_filename): Make result const.
+ * dwarf2read.c (dw2_find_symbol_file): Change return type.
+ * psymtab.c (find_symbol_file_from_partial): Change return type.
+ * symfile.h (struct quick_symbol_functions) <find_symbol_file>:
+ Make result const.
+
2010-07-13 Tom Tromey <tromey@redhat.com>
* breakpoint.c (save_cmdlist): No longer static.
}
}
-static char *
+static const char *
dw2_find_symbol_file (struct objfile *objfile, const char *name)
{
struct dwarf2_per_cu_data *cu;
if (!cu->v.quick->lines)
return NULL;
- return (char *) cu->v.quick->file_names[cu->v.quick->lines->num_file_names
- - 1];
+ return cu->v.quick->file_names[cu->v.quick->lines->num_file_names - 1];
}
static void
return NULL;
}
-static char *
+static const char *
find_symbol_file_from_partial (struct objfile *objfile, const char *name)
{
struct partial_symtab *pst;
void
set_initial_language (void)
{
- char *filename;
+ const char *filename;
enum language lang = language_unknown;
filename = find_main_filename ();
}
enum language
-deduce_language_from_filename (char *filename)
+deduce_language_from_filename (const char *filename)
{
int i;
char *cp;
/* Return the file name of the file holding the symbol in OBJFILE
named NAME. If no such symbol exists in OBJFILE, return NULL. */
- char *(*find_symbol_file) (struct objfile *objfile, const char *name);
+ const char *(*find_symbol_file) (struct objfile *objfile, const char *name);
/* This method is specific to Ada. It walks the partial symbol
tables of OBJFILE looking for a name match. WILD_MATCH and
/* FIXME: What about languages without main() or specially linked
executables that have no main() ? */
-char *
+const char *
find_main_filename (void)
{
struct objfile *objfile;
- char *result, *name = main_name ();
+ char *name = main_name ();
ALL_OBJFILES (objfile)
{
+ const char *result;
+
if (!objfile->sf)
continue;
result = objfile->sf->qf->find_symbol_file (objfile, name);
int matching_obj_sections (struct obj_section *, struct obj_section *);
-extern char *find_main_filename (void);
+extern const char *find_main_filename (void);
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
extern void clear_symtab_users (void);
-extern enum language deduce_language_from_filename (char *);
+extern enum language deduce_language_from_filename (const char *);
/* symtab.c */