[Mesa-dev] [PATCH 1/4] nir: Avoid C99 field initializers.

Sinclair Yeh syeh at vmware.com
Thu Apr 28 14:11:29 UTC 2016


Maybe add a short commit message for 3/4

Reviewed-by: Sinclair Yeh <syeh at vmware.com>

On Thu, Apr 28, 2016 at 12:27:05PM +0100, Jose Fonseca wrote:
> As they are not standard C++ and are not supported by MSVC C++ compiler.
> 
> Just have nir_imm_double match nir_imm_float above.
> ---
>  src/compiler/nir/nir_builder.h | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
> index a14f9ef..4fa9779 100644
> --- a/src/compiler/nir/nir_builder.h
> +++ b/src/compiler/nir/nir_builder.h
> @@ -117,9 +117,12 @@ nir_imm_float(nir_builder *build, float x)
>  static inline nir_ssa_def *
>  nir_imm_double(nir_builder *build, double x)
>  {
> -   nir_const_value v = { { .f64 = {x, 0, 0, 0} } };
> -   nir_ssa_def *def = nir_build_imm(build, 1, 64, v);
> -   return def;
> +   nir_const_value v;
> +
> +   memset(&v, 0, sizeof(v));
> +   v.f64[0] = x;
> +
> +   return nir_build_imm(build, 1, 64, v);
>  }
>  
>  static inline nir_ssa_def *
> -- 
> 2.5.0
> 
> _______________________________________________
> 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