ntdll: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Jun 23 12:34:32 CDT 2007


Changelog:
    ntdll: Constify some variables.

diff -urN a/dlls/ntdll/file.c b/dlls/ntdll/file.c
--- a/dlls/ntdll/file.c	2007-06-05 17:25:36.000000000 +0100
+++ b/dlls/ntdll/file.c	2007-06-23 18:31:08.000000000 +0100
@@ -465,7 +465,7 @@
 
 
 /* retrieve the timeout for the next wait, in milliseconds */
-static inline int get_next_io_timeout( struct io_timeouts *timeouts, ULONG already )
+static inline int get_next_io_timeout( const struct io_timeouts *timeouts, ULONG already )
 {
     int ret = -1;
 
@@ -973,7 +973,7 @@
 static NTSTATUS server_ioctl_file( HANDLE handle, HANDLE event,
                                    PIO_APC_ROUTINE apc, PVOID apc_context,
                                    IO_STATUS_BLOCK *io, ULONG code,
-                                   PVOID in_buffer, ULONG in_size,
+                                   const void *in_buffer, ULONG in_size,
                                    PVOID out_buffer, ULONG out_size )
 {
     struct async_ioctl *async;
diff -urN a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
--- a/dlls/ntdll/heap.c	2007-05-23 21:55:15.000000000 +0100
+++ b/dlls/ntdll/heap.c	2007-06-23 18:31:30.000000000 +0100
@@ -434,11 +434,11 @@
  *
  * If possible, decommit the heap storage from (including) 'ptr'.
  */
-static inline BOOL HEAP_Decommit( SUBHEAP *subheap, void *ptr )
+static inline BOOL HEAP_Decommit( SUBHEAP *subheap, const void *ptr )
 {
     void *addr;
     SIZE_T decommit_size;
-    SIZE_T size = (char *)ptr - (char *)subheap;
+    SIZE_T size = (const char *)ptr - (char *)subheap;
 
     /* round to next block and add one full block */
     size = ((size + COMMIT_MASK) & ~COMMIT_MASK) + COMMIT_MASK + 1;
diff -urN a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
--- a/dlls/ntdll/relay.c	2007-05-15 20:16:29.000000000 +0100
+++ b/dlls/ntdll/relay.c	2007-06-23 18:31:43.000000000 +0100
@@ -242,7 +242,7 @@
  *
  * Check if a given module and function is in the list.
  */
-static BOOL check_list( const char *module, int ordinal, const char *func, const WCHAR **list )
+static BOOL check_list( const char *module, int ordinal, const char *func, const WCHAR *const *list )
 {
     char ord_str[10];
 
@@ -320,14 +320,14 @@
 /***********************************************************************
  *           RELAY_PrintArgs
  */
-static inline void RELAY_PrintArgs( int *args, int nb_args, unsigned int typemask )
+static inline void RELAY_PrintArgs( const int *args, int nb_args, unsigned int typemask )
 {
     while (nb_args--)
     {
 	if ((typemask & 3) && HIWORD(*args))
         {
 	    if (typemask & 2)
-                DPRINTF( "%08x %s", *args, debugstr_w((LPWSTR)*args) );
+                DPRINTF( "%08x %s", *args, debugstr_w((LPCWSTR)*args) );
             else
                 DPRINTF( "%08x %s", *args, debugstr_a((LPCSTR)*args) );
 	}
@@ -367,7 +367,7 @@
  *
  * stack points to the return address, i.e. the first argument is stack[1].
  */
-static LONGLONG WINAPI relay_call_from_32( struct relay_descr *descr, unsigned int idx, int *stack )
+static LONGLONG WINAPI relay_call_from_32( struct relay_descr *descr, unsigned int idx, const int *stack )
 {
     LONGLONG ret;
     WORD ordinal = LOWORD(idx);



More information about the wine-patches mailing list