Andrew Talbot : msi: Constify some variables.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 14 07:47:02 CDT 2007


Module: wine
Branch: master
Commit: cf1e01eb0cd8e56fddd2cb7240e8b423b4d4b51e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cf1e01eb0cd8e56fddd2cb7240e8b423b4d4b51e

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Wed Jun 13 22:36:31 2007 +0100

msi: Constify some variables.

---

 dlls/msi/msipriv.h |    4 ++--
 dlls/msi/query.h   |    2 +-
 dlls/msi/table.c   |   19 ++++++++++---------
 dlls/msi/update.c  |    2 +-
 dlls/msi/where.c   |   10 +++++-----
 5 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 9e2f8ba..1f2677c 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -570,7 +570,7 @@ extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
 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 MSI_RecordCopyField( MSIRECORD *, unsigned int, MSIRECORD *, unsigne
 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 --git a/dlls/msi/query.h b/dlls/msi/query.h
index e92b470..48a1823 100644
--- a/dlls/msi/query.h
+++ b/dlls/msi/query.h
@@ -114,7 +114,7 @@ UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
 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 --git a/dlls/msi/table.c b/dlls/msi/table.c
index 9c78743..c9b1572 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -206,7 +206,7 @@ static int mime2utf(int x)
     return '_';
 }
 
-BOOL decode_streamname(LPWSTR in, LPWSTR out)
+BOOL decode_streamname(LPCWSTR in, LPWSTR out)
 {
     WCHAR ch;
     DWORD count = 0;
@@ -408,7 +408,7 @@ end:
 }
 
 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 @@ static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret )
     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 void msi_free_colinfo( MSICOLUMNINFO *colinfo, UINT count )
     }
 }
 
-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 @@ MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table )
         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_record( MSIRECORD *rec )
     }
 }
 
-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 void dump_table( string_table *st, USHORT *rawdata, UINT rawsize )
     }
 }
 
-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 @@ static UINT* msi_record_to_row( MSITABLEVIEW *tv, MSIRECORD *rec )
     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 --git a/dlls/msi/update.c b/dlls/msi/update.c
index 8c291de..6b9b3cf 100644
--- a/dlls/msi/update.c
+++ b/dlls/msi/update.c
@@ -186,7 +186,7 @@ static const MSIVIEWOPS update_ops =
     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 --git a/dlls/msi/where.c b/dlls/msi/where.c
index a30ebcb..78056e1 100644
--- a/dlls/msi/where.c
+++ b/dlls/msi/where.c
@@ -139,8 +139,8 @@ static INT INT_evaluate_unary( INT lval, UINT op )
     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 @@ static const WCHAR *STRING_evaluate( string_table *st,
     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 STRCMP_Evaluate( string_table *st, MSIVIEW *table, UINT row,
 }
 
 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-cvs mailing list