aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r--gcc/ggc-common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index fe75320bdb1..41a277052eb 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -271,12 +271,12 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie,
return 0;
}
- *slot = xcalloc (sizeof (struct ptr_data), 1);
+ *slot = XCNEW (struct ptr_data);
(*slot)->obj = obj;
(*slot)->note_ptr_fn = note_ptr_fn;
(*slot)->note_ptr_cookie = note_ptr_cookie;
if (note_ptr_fn == gt_pch_p_S)
- (*slot)->size = strlen (obj) + 1;
+ (*slot)->size = strlen ((const char *) obj) + 1;
else
(*slot)->size = ggc_get_size (obj);
(*slot)->type = type;
@@ -294,7 +294,7 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie,
if (obj == NULL || obj == (void *) 1)
return;
- data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
+ data = (struct ptr_data *) htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
data->reorder_fn = reorder_fn;
@@ -377,7 +377,7 @@ relocate_ptrs (void *ptr_p, void *state_p)
if (*ptr == NULL || *ptr == (void *)1)
return;
- result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
+ result = (struct ptr_data *) htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
gcc_assert (result);
*ptr = result->new_addr;
}
@@ -405,7 +405,7 @@ write_pch_globals (const struct ggc_root_tab * const *tab,
}
else
{
- new_ptr = htab_find_with_hash (saving_htab, ptr,
+ new_ptr = (struct ptr_data *) htab_find_with_hash (saving_htab, ptr,
POINTER_HASH (ptr));
if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f)
!= 1)
@@ -509,7 +509,7 @@ gt_pch_save (FILE *f)
if (this_object_size < state.ptrs[i]->size)
{
this_object_size = state.ptrs[i]->size;
- this_object = xrealloc (this_object, this_object_size);
+ this_object = (char *) xrealloc (this_object, this_object_size);
}
memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size);
if (state.ptrs[i]->reorder_fn != NULL)