aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r--gdb/ada-exp.y23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 1c45bcb..e64463e 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -876,7 +876,8 @@ write_object_renaming (struct parser_state *par_state,
if (orig_left_context == NULL)
orig_left_context = get_selected_block (NULL);
- name = obstack_copy0 (&temp_parse_space, renamed_entity, renamed_entity_len);
+ name = (char *) obstack_copy0 (&temp_parse_space, renamed_entity,
+ renamed_entity_len);
ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
if (sym_info.symbol == NULL)
error (_("Could not find renamed variable: %s"), ada_decode (name));
@@ -945,9 +946,9 @@ write_object_renaming (struct parser_state *par_state,
if (end == NULL)
end = renaming_expr + strlen (renaming_expr);
- index_name =
- obstack_copy0 (&temp_parse_space, renaming_expr,
- end - renaming_expr);
+ index_name
+ = (char *) obstack_copy0 (&temp_parse_space, renaming_expr,
+ end - renaming_expr);
renaming_expr = end;
ada_lookup_encoded_symbol (index_name, NULL, VAR_DOMAIN,
@@ -989,7 +990,7 @@ write_object_renaming (struct parser_state *par_state,
if (end == NULL)
end = renaming_expr + strlen (renaming_expr);
field_name.length = end - renaming_expr;
- buf = malloc (end - renaming_expr + 1);
+ buf = (char *) malloc (end - renaming_expr + 1);
field_name.ptr = buf;
strncpy (buf, renaming_expr, end - renaming_expr);
buf[end - renaming_expr] = '\000';
@@ -1167,7 +1168,8 @@ write_ambiguous_var (struct parser_state *par_state,
memset (sym, 0, sizeof (struct symbol));
SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
- SYMBOL_LINKAGE_NAME (sym) = obstack_copy0 (&temp_parse_space, name, len);
+ SYMBOL_LINKAGE_NAME (sym)
+ = (const char *) obstack_copy0 (&temp_parse_space, name, len);
SYMBOL_LANGUAGE (sym) = language_ada;
write_exp_elt_opcode (par_state, OP_VAR_VALUE);
@@ -1184,7 +1186,7 @@ static int
ada_nget_field_index (const struct type *type, const char *field_name0,
int field_name_len, int maybe_missing)
{
- char *field_name = alloca ((field_name_len + 1) * sizeof (char));
+ char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char));
strncpy (field_name, field_name0, field_name_len);
field_name[field_name_len] = '\0';
@@ -1265,7 +1267,8 @@ write_var_or_type (struct parser_state *par_state,
encoded_name = ada_encode (name0.ptr);
name_len = strlen (encoded_name);
- encoded_name = obstack_copy0 (&temp_parse_space, encoded_name, name_len);
+ encoded_name
+ = (char *) obstack_copy0 (&temp_parse_space, encoded_name, name_len);
for (depth = 0; depth < MAX_RENAMING_CHAIN_LENGTH; depth += 1)
{
int tail_index;
@@ -1318,9 +1321,9 @@ write_var_or_type (struct parser_state *par_state,
case ADA_EXCEPTION_RENAMING:
case ADA_SUBPROGRAM_RENAMING:
{
+ int alloc_len = renaming_len + name_len - tail_index + 1;
char *new_name
- = obstack_alloc (&temp_parse_space,
- renaming_len + name_len - tail_index + 1);
+ = (char *) obstack_alloc (&temp_parse_space, alloc_len);
strncpy (new_name, renaming, renaming_len);
strcpy (new_name + renaming_len, encoded_name + tail_index);
encoded_name = new_name;