Mesa (master): freedreno/a2xx: Squash a compiler warning
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 26 22:11:41 UTC 2018
Module: Mesa
Branch: master
Commit: 4222fe8af2b71f47dd076c94f817aa4ea1662963
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4222fe8af2b71f47dd076c94f817aa4ea1662963
Author: Kristian H. Kristensen <hoegsberg at chromium.org>
Date: Tue Oct 16 14:50:58 2018 -0700
freedreno/a2xx: Squash a compiler warning
We get a warning here for assigning a const char * pointer to
char *swizzle in struct ir2_src_register. The constructor strdups a 4
byte string here, so just memcpy to that instead.
Signed-off-by: Kristian H. Kristensen <hoegsberg at chromium.org>
---
src/gallium/drivers/freedreno/a2xx/fd2_compiler.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c b/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
index 7d33aa07a9..156bfc247c 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
@@ -724,8 +724,8 @@ translate_tex(struct fd2_compile_context *ctx,
instr = ir2_instr_create_alu_s(ctx->so->ir, RECIP_IEEE);
add_dst_reg(ctx, instr, &tmp_dst)->swizzle = "x___";
- add_src_reg(ctx, instr, &inst->Src[0].Register)->swizzle =
- swiz[inst->Src[0].Register.SwizzleW];
+ memcpy(add_src_reg(ctx, instr, &inst->Src[0].Register)->swizzle,
+ swiz[inst->Src[0].Register.SwizzleW], 4);
instr = ir2_instr_create_alu_v(ctx->so->ir, MULv);
add_dst_reg(ctx, instr, &tmp_dst)->swizzle = "xyz_";
More information about the mesa-commit
mailing list