+2013-03-13 Pedro Alves <palves@redhat.com>
+
+ * ada-lang.c (ada_decode_symbol): Cast away constness of GSYMBOL
+ rather than casting 'const char * const *' to 'const char **'.
+ * ada-lex.l (processInt): Make "trailer" local const. Remove
+ 'const char **' cast.
+ * arm-linux-tdep.c (arm_stap_parse_special_token): Add 'char *'
+ locals, and use those as strtol output pointer, instead than doing
+ invalid casts to from 'const char **' to 'char **'.
+ (_initialize_demangle): Remove cast.
+ * i386-tdep.c (i386_stap_parse_special_token): : Add 'char *'
+ locals, and use those as strtol output pointer, instead than doing
+ invalid casts to from 'const char **' to 'char **'.
+ * solib-dsbt.c (dsbt_get_initial_loadmaps): Remove 'gdb_byte**'
+ casts.
+ * stap-probe.c (stap_parse_register_operand)
+ (stap_parse_single_operand): Likewise.
+
2013-03-13 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tfile_get_trace_state_variable_value): Look for
const char *
ada_decode_symbol (const struct general_symbol_info *gsymbol)
{
- const char **resultp =
- (const char **) &gsymbol->language_specific.mangled_lang.demangled_name;
+ struct general_symbol_info *gsymbol_rw
+ = (struct general_symbol_info *) gsymbol;
+ const char **resultp
+ = &gsymbol_rw->language_specific.mangled_lang.demangled_name;
if (*resultp == NULL)
{
ULONGEST result;
long exp;
int base;
-
- char *trailer;
+ const char *trailer;
if (base0 == NULL)
base = 10;
exp = strtol(exp0, (char **) NULL, 10);
errno = 0;
- result = strtoulst (num0, (const char **) &trailer, base);
+ result = strtoulst (num0, &trailer, base);
if (errno == ERANGE)
error (_("Integer literal out of range"));
if (isxdigit(*trailer))
{
/* Temporary holder for lookahead. */
const char *tmp = p->arg;
+ char *endp;
/* Used to save the register name. */
const char *start;
char *regname;
got_minus = 1;
}
- displacement = strtol (tmp, (char **) &tmp, 10);
+ displacement = strtol (tmp, &endp, 10);
+ tmp = endp;
/* Skipping last `]'. */
if (*tmp++ != ']')
char *regname;
int len;
struct stoken str;
+ char *endp;
got_minus[0] = 0;
if (*s == '+')
got_minus[0] = 1;
}
- displacements[0] = strtol (s, (char **) &s, 10);
+ displacements[0] = strtol (s, &endp, 10);
+ s = endp;
if (*s != '+' && *s != '-')
{
got_minus[1] = 1;
}
- displacements[1] = strtol (s, (char **) &s, 10);
+ displacements[1] = strtol (s, &endp, 10);
+ s = endp;
if (*s != '+' && *s != '-')
{
got_minus[2] = 1;
}
- displacements[2] = strtol (s, (char **) &s, 10);
+ displacements[2] = strtol (s, &endp, 10);
+ s = endp;
if (*s != '(' || s[1] != '%')
break;
break;
if (isdigit (*s))
- offset = strtol (s, (char **) &s, 10);
+ {
+ char *endp;
+
+ offset = strtol (s, &endp, 10);
+ s = endp;
+ }
if (*s != '(' || s[1] != '%')
break;
if (*s == ',')
{
+ char *endp;
+
++s;
if (*s == '+')
++s;
size_minus = 1;
}
- size = strtol (s, (char **) &s, 10);
+ size = strtol (s, &endp, 10);
+ s = endp;
if (*s != ')')
break;
struct dsbt_info *info = get_dsbt_info ();
if (0 >= target_read_alloc (¤t_target, TARGET_OBJECT_FDPIC,
- "exec", (gdb_byte**) &buf))
+ "exec", &buf))
{
info->exec_loadmap = NULL;
error (_("Error reading DSBT exec loadmap"));
dsbt_print_loadmap (info->exec_loadmap);
if (0 >= target_read_alloc (¤t_target, TARGET_OBJECT_FDPIC,
- "interp", (gdb_byte**)&buf))
+ "interp", &buf))
{
info->interp_loadmap = NULL;
error (_("Error reading DSBT interp loadmap"));
{
/* The value of the displacement. */
long displacement;
+ char *endp;
disp_p = 1;
- displacement = strtol (p->arg, (char **) &p->arg, 10);
+ displacement = strtol (p->arg, &endp, 10);
+ p->arg = endp;
/* Generating the expression for the displacement. */
write_exp_elt_opcode (OP_LONG);
tmp = skip_spaces_const (tmp);
if (isdigit (*tmp))
- number = strtol (tmp, (char **) &tmp, 10);
+ {
+ char *endp;
+
+ number = strtol (tmp, &endp, 10);
+ tmp = endp;
+ }
if (!reg_ind_prefix
|| strncmp (tmp, reg_ind_prefix, reg_ind_prefix_len) != 0)
{
/* A temporary variable, needed for lookahead. */
const char *tmp = p->arg;
+ char *endp;
long number;
/* We can be dealing with a numeric constant (if `const_prefix' is
NULL), or with a register displacement. */
- number = strtol (tmp, (char **) &tmp, 10);
+ number = strtol (tmp, &endp, 10);
+ tmp = endp;
if (p->inside_paren_p)
tmp = skip_spaces_const (tmp);
{
/* We are dealing with a numeric constant. */
long number;
+ char *endp;
p->arg += const_prefix_len;
- number = strtol (p->arg, (char **) &p->arg, 10);
+ number = strtol (p->arg, &endp, 10);
+ p->arg = endp;
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (builtin_type (gdbarch)->builtin_long);