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
This commit is contained in:
Bernardo Innocenti 2004-07-26 03:33:36 +02:00 committed by Bernardo Innocenti
parent 1ad463f493
commit cca8ead2b9
4 changed files with 12 additions and 8 deletions

View 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

View 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); \
} \
\

View 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;
}
;

View 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);