Commit 7048110f by Kaveh Ghazi

decl.c, [...]: Don't cast return value of xmalloc et al.

	* decl.c, parse-scan.y, parse.y: Don't cast return value of
	xmalloc et al.

From-SVN: r61138
parent 77d3109b
......@@ -1583,7 +1583,7 @@ java_dup_lang_specific_decl (node)
return;
lang_decl_size = sizeof (struct lang_decl);
x = (struct lang_decl *) ggc_alloc (lang_decl_size);
x = ggc_alloc (lang_decl_size);
memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size);
DECL_LANG_SPECIFIC (node) = x;
}
......
......@@ -109,8 +109,7 @@ struct method_declarator {
};
#define NEW_METHOD_DECLARATOR(D,N,A) \
{ \
(D) = \
(struct method_declarator *)xmalloc (sizeof (struct method_declarator)); \
(D) = xmalloc (sizeof (struct method_declarator)); \
(D)->method_name = (N); \
(D)->args = (A); \
}
......@@ -1179,8 +1178,7 @@ constant_expression:
void
java_push_parser_context ()
{
struct parser_ctxt *new =
(struct parser_ctxt *) xcalloc (1, sizeof (struct parser_ctxt));
struct parser_ctxt *new = xcalloc (1, sizeof (struct parser_ctxt));
new->next = ctxp;
ctxp = new;
......@@ -1192,7 +1190,7 @@ push_class_context (name)
{
struct class_context *ctx;
ctx = (struct class_context *) xmalloc (sizeof (struct class_context));
ctx = xmalloc (sizeof (struct class_context));
ctx->name = (char *) name;
ctx->next = current_class_context;
current_class_context = ctx;
......
......@@ -2183,10 +2183,10 @@ dims:
{
allocate *= sizeof (int);
if (ctxp->osb_number)
ctxp->osb_number = (int *)xrealloc (ctxp->osb_number,
allocate);
ctxp->osb_number = xrealloc (ctxp->osb_number,
allocate);
else
ctxp->osb_number = (int *)xmalloc (allocate);
ctxp->osb_number = xmalloc (allocate);
}
ctxp->osb_depth++;
CURRENT_OSB (ctxp) = 1;
......@@ -2660,7 +2660,7 @@ create_new_parser_context (copy_from_previous)
{
struct parser_ctxt *new;
new = (struct parser_ctxt *) ggc_alloc (sizeof (struct parser_ctxt));
new = ggc_alloc (sizeof (struct parser_ctxt));
if (copy_from_previous)
{
memcpy (new, ctxp, sizeof (struct parser_ctxt));
......@@ -5133,7 +5133,7 @@ static void
create_jdep_list (ctxp)
struct parser_ctxt *ctxp;
{
jdeplist *new = (jdeplist *)xmalloc (sizeof (jdeplist));
jdeplist *new = xmalloc (sizeof (jdeplist));
new->first = new->last = NULL;
new->next = ctxp->classd_list;
ctxp->classd_list = new;
......@@ -5188,7 +5188,7 @@ register_incomplete_type (kind, wfl, decl, ptr)
int kind;
tree wfl, decl, ptr;
{
jdep *new = (jdep *)xmalloc (sizeof (jdep));
jdep *new = xmalloc (sizeof (jdep));
if (!ptr && kind != JDEP_METHOD_END) /* JDEP_METHOD_END is a mere marker */
ptr = obtain_incomplete_type (wfl);
......
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