[2/2] mscms: Get rid of the MSCMS_ prefix.

Hans Leidekker hans at codeweavers.com
Fri Jul 26 06:03:15 CDT 2013


---
 dlls/mscms/handle.c     |   48 ++++++++++++++++++-------------------
 dlls/mscms/mscms_priv.h |    2 +-
 dlls/mscms/profile.c    |   60 +++++++++++++++++++++++------------------------
 dlls/mscms/stub.c       |   10 ++++----
 dlls/mscms/transform.c  |    4 ++--
 5 files changed, 61 insertions(+), 63 deletions(-)

diff --git a/dlls/mscms/handle.c b/dlls/mscms/handle.c
index 8a0f26d..10334c6 100644
--- a/dlls/mscms/handle.c
+++ b/dlls/mscms/handle.c
@@ -33,15 +33,15 @@
 
 #ifdef HAVE_LCMS2
 
-static CRITICAL_SECTION MSCMS_handle_cs;
-static CRITICAL_SECTION_DEBUG MSCMS_handle_cs_debug =
+static CRITICAL_SECTION mscms_handle_cs;
+static CRITICAL_SECTION_DEBUG mscms_handle_cs_debug =
 {
-    0, 0, &MSCMS_handle_cs,
-    { &MSCMS_handle_cs_debug.ProcessLocksList,
-      &MSCMS_handle_cs_debug.ProcessLocksList },
-      0, 0, { (DWORD_PTR)(__FILE__ ": MSCMS_handle_cs") }
+    0, 0, &mscms_handle_cs,
+    { &mscms_handle_cs_debug.ProcessLocksList,
+      &mscms_handle_cs_debug.ProcessLocksList },
+      0, 0, { (DWORD_PTR)(__FILE__ ": mscms_handle_cs") }
 };
-static CRITICAL_SECTION MSCMS_handle_cs = { &MSCMS_handle_cs_debug, -1, 0, 0, 0, 0 };
+static CRITICAL_SECTION mscms_handle_cs = { &mscms_handle_cs_debug, -1, 0, 0, 0, 0 };
 
 static struct profile *profiletable;
 static struct transform *transformtable;
@@ -61,19 +61,19 @@ void free_handle_tables( void )
     transformtable = NULL;
     num_transform_handles = 0;
 
