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