Michael Stefaniuc : mscms: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Mon Nov 16 15:28:55 CST 2020


Module: wine
Branch: master
Commit: e32d62df4385c69d0140bbbc586381d5d3bca93b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e32d62df4385c69d0140bbbc586381d5d3bca93b

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Sun Nov 15 23:11:18 2020 +0100

mscms: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mscms/profile.c       |  8 +++-----
 dlls/mscms/tests/profile.c | 15 +++++----------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c
index bc7f200006b..26a2eacd597 100644
--- a/dlls/mscms/profile.c
+++ b/dlls/mscms/profile.c
@@ -615,7 +615,6 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
 
 static BOOL header_from_file( LPCWSTR file, PPROFILEHEADER header )
 {
-    static const WCHAR slash[] = {'\\',0};
     BOOL ret;
     PROFILE profile;
     WCHAR path[MAX_PATH];
@@ -628,13 +627,13 @@ static BOOL header_from_file( LPCWSTR file, PPROFILEHEADER header )
         WARN( "Can't retrieve color directory\n" );
         return FALSE;
     }
-    if (size + sizeof(slash) + sizeof(WCHAR) * lstrlenW( file ) > sizeof(path))
+    if (size + sizeof(L"\\") + sizeof(WCHAR) * lstrlenW( file ) > sizeof(path))
     {
         WARN( "Filename too long\n" );
         return FALSE;
     }
 
-    lstrcatW( path, slash );
+    lstrcatW( path, L"\\" );
     lstrcatW( path, file );
 
     profile.dwType = PROFILE_FILENAME;
@@ -1058,7 +1057,6 @@ BOOL WINAPI InstallColorProfileW( PCWSTR machine, PCWSTR profile )
 {
     WCHAR dest[MAX_PATH], base[MAX_PATH];
     DWORD size = sizeof(dest);
-    static const WCHAR slash[] = { '\\', 0 };
 
     TRACE( "( %s )\n", debugstr_w(profile) );
 
@@ -1068,7 +1066,7 @@ BOOL WINAPI InstallColorProfileW( PCWSTR machine, PCWSTR profile )
 
     basename( profile, base );
 
-    lstrcatW( dest, slash );
+    lstrcatW( dest, L"\\" );
     lstrcatW( dest, base );
 
     /* Is source equal to destination? */
diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c
index 15a0533145d..063ea22420d 100644
--- a/dlls/mscms/tests/profile.c
+++ b/dlls/mscms/tests/profile.c
@@ -102,7 +102,7 @@ static BOOL init_function_ptrs( void )
 }
 
 static const char machine[] = "dummy";
-static const WCHAR machineW[] = { 'd','u','m','m','y',0 };
+static const WCHAR machineW[] = L"dummy";
 
 /*  To do any real functionality testing with this suite you need a copy of
  *  the freely distributable standard RGB color space profile. It comes
@@ -119,12 +119,9 @@ static const char profile2[] =
 "\\spool\\drivers\\color\\srgb color space profile.icm";
 
 static const WCHAR profile1W[] =
-{ '\\','c','o','l','o','r','\\','s','r','g','b',' ','c','o','l','o','r',' ',
-  's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 };
+L"\\color\\srgb color space profile.icm";
 static const WCHAR profile2W[] =
-{ '\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\',
-  'c','o','l','o','r','\\','s','r','g','b',' ','c','o','l','o','r',' ',
-  's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 };
+L"\\spool\\drivers\\color\\srgb color space profile.icm";
 
 static BOOL have_color_profile;
 
@@ -832,7 +829,6 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
     {
         WCHAR dest[MAX_PATH], base[MAX_PATH];
         DWORD size = sizeof(dest);
-        WCHAR slash[] = { '\\', 0 };
         HANDLE handle;
 
         SetLastError(0xdeadbeef);
@@ -849,7 +845,7 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
 
         MSCMS_basenameW( testprofileW, base );
 
-        lstrcatW( dest, slash );
+        lstrcatW( dest, L"\\" );
         lstrcatW( dest, base );
 
         /* Check if the profile is really there */
@@ -1210,7 +1206,6 @@ static void test_UninstallColorProfileW( WCHAR *testprofileW )
         WCHAR dest[MAX_PATH], base[MAX_PATH];
         char destA[MAX_PATH];
         DWORD size = sizeof(dest);
-        WCHAR slash[] = { '\\', 0 };
         HANDLE handle;
         int bytes_copied;
 
@@ -1228,7 +1223,7 @@ static void test_UninstallColorProfileW( WCHAR *testprofileW )
 
         MSCMS_basenameW( testprofileW, base );
 
-        lstrcatW( dest, slash );
+        lstrcatW( dest, L"\\" );
         lstrcatW( dest, base );
 
         ret = pUninstallColorProfileW( NULL, dest, TRUE );




More information about the wine-cvs mailing list