-    DeleteCriticalSection( &MSCMS_handle_cs );
+    DeleteCriticalSection( &mscms_handle_cs );
 }
 
 struct profile *grab_profile( HPROFILE handle )
 {
     DWORD_PTR index;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     index = (DWORD_PTR)handle - 1;
     if (index > num_profile_handles)
     {
-        LeaveCriticalSection( &MSCMS_handle_cs );
+        LeaveCriticalSection( &mscms_handle_cs );
         return NULL;
     }
     return &profiletable[index];
@@ -81,19 +81,19 @@ struct profile *grab_profile( HPROFILE handle )
 
 void release_profile( struct profile *profile )
 {
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
 }
 
 struct transform *grab_transform( HTRANSFORM handle )
 {
     DWORD_PTR index;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     index = (DWORD_PTR)handle - 1;
     if (index > num_transform_handles)
     {
-        LeaveCriticalSection( &MSCMS_handle_cs );
+        LeaveCriticalSection( &mscms_handle_cs );
         return NULL;
     }
     return &transformtable[index];
@@ -101,7 +101,7 @@ struct transform *grab_transform( HTRANSFORM handle )
 
 void release_transform( struct transform *transform )
 {
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
 }
 
 static HPROFILE alloc_profile_handle( void )
@@ -135,14 +135,14 @@ HPROFILE create_profile( struct profile *profile )
 {
     HPROFILE handle;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     if ((handle = alloc_profile_handle()))
     {
         DWORD_PTR index = (DWORD_PTR)handle - 1;
         profiletable[index] = *profile;
     }
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
     return handle;
 }
 
@@ -151,12 +151,12 @@ BOOL close_profile( HPROFILE handle )
     DWORD_PTR index;
     struct profile *profile;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     index = (DWORD_PTR)handle - 1;
     if (index > num_profile_handles)
     {
-        LeaveCriticalSection( &MSCMS_handle_cs );
+        LeaveCriticalSection( &mscms_handle_cs );
         return FALSE;
     }
     profile = &profiletable[index];
@@ -181,7 +181,7 @@ BOOL close_profile( HPROFILE handle )
 
     memset( profile, 0, sizeof(struct profile) );
 
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
     return TRUE;
 }
 
@@ -216,14 +216,14 @@ HTRANSFORM create_transform( struct transform *transform )
 {
     HTRANSFORM handle;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     if ((handle = alloc_transform_handle()))
     {
         DWORD_PTR index = (DWORD_PTR)handle - 1;
         transformtable[index] = *transform;
     }
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
     return handle;
 }
 
@@ -232,12 +232,12 @@ BOOL close_transform( HTRANSFORM handle )
     DWORD_PTR index;
     struct transform *transform;
 
-    EnterCriticalSection( &MSCMS_handle_cs );
+    EnterCriticalSection( &mscms_handle_cs );
 
     index = (DWORD_PTR)handle - 1;
     if (index > num_transform_handles)
     {
-        LeaveCriticalSection( &MSCMS_handle_cs );
+        LeaveCriticalSection( &mscms_handle_cs );
         return FALSE;
     }
     transform = &transformtable[index];
@@ -245,7 +245,7 @@ BOOL close_transform( HTRANSFORM handle )
     cmsDeleteTransform( transform->cmstransform );
     memset( transform, 0, sizeof(struct transform) );
 
-    LeaveCriticalSection( &MSCMS_handle_cs );
+    LeaveCriticalSection( &mscms_handle_cs );
     return TRUE;
 }
 
diff --git a/dlls/mscms/mscms_priv.h b/dlls/mscms/mscms_priv.h
index a3bffa2..ffa2cb4 100644
--- a/dlls/mscms/mscms_priv.h
+++ b/dlls/mscms/mscms_priv.h
@@ -63,4 +63,4 @@ extern void set_profile_header( const struct profile *, const PROFILEHEADER * )
 
 #endif /* HAVE_LCMS2 */
 
-extern const char *MSCMS_dbgstr_tag(DWORD) DECLSPEC_HIDDEN;
+extern const char *dbgstr_tag(DWORD) DECLSPEC_HIDDEN;
diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c
index cb6fbfc..6759a96 100644
--- a/dlls/mscms/profile.c
+++ b/dlls/mscms/profile.c
@@ -35,17 +35,15 @@
 
 #include "mscms_priv.h"
 
-#define IS_SEPARATOR(ch)  ((ch) == '\\' || (ch) == '/')
-
-static void MSCMS_basename( LPCWSTR path, LPWSTR name )
+static void basename( LPCWSTR path, LPWSTR name )
 {
     INT i = lstrlenW( path );
 
-    while (i > 0 && !IS_SEPARATOR(path[i - 1])) i--;
+    while (i > 0 && path[i - 1] != '\\' && path[i - 1] != '/') i--;
     lstrcpyW( name, &path[i] );
 }
 
-static inline LPWSTR MSCMS_strdupW( LPCSTR str )
+static inline LPWSTR strdupW( LPCSTR str )
 {
     LPWSTR ret = NULL;
     if (str)
@@ -57,7 +55,7 @@ static inline LPWSTR MSCMS_strdupW( LPCSTR str )
     return ret;
 }
 
-const char *MSCMS_dbgstr_tag( DWORD tag )
+const char *dbgstr_tag( DWORD tag )
 {
     return wine_dbg_sprintf( "'%c%c%c%c'",
         (char)(tag >> 24), (char)(tag >> 16), (char)(tag >> 8), (char)(tag) );
@@ -136,7 +134,7 @@ static BOOL set_profile_device_key( PCWSTR file, const BYTE *value, DWORD size )
     }
     RegCreateKeyExW( HKEY_LOCAL_MACHINE, icmW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &icm_key, NULL );
 
