nir: Avoid structure initalization expressions.
authorJose Fonseca <jfonseca@vmware.com>
Wed, 13 Apr 2016 17:19:50 +0000 (18:19 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 14 Apr 2016 15:38:37 +0000 (16:38 +0100)
Not supported by MSVC, and completely unnecessary -- inline functions
work just as well.

NIR_SRC_INIT/NIR_DEST_INIT could and probably should be replaced by the
inline functions.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/compiler/nir/nir.h

index 4a66e8b0d3e31fff979167cf70066604d5dc9755..8067b4189a7c3a486da1cfcde70881846d15a673 100644 (file)
@@ -502,7 +502,14 @@ typedef struct nir_src {
    bool is_ssa;
 } nir_src;
 
-#define NIR_SRC_INIT (nir_src) { { NULL } }
+static inline nir_src
+nir_src_init(void)
+{
+   nir_src src = { { NULL } };
+   return src;
+}
+
+#define NIR_SRC_INIT nir_src_init()
 
 #define nir_foreach_use(reg_or_ssa_def, src) \
    list_for_each_entry(nir_src, src, &(reg_or_ssa_def)->uses, use_link)
@@ -525,7 +532,14 @@ typedef struct {
    bool is_ssa;
 } nir_dest;
 
-#define NIR_DEST_INIT (nir_dest) { { { NULL } } }
+static inline nir_dest
+nir_dest_init(void)
+{
+   nir_dest dest = { { { NULL } } };
+   return dest;
+}
+
+#define NIR_DEST_INIT nir_dest_init()
 
 #define nir_foreach_def(reg, dest) \
    list_for_each_entry(nir_dest, dest, &(reg)->defs, reg.def_link)