comctl32/tests: Replace some '#if 0's with 'if (0)'s.

Francois Gouget fgouget at free.fr
Thu Dec 14 11:09:38 CST 2006


Fix the code so it compiles without warnings.
---

Code which is ifdef-ed out is never compiled and ends up rotting, the 
first stages of which we are seeing here. So putting it inside an 'if 
(0)' is preferable.

Another option would be to remove the test entirely but I believe 
keeping them is useful as documentation, documentation which would be 
hard to reach if it was buried deep in the Git history.


 dlls/comctl32/tests/mru.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/tests/mru.c b/dlls/comctl32/tests/mru.c
index a58f4cc..182f10b 100644
--- a/dlls/comctl32/tests/mru.c
+++ b/dlls/comctl32/tests/mru.c
@@ -165,9 +165,11 @@ static void test_MRUListA(void)
     if (!pCreateMRUListA || !pFreeMRUList || !pAddMRUStringA)
         return;
 
-#if 0 /* Create (NULL) - crashes native */
+    if (0)
+    {
+    /* Create (NULL) - crashes native */
     hMRU = pCreateMRUListA(NULL);
-#endif
+    }
 
     /* Create (size too small) */
     mruA.cbSize = sizeof(mruA) - 2;
@@ -224,14 +226,15 @@ static void test_MRUListA(void)
            iRet, GetLastError());
 
         /* Add (NULL string) */
-#if 0
+        if (0)
+        {
 	/* Some native versions crash when passed NULL or fail to SetLastError()  */
         SetLastError(0);
         iRet = pAddMRUStringA(hMRU, NULL);
         ok(iRet == 0 && GetLastError() == ERROR_INVALID_PARAMETER,
-           "AddMRUStringA(NULL str) expected 0,ERROR_INVALID_PARAMETER got %d,%ld\n",
+           "AddMRUStringA(NULL str) expected 0,ERROR_INVALID_PARAMETER got %d,%d\n",
            iRet, GetLastError());
-#endif
+        }
 
         /* Add 3 strings. Check the registry is correct after each add */
         SetLastError(0);
-- 
1.4.4.1




More information about the wine-patches mailing list