summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2009-03-17 10:18:24 +0100
committerMichal Krol <[email protected]>2009-03-17 10:18:24 +0100
commit627c2d2f0a26e01095d23bb33955bee825390c8d (patch)
tree9c502174ba11cbffd27b5b37728556632dba974d /src/gallium
parent175f58baa9a758919163f9ada79306294e4139ce (diff)
tgsi: Silence const pointer cast warnings.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c
index 22006edf3d1..1c1263e596f 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_parse.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c
@@ -147,6 +147,7 @@ tgsi_parse_token(
case TGSI_TOKEN_TYPE_IMMEDIATE:
{
struct tgsi_full_immediate *imm = &ctx->FullToken.FullImmediate;
+ uint imm_count = imm->Immediate.NrTokens - 1;
*imm = tgsi_default_full_immediate();
copy_token(&imm->Immediate, &token);
@@ -154,10 +155,16 @@ tgsi_parse_token(
switch (imm->Immediate.DataType) {
case TGSI_IMM_FLOAT32:
- imm->u.Pointer = MALLOC(
- sizeof( struct tgsi_immediate_float32 ) * (imm->Immediate.NrTokens - 1) );
- for( i = 0; i < imm->Immediate.NrTokens - 1; i++ ) {
- next_token( ctx, (struct tgsi_immediate_float32 *) &imm->u.ImmediateFloat32[i] );
+ {
+ struct tgsi_immediate_float32 *data;
+
+ data = (struct tgsi_immediate_float32 *) MALLOC(sizeof(struct tgsi_immediate_float32) * imm_count);
+ if (data) {
+ for (i = 0; i < imm_count; i++) {
+ next_token(ctx, &data[i]);
+ }
+ imm->u.ImmediateFloat32 = data;
+ }
}
break;