Fix warnings found with -Wsign-compare.

This commit is contained in:
Mike McCormack 2004-08-06 17:30:20 +00:00 committed by Alexandre Julliard
parent 7ef15a607c
commit 4604e66094
3 changed files with 33 additions and 31 deletions

View File

@ -158,7 +158,7 @@ static DWORD deformat_string(MSIPACKAGE *package, WCHAR* ptr,WCHAR** data);
static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path, static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path,
BOOL source, BOOL set_prop, MSIFOLDER **folder); BOOL source, BOOL set_prop, MSIFOLDER **folder);
static UINT track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path); static int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
/* /*
* consts and values used * consts and values used
@ -264,8 +264,8 @@ inline static WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
inline static int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component ) inline static int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component )
{ {
INT rc = -1; int rc = -1;
INT i; DWORD i;
for (i = 0; i < package->loaded_components; i++) for (i = 0; i < package->loaded_components; i++)
{ {
@ -280,8 +280,8 @@ inline static int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component )
inline static int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ) inline static int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
{ {
INT rc = -1; int rc = -1;
INT i; DWORD i;
for (i = 0; i < package->loaded_features; i++) for (i = 0; i < package->loaded_features; i++)
{ {
@ -296,8 +296,8 @@ inline static int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature )
inline static int get_loaded_file(MSIPACKAGE* package, LPCWSTR file) inline static int get_loaded_file(MSIPACKAGE* package, LPCWSTR file)
{ {
INT rc = -1; int rc = -1;
INT i; DWORD i;
for (i = 0; i < package->loaded_files; i++) for (i = 0; i < package->loaded_files; i++)
{ {
@ -310,10 +310,10 @@ inline static int get_loaded_file(MSIPACKAGE* package, LPCWSTR file)
return rc; return rc;
} }
static UINT track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path) static int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path)
{ {
int i; DWORD i;
int index; DWORD index;
if (!package) if (!package)
return -2; return -2;
@ -343,7 +343,7 @@ static UINT track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path)
void ACTION_remove_tracked_tempfiles(MSIPACKAGE* package) void ACTION_remove_tracked_tempfiles(MSIPACKAGE* package)
{ {
int i; DWORD i;
if (!package) if (!package)
return; return;
@ -1625,10 +1625,10 @@ static UINT ACTION_CostInitialize(MSIPACKAGE *package)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static int load_file(MSIPACKAGE* package, MSIRECORD * row) static UINT load_file(MSIPACKAGE* package, MSIRECORD * row)
{ {
int index = package->loaded_files; DWORD index = package->loaded_files;
int i; DWORD i;
WCHAR buffer[0x100]; WCHAR buffer[0x100];
DWORD sz; DWORD sz;
@ -1745,7 +1745,8 @@ static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
WCHAR parent[0x100]; WCHAR parent[0x100];
DWORD sz=0x100; DWORD sz=0x100;
MSIRECORD * row = 0; MSIRECORD * row = 0;
INT i,index = -1; INT index = -1;
DWORD i;
TRACE("Looking for dir %s\n",debugstr_w(dir)); TRACE("Looking for dir %s\n",debugstr_w(dir));
@ -1753,7 +1754,7 @@ static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
{ {
if (strcmpW(package->folders[i].Directory,dir)==0) if (strcmpW(package->folders[i].Directory,dir)==0)
{ {
TRACE(" %s retuning on index %i\n",debugstr_w(dir),i); TRACE(" %s retuning on index %lu\n",debugstr_w(dir),i);
return i; return i;
} }
} }
@ -1877,7 +1878,7 @@ static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path, static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path,
BOOL source, BOOL set_prop, MSIFOLDER **folder) BOOL source, BOOL set_prop, MSIFOLDER **folder)
{ {
INT i; DWORD i;
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
DWORD sz; DWORD sz;
@ -2012,7 +2013,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
static const WCHAR szOne[] = { '1', 0 }; static const WCHAR szOne[] = { '1', 0 };
UINT rc; UINT rc;
MSIQUERY * view; MSIQUERY * view;
INT i; DWORD i;
TRACE("Building Directory properties\n"); TRACE("Building Directory properties\n");
@ -2345,11 +2346,11 @@ static UINT ready_media_for_file(MSIPACKAGE *package, UINT sequence,
WCHAR cab[0x100]; WCHAR cab[0x100];
DWORD sz=0x100; DWORD sz=0x100;
INT seq; INT seq;
static INT last_sequence = 0; static UINT last_sequence = 0;
if (sequence <= last_sequence) if (sequence <= last_sequence)
{ {
TRACE("Media already ready (%i, %i)\n",sequence,last_sequence); TRACE("Media already ready (%u, %u)\n",sequence,last_sequence);
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
@ -2441,7 +2442,7 @@ inline static UINT create_component_directory ( MSIPACKAGE* package, INT compone
static UINT ACTION_InstallFiles(MSIPACKAGE *package) static UINT ACTION_InstallFiles(MSIPACKAGE *package)
{ {
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
INT index; DWORD index;
MSIRECORD * uirow; MSIRECORD * uirow;
WCHAR uipath[MAX_PATH]; WCHAR uipath[MAX_PATH];
@ -2523,7 +2524,7 @@ static UINT ACTION_InstallFiles(MSIPACKAGE *package)
inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key, inline static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
LPWSTR file_source) LPWSTR file_source)
{ {
INT index; DWORD index;
if (!package) if (!package)
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
@ -3000,7 +3001,8 @@ static UINT ACTION_InstallInitialize(MSIPACKAGE *package)
WCHAR level[10000]; WCHAR level[10000];
INT install_level; INT install_level;
DWORD sz; DWORD sz;
INT i,j; DWORD i;
INT j;
DWORD rc; DWORD rc;
LPWSTR override = NULL; LPWSTR override = NULL;
static const WCHAR addlocal[]={'A','D','D','L','O','C','A','L',0}; static const WCHAR addlocal[]={'A','D','D','L','O','C','A','L',0};
@ -3200,7 +3202,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
WCHAR squished_cc[0x100]; WCHAR squished_cc[0x100];
DWORD sz; DWORD sz;
UINT rc; UINT rc;
INT i; DWORD i;
HKEY hkey=0,hkey2=0,hkey3=0; HKEY hkey=0,hkey2=0,hkey3=0;
static const WCHAR szProductCode[]= static const WCHAR szProductCode[]=
{'P','r','o','d','u','c','t','C','o','d','e',0}; {'P','r','o','d','u','c','t','C','o','d','e',0};
@ -4377,7 +4379,7 @@ UINT WINAPI MsiSetTargetPathA(MSIHANDLE hInstall, LPCSTR szFolder,
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
LPCWSTR szFolderPath) LPCWSTR szFolderPath)
{ {
INT i; DWORD i;
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
MSIFOLDER *folder; MSIFOLDER *folder;

View File

@ -52,9 +52,9 @@ struct string_table
msistring *strings; /* an array of strings (in the tree) */ msistring *strings; /* an array of strings (in the tree) */
}; };
static int msistring_makehash( const WCHAR *str ) static UINT msistring_makehash( const WCHAR *str )
{ {
int hash = 0; UINT hash = 0;
if (str==NULL) if (str==NULL)
return hash; return hash;
@ -106,7 +106,7 @@ VOID msi_destroy_stringtable( string_table *st )
static int st_find_free_entry( string_table *st ) static int st_find_free_entry( string_table *st )
{ {
int i, sz; UINT i, sz;
msistring *p; msistring *p;
TRACE("%p\n", st); TRACE("%p\n", st);
@ -135,7 +135,7 @@ static int st_find_free_entry( string_table *st )
return st->freeslot; return st->freeslot;
} }
static void st_mark_entry_used( string_table *st, int n ) static void st_mark_entry_used( string_table *st, UINT n )
{ {
if( n >= st->maxcount ) if( n >= st->maxcount )
return; return;
@ -351,7 +351,7 @@ UINT msi_id2stringA( string_table *st, UINT id, LPSTR buffer, UINT *sz )
*/ */
UINT msi_string2idW( string_table *st, LPCWSTR str, UINT *id ) UINT msi_string2idW( string_table *st, LPCWSTR str, UINT *id )
{ {
int hash; UINT hash;
UINT i, r = ERROR_INVALID_PARAMETER; UINT i, r = ERROR_INVALID_PARAMETER;
hash = msistring_makehash( str ); hash = msistring_makehash( str );

View File

@ -159,7 +159,7 @@ static const Keyword aKeywordTable[] = {
** returned. If the input is not a keyword, TK_ID is returned. ** returned. If the input is not a keyword, TK_ID is returned.
*/ */
int sqliteKeywordCode(const WCHAR *z, int n){ int sqliteKeywordCode(const WCHAR *z, int n){
int i, len; UINT i, len;
char buffer[0x10]; char buffer[0x10];
len = WideCharToMultiByte( CP_ACP, 0, z, n, buffer, sizeof buffer, NULL, NULL ); len = WideCharToMultiByte( CP_ACP, 0, z, n, buffer, sizeof buffer, NULL, NULL );