msvcrt: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Sat Jun 16 12:05:35 CDT 2007


Changelog:
    msvcrt: Constify some variables.

diff -urN a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c
--- a/dlls/msvcrt/cpp.c	2007-05-15 20:16:29.000000000 +0100
+++ b/dlls/msvcrt/cpp.c	2007-06-16 16:13:34.000000000 +0100
@@ -95,12 +95,12 @@
 extern const vtable_ptr MSVCRT_type_info_vtable;
 
 /* get the vtable pointer for a C++ object */
-static inline const vtable_ptr *get_vtable( void *obj )
+static inline const vtable_ptr *get_vtable( const void *obj )
 {
-    return *(const vtable_ptr **)obj;
+    return *(const vtable_ptr *const *)obj;
 }
 
-static inline const rtti_object_locator *get_obj_locator( void *cppobj )
+static inline const rtti_object_locator *get_obj_locator( const void *cppobj )
 {
     const vtable_ptr *vtable = get_vtable( cppobj );
     return (const rtti_object_locator *)vtable[-1];
@@ -131,7 +131,7 @@
 }
 
 /* Internal common ctor for exception */
-static void WINAPI EXCEPTION_ctor(exception *_this, const char** name)
+static void WINAPI EXCEPTION_ctor(exception * _this, const char *const * name)
 {
   _this->vtable = &MSVCRT_exception_vtable;
   if (*name)
diff -urN a/dlls/msvcrt/cppexcept.c b/dlls/msvcrt/cppexcept.c
--- a/dlls/msvcrt/cppexcept.c	2007-05-15 20:16:29.000000000 +0100
+++ b/dlls/msvcrt/cppexcept.c	2007-06-16 16:06:19.000000000 +0100
@@ -141,7 +141,7 @@
 }
 
 /* check if the exception type is caught by a given catch block, and return the type that matched */
-static const cxx_type_info *find_caught_type( cxx_exception_type *exc_type,
+static const cxx_type_info *find_caught_type( const cxx_exception_type *exc_type,
                                               const catchblock_info *catchblock )
 {
     UINT i;
diff -urN a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
--- a/dlls/msvcrt/wcs.c	2007-02-05 13:46:31.000000000 +0000
+++ b/dlls/msvcrt/wcs.c	2007-06-16 16:06:40.000000000 +0100
@@ -402,7 +402,7 @@
     return strchr( float_fmts, fmt ) ? TRUE : FALSE;
 }
 
-static void pf_rebuild_format_string( char *p, pf_flags *flags )
+static void pf_rebuild_format_string( char *p, const pf_flags *flags )
 {
     *p++ = '%';
     if( flags->Sign )



More information about the wine-patches mailing list