From: Pedro Alves Date: Mon, 9 Mar 2015 11:58:17 +0000 (+0000) Subject: constify sparc-sol2-tdep.c and spu-tdep.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53e780858180511b194438c87d2f3a1c68804f06;p=binutils-gdb.git constify sparc-sol2-tdep.c and spu-tdep.c /home/pedro/gdb/mygit/src/gdb/sparc-sol2-tdep.c: In function ‘const char* sparc_sol2_static_transform_name(const char*)’: /home/pedro/gdb/mygit/src/gdb/sparc-sol2-tdep.c:247:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] char *p = strrchr (name, '.'); ^ gdb: 2015-03-20 Pedro Alves * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Make "p" const. * spu-tdep.c (spu_gdbarch_init): Make "name" const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7ad050c0bb3..9d9c287889e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-03-20 Pedro Alves + + * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Make "p" const. + * spu-tdep.c (spu_gdbarch_init): Make "name" const. + 2015-03-20 Jan Kratochvil * config/djgpp/README: Remove gdb.hp. diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c index 1aabe763423..5afe3083ec0 100644 --- a/gdb/sparc-sol2-tdep.c +++ b/gdb/sparc-sol2-tdep.c @@ -244,7 +244,7 @@ sparc_sol2_static_transform_name (const char *name) if (name[0] == '$') { - char *p = strrchr (name, '.'); + const char *p = strrchr (name, '.'); if (p) return p + 1; } diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 36ad312e0f7..6ccb6791409 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -2698,7 +2698,7 @@ spu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) This assumes the filename convention employed by solib-spu.c. */ else if (info.abfd) { - char *name = strrchr (info.abfd->filename, '@'); + const char *name = strrchr (info.abfd->filename, '@'); if (name) sscanf (name, "@0x%*x <%d>", &id); }