summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-03 17:09:20 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-03 17:09:20 +0000
commite47a6f81edf98a062ad29cdb62590c1c7fdeb37a (patch)
treec67ebc05c0f9f25bf5e2c4cfeb978cad7945373c /gcc/gcc.c
parent18f0b7df705aaa6f409645ea592934f2525e6333 (diff)
downloadgcc-e47a6f81edf98a062ad29cdb62590c1c7fdeb37a.tar.gz
* system.h (CONST_CAST2, CONST_CAST_TREE, CONST_CAST_RTX,
CONST_CAST_BB): New macros for type-specific casts. (CONST_CAST): Add a TYPE parameter and define it in terms of CONST_CAST2. * c-decl.c (c_make_fname_decl): Supply a TYPE for CONST_CAST. * c-lex.c (cb_ident, lex_string): Likewise, * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise, * config/i386/i386.c (ix86_function_regparm, ix86_function_sseregparm): Use CONST_CAST_TREE. * config/mmix/mmix.c (mmix_encode_section_info): Supply a TYPE for CONST_CAST. * gcc.c (set_spec, read_specs, for_each_path, execute, do_spec_1, give_switch, set_multilib_dir): Likewise, * gengtype-parse.c (string_seq, typedef_name): Likewise, * gimple-low.c (block_may_fallthru): Use CONST_CAST_TREE. * jump.c (reversed_comparison_code_parts): Use CONST_CAST_RTX. * passes.c (execute_one_pass): Supply a TYPE for CONST_CAST. * prefix.c (update_path): Likewise, * pretty-print.c (pp_base_destroy_prefix): Likewise, * rtlanal.c (keep_with_call_p): Use CONST_CAST_RTX. * tree-cfg.c (tree_can_merge_blocks_p, tree_block_ends_with_condjump_p): Use CONST_CAST_BB. * tree-eh.c (lookup_stmt_eh_region_fn): USe CONST_CAST_TREE. * tree.c (build_string): Supply a TYPE for CONST_CAST. (attribute_list_contained): Use CONST_CAST_TREE. cp: * call.c (name_as_c_string): Supply a TYPE for CONST_CAST. * decl.c (cp_make_fname_decl): Likewise, * parser.c (cp_parser_string_literal): Likewise, * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE. * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): Likewise, fortran: * gfortranspec.c (lang_specific_driver): Use CONST_CAST2. * options.c (gfc_post_options): Supply a TYPE for CONST_CAST. * parse.c (parse_omp_structured_block): Likewise, * st.c (gfc_free_statement): Likewise, java: * jcf-parse.c (read_class, java_parse_file): Supply a TYPE for CONST_CAST. * jcf.h (JCF_FINISH): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128051 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index c7c3cf37220..99bcd787f06 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1888,7 +1888,7 @@ set_spec (const char *name, const char *spec)
/* Free the old spec. */
if (old_spec && sl->alloc_p)
- free (CONST_CAST(old_spec));
+ free (CONST_CAST(char *, old_spec));
sl->alloc_p = 1;
}
@@ -2193,7 +2193,7 @@ read_specs (const char *filename, int main_p)
set_spec (p2, *(sl->ptr_spec));
if (sl->alloc_p)
- free (CONST_CAST (*(sl->ptr_spec)));
+ free (CONST_CAST (char *, *(sl->ptr_spec)));
*(sl->ptr_spec) = "";
sl->alloc_p = 0;
@@ -2543,18 +2543,18 @@ for_each_path (const struct path_prefix *paths,
Don't repeat any we have already seen. */
if (multi_dir)
{
- free (CONST_CAST (multi_dir));
+ free (CONST_CAST (char *, multi_dir));
multi_dir = NULL;
- free (CONST_CAST (multi_suffix));
+ free (CONST_CAST (char *, multi_suffix));
multi_suffix = machine_suffix;
- free (CONST_CAST (just_multi_suffix));
+ free (CONST_CAST (char *, just_multi_suffix));
just_multi_suffix = just_machine_suffix;
}
else
skip_multi_dir = true;
if (multi_os_dir)
{
- free (CONST_CAST (multi_os_dir));
+ free (CONST_CAST (char *, multi_os_dir));
multi_os_dir = NULL;
}
else
@@ -2563,12 +2563,12 @@ for_each_path (const struct path_prefix *paths,
if (multi_dir)
{
- free (CONST_CAST (multi_dir));
- free (CONST_CAST (multi_suffix));
- free (CONST_CAST (just_multi_suffix));
+ free (CONST_CAST (char *, multi_dir));
+ free (CONST_CAST (char *, multi_suffix));
+ free (CONST_CAST (char *, just_multi_suffix));
}
if (multi_os_dir)
- free (CONST_CAST (multi_os_dir));
+ free (CONST_CAST (char *, multi_os_dir));
if (ret != path)
free (path);
return ret;
@@ -2985,7 +2985,7 @@ execute (void)
errmsg = pex_run (pex,
((i + 1 == n_commands ? PEX_LAST : 0)
| (string == commands[i].prog ? PEX_SEARCH : 0)),
- string, (char * const *) CONST_CAST (commands[i].argv),
+ string, CONST_CAST (char **, commands[i].argv),
NULL, NULL, &err);
if (errmsg != NULL)
{
@@ -2999,7 +2999,7 @@ execute (void)
}
if (string != commands[i].prog)
- free (CONST_CAST (string));
+ free (CONST_CAST (char *, string));
}
execution_count++;
@@ -5041,7 +5041,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
for (i = 0, j = 0; i < max; i++)
if (outfiles[i])
{
- argv[j] = (char *) CONST_CAST (outfiles[i]);
+ argv[j] = CONST_CAST (char *, outfiles[i]);
j++;
}
argv[j] = NULL;
@@ -5997,13 +5997,13 @@ give_switch (int switchnum, int omit_first_word)
while (length-- && !IS_DIR_SEPARATOR (arg[length]))
if (arg[length] == '.')
{
- ((char *)CONST_CAST(arg))[length] = 0;
+ (CONST_CAST(char *, arg))[length] = 0;
dot = 1;
break;
}
do_spec_1 (arg, 1, NULL);
if (dot)
- ((char *)CONST_CAST(arg))[length] = '.';
+ (CONST_CAST(char *, arg))[length] = '.';
do_spec_1 (suffix_subst, 1, NULL);
}
else
@@ -7456,7 +7456,7 @@ set_multilib_dir (void)
if (multilib_dir == NULL && multilib_os_dir != NULL
&& strcmp (multilib_os_dir, ".") == 0)
{
- free (CONST_CAST (multilib_os_dir));
+ free (CONST_CAST (char *, multilib_os_dir));
multilib_os_dir = NULL;
}
else if (multilib_dir != NULL && multilib_os_dir == NULL)