This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/8] make symtab::filename const
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Tue, 26 Nov 2013 14:49:40 -0700
- Subject: [PATCH 1/8] make symtab::filename const
- Authentication-results: sourceware.org; auth=none
- References: <1385502587-29757-1-git-send-email-tromey at redhat dot com>
This makes symtab::filename const and removes a newly unnecessary
cast.
2013-11-26 Tom Tromey <tromey@redhat.com>
* symfile.c (allocate_symtab): Remove cast.
* symtab.h (struct symtab) <filename>: Now const.
---
gdb/ChangeLog | 5 +++++
gdb/symfile.c | 4 ++--
gdb/symtab.h | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 59d0583..71f6b3e 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 7cc6667..821479a 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. */
--
1.8.1.4