msi: Sign-compare warnings fix.

This commit is contained in:
Andrew Talbot 2008-10-20 22:06:20 +01:00 committed by Alexandre Julliard
parent 40db5bdb16
commit 1c9886d6e7
4 changed files with 14 additions and 15 deletions

View File

@ -827,7 +827,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute,
{ {
save = *pcchValueBuf; save = *pcchValueBuf;
if (lstrlenW(val) < *pcchValueBuf) if (strlenW(val) < *pcchValueBuf)
r = msi_strcpy_to_awstring(val, szValue, pcchValueBuf); r = msi_strcpy_to_awstring(val, szValue, pcchValueBuf);
else if (szValue->str.a || szValue->str.w) else if (szValue->str.a || szValue->str.w)
r = ERROR_MORE_DATA; r = ERROR_MORE_DATA;
@ -973,7 +973,7 @@ static UINT msi_copy_outval(LPWSTR val, LPWSTR out, LPDWORD size)
if (out) if (out)
{ {
if (lstrlenW(val) >= *size) if (strlenW(val) >= *size)
{ {
r = ERROR_MORE_DATA; r = ERROR_MORE_DATA;
if (*size > 0) if (*size > 0)
@ -1591,7 +1591,7 @@ LANGID WINAPI MsiLoadStringA( MSIHANDLE handle, UINT id, LPSTR lpBuffer,
{ {
LPWSTR bufW; LPWSTR bufW;
LANGID r; LANGID r;
DWORD len; INT len;
bufW = msi_alloc(nBufferMax*sizeof(WCHAR)); bufW = msi_alloc(nBufferMax*sizeof(WCHAR));
r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang); r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang);
@ -2135,7 +2135,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS)); HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS));
if (lpVersionBuf) lstrcpynW(lpVersionBuf, tmp, *pcchVersionBuf); if (lpVersionBuf) lstrcpynW(lpVersionBuf, tmp, *pcchVersionBuf);
if (lstrlenW(tmp) >= *pcchVersionBuf) if (strlenW(tmp) >= *pcchVersionBuf)
ret = ERROR_MORE_DATA; ret = ERROR_MORE_DATA;
*pcchVersionBuf = lstrlenW(tmp); *pcchVersionBuf = lstrlenW(tmp);
@ -2155,7 +2155,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
wsprintfW(tmp, szLangFormat, *lang); wsprintfW(tmp, szLangFormat, *lang);
if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf); if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf);
if (lstrlenW(tmp) >= *pcchLangBuf) if (strlenW(tmp) >= *pcchLangBuf)
ret = ERROR_MORE_DATA; ret = ERROR_MORE_DATA;
*pcchLangBuf = lstrlenW(tmp); *pcchLangBuf = lstrlenW(tmp);

View File

@ -633,7 +633,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer,
MSIQUERY *query = NULL; MSIQUERY *query = NULL;
static const WCHAR szError[] = { 0 }; static const WCHAR szError[] = { 0 };
MSIDBERROR r = MSIDBERROR_NOERROR; MSIDBERROR r = MSIDBERROR_NOERROR;
int len; DWORD len;
FIXME("%ld %p %p - returns empty error string\n", FIXME("%ld %p %p - returns empty error string\n",
handle, szColumnNameBuffer, pcchBuf ); handle, szColumnNameBuffer, pcchBuf );
@ -645,7 +645,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer,
if( !query ) if( !query )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
len = lstrlenW( szError ); len = strlenW( szError );
if( szColumnNameBuffer ) if( szColumnNameBuffer )
{ {
if( *pcchBuf > len ) if( *pcchBuf > len )
@ -665,7 +665,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer,
static const CHAR szError[] = { 0 }; static const CHAR szError[] = { 0 };
MSIQUERY *query = NULL; MSIQUERY *query = NULL;
MSIDBERROR r = MSIDBERROR_NOERROR; MSIDBERROR r = MSIDBERROR_NOERROR;
int len; DWORD len;
FIXME("%ld %p %p - returns empty error string\n", FIXME("%ld %p %p - returns empty error string\n",
handle, szColumnNameBuffer, pcchBuf ); handle, szColumnNameBuffer, pcchBuf );
@ -677,7 +677,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer,
if( !query ) if( !query )
return MSIDBERROR_INVALIDARG; return MSIDBERROR_INVALIDARG;
len = lstrlenA( szError ); len = strlen( szError );
if( szColumnNameBuffer ) if( szColumnNameBuffer )
{ {
if( *pcchBuf > len ) if( *pcchBuf > len )

View File

@ -218,7 +218,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
DWORD numvals, size; DWORD numvals, size;
LONG res; LONG res;
UINT r; UINT r;
static int index = 0; static DWORD index = 0;
static const WCHAR fmt[] = {'#','%','d',0}; static const WCHAR fmt[] = {'#','%','d',0};
@ -360,7 +360,7 @@ UINT WINAPI MsiSourceListEnumSourcesA(LPCSTR szProductCodeOrPatch, LPCSTR szUser
LPWSTR source = NULL; LPWSTR source = NULL;
DWORD len = 0; DWORD len = 0;
UINT r = ERROR_INVALID_PARAMETER; UINT r = ERROR_INVALID_PARAMETER;
static int index = 0; static DWORD index = 0;
TRACE("(%s, %s, %d, %d, %d, %p, %p)\n", debugstr_a(szProductCodeOrPatch), TRACE("(%s, %s, %d, %d, %d, %p, %p)\n", debugstr_a(szProductCodeOrPatch),
debugstr_a(szUserSid), dwContext, dwOptions, dwIndex, szSource, pcchSource); debugstr_a(szUserSid), dwContext, dwOptions, dwIndex, szSource, pcchSource);
@ -433,7 +433,7 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs
HKEY subkey = NULL; HKEY subkey = NULL;
LONG res; LONG res;
UINT r = ERROR_INVALID_PARAMETER; UINT r = ERROR_INVALID_PARAMETER;
static int index = 0; static DWORD index = 0;
static const WCHAR format[] = {'%','d',0}; static const WCHAR format[] = {'%','d',0};
@ -654,7 +654,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if (szValue) if (szValue)
{ {
if (lstrlenW(ptr) < *pcchValue) if (strlenW(ptr) < *pcchValue)
lstrcpyW(szValue, ptr); lstrcpyW(szValue, ptr);
else else
rc = ERROR_MORE_DATA; rc = ERROR_MORE_DATA;

View File

@ -169,8 +169,7 @@ static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VART
static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz ) static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz )
{ {
UINT type; UINT type;
DWORD i; DWORD i, size;
int size;
PROPERTY_DATA *propdata; PROPERTY_DATA *propdata;
PROPVARIANT property, *ptr; PROPVARIANT property, *ptr;
PROPVARIANT changed; PROPVARIANT changed;