tgsi: fix rbug compile error

../mesa/src/gallium/auxiliary/tgsi/tgsi_parse.h:139:
error: dereferencing pointer ‘tokens.25’ does break strict-aliasing rules

Signed-off-by: Marek Olšák <maraeo@gmail.com>
This commit is contained in:
Marek Olšák
2010-12-11 08:38:39 +01:00
parent d0990db6bd
commit c398f1544e
+2 -1
View File
@@ -136,7 +136,8 @@ tgsi_parse_token(
static INLINE unsigned
tgsi_num_tokens(const struct tgsi_token *tokens)
{
struct tgsi_header header = *(const struct tgsi_header *) tokens;
struct tgsi_header header;
memcpy(&header, tokens, sizeof(header));
return header.HeaderSize + header.BodySize;
}