-    MSCMS_basename( file, basenameW );
+    basename( file, basenameW );
     sprintfW( classW, fmtW, (header.phClass >> 24) & 0xff, (header.phClass >> 16) & 0xff,
                             (header.phClass >> 8) & 0xff,  header.phClass & 0xff );
 
@@ -670,7 +668,7 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
     return TRUE;
 }
 
-static BOOL MSCMS_header_from_file( LPCWSTR file, PPROFILEHEADER header )
+static BOOL header_from_file( LPCWSTR file, PPROFILEHEADER header )
 {
     BOOL ret;
     PROFILE profile;
@@ -712,7 +710,7 @@ static BOOL MSCMS_header_from_file( LPCWSTR file, PPROFILEHEADER header )
     return ret;
 }
 
-static BOOL MSCMS_match_profile( PENUMTYPEW rec, PPROFILEHEADER hdr )
+static BOOL match_profile( PENUMTYPEW rec, PPROFILEHEADER hdr )
 {
     if (rec->dwFields & ET_DEVICENAME)
     {
@@ -733,36 +731,36 @@ static BOOL MSCMS_match_profile( PENUMTYPEW rec, PPROFILEHEADER hdr )
     }
     if (rec->dwFields & ET_DEVICECLASS)
     {
-        FIXME( "ET_DEVICECLASS: %s\n", MSCMS_dbgstr_tag(rec->dwMediaType) );
+        FIXME( "ET_DEVICECLASS: %s\n", dbgstr_tag(rec->dwMediaType) );
     }
     if (rec->dwFields & ET_CMMTYPE)
     {
-        TRACE( "ET_CMMTYPE: %s\n", MSCMS_dbgstr_tag(rec->dwCMMType) );
+        TRACE( "ET_CMMTYPE: %s\n", dbgstr_tag(rec->dwCMMType) );
         if (rec->dwCMMType != hdr->phCMMType) return FALSE;
     }
     if (rec->dwFields & ET_CLASS)
     {
-        TRACE( "ET_CLASS: %s\n", MSCMS_dbgstr_tag(rec->dwClass) );
+        TRACE( "ET_CLASS: %s\n", dbgstr_tag(rec->dwClass) );
         if (rec->dwClass != hdr->phClass) return FALSE;
     }
     if (rec->dwFields & ET_DATACOLORSPACE)
     {
-        TRACE( "ET_DATACOLORSPACE: %s\n", MSCMS_dbgstr_tag(rec->dwDataColorSpace) );
+        TRACE( "ET_DATACOLORSPACE: %s\n", dbgstr_tag(rec->dwDataColorSpace) );
         if (rec->dwDataColorSpace != hdr->phDataColorSpace) return FALSE;
     }
     if (rec->dwFields & ET_CONNECTIONSPACE)
     {
-        TRACE( "ET_CONNECTIONSPACE: %s\n", MSCMS_dbgstr_tag(rec->dwConnectionSpace) );
+        TRACE( "ET_CONNECTIONSPACE: %s\n", dbgstr_tag(rec->dwConnectionSpace) );
         if (rec->dwConnectionSpace != hdr->phConnectionSpace) return FALSE;
     }
     if (rec->dwFields & ET_SIGNATURE)
     {
-        TRACE( "ET_SIGNATURE: %s\n", MSCMS_dbgstr_tag(rec->dwSignature) );
+        TRACE( "ET_SIGNATURE: %s\n", dbgstr_tag(rec->dwSignature) );
         if (rec->dwSignature != hdr->phSignature) return FALSE;
     }
     if (rec->dwFields & ET_PLATFORM)
     {
-        TRACE( "ET_PLATFORM: %s\n", MSCMS_dbgstr_tag(rec->dwPlatform) );
+        TRACE( "ET_PLATFORM: %s\n", dbgstr_tag(rec->dwPlatform) );
         if (rec->dwPlatform != hdr->phPlatform) return FALSE;
     }
     if (rec->dwFields & ET_PROFILEFLAGS)
@@ -772,12 +770,12 @@ static BOOL MSCMS_match_profile( PENUMTYPEW rec, PPROFILEHEADER hdr )
     }
     if (rec->dwFields & ET_MANUFACTURER)
     {
-        TRACE( "ET_MANUFACTURER: %s\n", MSCMS_dbgstr_tag(rec->dwManufacturer) );
+        TRACE( "ET_MANUFACTURER: %s\n", dbgstr_tag(rec->dwManufacturer) );
         if (rec->dwManufacturer != hdr->phManufacturer) return FALSE;
     }
     if (rec->dwFields & ET_MODEL)
     {
-        TRACE( "ET_MODEL: %s\n", MSCMS_dbgstr_tag(rec->dwModel) );
+        TRACE( "ET_MODEL: %s\n", dbgstr_tag(rec->dwModel) );
         if (rec->dwModel != hdr->phModel) return FALSE;
     }
     if (rec->dwFields & ET_ATTRIBUTES)
