[Mesa-dev] [PATCH] tgsi: trivial build fix for MSVC
Marek Olšák
maraeo at gmail.com
Mon Oct 24 21:13:03 UTC 2016
The warning can be fixed by using {{0}}. Either way:
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Mon, Oct 24, 2016 at 10:45 PM, Brian Paul <brianp at vmware.com> wrote:
> Unfortunately, this fix causes a warning with some versions of gcc
> (such as 4.9.3):
>
> tgsi/tgsi_scan.c: In function 'scan_instruction':
> tgsi/tgsi_scan.c:373:17: warning: missing braces around initializer [-Wmissing-braces]
> struct tgsi_full_src_register src = {0};
> ^
> tgsi/tgsi_scan.c:373:17: warning: (near initialization for 'src.Register') [-Wmissing-braces]
> ---
> src/gallium/auxiliary/tgsi/tgsi_scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> index cbb3eec..2565ab2 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
> @@ -370,7 +370,7 @@ scan_instruction(struct tgsi_shader_info *info,
>
> if (fullinst->Instruction.Texture) {
> for (i = 0; i < fullinst->Texture.NumOffsets; i++) {
> - struct tgsi_full_src_register src = {};
> + struct tgsi_full_src_register src = {0};
>
> src.Register.File = fullinst->TexOffsets[i].File;
> src.Register.Index = fullinst->TexOffsets[i].Index;
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list