From 26a492eb4aa3d095f7ff687da072467b5887b1e2 Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Tue, 2 Aug 2011 17:26:21 +0200 Subject: [PATCH] reduce the scope of two variables reduce the scope of two variables REVIEW: 102057 --- effects/blur/blurshader.cpp | 2 +- effects/coverswitch/coverswitch.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/effects/blur/blurshader.cpp b/effects/blur/blurshader.cpp index e7e5bf3e86..decd430e15 100644 --- a/effects/blur/blurshader.cpp +++ b/effects/blur/blurshader.cpp @@ -193,13 +193,13 @@ void GLSLBlurShader::unbind() int GLSLBlurShader::maxKernelSize() const { - int value; #ifdef KWIN_HAVE_OPENGLES // GL_MAX_VARYING_FLOATS not available in GLES // querying for GL_MAX_VARYING_VECTORS crashes on nouveau // using the minimum value of 8 return 8 * 2; #else + int value; glGetIntegerv(GL_MAX_VARYING_FLOATS, &value); // Maximum number of vec4 varyings * 2 // The code generator will pack two vec2's into each vec4. diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 6bc98b3a02..4ffa40c980 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -775,7 +775,6 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i { if (frontWindow == NULL) return; - float distance = 0.0; bool specialHandlingForward = false; WindowPaintData data(frontWindow); data.xTranslate = area.width() * 0.5 - frontWindow->geometry().x() - frontWindow->geometry().width() * 0.5; @@ -788,7 +787,8 @@ void CoverSwitchEffect::paintFrontWindow(EffectWindow* frontWindow, int width, i rightWindows = 1; } if (animation) { - if (direction == Right) { + float distance = 0.0; + if (direction == Right) { // move to right distance = -frontWindow->geometry().width() * 0.5f + area.width() * 0.5f + (((float)displayWidth() * 0.5 * scaleFactor) - (float)area.width() * 0.5f) / rightWindows;