nir/builder: fix c++11 compiler warning
authorRob Clark <robclark@freedesktop.org>
Fri, 18 Sep 2015 01:07:41 +0000 (21:07 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 18 Sep 2015 01:08:25 +0000 (21:08 -0400)
Fixes:

   In file included from nir/nir_lower_samplers.cpp:27:0:
   nir/nir_builder.h: In function 'nir_ssa_def* nir_channel(nir_builder*, nir_ssa_def*, int)':
   nir/nir_builder.h:222:37: warning: narrowing conversion of 'c' from 'int' to 'unsigned int' inside { } is ill-formed in C++11 [-Wnarrowing]
       unsigned swizzle[4] = {c, c, c, c};

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/glsl/nir/nir_builder.h

index 44134cf4c29ea21e291f93bbaef165442e0fa01c..47533302a6da988147e5fc863feab79bb05b3445 100644 (file)
@@ -217,7 +217,7 @@ nir_swizzle(nir_builder *build, nir_ssa_def *src, unsigned swiz[4],
 }
 
 static inline nir_ssa_def *
-nir_channel(nir_builder *b, nir_ssa_def *def, int c)
+nir_channel(nir_builder *b, nir_ssa_def *def, unsigned c)
 {
    unsigned swizzle[4] = {c, c, c, c};
    return nir_swizzle(b, def, swizzle, 1, false);