From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24230 invoked by alias); 26 Nov 2013 21:50:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24183 invoked by uid 89); 26 Nov 2013 21:50:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2013 21:50:00 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAQLnq0x016479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Nov 2013 16:49:53 -0500 Received: from barimba.redhat.com (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAQLnprm008652; Tue, 26 Nov 2013 16:49:52 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/8] make symtab::filename const Date: Tue, 26 Nov 2013 21:57:00 -0000 Message-Id: <1385502587-29757-2-git-send-email-tromey@redhat.com> In-Reply-To: <1385502587-29757-1-git-send-email-tromey@redhat.com> References: <1385502587-29757-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-11/txt/msg00829.txt.bz2 This makes symtab::filename const and removes a newly unnecessary cast. 2013-11-26 Tom Tromey * symfile.c (allocate_symtab): Remove cast. * symtab.h (struct symtab) : 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