Fix gcc 4.0 warnings.

This commit is contained in:
Mike McCormack 2005-08-27 10:00:38 +00:00 committed by Alexandre Julliard
parent c9b7442689
commit 280bcf6e4a
11 changed files with 29 additions and 28 deletions

View File

@ -49,7 +49,7 @@ static void CRYPT_LMhash( unsigned char *dst, const unsigned char *pwd, const in
NTSTATUS WINAPI SystemFunction006( LPCSTR password, LPSTR hash ) NTSTATUS WINAPI SystemFunction006( LPCSTR password, LPSTR hash )
{ {
CRYPT_LMhash( hash, password, strlen(password) ); CRYPT_LMhash( (unsigned char*)hash, (unsigned char*)password, strlen(password) );
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View File

@ -49,7 +49,7 @@ typedef struct {
#define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); #define R4(v,w,x,y,z,i) z+=f4(w,x,y)+blk1(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
/* Hash a single 512-bit block. This is the core of the algorithm. */ /* Hash a single 512-bit block. This is the core of the algorithm. */
void SHA1Transform(ULONG State[5], CHAR Buffer[64]) void SHA1Transform(ULONG State[5], UCHAR Buffer[64])
{ {
ULONG a, b, c, d, e; ULONG a, b, c, d, e;
ULONG *Block; ULONG *Block;
@ -178,7 +178,7 @@ A_SHAFinal(PSHA_CTX Context, PULONG Result)
Count = (ULONG*)(Buffer + Pad); Count = (ULONG*)(Buffer + Pad);
Count[0] = DWORD2BE(LengthHi); Count[0] = DWORD2BE(LengthHi);
Count[1] = DWORD2BE(LengthLo); Count[1] = DWORD2BE(LengthLo);
A_SHAUpdate(Context, Buffer, Pad + 8); A_SHAUpdate(Context, (PCHAR)Buffer, Pad + 8);
for (Index = 0; Index < 5; Index++) for (Index = 0; Index < 5; Index++)
Result[Index] = DWORD2BE(Context->State[Index]); Result[Index] = DWORD2BE(Context->State[Index]);

View File

@ -991,7 +991,7 @@ DWORD WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD type,
if (type == REG_SZ) if (type == REG_SZ)
{ {
if (!data) return ERROR_INVALID_PARAMETER; if (!data) return ERROR_INVALID_PARAMETER;
count = strlen(data) + 1; count = strlen((const char *)data) + 1;
} }
} }
else if (count && is_string(type)) else if (count && is_string(type))
@ -1005,9 +1005,9 @@ DWORD WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD type,
if (is_string( type )) /* need to convert to Unicode */ if (is_string( type )) /* need to convert to Unicode */
{ {
DWORD lenW; DWORD lenW;
RtlMultiByteToUnicodeSize( &lenW, data, count ); RtlMultiByteToUnicodeSize( &lenW, (const char *)data, count );
if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW ))) return ERROR_OUTOFMEMORY; if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW ))) return ERROR_OUTOFMEMORY;
RtlMultiByteToUnicodeN( dataW, lenW, NULL, data, count ); RtlMultiByteToUnicodeN( dataW, lenW, NULL, (const char *)data, count );
count = lenW; count = lenW;
data = (BYTE *)dataW; data = (BYTE *)dataW;
} }
@ -1232,7 +1232,7 @@ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD
if (len > *count) status = STATUS_BUFFER_OVERFLOW; if (len > *count) status = STATUS_BUFFER_OVERFLOW;
else else
{ {
RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info_size), RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info_size),
total_size - info_size ); total_size - info_size );
/* if the type is REG_SZ and data is not 0-terminated /* if the type is REG_SZ and data is not 0-terminated
* and there is enough space in the buffer NT appends a \0 */ * and there is enough space in the buffer NT appends a \0 */
@ -1285,7 +1285,7 @@ DWORD WINAPI RegQueryValueW( HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count
{ {
if ((ret = RegOpenKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; if ((ret = RegOpenKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret;
} }
ret = RegQueryValueExW( subkey, NULL, NULL, NULL, (LPBYTE)data, count ); ret = RegQueryValueExW( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count );
if (subkey != hkey) RegCloseKey( subkey ); if (subkey != hkey) RegCloseKey( subkey );
if (ret == ERROR_FILE_NOT_FOUND) if (ret == ERROR_FILE_NOT_FOUND)
{ {
@ -1314,7 +1314,7 @@ DWORD WINAPI RegQueryValueA( HKEY hkey, LPCSTR name, LPSTR data, LPLONG count )
{ {
if ((ret = RegOpenKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; if ((ret = RegOpenKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret;
} }
ret = RegQueryValueExA( subkey, NULL, NULL, NULL, (LPBYTE)data, count ); ret = RegQueryValueExA( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count );
if (subkey != hkey) RegCloseKey( subkey ); if (subkey != hkey) RegCloseKey( subkey );
if (ret == ERROR_FILE_NOT_FOUND) if (ret == ERROR_FILE_NOT_FOUND)
{ {
@ -1731,7 +1731,7 @@ DWORD WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_cou
if (len > *count) status = STATUS_BUFFER_OVERFLOW; if (len > *count) status = STATUS_BUFFER_OVERFLOW;
else else
{ {
RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset), RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset),
total_size - info->DataOffset ); total_size - info->DataOffset );
/* if the type is REG_SZ and data is not 0-terminated /* if the type is REG_SZ and data is not 0-terminated
* and there is enough space in the buffer NT appends a \0 */ * and there is enough space in the buffer NT appends a \0 */

View File

@ -1637,7 +1637,7 @@ QueryServiceConfigA( SC_HANDLE hService,
CHAR str_buffer[ MAX_PATH ]; CHAR str_buffer[ MAX_PATH ];
LONG r; LONG r;
DWORD type, val, sz, total, n; DWORD type, val, sz, total, n;
LPBYTE p; LPSTR p;
TRACE("%p %p %ld %p\n", hService, lpServiceConfig, TRACE("%p %p %ld %p\n", hService, lpServiceConfig,
cbBufSize, pcbBytesNeeded); cbBufSize, pcbBytesNeeded);
@ -1715,7 +1715,7 @@ QueryServiceConfigA( SC_HANDLE hService,
lpServiceConfig->dwErrorControl = val; lpServiceConfig->dwErrorControl = val;
/* now do the strings */ /* now do the strings */
p = (LPBYTE) &lpServiceConfig[1]; p = (LPSTR) &lpServiceConfig[1];
n = total - sizeof (QUERY_SERVICE_CONFIGA); n = total - sizeof (QUERY_SERVICE_CONFIGA);
sz = sizeof(str_buffer); sz = sizeof(str_buffer);
@ -1725,7 +1725,7 @@ QueryServiceConfigA( SC_HANDLE hService,
sz = ExpandEnvironmentStringsA(str_buffer, p, n); sz = ExpandEnvironmentStringsA(str_buffer, p, n);
if( 0 == sz || sz > n ) return FALSE; if( 0 == sz || sz > n ) return FALSE;
lpServiceConfig->lpBinaryPathName = (LPSTR) p; lpServiceConfig->lpBinaryPathName = p;
p += sz; p += sz;
n -= sz; n -= sz;
} }
@ -1739,7 +1739,7 @@ QueryServiceConfigA( SC_HANDLE hService,
r = RegQueryValueExA( hKey, szGroup, 0, &type, (LPBYTE)p, &sz ); r = RegQueryValueExA( hKey, szGroup, 0, &type, (LPBYTE)p, &sz );
if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) )
{ {
lpServiceConfig->lpLoadOrderGroup = (LPSTR) p; lpServiceConfig->lpLoadOrderGroup = p;
p += sz; p += sz;
n -= sz; n -= sz;
} }
@ -1748,7 +1748,7 @@ QueryServiceConfigA( SC_HANDLE hService,
r = RegQueryValueExA( hKey, szDependencies, 0, &type, (LPBYTE)p, &sz ); r = RegQueryValueExA( hKey, szDependencies, 0, &type, (LPBYTE)p, &sz );
if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) ) if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) )
{ {
lpServiceConfig->lpDependencies = (LPSTR) p; lpServiceConfig->lpDependencies = p;
p += sz; p += sz;
n -= sz; n -= sz;
} }

View File

@ -29,9 +29,9 @@ fnSystemFunction006 pSystemFunction006;
static void test_SystemFunction006(void) static void test_SystemFunction006(void)
{ {
static unsigned char lmhash[16 + 1]; char lmhash[16 + 1];
unsigned char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 }; char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
unsigned char expect[] = unsigned char expect[] =
{ 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb, { 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee }; 0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };

View File

@ -51,7 +51,7 @@ static void test_md4_ctx(void)
"In our business there is Sin" "In our business there is Sin"
"In our bodies, there is Die"; "In our bodies, there is Die";
int size = strlen( message ); int size = sizeof(message) - 1;
HMODULE module; HMODULE module;
MD4_CTX ctx; MD4_CTX ctx;

View File

@ -51,7 +51,7 @@ static void test_md5_ctx(void)
"In our business there is Sin" "In our business there is Sin"
"In our bodies, there is Die"; "In our bodies, there is Die";
int size = strlen( message ); int size = sizeof(message) - 1;
HMODULE module; HMODULE module;
MD5_CTX ctx; MD5_CTX ctx;

View File

@ -324,15 +324,15 @@ typedef struct {
cab_ULONG cDataBlocks; cab_ULONG cDataBlocks;
cab_ULONG cbFileRemainer; /* uncompressed, yet to be written data */ cab_ULONG cbFileRemainer; /* uncompressed, yet to be written data */
/* of spanned file of a spanning folder of a spanning cabinet */ /* of spanned file of a spanning folder of a spanning cabinet */
cab_UBYTE szFileNameCFDATA1[CB_MAX_FILENAME]; char szFileNameCFDATA1[CB_MAX_FILENAME];
int handleCFDATA1; int handleCFDATA1;
cab_UBYTE szFileNameCFFILE1[CB_MAX_FILENAME]; char szFileNameCFFILE1[CB_MAX_FILENAME];
int handleCFFILE1; int handleCFFILE1;
cab_UBYTE szFileNameCFDATA2[CB_MAX_FILENAME]; char szFileNameCFDATA2[CB_MAX_FILENAME];
int handleCFDATA2; int handleCFDATA2;
cab_UBYTE szFileNameCFFILE2[CB_MAX_FILENAME]; char szFileNameCFFILE2[CB_MAX_FILENAME];
int handleCFFILE2; int handleCFFILE2;
cab_UBYTE szFileNameCFFOLDER[CB_MAX_FILENAME]; char szFileNameCFFOLDER[CB_MAX_FILENAME];
int handleCFFOLDER; int handleCFFOLDER;
cab_ULONG sizeFileCFDATA1; cab_ULONG sizeFileCFDATA1;
cab_ULONG sizeFileCFFILE1; cab_ULONG sizeFileCFFILE1;

View File

@ -3935,7 +3935,7 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
REBAR_BAND *lpBand; REBAR_BAND *lpBand;
UINT htFlags; UINT htFlags;
UINT iHitBand; INT iHitBand;
POINT ptMouseDown; POINT ptMouseDown;
ptMouseDown.x = (INT)LOWORD(lParam); ptMouseDown.x = (INT)LOWORD(lParam);
ptMouseDown.y = (INT)HIWORD(lParam); ptMouseDown.y = (INT)HIWORD(lParam);

View File

@ -601,7 +601,8 @@ static LRESULT
TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
POINT pt; POINT pt;
INT newItem, dummy; INT newItem;
UINT dummy;
if (infoPtr->hwndToolTip) if (infoPtr->hwndToolTip)
TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd, TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,

View File

@ -163,7 +163,7 @@ BOOL FileIsPlaceable( LPCSTR szFileName )
HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName ) HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
{ {
LPSTR lpData; LPBYTE lpData;
METAHEADER mfHeader; METAHEADER mfHeader;
APMFILEHEADER APMHeader; APMFILEHEADER APMHeader;
HFILE fh; HFILE fh;
@ -191,7 +191,7 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
if (!_lread(fh, (LPSTR)&mfHeader, sizeof(METAHEADER))) return 0; if (!_lread(fh, (LPSTR)&mfHeader, sizeof(METAHEADER))) return 0;
if (!(lpData = (LPSTR) GlobalAlloc(GPTR, (mfHeader.mtSize * 2L)))) return 0; if (!(lpData = GlobalAlloc(GPTR, (mfHeader.mtSize * 2L)))) return 0;
_llseek(fh, sizeof(APMFILEHEADER), 0); _llseek(fh, sizeof(APMFILEHEADER), 0);
if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L))) if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L)))