From 2c7ad71adbdb00924b3d7797339dbcf8d6d86479 Mon Sep 17 00:00:00 2001 From: Harri Porten Date: Mon, 14 Oct 2013 16:49:07 +0200 Subject: Fixed narrowing conversion compile error with SwizzleValue cast. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thiago Macieira --- src/gui/opengl/qopengltexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') 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; -- cgit v1.2.3