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.
+
+2015-10-13 Pedro Alves <palves@redhat.com>
+
* infrun.c (restore_execution_direction): New function.
(fetch_inferior_event): Use it instead of
make_cleanup_restore_integer.
{
static char *result;
static size_t result_len = 0;
- char *tmp;
+ const char *tmp;
/* First, unqualify the enumeration name:
1. Search for the last '.' character. If we find one, then skip
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;
else
{
int bound_len;
- char *bound = bounds + *n;
- char *pend;
+ const char *bound = bounds + *n;
+ const char *pend;
pend = strstr (bound, "__");
if (pend == NULL)
else
{
int prefix_len = subtype_info - name;
- char *bounds_str;
+ const char *bounds_str;
int n;
subtype_info += 5;
if (cfull_expression)
{
- char *join = was_ptr ? "->" : ".";
+ const char *join = was_ptr ? "->" : ".";
*cfull_expression = xstrprintf ("(%s)%s%s", parent_expression,
join, field_name);
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION)
{
- char *join = was_ptr ? "->" : ".";
+ const char *join = was_ptr ? "->" : ".";
if (CPLUS_FAKE_CHILD (parent))
{
if (cfull_expression)
{
- char *ptr = was_ptr ? "*" : "";
+ const char *ptr = was_ptr ? "*" : "";
/* Cast the parent to the base' type. Note that in gdb,
expression like
break;
case var_boolean:
{
- char *opt = *(int *) c->var ? "on" : "off";
+ const char *opt = *(int *) c->var ? "on" : "off";
observer_notify_command_param_changed (name, opt);
}
do
{
size_t this_len;
- char *next_field, *this_field;
+ const char *next_field;
+ char *this_field;
next_field = strchr (str, delimiter);
if (next_field == NULL)
{
/* Irix 6.2 native cc prepends <machine>.: to the compilation
directory, get rid of it. */
- char *cp = strchr (*comp_dir, ':');
+ const char *cp = strchr (*comp_dir, ':');
if (cp && cp != *comp_dir && cp[-1] == '.' && cp[1] == '/')
*comp_dir = cp + 1;
anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
- char *base;
+ const char *base;
if (die->tag != DW_TAG_class_type && die->tag != DW_TAG_interface_type
&& die->tag != DW_TAG_structure_type && die->tag != DW_TAG_union_type)
if (demangled)
{
- char *base;
+ const char *base;
/* FIXME: we already did this for the partial symbol... */
DW_STRING (attr)
const char *class_name;
struct type *run_time_type;
LONGEST offset_to_top;
- char *atsign;
+ const char *atsign;
/* We only have RTTI for class objects. */
if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT)
/* Pointer to "N" if valid "N<digit(s)>_" found. */
char *method_type;
/* Pointer to the first '.'. */
- char *first_dot;
+ const char *first_dot;
/* Pointer to the last '.'. */
- char *last_dot;
+ const char *last_dot;
/* Non-zero if we saw a pointer indicator. */
int saw_pointer;
for (j = 0; j < n_overloads; j++)
{
const char *real_physname;
- char *physname, *p;
+ const char *p;
+ char *physname;
int is_full_physname_constructor;
real_physname = TYPE_FN_FIELD_PHYSNAME (f, j);
int
net_open (struct serial *scb, const char *name)
{
- char *port_str, hostname[100];
+ char hostname[100];
+ const char *port_str;
int n, port, tmp;
int use_udp;
struct hostent *hostent;
deduce_language_from_filename (const char *filename)
{
int i;
- char *cp;
+ const char *cp;
if (filename != NULL)
if ((cp = strrchr (filename, '.')) != NULL)
int is_constructor;
int is_destructor = is_destructor_name (physname);
/* Need a new type prefix. */
- char *const_prefix = method->is_const ? "C" : "";
- char *volatile_prefix = method->is_volatile ? "V" : "";
+ const char *const_prefix = method->is_const ? "C" : "";
+ const char *volatile_prefix = method->is_volatile ? "V" : "";
char buf[20];
int len = (newname == NULL ? 0 : strlen (newname));
int c_line;
int in;
WINDOW *w;
- char *prompt;
+ const char *prompt;
int start_line;
/* Detect when we temporarily left SingleKey and now the readline