From 15e553daf0cd5fe70994b6ac5377ff11002357a3 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 26 May 2016 15:38:45 -0700 Subject: [PATCH] nir: Make nir_const_value a union There's no good reason for it to be a struct of an anonymous union. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96221 Tested-by: Vinson Lee Reviewed-by: Matt Turner --- src/compiler/nir/nir.h | 16 +++++++--------- src/compiler/nir/nir_constant_expressions.py | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 96246f6d634..2e1bdfb429e 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1266,15 +1266,13 @@ nir_tex_instr_src_index(nir_tex_instr *instr, nir_tex_src_type type) return -1; } -typedef struct { - union { - float f32[4]; - double f64[4]; - int32_t i32[4]; - uint32_t u32[4]; - int64_t i64[4]; - uint64_t u64[4]; - }; +typedef union { + float f32[4]; + double f64[4]; + int32_t i32[4]; + uint32_t u32[4]; + int64_t i64[4]; + uint64_t u64[4]; } nir_const_value; typedef struct { diff --git a/src/compiler/nir/nir_constant_expressions.py b/src/compiler/nir/nir_constant_expressions.py index e36dc4853b5..96d52557bd7 100644 --- a/src/compiler/nir/nir_constant_expressions.py +++ b/src/compiler/nir/nir_constant_expressions.py @@ -270,7 +270,7 @@ static nir_const_value evaluate_${name}(unsigned num_components, unsigned bit_size, nir_const_value *_src) { - nir_const_value _dst_val = { { {0, 0, 0, 0} } }; + nir_const_value _dst_val = { {0, } }; switch (bit_size) { % for bit_size in [32, 64]: -- 2.30.2