constify i386-sol2-tdep.c and machoread.c
authorPedro Alves <palves@redhat.com>
Mon, 9 Mar 2015 11:58:23 +0000 (11:58 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 20 Mar 2015 17:39:29 +0000 (17:39 +0000)
/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/ChangeLog
gdb/i386-sol2-tdep.c
gdb/machoread.c

index 04cd47d43cdbb9c60f4b05632cee503ba8144e35..72555330412373e5ad98e413c56a6ba128d33855 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2015-03-20  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (set_breakpoint_condition): Make argument "exp" const.
index af783dfc634e8e1eae1ffe56587a8fe428e41199..59f9be76e64f8d8aad46180de4aa0ccb88217450 100644 (file)
@@ -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
index 831bbcb622e0636e88c4da40e10d6792b1fe3dc0..675155e97b62fad69bb9058c4c10d518da78fd13 100644 (file)
@@ -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] != ')')
This page took 0.026703 seconds and 4 git commands to generate.