This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 9/9] constify i386-sol2-tdep.c and machoread.c
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 20 Mar 2015 16:56:40 +0000
- Subject: [PATCH 9/9] constify i386-sol2-tdep.c and machoread.c
- Authentication-results: sourceware.org; auth=none
- References: <1426870600-17876-1-git-send-email-qiyaoltc at gmail dot com>
From: Pedro Alves <palves@redhat.com>
/home/pedro/gdb/mygit/src/gdb/i386-sol2-tdep.c: In function âconst char* i386_sol2_static_transform_name(const char*)â:
/home/pedro/gdb/mygit/src/gdb/i386-sol2-tdep.c:93:29: error: invalid conversion from âconst char*â to âchar*â [-fpermissive]
p = strrchr (name, '.');
^
gdb:
2015-03-20 Pedro Alves <palves@redhat.com>
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Move "p" to
inner block and make it const.
* machoread.c (get_archive_prefix_len): Make "lparen" const.
---
gdb/i386-sol2-tdep.c | 3 ++-
gdb/machoread.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index af783df..59f9be7 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -80,9 +80,10 @@ i386_sol2_mcontext_addr (struct frame_info *this_frame)
static const char *
i386_sol2_static_transform_name (const char *name)
{
- char *p;
if (name[0] == '.')
{
+ const char *p;
+
/* For file-local statics there will be a period, a bunch of
junk (the contents of which match a string given in the
N_OPT), a period and the name. For function-local statics
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 831bbcb..675155e 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -343,7 +343,7 @@ macho_symtab_read (struct objfile *objfile,
static int
get_archive_prefix_len (const char *name)
{
- char *lparen;
+ const char *lparen;
int name_len = strlen (name);
if (name_len == 0 || name[name_len - 1] != ')')
--
1.9.1