msi: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Tue Jun 12 15:51:36 CDT 2007


Changelog:
    msi: Constify some variables.

diff -urN a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
--- a/dlls/msi/msipriv.h	2007-06-08 16:53:46.000000000 +0100
+++ b/dlls/msi/msipriv.h	2007-06-12 21:10:41.000000000 +0100
@@ -548,17 +548,17 @@
 };
 
 extern BOOL msi_addstringW( string_table *st, UINT string_no, const WCHAR *data, int len, UINT refcount, enum StringPersistence persistence );
-extern UINT msi_id2stringW( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
-extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT *sz );
+extern UINT msi_id2stringW( const string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
+extern UINT msi_id2stringA( const string_table *st, UINT string_no, LPSTR buffer, UINT *sz );
 
-extern UINT msi_string2idW( string_table *st, LPCWSTR buffer, UINT *id );
-extern UINT msi_string2idA( string_table *st, LPCSTR str, UINT *id );
+extern UINT msi_string2idW( const string_table *st, LPCWSTR buffer, UINT *id );
+extern UINT msi_string2idA( const string_table *st, LPCSTR str, UINT *id );
 extern VOID msi_destroy_stringtable( string_table *st );
-extern UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res );
-extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id );
+extern UINT msi_strcmp( const string_table *st, UINT lval, UINT rval, UINT *res );
+extern const WCHAR *msi_string_lookup_id( const string_table *st, UINT id );
 extern HRESULT msi_init_string_table( IStorage *stg );
 extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref );
-extern UINT msi_save_string_table( string_table *st, IStorage *storage );
+extern UINT msi_save_string_table( const string_table *st, IStorage *storage );
 
 
 extern void msi_table_set_strref(UINT bytes_per_strref);
diff -urN a/dlls/msi/query.h b/dlls/msi/query.h
--- a/dlls/msi/query.h	2007-06-06 17:19:59.000000000 +0100
+++ b/dlls/msi/query.h	2007-06-12 21:29:13.000000000 +0100
@@ -98,7 +98,7 @@
 UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view );
 
 UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
-                        column_info *columns );
+                        const column_info *columns );
 
 UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
 
diff -urN a/dlls/msi/select.c b/dlls/msi/select.c
--- a/dlls/msi/select.c	2007-04-24 13:26:04.000000000 +0100
+++ b/dlls/msi/select.c	2007-06-12 21:10:13.000000000 +0100
@@ -310,7 +310,7 @@
     return ERROR_SUCCESS;
 }
 
-static int select_count_columns( column_info *col )
+static int select_count_columns( const column_info *col )
 {
     int n;
     for (n = 0; col; col = col->next)
@@ -319,7 +319,7 @@
 }
 
 UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
-                        column_info *columns )
+                        const column_info *columns )
 {
     MSISELECTVIEW *sv = NULL;
     UINT count = 0, r = ERROR_SUCCESS;
diff -urN a/dlls/msi/sql.y b/dlls/msi/sql.y
--- a/dlls/msi/sql.y	2007-04-24 13:26:08.000000000 +0100
+++ b/dlls/msi/sql.y	2007-06-12 21:17:47.000000000 +0100
@@ -51,7 +51,7 @@
     struct list *mem;
 } SQL_input;
 
-static LPWSTR SQL_getstring( void *info, struct sql_str *str );
+static LPWSTR SQL_getstring( void *info, const struct sql_str *str );
 static INT SQL_getint( void *info );
 static int sql_lex( void *SQL_lval, SQL_input *info );
 
@@ -62,9 +62,9 @@
 
 static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r );
 static struct expr * EXPR_unary( void *info, struct expr *l, UINT op );
-static struct expr * EXPR_column( void *info, column_info *column );
+static struct expr * EXPR_column( void *info, const column_info *column );
 static struct expr * EXPR_ival( void *info, int val );
-static struct expr * EXPR_sval( void *info, struct sql_str * );
+static struct expr * EXPR_sval( void *info, const struct sql_str * );
 static struct expr * EXPR_wildcard( void *info );
 
 %}
@@ -697,7 +697,7 @@
     return token;
 }
 
-LPWSTR SQL_getstring( void *info, struct sql_str *strdata )
+LPWSTR SQL_getstring( void *info, const struct sql_str *strdata )
 {
     LPCWSTR p = strdata->data;
     UINT len = strdata->len;
@@ -779,7 +779,7 @@
     return e;
 }
 
-static struct expr * EXPR_column( void *info, column_info *column )
+static struct expr * EXPR_column( void *info, const column_info *column )
 {
     struct expr *e = parser_alloc( info, sizeof *e );
     if( e )
@@ -801,7 +801,7 @@
     return e;
 }
 