@@ -794,7 +792,7 @@ static BOOL MSCMS_match_profile( PENUMTYPEW rec, PPROFILEHEADER hdr )
     }
     if (rec->dwFields & ET_CREATOR)
     {
-        TRACE( "ET_CREATOR: %s\n", MSCMS_dbgstr_tag(rec->dwCreator) );
+        TRACE( "ET_CREATOR: %s\n", dbgstr_tag(rec->dwCreator) );
         if (rec->dwCreator != hdr->phCreator) return FALSE;
     }
     return TRUE;
@@ -843,17 +841,17 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record, PBYTE buffer,
     memcpy( &recordW, record, sizeof(ENUMTYPEA) );
     if (record->pDeviceName)
     {
-        deviceW = MSCMS_strdupW( record->pDeviceName );
+        deviceW = strdupW( record->pDeviceName );
         if (!(recordW.pDeviceName = deviceW)) goto exit;
     }
 
-    fileW = MSCMS_strdupW( data.cFileName );
+    fileW = strdupW( data.cFileName );
     if (!fileW) goto exit;
 
-    ret = MSCMS_header_from_file( fileW, &header );
+    ret = header_from_file( fileW, &header );
     if (ret)
     {
-        match = MSCMS_match_profile( &recordW, &header );
+        match = match_profile( &recordW, &header );
         if (match)
         {
             len = sizeof(char) * (lstrlenA( data.cFileName ) + 1);
@@ -874,17 +872,17 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record, PBYTE buffer,
 
     while (FindNextFileA( find, &data ))
     {
-        fileW = MSCMS_strdupW( data.cFileName );
+        fileW = strdupW( data.cFileName );
         if (!fileW) goto exit;
 
-        ret = MSCMS_header_from_file( fileW, &header );
+        ret = header_from_file( fileW, &header );
         if (!ret)
         {
             HeapFree( GetProcessHeap(), 0, fileW );
             continue;
         }
 
-        match = MSCMS_match_profile( &recordW, &header );
+        match = match_profile( &recordW, &header );
         if (match)
         {
             char **tmp = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
@@ -987,10 +985,10 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer,
     profiles = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR *) + 1 );
     if (!profiles) goto exit;
 
-    ret = MSCMS_header_from_file( data.cFileName, &header );
+    ret = header_from_file( data.cFileName, &header );
     if (ret)
     {
-        match = MSCMS_match_profile( record, &header );
+        match = match_profile( record, &header );
         if (match)
         {
             len = sizeof(WCHAR) * (lstrlenW( data.cFileName ) + 1);
@@ -1009,10 +1007,10 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer,
 
     while (FindNextFileW( find, &data ))
     {
-        ret = MSCMS_header_from_file( data.cFileName, &header );
+        ret = header_from_file( data.cFileName, &header );
         if (!ret) continue;
 
-        match = MSCMS_match_profile( record, &header );
+        match = match_profile( record, &header );
         if (match)
         {
             WCHAR **tmp = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
@@ -1115,7 +1113,7 @@ BOOL WINAPI InstallColorProfileW( PCWSTR machine, PCWSTR profile )
 
     if (!GetColorDirectoryW( machine, dest, &size )) return FALSE;
 
-    MSCMS_basename( profile, base );
+    basename( profile, base );
 
     lstrcatW( dest, slash );
     lstrcatW( dest, base );
diff --git a/dlls/mscms/stub.c b/dlls/mscms/stub.c
index 84c0cdc..4cd6863 100644
--- a/dlls/mscms/stub.c
+++ b/dlls/mscms/stub.c
@@ -137,21 +137,21 @@ BOOL WINAPI GetPS2ColorSpaceArray( HPROFILE profile, DWORD intent, DWORD type, P
 
 BOOL WINAPI RegisterCMMA( PCSTR machine, DWORD id, PCSTR dll )
 {
-    FIXME( "( %p, %s, %p ) stub\n", machine, MSCMS_dbgstr_tag(id), dll );
+    FIXME( "( %p, %s, %p ) stub\n", machine, dbgstr_tag(id), dll );
 
     return TRUE;
 }
 
 BOOL WINAPI RegisterCMMW( PCWSTR machine, DWORD id, PCWSTR dll )
 {
-    FIXME( "( %p, %s, %p ) stub\n", machine, MSCMS_dbgstr_tag(id), dll );
+    FIXME( "( %p, %s, %p ) stub\n", machine, dbgstr_tag(id), dll );
 
     return TRUE;
 }
 
 BOOL WINAPI SelectCMM( DWORD id )
 {
-    FIXME( "(%s) stub\n", MSCMS_dbgstr_tag(id) );
+    FIXME( "(%s) stub\n", dbgstr_tag(id) );
 
     return TRUE;
 }
@@ -190,14 +190,14 @@ BOOL WINAPI SpoolerCopyFileEvent( LPWSTR printer, LPWSTR key, DWORD event )
 
 BOOL WINAPI UnregisterCMMA( PCSTR machine, DWORD id )
 {
-    FIXME( "( %p, %s ) stub\n", machine, MSCMS_dbgstr_tag(id) );
+    FIXME( "( %p, %s ) stub\n", machine, dbgstr_tag(id) );
 
     return TRUE;
 }
 
 BOOL WINAPI UnregisterCMMW( PCWSTR machine, DWORD id )
 {
-    FIXME( "( %p, %s ) stub\n", machine, MSCMS_dbgstr_tag(id) );
+    FIXME( "( %p, %s ) stub\n", machine, dbgstr_tag(id) );
 
     return TRUE;
 }
diff --git a/dlls/mscms/transform.c b/dlls/mscms/transform.c
index 56a3232..1bd4e02 100644
--- a/dlls/mscms/transform.c
+++ b/dlls/mscms/transform.c
@@ -41,7 +41,7 @@ static DWORD from_profile( HPROFILE profile )
     PROFILEHEADER header;
 
     GetColorProfileHeader( profile, &header );
-    TRACE( "color space: 0x%08x %s\n", header.phDataColorSpace, MSCMS_dbgstr_tag( header.phDataColorSpace ) );
+    TRACE( "color space: 0x%08x %s\n", header.phDataColorSpace, dbgstr_tag( header.phDataColorSpace ) );
 
     switch (header.phDataColorSpace)
     {
@@ -160,7 +160,7 @@ HTRANSFORM WINAPI CreateColorTransformW( LPLOGCOLORSPACEW space, HPROFILE dest,
     intent = space->lcsIntent > 3 ? INTENT_PERCEPTUAL : space->lcsIntent;
 
     TRACE( "lcsIntent:   %x\n", space->lcsIntent );
-    TRACE( "lcsCSType:   %s\n", MSCMS_dbgstr_tag( space->lcsCSType ) );
+    TRACE( "lcsCSType:   %s\n", dbgstr_tag( space->lcsCSType ) );
     TRACE( "lcsFilename: %s\n", debugstr_w( space->lcsFilename ) );
 
     in_format  = TYPE_RGB_16;
-- 
1.7.10.4






More information about the wine-patches mailing list