msi: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Wed Jun 13 16:36:31 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-13 17:43:49.000000000 +0100
+++ b/dlls/msi/msipriv.h	2007-06-13 22:03:34.000000000 +0100
@@ -570,7 +570,7 @@
 extern UINT read_stream_data( IStorage *stg, LPCWSTR stname,
                               USHORT **pdata, UINT *psz );
 extern UINT write_stream_data( IStorage *stg, LPCWSTR stname,
-                               LPVOID data, UINT sz, BOOL bTable );
+                               LPCVOID data, UINT sz, BOOL bTable );
 
 /* transform functions */
 extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg );
@@ -609,7 +609,7 @@
 extern UINT get_raw_stream( MSIHANDLE hdb, LPCWSTR stname, IStream **stm );
 extern UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm );
 extern void enum_stream_names( IStorage *stg );
-extern BOOL decode_streamname(LPWSTR in, LPWSTR out);
+extern BOOL decode_streamname(LPCWSTR in, LPWSTR out);
 extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in);
 
 /* database internals */
diff -urN a/dlls/msi/query.h b/dlls/msi/query.h
--- a/dlls/msi/query.h	2007-06-13 17:43:49.000000000 +0100
+++ b/dlls/msi/query.h	2007-06-13 22:03:50.000000000 +0100
@@ -114,7 +114,7 @@
 UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
                         column_info *columns, column_info *values, BOOL temp );
 
-UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **, LPWSTR table,
+UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **, LPCWSTR table,
                         column_info *list, struct expr *expr );
 
 UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table );
diff -urN a/dlls/msi/table.c b/dlls/msi/table.c
--- a/dlls/msi/table.c	2007-06-08 16:53:46.000000000 +0100
+++ b/dlls/msi/table.c	2007-06-13 22:02:59.000000000 +0100
@@ -206,7 +206,7 @@
     return '_';
 }
 
-BOOL decode_streamname(LPWSTR in, LPWSTR out)
+BOOL decode_streamname(LPCWSTR in, LPWSTR out)
 {
     WCHAR ch;
     DWORD count = 0;
@@ -408,7 +408,7 @@
 }
 
 UINT write_stream_data( IStorage *stg, LPCWSTR stname,
-                        LPVOID data, UINT sz, BOOL bTable )
+                        LPCVOID data, UINT sz, BOOL bTable )
 {
     HRESULT r;
     UINT ret = ERROR_FUNCTION_FAILED;
@@ -819,7 +819,7 @@
     return ERROR_SUCCESS;
 }
 
-static UINT save_table( MSIDATABASE *db, MSITABLE *t )
+static UINT save_table( MSIDATABASE *db, const MSITABLE *t )
 {
     BYTE *rawdata = NULL, *p;
     UINT rawsize, r, i, j, row_size;
@@ -933,12 +933,12 @@
     }
 }
 
-static LPWSTR msi_makestring( MSIDATABASE *db, UINT stringid)
+static LPWSTR msi_makestring( const MSIDATABASE *db, UINT stringid)
 {
     return strdupW(msi_string_lookup_id( db->strings, stringid ));
 }
 
-static UINT read_table_int(BYTE **data, UINT row, UINT col, UINT bytes)
+static UINT read_table_int(BYTE *const *data, UINT row, UINT col, UINT bytes)
 {
     UINT ret = 0, i;
 
@@ -1720,7 +1720,8 @@
         return MSICONDITION_FALSE;
 }
 
-static MSIRECORD *msi_get_transform_record( MSITABLEVIEW *tv, string_table *st, USHORT *rawdata )
+static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string_table *st,
+                                            const USHORT *rawdata )
 {
     UINT i, val, ofs = 0;
     USHORT mask = *rawdata++;
@@ -1793,7 +1794,7 @@
     }
 }
 
-static void dump_table( string_table *st, USHORT *rawdata, UINT rawsize )
+static void dump_table( const string_table *st, const USHORT *rawdata, UINT rawsize )
 {
     LPCWSTR sval;
     UINT i;
@@ -1805,7 +1806,7 @@
     }
 }
 
-static UINT* msi_record_to_row( MSITABLEVIEW *tv, MSIRECORD *rec )
+static UINT* msi_record_to_row( const MSITABLEVIEW *tv, MSIRECORD *rec )
 {
     LPCWSTR str;
     UINT i, r, *data;
@@ -1845,7 +1846,7 @@
     return data;
 }
 
-static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, UINT *data )
+static UINT msi_row_matches( MSITABLEVIEW *tv, UINT row, const UINT *data )
 {
     UINT i, r, x, ret = ERROR_FUNCTION_FAILED;
 
diff -urN a/dlls/msi/update.c b/dlls/msi/update.c
--- a/dlls/msi/update.c	2007-05-06 14:25:43.000000000 +0100
+++ b/dlls/msi/update.c	2007-06-13 22:03:41.000000000 +0100
@@ -186,7 +186,7 @@
     UPDATE_find_matching_rows
 };
 
-UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
+UINT UPDATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR table,
                         column_info *columns, struct expr *expr )
 {
     MSIUPDATEVIEW *uv = NULL;
diff -urN a/dlls/msi/where.c b/dlls/msi/where.c
--- a/dlls/msi/where.c	2006-11-07 16:18:48.000000000 +0000
+++ b/dlls/msi/where.c	2007-06-13 22:03:59.000000000 +0100
@@ -139,8 +139,8 @@
     return 0;
 }
 
-static const WCHAR *STRING_evaluate( string_table *st,
-              MSIVIEW *table, UINT row, struct expr *expr, MSIRECORD *record )
+static const WCHAR *STRING_evaluate( const string_table *st,
+              MSIVIEW *table, UINT row, const struct expr *expr, const MSIRECORD *record )
 {
     UINT val = 0, r;
 
@@ -165,8 +165,8 @@
     return NULL;
 }
 
-static UINT STRCMP_Evaluate( string_table *st, MSIVIEW *table, UINT row, 
-                             struct expr *cond, INT *val, MSIRECORD *record )
+static UINT STRCMP_Evaluate( const string_table *st, MSIVIEW *table, UINT row, 
+                             const struct expr *cond, INT *val, const MSIRECORD *record )
 {
     int sr;
     const WCHAR *l_str, *r_str;
@@ -190,7 +190,7 @@
 }
 
 static UINT WHERE_evaluate( MSIDATABASE *db, MSIVIEW *table, UINT row, 
-                             struct expr *cond, INT *val, MSIRECORD *record )
+                             const struct expr *cond, INT *val, MSIRECORD *record )
 {
     UINT r, tval;
     INT lval, rval;



More information about the wine-patches mailing list