From: Tom Tromey Date: Mon, 25 Nov 2013 14:32:35 +0000 (-0700) Subject: make symtab::filename const X-Git-Tag: hjl/linux/release/2.24.51.0.2~3^2~1^2~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21ea9eece76627d5f71f6a755ea3fc7b2916db72;p=thirdparty%2Fbinutils-gdb.git make symtab::filename const This makes symtab::filename const and removes a newly unnecessary cast. 2013-12-06 Tom Tromey * symfile.c (allocate_symtab): Remove cast. * symtab.h (struct symtab) : Now const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 68935db8ee0..33366e2d819 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-12-06 Tom Tromey + + * symfile.c (allocate_symtab): Remove cast. + * symtab.h (struct symtab) : Now const. + 2013-12-06 Tom Tromey * break-catch-throw.c (fetch_probe_arguments): Use diff --git a/gdb/symfile.c b/gdb/symfile.c index 59d0583acf2..71f6b3e8c77 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2883,8 +2883,8 @@ allocate_symtab (const char *filename, struct objfile *objfile) symtab = (struct symtab *) obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab)); memset (symtab, 0, sizeof (*symtab)); - symtab->filename = (char *) bcache (filename, strlen (filename) + 1, - objfile->per_bfd->filename_cache); + symtab->filename = bcache (filename, strlen (filename) + 1, + objfile->per_bfd->filename_cache); symtab->fullname = NULL; symtab->language = deduce_language_from_filename (filename); symtab->debugformat = "unknown"; diff --git a/gdb/symtab.h b/gdb/symtab.h index 7cc66673e75..821479ac7b6 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -875,7 +875,7 @@ struct symtab /* Name of this source file. This pointer is never NULL. */ - char *filename; + const char *filename; /* Directory in which it was compiled, or NULL if we don't know. */