gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC ().
authorBernardo Innocenti <bernie@develer.com>
Mon, 26 Jul 2004 01:33:36 +0000 (03:33 +0200)
committerBernardo Innocenti <bernie@gcc.gnu.org>
Mon, 26 Jul 2004 01:33:36 +0000 (03:33 +0200)
* gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC ().
* gengtype-yacc.y: Likewise.  Replace free() with XDELETE ().
* c-typeck.c (PUSH_SPELLING): Remove redundant NULL-pointer
check on invocation of XRESIZEVEC ().

From-SVN: r85177

gcc/ChangeLog
gcc/c-typeck.c
gcc/gengtype-yacc.y
gcc/gengtype.c

index 92168139e241cd2d89f45e0ddc80b96d74802ff3..a44180fe3c82f72abc76288a7e27acc7f739d06b 100644 (file)
@@ -1,3 +1,10 @@
+2004-07-26  Bernardo Innocenti  <bernie@develer.com>
+
+       * gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC ().
+       * gengtype-yacc.y: Likewise.  Replace free() with XDELETE ().
+       * c-typeck.c (PUSH_SPELLING): Remove redundant NULL-pointer
+       check on invocation of XRESIZEVEC ().
+
 2004-07-26  Bernardo Innocenti  <bernie@develer.com>
 
        * c-common.c (disable_builtin_function): Rename variable n to
index 9a41da62382d2e4778475fd2df0a9e314e47f5be..9f88d6fc05b6e61f49f3b39bdfd037a7f23b685f 100644 (file)
@@ -3755,11 +3755,8 @@ static int spelling_size;                /* Size of the spelling stack.  */
   if (depth >= spelling_size)                                          \
     {                                                                  \
       spelling_size += 10;                                             \
-      if (spelling_base == 0)                                          \
-       spelling_base = XNEWVEC (struct spelling, spelling_size);       \
-      else                                                             \
-        spelling_base = XRESIZEVEC (struct spelling, spelling_base,    \
-                                   spelling_size);                     \
+      spelling_base = XRESIZEVEC (struct spelling, spelling_base,      \
+                                 spelling_size);                       \
       RESTORE_SPELLING_DEPTH (depth);                                  \
     }                                                                  \
                                                                        \
index 0d64d97c7d0e5f9794bfd11267c895099897ee68..403e23f1f38abfc05b8426a9e4a1fe682048d8a3 100644 (file)
@@ -314,9 +314,9 @@ stringseq: STRING
             {
               size_t l1 = strlen ($1);
               size_t l2 = strlen ($2);
-              char *s = (char *) xrealloc ((char *)$1, l1 + l2 + 1);
+              char *s = XRESIZEVEC (char, $1, l1 + l2 + 1);
               memcpy (s + l1, $2, l2 + 1);
-              free ((void *)$2);
+              XDELETE ($2);
               $$ = s;
             }
           ;
index 441420c7feeeda7fcc1a99c0b92f239c7e197466..76f39fa98730a3244ac4c9862ad5082d8d4ccf7b 100644 (file)
@@ -1028,7 +1028,7 @@ oprintf (outf_p o, const char *format, ...)
       do {
        new_len *= 2;
       } while (o->bufused + slength >= new_len);
-      o->buf = (char *) xrealloc (o->buf, new_len);
+      o->buf = XRESIZEVEC (char, o->buf, new_len);
       o->buflength = new_len;
     }
   memcpy (o->buf + o->bufused, s, slength);