summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarri Porten <porten@froglogic.com>2013-10-14 16:49:07 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 00:06:54 +0200
commit2c7ad71adbdb00924b3d7797339dbcf8d6d86479 (patch)
tree1578002f7ed5c2f3e1d0fb7b4905e21a5b88476d /src
parent4c8f194adee41d954bae4bb1c62b3a2591d86630 (diff)
Fixed narrowing conversion compile error with SwizzleValue cast.
I got the following compile error with gcc 4.7.0: error: narrowing conversion of ‘r’ from ‘QOpenGLTexture::SwizzleValue’ to ‘GLint {aka int}’ inside { } [-Werror=narrowing] The compiler must being going through the route of treating the enum as an unsigned int and thus choking on the conversion to a signed int. Change-Id: I35c15673d0371c69984bdec80622066f792527ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopengltexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index fcd556e892..d5a7399c18 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -2488,7 +2488,7 @@ void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
qWarning("QOpenGLTexture::setSwizzleMask() requires OpenGL >= 3.3");
return;
}
- GLint swizzleMask[] = {r, g, b, a};
+ GLint swizzleMask[] = {GLint(r), GLint(g), GLint(b), GLint(a)};
d->swizzleMask[0] = r;
d->swizzleMask[1] = g;
d->swizzleMask[2] = b;