decl.c, [...]: Don't cast return value of xmalloc et al.
authorKaveh Ghazi <ghazi@gcc.gnu.org>
Fri, 10 Jan 2003 03:13:50 +0000 (03:13 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Fri, 10 Jan 2003 03:13:50 +0000 (03:13 +0000)
* decl.c, parse-scan.y, parse.y: Don't cast return value of
xmalloc et al.

From-SVN: r61138

gcc/java/decl.c
gcc/java/parse-scan.y
gcc/java/parse.y

index fa690663bcf6c834d325176fb89d368c15250b53..b0703007a1f6263e71f562a8d0b95917b0a5e9f9 100644 (file)
@@ -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;
 }
index 2411b1187ba3e6d5c88eb70f11eb87f4c6d996e4..24e8055414ce2cf5d5bceb33f1abf5e77f05d1be 100644 (file)
@@ -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;
index 65a114721191981cccc53cb209adf2f4496654cb..236525c2198c6cc20b8e9361526bbe06503b99b4 100644 (file)
@@ -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);