-static struct expr * EXPR_sval( void *info, struct sql_str *str )
+static struct expr * EXPR_sval( void *info, const struct sql_str *str )
 {
     struct expr *e = parser_alloc( info, sizeof *e );
     if( e )
diff -urN a/dlls/msi/string.c b/dlls/msi/string.c
--- a/dlls/msi/string.c	2007-06-08 16:53:46.000000000 +0100
+++ b/dlls/msi/string.c	2007-06-12 21:10:50.000000000 +0100
@@ -279,7 +279,7 @@
 }
 
 /* find the string identified by an id - return null if there's none */
-const WCHAR *msi_string_lookup_id( string_table *st, UINT id )
+const WCHAR *msi_string_lookup_id( const string_table *st, UINT id )
 {
     static const WCHAR zero[] = { 0 };
     if( id == 0 )
@@ -306,7 +306,7 @@
  *   The size includes the terminating nul character.  Short buffers
  *  will be filled, but not nul terminated.
  */
-UINT msi_id2stringW( string_table *st, UINT id, LPWSTR buffer, UINT *sz )
+UINT msi_id2stringW( const string_table *st, UINT id, LPWSTR buffer, UINT *sz )
 {
     UINT len;
     const WCHAR *str;
@@ -345,7 +345,7 @@
  *   The size includes the terminating nul character.  Short buffers
  *  will be filled, but not nul terminated.
  */
-UINT msi_id2stringA( string_table *st, UINT id, LPSTR buffer, UINT *sz )
+UINT msi_id2stringA( const string_table *st, UINT id, LPSTR buffer, UINT *sz )
 {
     UINT len;
     const WCHAR *str;
@@ -387,7 +387,7 @@
  *  [in] str        - string to find in the string table
  *  [out] id        - id of the string, if found
  */
-UINT msi_string2idW( string_table *st, LPCWSTR str, UINT *id )
+UINT msi_string2idW( const string_table *st, LPCWSTR str, UINT *id )
 {
     UINT n, hash = msistring_makehash( str );
     msistring *se = st->strings;
@@ -404,7 +404,7 @@
     return ERROR_INVALID_PARAMETER;
 }
 
-UINT msi_string2idA( string_table *st, LPCSTR buffer, UINT *id )
+UINT msi_string2idA( const string_table *st, LPCSTR buffer, UINT *id )
 {
     DWORD sz;
     UINT r = ERROR_INVALID_PARAMETER;
@@ -432,7 +432,7 @@
     return r;
 }
 
-UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res )
+UINT msi_strcmp( const string_table *st, UINT lval, UINT rval, UINT *res )
 {
     const WCHAR *l_str, *r_str;
 
@@ -450,7 +450,7 @@
     return ERROR_SUCCESS;
 }
 
-static void string_totalsize( string_table *st, UINT *datasize, UINT *poolsize )
+static void string_totalsize( const string_table *st, UINT *datasize, UINT *poolsize )
 {
     UINT i, len, max, holesize;
 
@@ -595,7 +595,7 @@
     return st;
 }
 
-UINT msi_save_string_table( string_table *st, IStorage *storage )
+UINT msi_save_string_table( const string_table *st, IStorage *storage )
 {
     UINT i, datasize = 0, poolsize = 0, sz, used, r, codepage, n;
     UINT ret = ERROR_FUNCTION_FAILED;
diff -urN a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
--- a/dlls/msi/suminfo.c	2007-06-05 17:25:36.000000000 +0100
+++ b/dlls/msi/suminfo.c	2007-06-12 21:10:59.000000000 +0100
@@ -131,7 +131,7 @@
     return VT_EMPTY;
 }
 
-static UINT get_property_count( PROPVARIANT *property )
+static UINT get_property_count( const PROPVARIANT *property )
 {
     UINT i, n = 0;
 
@@ -293,7 +293,7 @@
     return 4;
 }
 
-static DWORD write_filetime( LPBYTE data, DWORD ofs, LPFILETIME ft )
+static DWORD write_filetime( LPBYTE data, DWORD ofs, const FILETIME *ft )
 {
     write_dword( data, ofs, ft->dwLowDateTime );
     write_dword( data, ofs + 4, ft->dwHighDateTime );
@@ -309,7 +309,7 @@
     return (7 + len) & ~3;
 }
 
-static UINT write_property_to_data( PROPVARIANT *prop, LPBYTE data )
+static UINT write_property_to_data( const PROPVARIANT *prop, LPBYTE data )
 {
     DWORD sz = 0;
 
@@ -336,7 +336,7 @@
     return sz;
 }
 
-static UINT save_summary_info( MSISUMMARYINFO * si, IStream *stm )
+static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm )
 {
     UINT ret = ERROR_FUNCTION_FAILED;
     PROPERTYSETHEADER set_hdr;



More information about the wine-patches mailing list