aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2008-06-20 03:46:09 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2008-06-20 03:46:09 +0000
commite1e4cdc42c8b28235ab637dc5df2b4ef159c5b98 (patch)
treea9a495581b5ae5ebeabcad170ec8ae93f77566c2 /gcc/java/class.c
parent54e998b2f10c2f2f4fcbf9f40ebcb926ac125d33 (diff)
downloadgcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.zip
gcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.tar.gz
gcc-e1e4cdc42c8b28235ab637dc5df2b4ef159c5b98.tar.bz2
collect2.c (main, [...]): Fix for -Wc++-compat.
* collect2.c (main, add_to_list): Fix for -Wc++-compat. * gcc.c (translate_options, init_spec, store_arg, read_specs, add_to_obstack, file_at_path, find_a_file, execute, add_preprocessor_option, add_assembler_option, add_linker_option, process_command, insert_wrapper, do_option_spec, do_self_spec, spec_path, do_spec_1, is_directory, main, used_arg, getenv_spec_function): Likewise. * tlink.c (symbol_hash_lookup, file_hash_lookup, demangled_hash_lookup, symbol_push, file_push, frob_extension): Likewise. java: * class.c (ident_subst, mangled_classname, unmangle_classname, gen_indirect_dispatch_tables, add_method_1, build_fieldref_cache_entry, make_local_function_alias, layout_class, java_treetreehash_find, java_treetreehash_new, split_qualified_name): Fix for -Wc++-compat. * constants.c (set_constant_entry, cpool_for_class): Likewise. * decl.c (make_binding_level, java_dup_lang_specific_decl, start_java_method): Likewise. * except.c (prepare_eh_table_type): Likewise. * expr.c (type_assertion_hash, note_instructions): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC, MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * jcf-io.c (jcf_filbuf_from_stdio, opendir_in_zip, find_class): Likewise. * jcf-parse.c (reverse, java_read_sourcefilenames, annotation_grow, rewrite_reflection_indexes, java_parse_file, process_zip_dir): Likewise. * jcf-path.c (add_entry, add_path, jcf_path_init, jcf_path_extdirs_arg): Likewise. * jcf-reader.c (jcf_parse_constant_pool): Likewise. * jvgenmain.c (do_mangle_classname): Likewise. * lang.c (put_decl_string): Likewise. * verify-impl.c (make_state_copy, make_state, add_new_state): Likewise. objc: * objc-act.c (setup_string_decl, objc_build_string_object, hash_interface, eq_interface, objc_begin_try_stmt, encode_method_prototype, build_ivar_list_initializer, objc_build_encode_expr): Fix for -Wc++-compat. From-SVN: r136980
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index dff75ac..bf53b47 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -279,7 +279,7 @@ ident_subst (const char* old_name,
int prefix_len = strlen (prefix);
int suffix_len = strlen (suffix);
int i = prefix_len + old_length + suffix_len + 1;
- char *buffer = alloca (i);
+ char *buffer = (char *) alloca (i);
strcpy (buffer, prefix);
for (i = 0; i < old_length; i++)
@@ -349,7 +349,7 @@ mangled_classname (const char *prefix, tree type)
rewriting. */
if (illegal_chars != 0)
{
- char *buffer = alloca (illegal_chars * 4 + len + 1);
+ char *buffer = (char *) alloca (illegal_chars * 4 + len + 1);
int j;
for (i = 0, j = 0; i < len; i++)
@@ -413,7 +413,7 @@ unmangle_classname (const char *name, int name_length)
do \
{ \
const char *typename = IDENTIFIER_POINTER (mangled_classname ("", TYPE)); \
- char *buf = alloca (strlen (typename) + strlen (#NAME "_syms_") + 1); \
+ char *buf = (char *) alloca (strlen (typename) + strlen (#NAME "_syms_") + 1); \
tree decl; \
\
sprintf (buf, #NAME "_%s", typename); \
@@ -445,7 +445,7 @@ gen_indirect_dispatch_tables (tree type)
const char *typename = IDENTIFIER_POINTER (mangled_classname ("", type));
{
tree field = NULL;
- char *buf = alloca (strlen (typename) + strlen ("_catch_classes_") + 1);
+ char *buf = (char *) alloca (strlen (typename) + strlen ("_catch_classes_") + 1);
tree catch_class_type = make_node (RECORD_TYPE);
sprintf (buf, "_catch_classes_%s", typename);
@@ -759,7 +759,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
DECL_CONTEXT (fndecl) = this_class;
DECL_LANG_SPECIFIC (fndecl)
- = ggc_alloc_cleared (sizeof (struct lang_decl));
+ = GGC_CNEW (struct lang_decl);
DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC;
/* Initialize the static initializer test table. */
@@ -1192,7 +1192,7 @@ build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED)
{
tree decl, decl_name;
const char *name = IDENTIFIER_POINTER (mangled_classname ("_cpool_", output_class));
- char *buf = alloca (strlen (name) + 20);
+ char *buf = (char *) alloca (strlen (name) + 20);
sprintf (buf, "%s_%d_ref", name, index);
decl_name = get_identifier (buf);
decl = IDENTIFIER_GLOBAL_VALUE (decl_name);
@@ -1367,8 +1367,8 @@ make_local_function_alias (tree method)
tree alias;
const char *method_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (method));
- char *name = alloca (strlen (method_name) + 2);
- char *buf = alloca (strlen (method_name) + 128);
+ char *name = (char *) alloca (strlen (method_name) + 2);
+ char *buf = (char *) alloca (strlen (method_name) + 128);
/* Only create aliases for local functions. */
if (DECL_EXTERNAL (method))
@@ -2421,7 +2421,7 @@ layout_class (tree this_class)
obstack_grow (&temporary_obstack, buffer, strlen (buffer));
}
obstack_1grow (&temporary_obstack, '\0');
- report = obstack_finish (&temporary_obstack);
+ report = XOBFINISH (&temporary_obstack, char *);
cyclic_inheritance_report = ggc_strdup (report);
obstack_free (&temporary_obstack, report);
TYPE_SIZE (this_class) = error_mark_node;
@@ -3088,7 +3088,7 @@ java_treetreehash_find (htab_t ht, tree t)
{
struct treetreehash_entry *e;
hashval_t hv = JAVA_TREEHASHHASH_H (t);
- e = htab_find_with_hash (ht, t, hv);
+ e = (struct treetreehash_entry *) htab_find_with_hash (ht, t, hv);
if (e == NULL)
return NULL;
else
@@ -3105,7 +3105,7 @@ java_treetreehash_new (htab_t ht, tree t)
e = htab_find_slot_with_hash (ht, t, hv, INSERT);
if (*e == NULL)
{
- tthe = (*ht->alloc_f) (1, sizeof (*tthe));
+ tthe = (struct treetreehash_entry *) (*ht->alloc_f) (1, sizeof (*tthe));
tthe->key = t;
*e = tthe;
}
@@ -3135,7 +3135,7 @@ split_qualified_name (tree *left, tree *right, tree source)
char *p, *base;
int l = IDENTIFIER_LENGTH (source);
- base = alloca (l + 1);
+ base = (char *) alloca (l + 1);
memcpy (base, IDENTIFIER_POINTER (source), l + 1);
/* Breakdown NAME into REMAINDER . IDENTIFIER. */