diff --git a/client.cpp b/client.cpp index a9a5f886a1..ba54483e65 100644 --- a/client.cpp +++ b/client.cpp @@ -744,7 +744,8 @@ void Client::setMask(const QRegion& reg, int mode) } if (shape()) { // The rest of the applyign using a temporary window - XRectangle rec = { 0, 0, clientSize().width(), clientSize().height() }; + XRectangle rec = { 0, 0, static_cast(clientSize().width()), + static_cast(clientSize().height()) }; XShapeCombineRectangles(display(), shape_helper_window, ShapeBounding, clientPos().x(), clientPos().y(), &rec, 1, ShapeSubtract, Unsorted); XShapeCombineShape(display(), shape_helper_window, ShapeBounding, diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index 67277c6736..2d976a58f9 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -432,7 +432,8 @@ void LanczosFilter::prepareRenderStates(GLTexture* tex, double opacity, double b // Note that both operands have to be in range [0.5; 1] since opengl // automatically substracts 0.5 from them glActiveTexture(GL_TEXTURE1); - float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, saturation }; + float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, + static_cast(saturation) }; glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS); @@ -500,7 +501,8 @@ void LanczosFilter::prepareRenderStates(GLTexture* tex, double opacity, double b opacity); } else { // Multiply color by brightness and replace alpha by opacity - float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, opacity }; + float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, + static_cast(opacity) }; glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE); diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index a3fbec9d02..f03d357acd 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -311,10 +311,10 @@ void GLTexture::render(QRegion region, const QRect& rect, bool hardwareClipping) } const float verts[ 4 * 2 ] = { // NOTICE: r.x/y could be replaced by "0", but that would make it unreadable... - r.x(), r.y(), - r.x(), r.y() + rect.height(), - r.x() + rect.width(), r.y(), - r.x() + rect.width(), r.y() + rect.height() + static_cast(r.x()), static_cast(r.y()), + static_cast(r.x()), static_cast(r.y() + rect.height()), + static_cast(r.x() + rect.width()), static_cast(r.y()), + static_cast(r.x() + rect.width()), static_cast(r.y() + rect.height()) }; #ifdef KWIN_HAVE_OPENGLES const float texWidth = 1.0f; diff --git a/overlaywindow.cpp b/overlaywindow.cpp index 528dade5df..221118e8da 100644 --- a/overlaywindow.cpp +++ b/overlaywindow.cpp @@ -142,7 +142,7 @@ void OverlayWindow::destroy() if (m_window == None) return; // reset the overlay shape - XRectangle rec = { 0, 0, displayWidth(), displayHeight() }; + XRectangle rec = { 0, 0, static_cast(displayWidth()), static_cast(displayHeight()) }; XShapeCombineRectangles(display(), m_window, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted); XShapeCombineRectangles(display(), m_window, ShapeInput, 0, 0, &rec, 1, ShapeSet, Unsorted); #ifdef KWIN_HAVE_XCOMPOSITE_OVERLAY diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 7f2368efff..81f1db521d 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1299,7 +1299,8 @@ void SceneOpenGL1Window::prepareStates(TextureType type, qreal opacity, qreal br // Note that both operands have to be in range [0.5; 1] since opengl // automatically substracts 0.5 from them glActiveTexture(GL_TEXTURE1); - float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, saturation }; + float saturation_constant[] = { 0.5 + 0.5 * 0.30, 0.5 + 0.5 * 0.59, 0.5 + 0.5 * 0.11, + static_cast(saturation) }; glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS); @@ -1367,7 +1368,8 @@ void SceneOpenGL1Window::prepareStates(TextureType type, qreal opacity, qreal br opacity); } else { // Multiply color by brightness and replace alpha by opacity - float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, opacity }; + float constant[] = { opacityByBrightness, opacityByBrightness, opacityByBrightness, + static_cast(opacity) }; glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE); glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE); diff --git a/scene_xrender.cpp b/scene_xrender.cpp index bc49e26e41..93d3502f49 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -696,7 +696,7 @@ XRenderComposite(display(), PictOpOver, _PART_->x11PictureHandle(), decorationAl if (data.brightness() < 1.0) { // fake brightness change by overlaying black - XRenderColor col = { 0, 0, 0, 0xffff *(1 - data.brightness()) * data.opacity() }; + XRenderColor col = { 0, 0, 0, static_cast(0xffff *(1 - data.brightness()) * data.opacity()) }; if (blitInTempPixmap) { XRenderFillRectangle(display(), PictOpOver, renderTarget, &col, -temp_visibleRect.left(), -temp_visibleRect.top(), width(), height());