SHLWAPI: fixes for -Wmissing-declaration and -Wwrite-string warnings

Mike McCormack mike at codeweavers.com
Tue Jun 14 08:52:32 CDT 2005


ChangeLog:
* fixes for -Wmissing-declaration and -Wwrite-string warnings
-------------- next part --------------
Index: dlls/shlwapi/tests/path.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/tests/path.c,v
retrieving revision 1.21
diff -u -p -r1.21 path.c
--- dlls/shlwapi/tests/path.c	23 May 2005 16:23:02 -0000	1.21
+++ dlls/shlwapi/tests/path.c	14 Jun 2005 13:52:55 -0000
@@ -38,10 +38,10 @@ const char* TEST_URL_2 = "http://localho
 const char* TEST_URL_3 = "http://foo:bar@localhost:21/internal.php?query=x&return=y";
 
 typedef struct _TEST_URL_CANONICALIZE {
-    char *url;
+    const char *url;
     DWORD flags;
     HRESULT expectret;
-    char *expecturl;
+    const char *expecturl;
 } TEST_URL_CANONICALIZE;
 
 const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
@@ -67,11 +67,11 @@ const TEST_URL_CANONICALIZE TEST_CANONIC
 };
 
 typedef struct _TEST_URL_ESCAPE {
-    char *url;
+    const char *url;
     DWORD flags;
     DWORD expectescaped;
     HRESULT expectret;
-    char *expecturl;
+    const char *expecturl;
 } TEST_URL_ESCAPE;
 
 const TEST_URL_ESCAPE TEST_ESCAPE[] = {
@@ -156,11 +156,11 @@ const TEST_URL_ESCAPE TEST_ESCAPE[] = {
 };
 
 typedef struct _TEST_URL_COMBINE {
-    char *url1;
-    char *url2;
+    const char *url1;
+    const char *url2;
     DWORD flags;
     HRESULT expectret;
-    char *expecturl;
+    const char *expecturl;
 } TEST_URL_COMBINE;
 
 const TEST_URL_COMBINE TEST_COMBINE[] = {
@@ -178,8 +178,8 @@ const TEST_URL_COMBINE TEST_COMBINE[] = 
 };
 
 struct {
-    char *path;
-    char *url;
+    const char *path;
+    const char *url;
     DWORD ret;
 } TEST_URLFROMPATH [] = {
     {"foo", "file:foo", S_OK},
@@ -198,8 +198,8 @@ struct {
 };
 
 struct {
-    char *url;
-    char *path;
+    const char *url;
+    const char *path;
     DWORD ret;
 } TEST_PATHFROMURL[] = {
     {"file:///c:/foo/ba%5Cr", "c:\\foo\\ba\\r", S_OK},
@@ -232,8 +232,8 @@ struct {
 };
 
 struct {
-    char *url;
-    char *expect;
+    char url[30];
+    const char *expect;
 } TEST_URL_UNESCAPE[] = {
     {"file://foo/bar", "file://foo/bar"},
     {"file://fo%20o%5Ca/bar", "file://fo o\\a/bar"}
@@ -241,7 +241,7 @@ struct {
 
 
 struct {
-    char *path;
+    const char *path;
     BOOL expect;
 } TEST_PATH_IS_URL[] = {
     {"http://foo/bar", TRUE},
@@ -254,7 +254,7 @@ struct {
 };
 
 struct {
-    char *url;
+    const char *url;
     BOOL expectOpaque;
     BOOL expectFile;
 } TEST_URLIS_ATTRIBS[] = {
Index: dlls/shlwapi/tests/string.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/tests/string.c,v
retrieving revision 1.10
diff -u -p -r1.10 string.c
--- dlls/shlwapi/tests/string.c	18 May 2005 15:33:20 -0000	1.10
+++ dlls/shlwapi/tests/string.c	14 Jun 2005 13:52:55 -0000
@@ -484,8 +484,6 @@ static void test_StrDupA()
 
 static void test_StrFormatByteSize64A(void)
 {
-/* this test fails on locales which do not use '.' as a decimal separator */
-#if 0
   char szBuff[256];
   const StrFormatSizeResult* result = StrFormatSize_results;
 
@@ -499,13 +497,10 @@ static void test_StrFormatByteSize64A(vo
 
     result++;
   }
-#endif
 }
 
 static void test_StrFormatKBSizeW(void)
 {
-/* FIXME: Awaiting NLS fixes in kernel before these succeed */
-#if 0
   WCHAR szBuffW[256];
   char szBuff[256];
   const StrFormatSizeResult* result = StrFormatSize_results;
@@ -519,13 +514,10 @@ static void test_StrFormatKBSizeW(void)
        (LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size);
     result++;
   }
-#endif
 }
 
 static void test_StrFormatKBSizeA(void)
 {
-/* this test fails on locales which do not use '.' as a decimal separator */
-#if 0
   char szBuff[256];
   const StrFormatSizeResult* result = StrFormatSize_results;
 
@@ -538,10 +530,9 @@ static void test_StrFormatKBSizeA(void)
        (LONG)(result->value >> 32), (LONG)result->value, szBuff, result->kb_size);
     result++;
   }
-#endif
 }
 
-void test_StrFromTimeIntervalA(void)
+static void test_StrFromTimeIntervalA(void)
 {
   char szBuff[256];
   const StrFromTimeIntervalResult* result = StrFromTimeInterval_results;
@@ -556,7 +547,7 @@ void test_StrFromTimeIntervalA(void)
   }
 }
 
-void test_StrCmpA(void)
+static void test_StrCmpA(void)
 {
   static const char str1[] = {'a','b','c','d','e','f'};
   static const char str2[] = {'a','B','c','d','e','f'};
@@ -582,7 +573,7 @@ void test_StrCmpA(void)
   ok(!pIntlStrEqWorkerA(TRUE, str1, str2, 5), "pIntlStrEqWorkerA(TRUE,...) isn't case-sensitive\n");
 }
 
-void test_StrCmpW(void)
+static void test_StrCmpW(void)
 {
   static const WCHAR str1[] = {'a','b','c','d','e','f'};
   static const WCHAR str2[] = {'a','B','c','d','e','f'};
@@ -747,9 +738,17 @@ START_TEST(string)
   test_StrToIntExA();
   test_StrToIntExW();
   test_StrDupA();
-  test_StrFormatByteSize64A();
-  test_StrFormatKBSizeA();
-  test_StrFormatKBSizeW();
+  if (0)
+  {
+    /* this test fails on locales which do not use '.' as a decimal separator */
+    test_StrFormatByteSize64A();
+
+    /* this test fails on locales which do not use '.' as a decimal separator */
+    test_StrFormatKBSizeA();
+
+    /* FIXME: Awaiting NLS fixes in kernel before these succeed */
+    test_StrFormatKBSizeW();
+  }
   test_StrFromTimeIntervalA();
   test_StrCmpA();
   test_StrCmpW();


More information about the wine-patches mailing list