From 9312f0f974de36bc4bf6e7dcd6e9ae104872d9d6 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Mon, 28 May 2007 18:11:29 +0100 Subject: [PATCH] mscms: Constify some variables. --- dlls/mscms/handle.c | 2 +- dlls/mscms/icc.c | 16 ++++++++-------- dlls/mscms/mscms_priv.h | 14 +++++++------- dlls/mscms/profile.c | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/mscms/handle.c b/dlls/mscms/handle.c index 0ee2c95e6a5..fe474f37051 100644 --- a/dlls/mscms/handle.c +++ b/dlls/mscms/handle.c @@ -153,7 +153,7 @@ cmsHPROFILE MSCMS_hprofile2cmsprofile( HPROFILE profile ) return cmsprofile; } -HPROFILE MSCMS_iccprofile2hprofile( icProfile *iccprofile ) +HPROFILE MSCMS_iccprofile2hprofile( const icProfile *iccprofile ) { HPROFILE profile = NULL; DWORD_PTR i; diff --git a/dlls/mscms/icc.c b/dlls/mscms/icc.c index e5d0ba838e9..ffdd3e54b16 100644 --- a/dlls/mscms/icc.c +++ b/dlls/mscms/icc.c @@ -40,7 +40,7 @@ static inline void MSCMS_adjust_endianess32( ULONG *ptr ) #endif } -void MSCMS_get_profile_header( icProfile *iccprofile, PROFILEHEADER *header ) +void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *header ) { unsigned int i; @@ -51,7 +51,7 @@ void MSCMS_get_profile_header( icProfile *iccprofile, PROFILEHEADER *header ) MSCMS_adjust_endianess32( (ULONG *)header + i ); } -void MSCMS_set_profile_header( icProfile *iccprofile, PROFILEHEADER *header ) +void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header ) { unsigned int i; icHeader *iccheader = (icHeader *)iccprofile; @@ -63,7 +63,7 @@ void MSCMS_set_profile_header( icProfile *iccprofile, PROFILEHEADER *header ) MSCMS_adjust_endianess32( (ULONG *)iccheader + i ); } -DWORD MSCMS_get_tag_count( icProfile *iccprofile ) +DWORD MSCMS_get_tag_count( const icProfile *iccprofile ) { ULONG count = iccprofile->count; @@ -84,19 +84,19 @@ void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag ) MSCMS_adjust_endianess32( (ULONG *)&tag->size ); } -void MSCMS_get_tag_data( icProfile *iccprofile, icTag *tag, DWORD offset, void *buffer ) +void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer ) { - memcpy( buffer, (char *)iccprofile + tag->offset + offset, tag->size - offset ); + memcpy( buffer, (const char *)iccprofile + tag->offset + offset, tag->size - offset ); } -void MSCMS_set_tag_data( icProfile *iccprofile, icTag *tag, DWORD offset, void *buffer ) +void MSCMS_set_tag_data( icProfile *iccprofile, const icTag *tag, DWORD offset, const void *buffer ) { memcpy( (char *)iccprofile + tag->offset + offset, buffer, tag->size - offset ); } -DWORD MSCMS_get_profile_size( icProfile *iccprofile ) +DWORD MSCMS_get_profile_size( const icProfile *iccprofile ) { - DWORD size = ((icHeader *)iccprofile)->size; + DWORD size = ((const icHeader *)iccprofile)->size; MSCMS_adjust_endianess32( (ULONG *)&size ); return size; diff --git a/dlls/mscms/mscms_priv.h b/dlls/mscms/mscms_priv.h index 9bde1c85e0e..fd89ba2e64b 100644 --- a/dlls/mscms/mscms_priv.h +++ b/dlls/mscms/mscms_priv.h @@ -69,7 +69,7 @@ extern DWORD MSCMS_hprofile2access( HPROFILE ); extern HPROFILE MSCMS_handle2hprofile( HANDLE file ); extern HPROFILE MSCMS_cmsprofile2hprofile( cmsHPROFILE cmsprofile ); -extern HPROFILE MSCMS_iccprofile2hprofile( icProfile *iccprofile ); +extern HPROFILE MSCMS_iccprofile2hprofile( const icProfile *iccprofile ); extern HANDLE MSCMS_hprofile2handle( HPROFILE profile ); extern cmsHPROFILE MSCMS_hprofile2cmsprofile( HPROFILE profile ); extern icProfile *MSCMS_hprofile2iccprofile( HPROFILE profile ); @@ -82,12 +82,12 @@ extern cmsHTRANSFORM MSCMS_htransform2cmstransform( HTRANSFORM transform ); extern HTRANSFORM MSCMS_create_htransform_handle( cmsHTRANSFORM cmstransform ); extern void MSCMS_destroy_htransform_handle( HTRANSFORM transform ); -extern DWORD MSCMS_get_tag_count( icProfile *iccprofile ); +extern DWORD MSCMS_get_tag_count( const icProfile *iccprofile ); extern void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag ); -extern void MSCMS_get_tag_data( icProfile *iccprofile, icTag *tag, DWORD offset, void *buffer ); -extern void MSCMS_set_tag_data( icProfile *iccprofile, icTag *tag, DWORD offset, void *buffer ); -extern void MSCMS_get_profile_header( icProfile *iccprofile, PROFILEHEADER *header ); -extern void MSCMS_set_profile_header( icProfile *iccprofile, PROFILEHEADER *header ); -extern DWORD MSCMS_get_profile_size( icProfile *iccprofile ); +extern void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer ); +extern void MSCMS_set_tag_data( icProfile *iccprofile, const icTag *tag, DWORD offset, const void *buffer ); +extern void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *header ); +extern void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header ); +extern DWORD MSCMS_get_profile_size( const icProfile *iccprofile ); #endif /* HAVE_LCMS */ diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index 0ada3e8ab7a..8c9d73c5e40 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -471,7 +471,7 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi return TRUE; } -static BOOL MSCMS_header_from_file( LPWSTR file, PPROFILEHEADER header ) +static BOOL MSCMS_header_from_file( LPCWSTR file, PPROFILEHEADER header ) { BOOL ret; PROFILE profile;