MSI: -Wmissing-declarations and -Wwrite-strings warning fixes
Mike McCormack
mike at codeweavers.com
Sun May 29 03:01:49 CDT 2005
After compiling with -Wmissing-declarations and -Wwrite-strings, there
were quite a number of warnings in the MSI code. This patch fixes some
of them.
Mike
ChangeLog:
* -Wmissing-declarations and -Wwrite-strings warning fixes
-------------- next part --------------
? dlls/msi/events.c.1
Index: dlls/msi/cond.y
===================================================================
RCS file: /home/wine/wine/dlls/msi/cond.y,v
retrieving revision 1.18
diff -u -p -r1.18 cond.y
--- dlls/msi/cond.y 18 May 2005 17:46:38 -0000 1.18
+++ dlls/msi/cond.y 29 May 2005 08:01:23 -0000
@@ -38,7 +38,7 @@
#define YYLEX_PARAM info
#define YYPARSE_PARAM info
-static int COND_error(char *str);
+static int COND_error(const char *str);
WINE_DEFAULT_DEBUG_CHANNEL(msi);
@@ -722,7 +722,7 @@ static LPWSTR COND_GetLiteral( struct co
return ret;
}
-static int COND_error(char *str)
+static int COND_error(const char *str)
{
return 0;
}
Index: dlls/msi/format.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/format.c,v
retrieving revision 1.14
diff -u -p -r1.14 format.c
--- dlls/msi/format.c 27 May 2005 19:23:29 -0000 1.14
+++ dlls/msi/format.c 29 May 2005 08:01:24 -0000
@@ -421,7 +421,7 @@ static DWORD deformat_string_internal(MS
/* not formatted */
*data = HeapAlloc(GetProcessHeap(),0,(len*sizeof(WCHAR)));
memcpy(*data,ptr,len*sizeof(WCHAR));
- TRACE("Returning %s\n",debugstr_w(*data));
+ TRACE("Returning %s\n",debugstr_wn(*data,len));
return len;
}
Index: dlls/msi/tokenize.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/tokenize.c,v
retrieving revision 1.9
diff -u -p -r1.9 tokenize.c
--- dlls/msi/tokenize.c 19 May 2005 11:15:37 -0000 1.9
+++ dlls/msi/tokenize.c 29 May 2005 08:01:24 -0000
@@ -158,7 +158,7 @@ static const Keyword aKeywordTable[] = {
** keyword. If it is a keyword, the token code of that keyword is
** returned. If the input is not a keyword, TK_ID is returned.
*/
-int sqliteKeywordCode(const WCHAR *z, int n){
+static int sqliteKeywordCode(const WCHAR *z, int n){
UINT i, len;
char buffer[0x10];
Index: dlls/msi/where.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/where.c,v
retrieving revision 1.18
diff -u -p -r1.18 where.c
--- dlls/msi/where.c 23 May 2005 12:08:17 -0000 1.18
+++ dlls/msi/where.c 29 May 2005 08:01:24 -0000
@@ -24,7 +24,6 @@
#include "winbase.h"
#include "winerror.h"
#include "wine/debug.h"
-#include "wine/unicode.h"
#include "msi.h"
#include "msiquery.h"
#include "objbase.h"
@@ -171,7 +170,7 @@ static UINT STRCMP_Evaluate( string_tabl
else if( r_str && ! l_str )
sr = -1;
else
- sr = strcmpW( l_str, r_str );
+ sr = lstrcmpW( l_str, r_str );
*val = ( cond->u.expr.op == OP_EQ && ( sr == 0 ) ) ||
( cond->u.expr.op == OP_LT && ( sr < 0 ) ) ||
Index: dlls/msi/tests/db.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/tests/db.c,v
retrieving revision 1.11
diff -u -p -r1.11 db.c
--- dlls/msi/tests/db.c 27 May 2005 19:25:42 -0000 1.11
+++ dlls/msi/tests/db.c 29 May 2005 08:01:24 -0000
@@ -47,12 +47,13 @@ static void test_msidatabase(void)
ok( res == TRUE, "Falled to delete database\n" );
}
-void test_msiinsert(void)
+static void test_msiinsert(void)
{
const char *msifile = "winetest.msi";
MSIHANDLE hdb = 0, hview = 0, hrec = 0;
UINT r;
- char *query, buf[80];
+ const char *query;
+ char buf[80];
DWORD sz;
DeleteFile(msifile);
@@ -129,10 +130,10 @@ void test_msiinsert(void)
typedef UINT (WINAPI *fnMsiDecomposeDescriptorA)(LPCSTR, LPCSTR, LPSTR, LPSTR, DWORD *);
fnMsiDecomposeDescriptorA MsiDecomposeDescriptorA;
-void test_msidecomposedesc(void)
+static void test_msidecomposedesc(void)
{
char prod[MAX_FEATURE_CHARS+1], comp[MAX_FEATURE_CHARS+1], feature[MAX_FEATURE_CHARS+1];
- char *desc;
+ const char *desc;
UINT r;
DWORD len;
HMODULE hmod;
@@ -177,7 +178,7 @@ void test_msidecomposedesc(void)
ok(len == (strlen(desc) - strlen("extra")), "length wrong\n");
}
-static UINT try_query_param( MSIHANDLE hdb, LPSTR szQuery, MSIHANDLE hrec )
+static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )
{
MSIHANDLE htab = 0;
UINT res;
@@ -202,12 +203,12 @@ static UINT try_query_param( MSIHANDLE h
return res;
}
-static UINT try_query( MSIHANDLE hdb, LPSTR szQuery )
+static UINT try_query( MSIHANDLE hdb, LPCSTR szQuery )
{
return try_query_param( hdb, szQuery, 0 );
}
-static UINT try_insert_query( MSIHANDLE hdb, LPSTR szQuery )
+static UINT try_insert_query( MSIHANDLE hdb, LPCSTR szQuery )
{
MSIHANDLE hrec = 0;
UINT r;
@@ -221,7 +222,7 @@ static UINT try_insert_query( MSIHANDLE
return r;
}
-void test_msibadqueries()
+static void test_msibadqueries()
{
const char *msifile = "winetest.msi";
MSIHANDLE hdb = 0;
Index: dlls/msi/tests/record.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/tests/record.c,v
retrieving revision 1.8
diff -u -p -r1.8 record.c
--- dlls/msi/tests/record.c 27 May 2005 09:26:13 -0000 1.8
+++ dlls/msi/tests/record.c 29 May 2005 08:01:24 -0000
@@ -45,7 +45,7 @@ static BOOL create_temp_file(char *name)
return r;
}
-void test_msirecord(void)
+static void test_msirecord(void)
{
DWORD r, sz;
INT i;
More information about the wine-patches
mailing list