[PATCH 1/7] gdi32/tests: Fix a compiler warning.

Sven Baars sbaars at codeweavers.com
Mon Nov 9 05:03:25 CST 2020


Signed-off-by: Sven Baars <sbaars at codeweavers.com>
---
../dlls/gdi32/tests/font.c:1361:19: warning: ‘code’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1361 |             ret = GetCharABCWidthsA(hdc, code, code, abc);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 dlls/gdi32/tests/font.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 4c8b1cbb91b..d3ec971dce0 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1330,17 +1330,16 @@ static void test_GetCharABCWidths(void)
 
         memset(&lf, 0, sizeof(lf));
         lf.lfHeight = 20;
-        switch(i)
+        if (i == 1)
         {
-        case 1:
             strcpy(lf.lfFaceName, "Tahoma");
             code = 'a';
-            break;
-        case 2:
+        }
+        else
+        {
             strcpy(lf.lfFaceName, "Times New Roman");
             lf.lfItalic = TRUE;
             code = 'f';
-            break;
         }
         if (!is_truetype_font_installed(lf.lfFaceName))
         {
-- 
2.25.1




More information about the wine-devel mailing list