From 4077bf7a09b962c6c89974ff79086f9608552619 Mon Sep 17 00:00:00 2001 From: ghazi Date: Thu, 26 Jun 2008 00:18:25 +0000 Subject: * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137134 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ggc-common.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'gcc/ggc-common.c') diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 17c1f50b608..a01fa3f0b01 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -116,7 +116,8 @@ ggc_mark_roots (void) if (*cti->base) { ggc_set_mark (*cti->base); - htab_traverse_noresize (*cti->base, ggc_htab_delete, (void *) cti); + htab_traverse_noresize (*cti->base, ggc_htab_delete, + CONST_CAST (void *, (const void *)cti)); ggc_set_mark ((*cti->base)->entries); } @@ -264,12 +265,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; @@ -287,7 +288,8 @@ 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; @@ -370,7 +372,8 @@ 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; } @@ -398,8 +401,8 @@ write_pch_globals (const struct ggc_root_tab * const *tab, } else { - new_ptr = htab_find_with_hash (saving_htab, ptr, - POINTER_HASH (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) fatal_error ("can't write PCH file: %m"); @@ -502,7 +505,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 = XRESIZEVAR (char, this_object, this_object_size); } memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size); if (state.ptrs[i]->reorder_fn != NULL) -- cgit v1.2.1