gdi32: Remove a basically unused variable (PVS-Studio)

Michael Stefaniuc mstefani at redhat.de
Sun Nov 2 15:31:29 CST 2014


---
PVS-Studio complained about the always true and always false conditional
subexpressions in the if.


 dlls/gdi32/freetype.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index d49a3f8..924f5f3 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6937,7 +6937,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
             INT x, src_pitch, src_width, src_height, rgb_interval, hmul, vmul;
             INT x_shift, y_shift;
             BOOL rgb;
-            FT_LcdFilter lcdfilter = FT_LCD_FILTER_DEFAULT;
             FT_Render_Mode render_mode =
                 (format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_HBGR_BITMAP)?
                     FT_RENDER_MODE_LCD: FT_RENDER_MODE_LCD_V;
@@ -6948,20 +6947,17 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
                 return GDI_ERROR;
             }
 
-            if ( lcdfilter == FT_LCD_FILTER_DEFAULT || lcdfilter == FT_LCD_FILTER_LIGHT )
+            if ( render_mode == FT_RENDER_MODE_LCD)
             {
-                if ( render_mode == FT_RENDER_MODE_LCD)
-                {
-                    gm.gmBlackBoxX += 2;
-                    gm.gmptGlyphOrigin.x -= 1;
-                    left -= (1 << 6);
-                }
-                else
-                {
-                    gm.gmBlackBoxY += 2;
-                    gm.gmptGlyphOrigin.y += 1;
-                    top += (1 << 6);
-                }
+                gm.gmBlackBoxX += 2;
+                gm.gmptGlyphOrigin.x -= 1;
+                left -= (1 << 6);
+            }
+            else
+            {
+                gm.gmBlackBoxY += 2;
+                gm.gmptGlyphOrigin.y += 1;
+                top += (1 << 6);
             }
 
             width  = gm.gmBlackBoxX;
@@ -6981,7 +6977,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
                 pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki);
 
             if ( pFT_Library_SetLcdFilter )
-                pFT_Library_SetLcdFilter( library, lcdfilter );
+                pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT );
             pFT_Render_Glyph (ft_face->glyph, render_mode);
 
             src = ft_face->glyph->bitmap.buffer;
-- 
1.8.3.1



More information about the wine-patches mailing list