mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
More char constification
Trivial constifications flagged by G++. E.g.: src/gdb/c-varobj.c: In function ‘void c_describe_child(const varobj*, int, char**, value**, type**, char**)’: src/gdb/c-varobj.c:373:33: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] char *join = was_ptr ? "->" : "."; ^ gdb/ChangeLog: 2015-10-13 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_enum_name): Constify local. * ada-typeprint.c (print_range_bound): Constify locals. * c-varobj.c (c_describe_child): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * dwarf2read.c (find_file_and_directory): Likewise. (anonymous_struct_prefix, dwarf2_name): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-lang.c (unpack_mangled_go_symbol): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * ser-tcp.c (net_open): Likewise. * symfile.c (deduce_language_from_filename): Likewise. * symtab.c (gdb_mangle_name): Likewise. * tui/tui-io.c (tui_redisplay_readline): Likewise.
This commit is contained in:
@ -203,7 +203,7 @@ print_range (struct type *type, struct ui_file *stream,
|
||||
set *N past the bound and its delimiter, if any. */
|
||||
|
||||
static void
|
||||
print_range_bound (struct type *type, char *bounds, int *n,
|
||||
print_range_bound (struct type *type, const char *bounds, int *n,
|
||||
struct ui_file *stream)
|
||||
{
|
||||
LONGEST B;
|
||||
@ -230,8 +230,8 @@ print_range_bound (struct type *type, char *bounds, int *n,
|
||||
else
|
||||
{
|
||||
int bound_len;
|
||||
char *bound = bounds + *n;
|
||||
char *pend;
|
||||
const char *bound = bounds + *n;
|
||||
const char *pend;
|
||||
|
||||
pend = strstr (bound, "__");
|
||||
if (pend == NULL)
|
||||
@ -300,7 +300,7 @@ print_range_type (struct type *raw_type, struct ui_file *stream,
|
||||
else
|
||||
{
|
||||
int prefix_len = subtype_info - name;
|
||||
char *bounds_str;
|
||||
const char *bounds_str;
|
||||
int n;
|
||||
|
||||
subtype_info += 5;
|
||||
|
Reference in New Issue
Block a user