Commit e1e4cdc4 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 54e998b2
2008-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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.
2008-06-19 Kenneth Zadeck <zadeck@naturalbridge.com> 2008-06-19 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/rtl.texi: Updated subreg section. * doc/rtl.texi: Updated subreg section.
......
...@@ -846,9 +846,9 @@ main (int argc, char **argv) ...@@ -846,9 +846,9 @@ main (int argc, char **argv)
/* Do not invoke xcalloc before this point, since locale needs to be /* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */ set first, in case a diagnostic is issued. */
ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+4)); ld1 = (const char **)(ld1_argv = XCNEWVEC (char *, argc+4));
ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+11)); ld2 = (const char **)(ld2_argv = XCNEWVEC (char *, argc+11));
object = (const char **)(object_lst = xcalloc(sizeof (char *), argc)); object = (const char **)(object_lst = XCNEWVEC (char *, argc));
#ifdef DEBUG #ifdef DEBUG
debug = 1; debug = 1;
...@@ -875,7 +875,7 @@ main (int argc, char **argv) ...@@ -875,7 +875,7 @@ main (int argc, char **argv)
#endif #endif
obstack_begin (&temporary_obstack, 0); obstack_begin (&temporary_obstack, 0);
temporary_firstobj = obstack_alloc (&temporary_obstack, 0); temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
#ifndef HAVE_LD_DEMANGLE #ifndef HAVE_LD_DEMANGLE
current_demangling_style = auto_demangling; current_demangling_style = auto_demangling;
...@@ -893,7 +893,7 @@ main (int argc, char **argv) ...@@ -893,7 +893,7 @@ main (int argc, char **argv)
-fno-exceptions -w */ -fno-exceptions -w */
num_c_args += 5; num_c_args += 5;
c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args)); c_ptr = (const char **) (c_argv = XCNEWVEC (char *, num_c_args));
if (argc < 2) if (argc < 2)
fatal ("no arguments"); fatal ("no arguments");
...@@ -1676,7 +1676,8 @@ static long sequence_number = 0; ...@@ -1676,7 +1676,8 @@ static long sequence_number = 0;
static void static void
add_to_list (struct head *head_ptr, const char *name) add_to_list (struct head *head_ptr, const char *name)
{ {
struct id *newid = xcalloc (sizeof (struct id) + strlen (name), 1); struct id *newid
= (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p; struct id *p;
strcpy (newid->name, name); strcpy (newid->name, name);
......
2008-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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.
2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gcj.texi: Expand TABs, remove whitespace from blank lines. * gcj.texi: Expand TABs, remove whitespace from blank lines.
......
...@@ -279,7 +279,7 @@ ident_subst (const char* old_name, ...@@ -279,7 +279,7 @@ ident_subst (const char* old_name,
int prefix_len = strlen (prefix); int prefix_len = strlen (prefix);
int suffix_len = strlen (suffix); int suffix_len = strlen (suffix);
int i = prefix_len + old_length + suffix_len + 1; int i = prefix_len + old_length + suffix_len + 1;
char *buffer = alloca (i); char *buffer = (char *) alloca (i);
strcpy (buffer, prefix); strcpy (buffer, prefix);
for (i = 0; i < old_length; i++) for (i = 0; i < old_length; i++)
...@@ -349,7 +349,7 @@ mangled_classname (const char *prefix, tree type) ...@@ -349,7 +349,7 @@ mangled_classname (const char *prefix, tree type)
rewriting. */ rewriting. */
if (illegal_chars != 0) if (illegal_chars != 0)
{ {
char *buffer = alloca (illegal_chars * 4 + len + 1); char *buffer = (char *) alloca (illegal_chars * 4 + len + 1);
int j; int j;
for (i = 0, j = 0; i < len; i++) for (i = 0, j = 0; i < len; i++)
...@@ -413,7 +413,7 @@ unmangle_classname (const char *name, int name_length) ...@@ -413,7 +413,7 @@ unmangle_classname (const char *name, int name_length)
do \ do \
{ \ { \
const char *typename = IDENTIFIER_POINTER (mangled_classname ("", TYPE)); \ 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; \ tree decl; \
\ \
sprintf (buf, #NAME "_%s", typename); \ sprintf (buf, #NAME "_%s", typename); \
...@@ -445,7 +445,7 @@ gen_indirect_dispatch_tables (tree type) ...@@ -445,7 +445,7 @@ gen_indirect_dispatch_tables (tree type)
const char *typename = IDENTIFIER_POINTER (mangled_classname ("", type)); const char *typename = IDENTIFIER_POINTER (mangled_classname ("", type));
{ {
tree field = NULL; 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); tree catch_class_type = make_node (RECORD_TYPE);
sprintf (buf, "_catch_classes_%s", typename); sprintf (buf, "_catch_classes_%s", typename);
...@@ -759,7 +759,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type) ...@@ -759,7 +759,7 @@ add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
DECL_CONTEXT (fndecl) = this_class; DECL_CONTEXT (fndecl) = this_class;
DECL_LANG_SPECIFIC (fndecl) DECL_LANG_SPECIFIC (fndecl)
= ggc_alloc_cleared (sizeof (struct lang_decl)); = GGC_CNEW (struct lang_decl);
DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC; DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC;
/* Initialize the static initializer test table. */ /* Initialize the static initializer test table. */
...@@ -1192,7 +1192,7 @@ build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED) ...@@ -1192,7 +1192,7 @@ build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED)
{ {
tree decl, decl_name; tree decl, decl_name;
const char *name = IDENTIFIER_POINTER (mangled_classname ("_cpool_", output_class)); 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); sprintf (buf, "%s_%d_ref", name, index);
decl_name = get_identifier (buf); decl_name = get_identifier (buf);
decl = IDENTIFIER_GLOBAL_VALUE (decl_name); decl = IDENTIFIER_GLOBAL_VALUE (decl_name);
...@@ -1367,8 +1367,8 @@ make_local_function_alias (tree method) ...@@ -1367,8 +1367,8 @@ make_local_function_alias (tree method)
tree alias; tree alias;
const char *method_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (method)); const char *method_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (method));
char *name = alloca (strlen (method_name) + 2); char *name = (char *) alloca (strlen (method_name) + 2);
char *buf = alloca (strlen (method_name) + 128); char *buf = (char *) alloca (strlen (method_name) + 128);
/* Only create aliases for local functions. */ /* Only create aliases for local functions. */
if (DECL_EXTERNAL (method)) if (DECL_EXTERNAL (method))
...@@ -2421,7 +2421,7 @@ layout_class (tree this_class) ...@@ -2421,7 +2421,7 @@ layout_class (tree this_class)
obstack_grow (&temporary_obstack, buffer, strlen (buffer)); obstack_grow (&temporary_obstack, buffer, strlen (buffer));
} }
obstack_1grow (&temporary_obstack, '\0'); obstack_1grow (&temporary_obstack, '\0');
report = obstack_finish (&temporary_obstack); report = XOBFINISH (&temporary_obstack, char *);
cyclic_inheritance_report = ggc_strdup (report); cyclic_inheritance_report = ggc_strdup (report);
obstack_free (&temporary_obstack, report); obstack_free (&temporary_obstack, report);
TYPE_SIZE (this_class) = error_mark_node; TYPE_SIZE (this_class) = error_mark_node;
...@@ -3088,7 +3088,7 @@ java_treetreehash_find (htab_t ht, tree t) ...@@ -3088,7 +3088,7 @@ java_treetreehash_find (htab_t ht, tree t)
{ {
struct treetreehash_entry *e; struct treetreehash_entry *e;
hashval_t hv = JAVA_TREEHASHHASH_H (t); 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) if (e == NULL)
return NULL; return NULL;
else else
...@@ -3105,7 +3105,7 @@ java_treetreehash_new (htab_t ht, tree t) ...@@ -3105,7 +3105,7 @@ java_treetreehash_new (htab_t ht, tree t)
e = htab_find_slot_with_hash (ht, t, hv, INSERT); e = htab_find_slot_with_hash (ht, t, hv, INSERT);
if (*e == NULL) if (*e == NULL)
{ {
tthe = (*ht->alloc_f) (1, sizeof (*tthe)); tthe = (struct treetreehash_entry *) (*ht->alloc_f) (1, sizeof (*tthe));
tthe->key = t; tthe->key = t;
*e = tthe; *e = tthe;
} }
...@@ -3135,7 +3135,7 @@ split_qualified_name (tree *left, tree *right, tree source) ...@@ -3135,7 +3135,7 @@ split_qualified_name (tree *left, tree *right, tree source)
char *p, *base; char *p, *base;
int l = IDENTIFIER_LENGTH (source); int l = IDENTIFIER_LENGTH (source);
base = alloca (l + 1); base = (char *) alloca (l + 1);
memcpy (base, IDENTIFIER_POINTER (source), l + 1); memcpy (base, IDENTIFIER_POINTER (source), l + 1);
/* Breakdown NAME into REMAINDER . IDENTIFIER. */ /* Breakdown NAME into REMAINDER . IDENTIFIER. */
......
...@@ -44,9 +44,8 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value) ...@@ -44,9 +44,8 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
if (cpool->data == NULL) if (cpool->data == NULL)
{ {
cpool->capacity = 100; cpool->capacity = 100;
cpool->tags = ggc_alloc_cleared (sizeof(uint8) * cpool->capacity); cpool->tags = GGC_CNEWVEC (uint8, cpool->capacity);
cpool->data = ggc_alloc_cleared (sizeof(union cpool_entry) cpool->data = GGC_CNEWVEC (union cpool_entry, cpool->capacity);
* cpool->capacity);
cpool->count = 1; cpool->count = 1;
} }
if (index >= cpool->capacity) if (index >= cpool->capacity)
...@@ -55,10 +54,9 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value) ...@@ -55,10 +54,9 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
cpool->capacity *= 2; cpool->capacity *= 2;
if (index >= cpool->capacity) if (index >= cpool->capacity)
cpool->capacity = index + 10; cpool->capacity = index + 10;
cpool->tags = ggc_realloc (cpool->tags, cpool->tags = GGC_RESIZEVEC (uint8, cpool->tags, cpool->capacity);
sizeof(uint8) * cpool->capacity); cpool->data = GGC_RESIZEVEC (union cpool_entry, cpool->data,
cpool->data = ggc_realloc (cpool->data, cpool->capacity);
sizeof(union cpool_entry) * cpool->capacity);
/* Make sure GC never sees uninitialized tag values. */ /* Make sure GC never sees uninitialized tag values. */
memset (cpool->tags + old_cap, 0, cpool->capacity - old_cap); memset (cpool->tags + old_cap, 0, cpool->capacity - old_cap);
...@@ -335,7 +333,7 @@ cpool_for_class (tree class) ...@@ -335,7 +333,7 @@ cpool_for_class (tree class)
if (cpool == NULL) if (cpool == NULL)
{ {
cpool = ggc_alloc_cleared (sizeof (struct CPool)); cpool = GGC_CNEW (struct CPool);
TYPE_CPOOL (class) = cpool; TYPE_CPOOL (class) = cpool;
} }
return cpool; return cpool;
......
...@@ -1254,7 +1254,7 @@ static struct binding_level * ...@@ -1254,7 +1254,7 @@ static struct binding_level *
make_binding_level (void) make_binding_level (void)
{ {
/* NOSTRICT */ /* NOSTRICT */
return ggc_alloc_cleared (sizeof (struct binding_level)); return GGC_CNEW (struct binding_level);
} }
void void
...@@ -1593,7 +1593,7 @@ java_dup_lang_specific_decl (tree node) ...@@ -1593,7 +1593,7 @@ java_dup_lang_specific_decl (tree node)
return; return;
lang_decl_size = sizeof (struct lang_decl); lang_decl_size = sizeof (struct lang_decl);
x = ggc_alloc (lang_decl_size); x = GGC_NEW (struct lang_decl);
memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size); memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size);
DECL_LANG_SPECIFIC (node) = x; DECL_LANG_SPECIFIC (node) = x;
} }
...@@ -1720,7 +1720,7 @@ start_java_method (tree fndecl) ...@@ -1720,7 +1720,7 @@ start_java_method (tree fndecl)
i = DECL_MAX_LOCALS(fndecl) + DECL_MAX_STACK(fndecl); i = DECL_MAX_LOCALS(fndecl) + DECL_MAX_STACK(fndecl);
decl_map = make_tree_vec (i); decl_map = make_tree_vec (i);
base_decl_map = make_tree_vec (i); base_decl_map = make_tree_vec (i);
type_map = xrealloc (type_map, i * sizeof (tree)); type_map = XRESIZEVEC (tree, type_map, i);
#if defined(DEBUG_JAVA_BINDING_LEVELS) #if defined(DEBUG_JAVA_BINDING_LEVELS)
fprintf (stderr, "%s:\n", lang_printable_name (fndecl, 2)); fprintf (stderr, "%s:\n", lang_printable_name (fndecl, 2));
......
...@@ -391,7 +391,7 @@ prepare_eh_table_type (tree type) ...@@ -391,7 +391,7 @@ prepare_eh_table_type (tree type)
if (is_compiled_class (type) && !flag_indirect_dispatch) if (is_compiled_class (type) && !flag_indirect_dispatch)
{ {
name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
buf = alloca (strlen (name) + 5); buf = (char *) alloca (strlen (name) + 5);
sprintf (buf, "%s_ref", name); sprintf (buf, "%s_ref", name);
decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node); decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
...@@ -408,7 +408,7 @@ prepare_eh_table_type (tree type) ...@@ -408,7 +408,7 @@ prepare_eh_table_type (tree type)
{ {
utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type))); utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
name = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0))); name = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0)));
buf = alloca (strlen (name) + 5); buf = (char *) alloca (strlen (name) + 5);
sprintf (buf, "%s_ref", name); sprintf (buf, "%s_ref", name);
decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type); decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type);
TREE_STATIC (decl) = 1; TREE_STATIC (decl) = 1;
......
...@@ -430,7 +430,7 @@ type_assertion_eq (const void * k1_p, const void * k2_p) ...@@ -430,7 +430,7 @@ type_assertion_eq (const void * k1_p, const void * k2_p)
static hashval_t static hashval_t
type_assertion_hash (const void *p) type_assertion_hash (const void *p)
{ {
const type_assertion *k_p = p; const type_assertion *k_p = (const type_assertion *) p;
hashval_t hash = iterative_hash (&k_p->assertion_code, sizeof hashval_t hash = iterative_hash (&k_p->assertion_code, sizeof
k_p->assertion_code, 0); k_p->assertion_code, 0);
...@@ -3009,7 +3009,7 @@ note_instructions (JCF *jcf, tree method) ...@@ -3009,7 +3009,7 @@ note_instructions (JCF *jcf, tree method)
JCF_SEEK (jcf, DECL_CODE_OFFSET (method)); JCF_SEEK (jcf, DECL_CODE_OFFSET (method));
byte_ops = jcf->read_ptr; byte_ops = jcf->read_ptr;
instruction_bits = xrealloc (instruction_bits, length + 1); instruction_bits = XRESIZEVAR (char, instruction_bits, length + 1);
memset (instruction_bits, 0, length + 1); memset (instruction_bits, 0, length + 1);
type_states = VEC_alloc (tree, gc, length + 1); type_states = VEC_alloc (tree, gc, length + 1);
VEC_safe_grow_cleared (tree, gc, type_states, length + 1); VEC_safe_grow_cleared (tree, gc, type_states, length + 1);
......
...@@ -769,8 +769,7 @@ union lang_tree_node ...@@ -769,8 +769,7 @@ union lang_tree_node
#define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \ #define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \
if (DECL_LANG_SPECIFIC (T) == NULL) \ if (DECL_LANG_SPECIFIC (T) == NULL) \
{ \ { \
DECL_LANG_SPECIFIC ((T)) \ DECL_LANG_SPECIFIC ((T)) = GGC_CNEW (struct lang_decl); \
= ggc_alloc_cleared (sizeof (struct lang_decl)); \
DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \ DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \
} }
...@@ -900,7 +899,7 @@ struct lang_decl GTY(()) ...@@ -900,7 +899,7 @@ struct lang_decl GTY(())
#define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \ #define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \
if (TYPE_LANG_SPECIFIC ((T)) == NULL) \ if (TYPE_LANG_SPECIFIC ((T)) == NULL) \
TYPE_LANG_SPECIFIC ((T)) \ TYPE_LANG_SPECIFIC ((T)) \
= ggc_alloc_cleared (sizeof (struct lang_type)); = GGC_CNEW (struct lang_type);
#define TYPE_DUMMY(T) (TYPE_LANG_SPECIFIC(T)->dummy_class) #define TYPE_DUMMY(T) (TYPE_LANG_SPECIFIC(T)->dummy_class)
......
...@@ -78,8 +78,9 @@ jcf_filbuf_from_stdio (JCF *jcf, int count) ...@@ -78,8 +78,9 @@ jcf_filbuf_from_stdio (JCF *jcf, int count)
JCF_u4 old_read_end = jcf->read_end - jcf->buffer; JCF_u4 old_read_end = jcf->read_end - jcf->buffer;
JCF_u4 old_size = jcf->buffer_end - jcf->buffer; JCF_u4 old_size = jcf->buffer_end - jcf->buffer;
JCF_u4 new_size = (old_size == 0 ? 2000 : 2 * old_size) + count; JCF_u4 new_size = (old_size == 0 ? 2000 : 2 * old_size) + count;
unsigned char *new_buffer = jcf->buffer == NULL ? ALLOC (new_size) unsigned char *new_buffer
: REALLOC (jcf->buffer, new_size); = jcf->buffer == NULL ? XNEWVAR (unsigned char, new_size)
: XRESIZEVAR (unsigned char, jcf->buffer, new_size);
jcf->buffer = new_buffer; jcf->buffer = new_buffer;
jcf->buffer_end = new_buffer + new_size; jcf->buffer_end = new_buffer + new_size;
jcf->read_ptr = new_buffer + old_read_ptr; jcf->read_ptr = new_buffer + old_read_ptr;
...@@ -115,7 +116,7 @@ opendir_in_zip (const char *zipfile, int is_system) ...@@ -115,7 +116,7 @@ opendir_in_zip (const char *zipfile, int is_system)
return zipf; return zipf;
} }
zipf = ALLOC (sizeof (struct ZipFile) + strlen (zipfile) + 1); zipf = XNEWVAR (struct ZipFile, sizeof (struct ZipFile) + strlen (zipfile) + 1);
zipf->next = SeenZipFiles; zipf->next = SeenZipFiles;
zipf->name = (char*)(zipf+1); zipf->name = (char*)(zipf+1);
strcpy (zipf->name, zipfile); strcpy (zipf->name, zipfile);
...@@ -471,7 +472,7 @@ find_class (const char *classname, int classname_length, JCF *jcf) ...@@ -471,7 +472,7 @@ find_class (const char *classname, int classname_length, JCF *jcf)
/* Allocate and zero out the buffer, since we don't explicitly put a /* Allocate and zero out the buffer, since we don't explicitly put a
null pointer when we're copying it below. */ null pointer when we're copying it below. */
buflen = jcf_path_max_len () + classname_length + 10; buflen = jcf_path_max_len () + classname_length + 10;
buffer = ALLOC (buflen); buffer = XNEWVAR (char, buflen);
memset (buffer, 0, buflen); memset (buffer, 0, buflen);
for (entry = jcf_path_start (); entry != NULL; entry = jcf_path_next (entry)) for (entry = jcf_path_start (); entry != NULL; entry = jcf_path_next (entry))
......
...@@ -145,7 +145,7 @@ reverse (const char *s) ...@@ -145,7 +145,7 @@ reverse (const char *s)
else else
{ {
int len = strlen (s); int len = strlen (s);
char *d = xmalloc (len + 1); char *d = XNEWVAR (char, len + 1);
const char *sp; const char *sp;
char *dp; char *dp;
...@@ -213,11 +213,11 @@ java_read_sourcefilenames (const char *fsource_filename) ...@@ -213,11 +213,11 @@ java_read_sourcefilenames (const char *fsource_filename)
/* Read the filenames. Put a pointer to each filename into the /* Read the filenames. Put a pointer to each filename into the
array FILENAMES. */ array FILENAMES. */
{ {
char *linebuf = alloca (longest_line + 1); char *linebuf = (char *) alloca (longest_line + 1);
int i = 0; int i = 0;
int charpos; int charpos;
filenames = xmalloc (num_files * sizeof (char*)); filenames = XNEWVEC (char *, num_files);
charpos = 0; charpos = 0;
for (;;) for (;;)
...@@ -249,7 +249,7 @@ java_read_sourcefilenames (const char *fsource_filename) ...@@ -249,7 +249,7 @@ java_read_sourcefilenames (const char *fsource_filename)
} }
else else
{ {
filenames = xmalloc (sizeof (char*)); filenames = XNEWVEC (char *, 1);
filenames[0] = reverse (fsource_filename); filenames[0] = reverse (fsource_filename);
num_files = 1; num_files = 1;
} }
...@@ -391,13 +391,13 @@ annotation_grow (int delta) ...@@ -391,13 +391,13 @@ annotation_grow (int delta)
if (*data == NULL) if (*data == NULL)
{ {
*data = xmalloc (delta); *data = XNEWVAR (unsigned char, delta);
} }
else else
{ {
int newlen = *datasize + delta; int newlen = *datasize + delta;
if (floor_log2 (newlen) != floor_log2 (*datasize)) if (floor_log2 (newlen) != floor_log2 (*datasize))
*data = xrealloc (*data, 2 << (floor_log2 (newlen))); *data = XRESIZEVAR (unsigned char, *data, 2 << (floor_log2 (newlen)));
} }
*datasize += delta; *datasize += delta;
return *data + len; return *data + len;
...@@ -746,7 +746,7 @@ rewrite_reflection_indexes (void *arg) ...@@ -746,7 +746,7 @@ rewrite_reflection_indexes (void *arg)
{ {
bitmap_iterator bi; bitmap_iterator bi;
unsigned int offset; unsigned int offset;
VEC(int, heap) *map = arg; VEC(int, heap) *map = (VEC(int, heap) *) arg;
unsigned char *data = TYPE_REFLECTION_DATA (current_class); unsigned char *data = TYPE_REFLECTION_DATA (current_class);
if (map) if (map)
...@@ -1731,7 +1731,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) ...@@ -1731,7 +1731,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{ {
count = next - list; count = next - list;
avail = 2 * (count + avail); avail = 2 * (count + avail);
list = xrealloc (list, avail); list = XRESIZEVEC (char, list, avail);
next = list + count; next = list + count;
avail = avail - count; avail = avail - count;
} }
...@@ -1877,7 +1877,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) ...@@ -1877,7 +1877,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
if (magic == 0xcafebabe) if (magic == 0xcafebabe)
{ {
CLASS_FILE_P (node) = 1; CLASS_FILE_P (node) = 1;
current_jcf = ggc_alloc (sizeof (JCF)); current_jcf = GGC_NEW (JCF);
JCF_ZERO (current_jcf); JCF_ZERO (current_jcf);
current_jcf->read_state = finput; current_jcf->read_state = finput;
current_jcf->filbuf = jcf_filbuf_from_stdio; current_jcf->filbuf = jcf_filbuf_from_stdio;
...@@ -1895,7 +1895,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) ...@@ -1895,7 +1895,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
} }
else if (magic == (JCF_u4)ZIPMAGIC) else if (magic == (JCF_u4)ZIPMAGIC)
{ {
main_jcf = ggc_alloc (sizeof (JCF)); main_jcf = GGC_NEW (JCF);
JCF_ZERO (main_jcf); JCF_ZERO (main_jcf);
main_jcf->read_state = finput; main_jcf->read_state = finput;
main_jcf->filbuf = jcf_filbuf_from_stdio; main_jcf->filbuf = jcf_filbuf_from_stdio;
...@@ -1905,7 +1905,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) ...@@ -1905,7 +1905,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
fatal_error ("bad zip/jar file %s", filename); fatal_error ("bad zip/jar file %s", filename);
localToFile = SeenZipFiles; localToFile = SeenZipFiles;
/* Register all the classes defined there. */ /* Register all the classes defined there. */
process_zip_dir (main_jcf->read_state); process_zip_dir ((FILE *) main_jcf->read_state);
linemap_add (line_table, LC_LEAVE, false, NULL, 0); linemap_add (line_table, LC_LEAVE, false, NULL, 0);
parse_zip_file_entries (); parse_zip_file_entries ();
} }
...@@ -2157,7 +2157,7 @@ process_zip_dir (FILE *finput) ...@@ -2157,7 +2157,7 @@ process_zip_dir (FILE *finput)
class_name = compute_class_name (zdir); class_name = compute_class_name (zdir);
file_name = XNEWVEC (char, zdir->filename_length+1); file_name = XNEWVEC (char, zdir->filename_length+1);
jcf = ggc_alloc (sizeof (JCF)); jcf = GGC_NEW (JCF);
JCF_ZERO (jcf); JCF_ZERO (jcf);
strncpy (file_name, class_name_in_zip_dir, zdir->filename_length); strncpy (file_name, class_name_in_zip_dir, zdir->filename_length);
......
...@@ -154,7 +154,7 @@ add_entry (struct entry **entp, const char *filename, int is_system) ...@@ -154,7 +154,7 @@ add_entry (struct entry **entp, const char *filename, int is_system)
work more easily. Eww. */ work more easily. Eww. */
if (! IS_DIR_SEPARATOR (filename[len - 1])) if (! IS_DIR_SEPARATOR (filename[len - 1]))
{ {
char *f2 = alloca (len + 2); char *f2 = (char *) alloca (len + 2);
strcpy (f2, filename); strcpy (f2, filename);
f2[len] = DIR_SEPARATOR; f2[len] = DIR_SEPARATOR;
f2[len + 1] = '\0'; f2[len + 1] = '\0';
...@@ -177,7 +177,7 @@ add_path (struct entry **entp, const char *cp, int is_system) ...@@ -177,7 +177,7 @@ add_path (struct entry **entp, const char *cp, int is_system)
if (cp) if (cp)
{ {
char *buf = alloca (strlen (cp) + 3); char *buf = (char *) alloca (strlen (cp) + 3);
startp = endp = cp; startp = endp = cp;
while (1) while (1)
{ {
...@@ -227,7 +227,7 @@ jcf_path_init (void) ...@@ -227,7 +227,7 @@ jcf_path_init (void)
GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX"); GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX");
if (cp) if (cp)
{ {
try = alloca (strlen (cp) + 50); try = (char *) alloca (strlen (cp) + 50);
/* The exec prefix can be something like /* The exec prefix can be something like
/usr/local/bin/../lib/gcc-lib/. We want to change this /usr/local/bin/../lib/gcc-lib/. We want to change this
into a pointer to the share/java directory. We support two into a pointer to the share/java directory. We support two
...@@ -285,7 +285,7 @@ jcf_path_init (void) ...@@ -285,7 +285,7 @@ jcf_path_init (void)
/* Desperation: use the installed one. */ /* Desperation: use the installed one. */
char *extdirs; char *extdirs;
add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1); add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1);
extdirs = alloca (strlen (LIBGCJ_ZIP_FILE) + 1); extdirs = (char *) alloca (strlen (LIBGCJ_ZIP_FILE) + 1);
strcpy (extdirs, LIBGCJ_ZIP_FILE); strcpy (extdirs, LIBGCJ_ZIP_FILE);
strcpy (&extdirs[strlen (LIBGCJ_ZIP_FILE) strcpy (&extdirs[strlen (LIBGCJ_ZIP_FILE)
- strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")], - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
...@@ -329,7 +329,7 @@ jcf_path_extdirs_arg (const char *cp) ...@@ -329,7 +329,7 @@ jcf_path_extdirs_arg (const char *cp)
if (cp) if (cp)
{ {
char *buf = alloca (strlen (cp) + 3); char *buf = (char *) alloca (strlen (cp) + 3);
startp = endp = cp; startp = endp = cp;
while (1) while (1)
{ {
...@@ -358,7 +358,7 @@ jcf_path_extdirs_arg (const char *cp) ...@@ -358,7 +358,7 @@ jcf_path_extdirs_arg (const char *cp)
if (direntp->d_name[0] != '.') if (direntp->d_name[0] != '.')
{ {
char *name = alloca (dirname_length char *name = (char *) alloca (dirname_length
+ strlen (direntp->d_name) + 2); + strlen (direntp->d_name) + 2);
strcpy (name, buf); strcpy (name, buf);
if (! IS_DIR_SEPARATOR (name[dirname_length-1])) if (! IS_DIR_SEPARATOR (name[dirname_length-1]))
......
...@@ -330,8 +330,8 @@ jcf_parse_constant_pool (JCF* jcf) ...@@ -330,8 +330,8 @@ jcf_parse_constant_pool (JCF* jcf)
{ {
int i, n; int i, n;
JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf)); JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf));
jcf->cpool.tags = ggc_alloc (JPOOL_SIZE (jcf)); jcf->cpool.tags = GGC_NEWVAR (uint8, JPOOL_SIZE (jcf));
jcf->cpool.data = ggc_alloc (sizeof (jword) * JPOOL_SIZE (jcf)); jcf->cpool.data = GGC_NEWVAR (union cpool_entry, sizeof (jword) * JPOOL_SIZE (jcf));
jcf->cpool.tags[0] = 0; jcf->cpool.tags[0] = 0;
#ifdef HANDLE_START_CONSTANT_POOL #ifdef HANDLE_START_CONSTANT_POOL
HANDLE_START_CONSTANT_POOL (JPOOL_SIZE (jcf)); HANDLE_START_CONSTANT_POOL (JPOOL_SIZE (jcf));
......
...@@ -177,5 +177,5 @@ do_mangle_classname (const char *string) ...@@ -177,5 +177,5 @@ do_mangle_classname (const char *string)
append_gpp_mangled_name (&ptr [-count], count); append_gpp_mangled_name (&ptr [-count], count);
obstack_grow (mangle_obstack, "6class$E", strlen ("6class$E")); obstack_grow (mangle_obstack, "6class$E", strlen ("6class$E"));
obstack_1grow (mangle_obstack, '\0'); obstack_1grow (mangle_obstack, '\0');
return obstack_finish (mangle_obstack); return XOBFINISH (mangle_obstack, char *);
} }
...@@ -389,7 +389,7 @@ put_decl_string (const char *str, int len) ...@@ -389,7 +389,7 @@ put_decl_string (const char *str, int len)
else else
{ {
decl_buflen *= 2; decl_buflen *= 2;
decl_buf = xrealloc (decl_buf, decl_buflen); decl_buf = XRESIZEVAR (char, decl_buf, decl_buflen);
} }
} }
strcpy (decl_buf + decl_bufpos, str); strcpy (decl_buf + decl_bufpos, str);
......
...@@ -983,7 +983,7 @@ copy_state_with_stack (state *s, state *orig, int max_stack, int max_locals) ...@@ -983,7 +983,7 @@ copy_state_with_stack (state *s, state *orig, int max_stack, int max_locals)
static state * static state *
make_state_copy (state *orig, int max_stack, int max_locals) make_state_copy (state *orig, int max_stack, int max_locals)
{ {
state *s = vfy_alloc (sizeof (state)); state *s = (state *) vfy_alloc (sizeof (state));
copy_state_with_stack (s, orig, max_stack, max_locals); copy_state_with_stack (s, orig, max_stack, max_locals);
return s; return s;
} }
...@@ -991,7 +991,7 @@ make_state_copy (state *orig, int max_stack, int max_locals) ...@@ -991,7 +991,7 @@ make_state_copy (state *orig, int max_stack, int max_locals)
static state * static state *
make_state (int max_stack, int max_locals) make_state (int max_stack, int max_locals)
{ {
state *s = vfy_alloc (sizeof (state)); state *s = (state *) vfy_alloc (sizeof (state));
init_state_with_stack (s, max_stack, max_locals); init_state_with_stack (s, max_stack, max_locals);
return s; return s;
} }
...@@ -1385,7 +1385,7 @@ add_new_state (int npc, state *old_state) ...@@ -1385,7 +1385,7 @@ add_new_state (int npc, state *old_state)
debug_print_state (new_state, "New", npc, current_method->max_stack, debug_print_state (new_state, "New", npc, current_method->max_stack,
current_method->max_locals); current_method->max_locals);
nlink = vfy_alloc (sizeof (state_list)); nlink = (state_list *) vfy_alloc (sizeof (state_list));
nlink->val = new_state; nlink->val = new_state;
nlink->next = vfr->states[npc]; nlink->next = vfr->states[npc];
vfr->states[npc] = nlink; vfr->states[npc] = nlink;
......
2008-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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.
2008-05-12 Tomas Bily <tbily@suse.cz> 2008-05-12 Tomas Bily <tbily@suse.cz>
* objc-act.c (objc_generate_write_barrier, objc_finish_message_expr): * objc-act.c (objc_generate_write_barrier, objc_finish_message_expr):
......
...@@ -1500,7 +1500,7 @@ setup_string_decl (void) ...@@ -1500,7 +1500,7 @@ setup_string_decl (void)
/* %s in format will provide room for terminating null */ /* %s in format will provide room for terminating null */
length = strlen (STRING_OBJECT_GLOBAL_FORMAT) length = strlen (STRING_OBJECT_GLOBAL_FORMAT)
+ strlen (constant_string_class_name); + strlen (constant_string_class_name);
name = xmalloc (length); name = XNEWVEC (char, length);
sprintf (name, STRING_OBJECT_GLOBAL_FORMAT, sprintf (name, STRING_OBJECT_GLOBAL_FORMAT,
constant_string_class_name); constant_string_class_name);
constant_string_global_id = get_identifier (name); constant_string_global_id = get_identifier (name);
...@@ -1929,12 +1929,12 @@ objc_build_string_object (tree string) ...@@ -1929,12 +1929,12 @@ objc_build_string_object (tree string)
/* Perhaps we already constructed a constant string just like this one? */ /* Perhaps we already constructed a constant string just like this one? */
key.literal = string; key.literal = string;
loc = htab_find_slot (string_htab, &key, INSERT); loc = htab_find_slot (string_htab, &key, INSERT);
desc = *loc; desc = (struct string_descriptor *) *loc;
if (!desc) if (!desc)
{ {
tree var; tree var;
*loc = desc = ggc_alloc (sizeof (*desc)); *loc = desc = GGC_NEW (struct string_descriptor);
desc->literal = string; desc->literal = string;
/* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */ /* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */
...@@ -3290,14 +3290,14 @@ static GTY ((param_is (struct interface_tuple))) htab_t interface_htab; ...@@ -3290,14 +3290,14 @@ static GTY ((param_is (struct interface_tuple))) htab_t interface_htab;
static hashval_t static hashval_t
hash_interface (const void *p) hash_interface (const void *p)
{ {
const struct interface_tuple *d = p; const struct interface_tuple *d = (const struct interface_tuple *) p;
return IDENTIFIER_HASH_VALUE (d->id); return IDENTIFIER_HASH_VALUE (d->id);
} }
static int static int
eq_interface (const void *p1, const void *p2) eq_interface (const void *p1, const void *p2)
{ {
const struct interface_tuple *d = p1; const struct interface_tuple *d = (const struct interface_tuple *) p1;
return d->id == p2; return d->id == p2;
} }
...@@ -3751,7 +3751,7 @@ next_sjlj_build_try_catch_finally (void) ...@@ -3751,7 +3751,7 @@ next_sjlj_build_try_catch_finally (void)
void void
objc_begin_try_stmt (location_t try_locus, tree body) objc_begin_try_stmt (location_t try_locus, tree body)
{ {
struct objc_try_context *c = xcalloc (1, sizeof (*c)); struct objc_try_context *c = XCNEW (struct objc_try_context);
c->outer = cur_try_context; c->outer = cur_try_context;
c->try_body = body; c->try_body = body;
c->try_locus = try_locus; c->try_locus = try_locus;
...@@ -4348,7 +4348,7 @@ encode_method_prototype (tree method_decl) ...@@ -4348,7 +4348,7 @@ encode_method_prototype (tree method_decl)
finish_encoding: finish_encoding:
obstack_1grow (&util_obstack, '\0'); obstack_1grow (&util_obstack, '\0');
result = get_identifier (obstack_finish (&util_obstack)); result = get_identifier (XOBFINISH (&util_obstack, char *));
obstack_free (&util_obstack, util_firstobj); obstack_free (&util_obstack, util_firstobj);
return result; return result;
} }
...@@ -5160,7 +5160,7 @@ build_ivar_list_initializer (tree type, tree field_decl) ...@@ -5160,7 +5160,7 @@ build_ivar_list_initializer (tree type, tree field_decl)
ivar ivar
= tree_cons = tree_cons
(NULL_TREE, (NULL_TREE,
add_objc_string (get_identifier (obstack_finish (&util_obstack)), add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
meth_var_types), meth_var_types),
ivar); ivar);
obstack_free (&util_obstack, util_firstobj); obstack_free (&util_obstack, util_firstobj);
...@@ -6690,7 +6690,7 @@ objc_build_encode_expr (tree type) ...@@ -6690,7 +6690,7 @@ objc_build_encode_expr (tree type)
encode_type (type, obstack_object_size (&util_obstack), encode_type (type, obstack_object_size (&util_obstack),
OBJC_ENCODE_INLINE_DEFS); OBJC_ENCODE_INLINE_DEFS);
obstack_1grow (&util_obstack, 0); /* null terminate string */ obstack_1grow (&util_obstack, 0); /* null terminate string */
string = obstack_finish (&util_obstack); string = XOBFINISH (&util_obstack, const char *);
/* Synthesize a string that represents the encoded struct/union. */ /* Synthesize a string that represents the encoded struct/union. */
result = my_build_string (strlen (string) + 1, string); result = my_build_string (strlen (string) + 1, string);
......
...@@ -127,7 +127,7 @@ symbol_hash_lookup (const char *string, int create) ...@@ -127,7 +127,7 @@ symbol_hash_lookup (const char *string, int create)
*e = v = XCNEW (struct symbol_hash_entry); *e = v = XCNEW (struct symbol_hash_entry);
v->key = xstrdup (string); v->key = xstrdup (string);
} }
return *e; return (struct symbol_hash_entry *) *e;
} }
static htab_t file_table; static htab_t file_table;
...@@ -147,7 +147,7 @@ file_hash_lookup (const char *string) ...@@ -147,7 +147,7 @@ file_hash_lookup (const char *string)
*e = v = XCNEW (struct file_hash_entry); *e = v = XCNEW (struct file_hash_entry);
v->key = xstrdup (string); v->key = xstrdup (string);
} }
return *e; return (struct file_hash_entry *) *e;
} }
static htab_t demangled_table; static htab_t demangled_table;
...@@ -169,7 +169,7 @@ demangled_hash_lookup (const char *string, int create) ...@@ -169,7 +169,7 @@ demangled_hash_lookup (const char *string, int create)
*e = v = XCNEW (struct demangled_hash_entry); *e = v = XCNEW (struct demangled_hash_entry);
v->key = xstrdup (string); v->key = xstrdup (string);
} }
return *e; return (struct demangled_hash_entry *) *e;
} }
/* Stack code. */ /* Stack code. */
...@@ -193,8 +193,8 @@ struct file_stack_entry *file_stack; ...@@ -193,8 +193,8 @@ struct file_stack_entry *file_stack;
static void static void
symbol_push (symbol *p) symbol_push (symbol *p)
{ {
struct symbol_stack_entry *ep = obstack_alloc struct symbol_stack_entry *ep
(&symbol_stack_obstack, sizeof (struct symbol_stack_entry)); = XOBNEW (&symbol_stack_obstack, struct symbol_stack_entry);
ep->value = p; ep->value = p;
ep->next = symbol_stack; ep->next = symbol_stack;
symbol_stack = ep; symbol_stack = ep;
...@@ -221,8 +221,7 @@ file_push (file *p) ...@@ -221,8 +221,7 @@ file_push (file *p)
if (p->tweaking) if (p->tweaking)
return; return;
ep = obstack_alloc ep = XOBNEW (&file_stack_obstack, struct file_stack_entry);
(&file_stack_obstack, sizeof (struct file_stack_entry));
ep->value = p; ep->value = p;
ep->next = file_stack; ep->next = file_stack;
file_stack = ep; file_stack = ep;
...@@ -298,7 +297,7 @@ frob_extension (const char *s, const char *ext) ...@@ -298,7 +297,7 @@ frob_extension (const char *s, const char *ext)
p = s + strlen (s); p = s + strlen (s);
obstack_grow (&temporary_obstack, s, p - s); obstack_grow (&temporary_obstack, s, p - s);
return obstack_copy0 (&temporary_obstack, ext, strlen (ext)); return (char *) obstack_copy0 (&temporary_obstack, ext, strlen (ext));
} }
static char * static char *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment