make symtab::filename const
authorTom Tromey <tromey@redhat.com>
Mon, 25 Nov 2013 14:32:35 +0000 (07:32 -0700)
committerTom Tromey <tromey@redhat.com>
Fri, 6 Dec 2013 19:13:31 +0000 (12:13 -0700)
This makes symtab::filename const and removes a newly unnecessary
cast.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* symfile.c (allocate_symtab): Remove cast.
* symtab.h (struct symtab) <filename>: Now const.

gdb/ChangeLog
gdb/symfile.c
gdb/symtab.h

index 68935db8ee0a87ee065f706447cb0680c762c995..33366e2d8197f51caf2f12ee8ac1a8afc84c0087 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-06  Tom Tromey  <tromey@redhat.com>
+
+       * symfile.c (allocate_symtab): Remove cast.
+       * symtab.h (struct symtab) <filename>: Now const.
+
 2013-12-06  Tom Tromey  <tromey@redhat.com>
 
        * break-catch-throw.c (fetch_probe_arguments): Use
index 59d0583acf2167fa596c256ebb65acb88abacba5..71f6b3e8c77fd0671d17c7f52963d2b158066793 100644 (file)
@@ -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";
index 7cc66673e755975bcae9011c0dba9360cf64e747..821479ac7b6ee58ae5839f08adc2ca0217e42fc6 100644 (file)
@@ -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.  */
 
This page took 0.031371 seconds and 4 git commands to generate.