fix an alias warning by replacing cast by an union.

This commit is contained in:
Vítor Santos Costa 2011-03-02 09:15:30 +00:00
parent b868d85ac8
commit 282760de9c

View File

@ -549,12 +549,15 @@ raw_read2(ReadData _PL_rd ARG_LD)
if ( c == '*' )
{ int last;
int level = 1;
tmp_buffer ctmpbuf;
union {
tmp_buffer ctmpbuf;
buffer tmpbuf;
} u;
Buffer cbuf;
if ( _PL_rd->comments )
{ initBuffer(&ctmpbuf);
cbuf = (Buffer)&ctmpbuf;
{ initBuffer(&u.ctmpbuf);
cbuf = &u.tmpbuf;
addUTF8Buffer(cbuf, '/');
addUTF8Buffer(cbuf, '*');
} else
@ -628,7 +631,10 @@ raw_read2(ReadData _PL_rd ARG_LD)
case '%': if ( something_read )
addToBuffer(' ', _PL_rd);
if ( _PL_rd->comments )
{ tmp_buffer ctmpbuf;
{ union {
tmp_buffer ctmpbuf;
buffer uctmpbuf;
} u;
Buffer cbuf;
if ( rb.stream->position )
@ -639,8 +645,8 @@ raw_read2(ReadData _PL_rd ARG_LD)
} else
pos = NULL;
initBuffer(&ctmpbuf);
cbuf = (Buffer)&ctmpbuf;
initBuffer(&u.ctmpbuf);
cbuf = (Buffer)&u.uctmpbuf;
addUTF8Buffer(cbuf, '%');
for(;;)