ole32: Constify some variables (2 of 2)

Andrew Talbot Andrew.Talbot at talbotville.com
Sun Jul 1 11:15:26 CDT 2007


Changelog:
    ole32: Constify some variables.

diff -urN a/dlls/ole32/stg_bigblockfile.c b/dlls/ole32/stg_bigblockfile.c
--- a/dlls/ole32/stg_bigblockfile.c	2007-04-05 12:44:06.000000000 +0100
+++ b/dlls/ole32/stg_bigblockfile.c	2007-07-01 16:31:04.000000000 +0100
@@ -920,7 +920,7 @@
 }
 
 HRESULT    BIGBLOCKFILE_WriteAt(LPBIGBLOCKFILE This, ULARGE_INTEGER offset,
-                void* buffer, const ULONG size, ULONG* bytesRead)
+                const void* buffer, ULONG size, ULONG* bytesRead)
 {
     if (This->fileBased)
         return ImplBIGBLOCKFILE_WriteAt(This,offset,buffer,size,bytesRead);
diff -urN a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
--- a/dlls/ole32/stg_prop.c	2007-03-12 13:30:56.000000000 +0000
+++ b/dlls/ole32/stg_prop.c	2007-07-01 14:04:59.000000000 +0100
@@ -1617,7 +1617,7 @@
 }
 
 static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
- DWORD propNum, DWORD propid, PROPVARIANT *var, DWORD *sectionOffset)
+ DWORD propNum, DWORD propid, const PROPVARIANT *var, DWORD *sectionOffset)
 {
     HRESULT hr;
     LARGE_INTEGER seek;
@@ -1717,7 +1717,7 @@
         FILETIME temp;
 
         StorageUtl_WriteULargeInteger((BYTE *)&temp, 0,
-         (ULARGE_INTEGER *)&var->u.filetime);
+         (const ULARGE_INTEGER *)&var->u.filetime);
         hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count);
         bytesWritten = count;
         break;
diff -urN a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
--- a/dlls/ole32/storage32.c	2007-06-08 16:53:46.000000000 +0100
+++ b/dlls/ole32/storage32.c	2007-07-01 16:31:27.000000000 +0100
@@ -279,7 +279,7 @@
 
 static HRESULT StorageImpl_WriteAt(StorageImpl* This,
   ULARGE_INTEGER offset,
-  void*          buffer,
+  const void*    buffer,
   const ULONG    size,
   ULONG*         bytesWritten)
 {
@@ -3373,9 +3373,9 @@
  * Write the specified property into the property chain
  */
 BOOL StorageImpl_WriteProperty(
-  StorageImpl* This,
-  ULONG          index,
-  StgProperty*   buffer)
+  StorageImpl*          This,
+  ULONG                 index,
+  const StgProperty*    buffer)
 {
   BYTE           currentProperty[PROPSET_BLOCK_SIZE];
   ULARGE_INTEGER offsetInPropSet;
@@ -3492,9 +3492,9 @@
 }
 
 static BOOL StorageImpl_WriteBigBlock(
-  StorageImpl* This,
-  ULONG          blockIndex,
-  void*          buffer)
+  StorageImpl*  This,
+  ULONG         blockIndex,
+  const void*   buffer)
 {
   ULARGE_INTEGER ulOffset;
   DWORD  wrote;
@@ -4337,9 +4337,9 @@
 }
 
 void StorageUtl_CopyPropertyToSTATSTG(
-  STATSTG*     destination,
-  StgProperty* source,
-  int          statFlags)
+  STATSTG*              destination,
+  const StgProperty*    source,
+  int                   statFlags)
 {
   /*
    * The copy of the string occurs only when the flag is not set
@@ -6864,7 +6864,7 @@
  *
  *
  */
-static void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD nBufferLength)
+static void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, const BYTE *pBuffer, DWORD nBufferLength)
 {
     HRESULT hRes;
     HANDLE hFile;
@@ -7414,7 +7414,7 @@
  *     Might need to verify the data and return appropriate error message
  *
  */
-static void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD dwDataLength)
+static void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, const BYTE *pData, DWORD dwDataLength)
 {
     HRESULT hRes;
     IStream *pStream;
diff -urN a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
--- a/dlls/ole32/storage32.h	2007-06-08 16:53:46.000000000 +0100
+++ b/dlls/ole32/storage32.h	2007-07-01 16:31:15.000000000 +0100
@@ -189,7 +189,7 @@
 HRESULT        BIGBLOCKFILE_ReadAt(LPBIGBLOCKFILE This, ULARGE_INTEGER offset,
            void* buffer, ULONG size, ULONG* bytesRead);
 HRESULT        BIGBLOCKFILE_WriteAt(LPBIGBLOCKFILE This, ULARGE_INTEGER offset,
-           void* buffer, const ULONG size, ULONG* bytesRead);
+           const void* buffer, ULONG size, ULONG* bytesRead);
 
 /*************************************************************************
  * Ole Convert support
@@ -311,14 +311,14 @@
 };
 
 BOOL StorageImpl_ReadProperty(
-            StorageImpl* This,
-	    ULONG          index,
-	    StgProperty*    buffer);
+            StorageImpl*    This,
+            ULONG           index,
+            StgProperty*    buffer);
 
 BOOL StorageImpl_WriteProperty(
-            StorageImpl* This,
-	    ULONG          index,
-	    StgProperty*   buffer);
+            StorageImpl*        This,
+            ULONG               index,
+            const StgProperty*  buffer);
 
 BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
                       StorageImpl* This,
@@ -423,9 +423,8 @@
  const ULARGE_INTEGER *value);
 void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value);
 void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value);
-void StorageUtl_CopyPropertyToSTATSTG(STATSTG*     destination,
-					     StgProperty* source,
-					     int          statFlags);
+void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination, const StgProperty* source,
+ int statFlags);
 
 /****************************************************************************
  * BlockChainStream definitions.
diff -urN a/dlls/ole32/storage.c b/dlls/ole32/storage.c
--- a/dlls/ole32/storage.c	2007-05-16 17:27:18.000000000 +0100
+++ b/dlls/ole32/storage.c	2007-07-01 16:31:40.000000000 +0100
@@ -552,7 +552,7 @@
  * STORAGE_put_small_block [INTERNAL]
  */
 static BOOL
-STORAGE_put_small_block(stream_access16 *str,int blocknr,BYTE *sblock) {
+STORAGE_put_small_block(stream_access16 *str,int blocknr,const BYTE *sblock) {
 	BYTE				block[BIGSIZE];
 	int				bigblocknr;
 	struct storage_pps_entry	root;
@@ -654,7 +654,7 @@
  *		STORAGE_put_pps_entry	[Internal]
  */
 static int
-STORAGE_put_pps_entry(stream_access16*str,int n,struct storage_pps_entry *pstde) {
+STORAGE_put_pps_entry(stream_access16*str,int n,const struct storage_pps_entry *pstde) {
 	int	blocknr;
 	BYTE	block[BIGSIZE];
 	struct storage_pps_entry *stde = (struct storage_pps_entry*)(((LPBYTE)block)+128*(n&3));



More information about the wine-patches mailing list