aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog27
-rw-r--r--gcc/java/class.c24
-rw-r--r--gcc/java/constants.c14
-rw-r--r--gcc/java/decl.c6
-rw-r--r--gcc/java/except.c4
-rw-r--r--gcc/java/expr.c4
-rw-r--r--gcc/java/java-tree.h5
-rw-r--r--gcc/java/jcf-io.c9
-rw-r--r--gcc/java/jcf-parse.c24
-rw-r--r--gcc/java/jcf-path.c12
-rw-r--r--gcc/java/jcf-reader.c4
-rw-r--r--gcc/java/jvgenmain.c2
-rw-r--r--gcc/java/lang.c2
-rw-r--r--gcc/java/verify-impl.c6
14 files changed, 84 insertions, 59 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 1941c96..775b82b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,30 @@
+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>
* gcj.texi: Expand TABs, remove whitespace from blank lines.
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. */
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 5294285..f3436cf 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -44,9 +44,8 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
if (cpool->data == NULL)
{
cpool->capacity = 100;
- cpool->tags = ggc_alloc_cleared (sizeof(uint8) * cpool->capacity);
- cpool->data = ggc_alloc_cleared (sizeof(union cpool_entry)
- * cpool->capacity);
+ cpool->tags = GGC_CNEWVEC (uint8, cpool->capacity);
+ cpool->data = GGC_CNEWVEC (union cpool_entry, cpool->capacity);
cpool->count = 1;
}
if (index >= cpool->capacity)
@@ -55,10 +54,9 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
cpool->capacity *= 2;
if (index >= cpool->capacity)
cpool->capacity = index + 10;
- cpool->tags = ggc_realloc (cpool->tags,
- sizeof(uint8) * cpool->capacity);
- cpool->data = ggc_realloc (cpool->data,
- sizeof(union cpool_entry) * cpool->capacity);
+ cpool->tags = GGC_RESIZEVEC (uint8, cpool->tags, cpool->capacity);
+ cpool->data = GGC_RESIZEVEC (union cpool_entry, cpool->data,
+ cpool->capacity);
/* Make sure GC never sees uninitialized tag values. */
memset (cpool->tags + old_cap, 0, cpool->capacity - old_cap);
@@ -335,7 +333,7 @@ cpool_for_class (tree class)
if (cpool == NULL)
{
- cpool = ggc_alloc_cleared (sizeof (struct CPool));
+ cpool = GGC_CNEW (struct CPool);
TYPE_CPOOL (class) = cpool;
}
return cpool;
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index fcc1c12..8ed8926 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1254,7 +1254,7 @@ static struct binding_level *
make_binding_level (void)
{
/* NOSTRICT */
- return ggc_alloc_cleared (sizeof (struct binding_level));
+ return GGC_CNEW (struct binding_level);
}
void
@@ -1593,7 +1593,7 @@ java_dup_lang_specific_decl (tree node)
return;
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);
DECL_LANG_SPECIFIC (node) = x;
}
@@ -1720,7 +1720,7 @@ start_java_method (tree fndecl)
i = DECL_MAX_LOCALS(fndecl) + DECL_MAX_STACK(fndecl);
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)
fprintf (stderr, "%s:\n", lang_printable_name (fndecl, 2));
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 02203e7..01e2fbe 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -391,7 +391,7 @@ prepare_eh_table_type (tree type)
if (is_compiled_class (type) && !flag_indirect_dispatch)
{
name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
- buf = alloca (strlen (name) + 5);
+ buf = (char *) alloca (strlen (name) + 5);
sprintf (buf, "%s_ref", name);
decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node);
TREE_STATIC (decl) = 1;
@@ -408,7 +408,7 @@ prepare_eh_table_type (tree type)
{
utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
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);
decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type);
TREE_STATIC (decl) = 1;
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 75c18e5..654a25e 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -430,7 +430,7 @@ type_assertion_eq (const void * k1_p, const void * k2_p)
static hashval_t
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
k_p->assertion_code, 0);
@@ -3009,7 +3009,7 @@ note_instructions (JCF *jcf, tree method)
JCF_SEEK (jcf, DECL_CODE_OFFSET (method));
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);
type_states = VEC_alloc (tree, gc, length + 1);
VEC_safe_grow_cleared (tree, gc, type_states, length + 1);
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 02f93e2..65a7589 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -769,8 +769,7 @@ union lang_tree_node
#define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \
if (DECL_LANG_SPECIFIC (T) == NULL) \
{ \
- DECL_LANG_SPECIFIC ((T)) \
- = ggc_alloc_cleared (sizeof (struct lang_decl)); \
+ DECL_LANG_SPECIFIC ((T)) = GGC_CNEW (struct lang_decl); \
DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \
}
@@ -900,7 +899,7 @@ struct lang_decl GTY(())
#define MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC(T) \
if (TYPE_LANG_SPECIFIC ((T)) == NULL) \
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)
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index f639e10..fb8f756 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -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_size = jcf->buffer_end - jcf->buffer;
JCF_u4 new_size = (old_size == 0 ? 2000 : 2 * old_size) + count;
- unsigned char *new_buffer = jcf->buffer == NULL ? ALLOC (new_size)
- : REALLOC (jcf->buffer, new_size);
+ unsigned char *new_buffer
+ = jcf->buffer == NULL ? XNEWVAR (unsigned char, new_size)
+ : XRESIZEVAR (unsigned char, jcf->buffer, new_size);
jcf->buffer = new_buffer;
jcf->buffer_end = new_buffer + new_size;
jcf->read_ptr = new_buffer + old_read_ptr;
@@ -115,7 +116,7 @@ opendir_in_zip (const char *zipfile, int is_system)
return zipf;
}
- zipf = ALLOC (sizeof (struct ZipFile) + strlen (zipfile) + 1);
+ zipf = XNEWVAR (struct ZipFile, sizeof (struct ZipFile) + strlen (zipfile) + 1);
zipf->next = SeenZipFiles;
zipf->name = (char*)(zipf+1);
strcpy (zipf->name, zipfile);
@@ -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
null pointer when we're copying it below. */
buflen = jcf_path_max_len () + classname_length + 10;
- buffer = ALLOC (buflen);
+ buffer = XNEWVAR (char, buflen);
memset (buffer, 0, buflen);
for (entry = jcf_path_start (); entry != NULL; entry = jcf_path_next (entry))
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 11b18a2..c53e871c 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -145,7 +145,7 @@ reverse (const char *s)
else
{
int len = strlen (s);
- char *d = xmalloc (len + 1);
+ char *d = XNEWVAR (char, len + 1);
const char *sp;
char *dp;
@@ -213,11 +213,11 @@ java_read_sourcefilenames (const char *fsource_filename)
/* Read the filenames. Put a pointer to each filename into the
array FILENAMES. */
{
- char *linebuf = alloca (longest_line + 1);
+ char *linebuf = (char *) alloca (longest_line + 1);
int i = 0;
int charpos;
- filenames = xmalloc (num_files * sizeof (char*));
+ filenames = XNEWVEC (char *, num_files);
charpos = 0;
for (;;)
@@ -249,7 +249,7 @@ java_read_sourcefilenames (const char *fsource_filename)
}
else
{
- filenames = xmalloc (sizeof (char*));
+ filenames = XNEWVEC (char *, 1);
filenames[0] = reverse (fsource_filename);
num_files = 1;
}
@@ -391,13 +391,13 @@ annotation_grow (int delta)
if (*data == NULL)
{
- *data = xmalloc (delta);
+ *data = XNEWVAR (unsigned char, delta);
}
else
{
int newlen = *datasize + delta;
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;
return *data + len;
@@ -746,7 +746,7 @@ rewrite_reflection_indexes (void *arg)
{
bitmap_iterator bi;
unsigned int offset;
- VEC(int, heap) *map = arg;
+ VEC(int, heap) *map = (VEC(int, heap) *) arg;
unsigned char *data = TYPE_REFLECTION_DATA (current_class);
if (map)
@@ -1731,7 +1731,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
count = next - list;
avail = 2 * (count + avail);
- list = xrealloc (list, avail);
+ list = XRESIZEVEC (char, list, avail);
next = list + count;
avail = avail - count;
}
@@ -1877,7 +1877,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
if (magic == 0xcafebabe)
{
CLASS_FILE_P (node) = 1;
- current_jcf = ggc_alloc (sizeof (JCF));
+ current_jcf = GGC_NEW (JCF);
JCF_ZERO (current_jcf);
current_jcf->read_state = finput;
current_jcf->filbuf = jcf_filbuf_from_stdio;
@@ -1895,7 +1895,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
}
else if (magic == (JCF_u4)ZIPMAGIC)
{
- main_jcf = ggc_alloc (sizeof (JCF));
+ main_jcf = GGC_NEW (JCF);
JCF_ZERO (main_jcf);
main_jcf->read_state = finput;
main_jcf->filbuf = jcf_filbuf_from_stdio;
@@ -1905,7 +1905,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
fatal_error ("bad zip/jar file %s", filename);
localToFile = SeenZipFiles;
/* 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);
parse_zip_file_entries ();
}
@@ -2157,7 +2157,7 @@ process_zip_dir (FILE *finput)
class_name = compute_class_name (zdir);
file_name = XNEWVEC (char, zdir->filename_length+1);
- jcf = ggc_alloc (sizeof (JCF));
+ jcf = GGC_NEW (JCF);
JCF_ZERO (jcf);
strncpy (file_name, class_name_in_zip_dir, zdir->filename_length);
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index d0661e7..ca7875c 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -154,7 +154,7 @@ add_entry (struct entry **entp, const char *filename, int is_system)
work more easily. Eww. */
if (! IS_DIR_SEPARATOR (filename[len - 1]))
{
- char *f2 = alloca (len + 2);
+ char *f2 = (char *) alloca (len + 2);
strcpy (f2, filename);
f2[len] = DIR_SEPARATOR;
f2[len + 1] = '\0';
@@ -177,7 +177,7 @@ add_path (struct entry **entp, const char *cp, int is_system)
if (cp)
{
- char *buf = alloca (strlen (cp) + 3);
+ char *buf = (char *) alloca (strlen (cp) + 3);
startp = endp = cp;
while (1)
{
@@ -227,7 +227,7 @@ jcf_path_init (void)
GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX");
if (cp)
{
- try = alloca (strlen (cp) + 50);
+ try = (char *) alloca (strlen (cp) + 50);
/* The exec prefix can be something like
/usr/local/bin/../lib/gcc-lib/. We want to change this
into a pointer to the share/java directory. We support two
@@ -285,7 +285,7 @@ jcf_path_init (void)
/* Desperation: use the installed one. */
char *extdirs;
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[strlen (LIBGCJ_ZIP_FILE)
- strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")],
@@ -329,7 +329,7 @@ jcf_path_extdirs_arg (const char *cp)
if (cp)
{
- char *buf = alloca (strlen (cp) + 3);
+ char *buf = (char *) alloca (strlen (cp) + 3);
startp = endp = cp;
while (1)
{
@@ -358,7 +358,7 @@ jcf_path_extdirs_arg (const char *cp)
if (direntp->d_name[0] != '.')
{
- char *name = alloca (dirname_length
+ char *name = (char *) alloca (dirname_length
+ strlen (direntp->d_name) + 2);
strcpy (name, buf);
if (! IS_DIR_SEPARATOR (name[dirname_length-1]))
diff --git a/gcc/java/jcf-reader.c b/gcc/java/jcf-reader.c
index 25517d6..c437d16 100644
--- a/gcc/java/jcf-reader.c
+++ b/gcc/java/jcf-reader.c
@@ -330,8 +330,8 @@ jcf_parse_constant_pool (JCF* jcf)
{
int i, n;
JPOOL_SIZE (jcf) = (JCF_FILL (jcf, 2), JCF_readu2 (jcf));
- jcf->cpool.tags = ggc_alloc (JPOOL_SIZE (jcf));
- jcf->cpool.data = ggc_alloc (sizeof (jword) * JPOOL_SIZE (jcf));
+ jcf->cpool.tags = GGC_NEWVAR (uint8, JPOOL_SIZE (jcf));
+ jcf->cpool.data = GGC_NEWVAR (union cpool_entry, sizeof (jword) * JPOOL_SIZE (jcf));
jcf->cpool.tags[0] = 0;
#ifdef HANDLE_START_CONSTANT_POOL
HANDLE_START_CONSTANT_POOL (JPOOL_SIZE (jcf));
diff --git a/gcc/java/jvgenmain.c b/gcc/java/jvgenmain.c
index 33d95ec..6b7fa4c 100644
--- a/gcc/java/jvgenmain.c
+++ b/gcc/java/jvgenmain.c
@@ -177,5 +177,5 @@ do_mangle_classname (const char *string)
append_gpp_mangled_name (&ptr [-count], count);
obstack_grow (mangle_obstack, "6class$E", strlen ("6class$E"));
obstack_1grow (mangle_obstack, '\0');
- return obstack_finish (mangle_obstack);
+ return XOBFINISH (mangle_obstack, char *);
}
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index fa98114..71f2478 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -389,7 +389,7 @@ put_decl_string (const char *str, int len)
else
{
decl_buflen *= 2;
- decl_buf = xrealloc (decl_buf, decl_buflen);
+ decl_buf = XRESIZEVAR (char, decl_buf, decl_buflen);
}
}
strcpy (decl_buf + decl_bufpos, str);
diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c
index 1efcf68..69fb031 100644
--- a/gcc/java/verify-impl.c
+++ b/gcc/java/verify-impl.c
@@ -983,7 +983,7 @@ copy_state_with_stack (state *s, state *orig, int max_stack, int max_locals)
static state *
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);
return s;
}
@@ -991,7 +991,7 @@ make_state_copy (state *orig, int max_stack, int max_locals)
static state *
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);
return s;
}
@@ -1385,7 +1385,7 @@ add_new_state (int npc, state *old_state)
debug_print_state (new_state, "New", npc, current_method->max_stack,
current_method->max_locals);
- nlink = vfy_alloc (sizeof (state_list));
+ nlink = (state_list *) vfy_alloc (sizeof (state_list));
nlink->val = new_state;
nlink->next = vfr->states[npc];
vfr->states[npc] = nlink;