From: Bernardo Innocenti Date: Mon, 26 Jul 2004 01:33:36 +0000 (+0200) Subject: gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC (). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cca8ead2b904e26000eb1582326ad70843515739;p=gcc.git gengtype.c (oprintf): Replace xrealloc () with XRESIZEVEC (). * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 92168139e24..a44180fe3c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-26 Bernardo Innocenti + + * 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 * c-common.c (disable_builtin_function): Rename variable n to diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 9a41da62382..9f88d6fc05b 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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); \ } \ \ diff --git a/gcc/gengtype-yacc.y b/gcc/gengtype-yacc.y index 0d64d97c7d0..403e23f1f38 100644 --- a/gcc/gengtype-yacc.y +++ b/gcc/gengtype-yacc.y @@ -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; } ; diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 441420c7fee..76f39fa9873 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -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);