Commit 280bcf6e authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix gcc 4.0 warnings.

parent c9b74426
......@@ -49,7 +49,7 @@ static void CRYPT_LMhash( unsigned char *dst, const unsigned char *pwd, const in
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;
}
......@@ -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);
/* 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 *Block;
......@@ -178,7 +178,7 @@ A_SHAFinal(PSHA_CTX Context, PULONG Result)
Count = (ULONG*)(Buffer + Pad);
Count[0] = DWORD2BE(LengthHi);
Count[1] = DWORD2BE(LengthLo);
A_SHAUpdate(Context, Buffer, Pad + 8);
A_SHAUpdate(Context, (PCHAR)Buffer, Pad + 8);
for (Index = 0; Index < 5; Index++)
Result[Index] = DWORD2BE(Context->State[Index]);
......
......@@ -991,7 +991,7 @@ DWORD WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD type,
if (type == REG_SZ)
{
if (!data) return ERROR_INVALID_PARAMETER;
count = strlen(data) + 1;
count = strlen((const char *)data) + 1;
}
}
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 */
{
DWORD lenW;
RtlMultiByteToUnicodeSize( &lenW, data, count );
RtlMultiByteToUnicodeSize( &lenW, (const char *)data, count );
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;
data = (BYTE *)dataW;
}
......@@ -1232,7 +1232,7 @@ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD
if (len > *count) status = STATUS_BUFFER_OVERFLOW;
else
{
RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info_size),
RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info_size),
total_size - info_size );
/* if the type is REG_SZ and data is not 0-terminated
* 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;
}
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 (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;
}
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 (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;
else
{
RtlUnicodeToMultiByteN( data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset),
RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset),
total_size - info->DataOffset );
/* if the type is REG_SZ and data is not 0-terminated
* and there is enough space in the buffer NT appends a \0 */
......
......@@ -1637,7 +1637,7 @@ QueryServiceConfigA( SC_HANDLE hService,
CHAR str_buffer[ MAX_PATH ];
LONG r;
DWORD type, val, sz, total, n;
LPBYTE p;
LPSTR p;
TRACE("%p %p %ld %p\n", hService, lpServiceConfig,
cbBufSize, pcbBytesNeeded);
......@@ -1715,7 +1715,7 @@ QueryServiceConfigA( SC_HANDLE hService,
lpServiceConfig->dwErrorControl = val;
/* now do the strings */
p = (LPBYTE) &lpServiceConfig[1];
p = (LPSTR) &lpServiceConfig[1];
n = total - sizeof (QUERY_SERVICE_CONFIGA);
sz = sizeof(str_buffer);
......@@ -1725,7 +1725,7 @@ QueryServiceConfigA( SC_HANDLE hService,
sz = ExpandEnvironmentStringsA(str_buffer, p, n);
if( 0 == sz || sz > n ) return FALSE;
lpServiceConfig->lpBinaryPathName = (LPSTR) p;
lpServiceConfig->lpBinaryPathName = p;
p += sz;
n -= sz;
}
......@@ -1739,7 +1739,7 @@ QueryServiceConfigA( SC_HANDLE hService,
r = RegQueryValueExA( hKey, szGroup, 0, &type, (LPBYTE)p, &sz );
if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) )
{
lpServiceConfig->lpLoadOrderGroup = (LPSTR) p;
lpServiceConfig->lpLoadOrderGroup = p;
p += sz;
n -= sz;
}
......@@ -1748,7 +1748,7 @@ QueryServiceConfigA( SC_HANDLE hService,
r = RegQueryValueExA( hKey, szDependencies, 0, &type, (LPBYTE)p, &sz );
if( ( r == ERROR_SUCCESS ) || ( type == REG_SZ ) )
{
lpServiceConfig->lpDependencies = (LPSTR) p;
lpServiceConfig->lpDependencies = p;
p += sz;
n -= sz;
}
......
......@@ -29,9 +29,9 @@ fnSystemFunction006 pSystemFunction006;
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[] =
{ 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
......
......@@ -51,7 +51,7 @@ static void test_md4_ctx(void)
"In our business there is Sin"
"In our bodies, there is Die";
int size = strlen( message );
int size = sizeof(message) - 1;
HMODULE module;
MD4_CTX ctx;
......
......@@ -51,7 +51,7 @@ static void test_md5_ctx(void)
"In our business there is Sin"
"In our bodies, there is Die";
int size = strlen( message );
int size = sizeof(message) - 1;
HMODULE module;
MD5_CTX ctx;
......
......@@ -324,15 +324,15 @@ typedef struct {
cab_ULONG cDataBlocks;
cab_ULONG cbFileRemainer; /* uncompressed, yet to be written data */
/* of spanned file of a spanning folder of a spanning cabinet */
cab_UBYTE szFileNameCFDATA1[CB_MAX_FILENAME];
char szFileNameCFDATA1[CB_MAX_FILENAME];
int handleCFDATA1;
cab_UBYTE szFileNameCFFILE1[CB_MAX_FILENAME];
char szFileNameCFFILE1[CB_MAX_FILENAME];
int handleCFFILE1;
cab_UBYTE szFileNameCFDATA2[CB_MAX_FILENAME];
char szFileNameCFDATA2[CB_MAX_FILENAME];
int handleCFDATA2;
cab_UBYTE szFileNameCFFILE2[CB_MAX_FILENAME];
char szFileNameCFFILE2[CB_MAX_FILENAME];
int handleCFFILE2;
cab_UBYTE szFileNameCFFOLDER[CB_MAX_FILENAME];
char szFileNameCFFOLDER[CB_MAX_FILENAME];
int handleCFFOLDER;
cab_ULONG sizeFileCFDATA1;
cab_ULONG sizeFileCFFILE1;
......
......@@ -3935,7 +3935,7 @@ REBAR_LButtonDown (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
REBAR_BAND *lpBand;
UINT htFlags;
UINT iHitBand;
INT iHitBand;
POINT ptMouseDown;
ptMouseDown.x = (INT)LOWORD(lParam);
ptMouseDown.y = (INT)HIWORD(lParam);
......
......@@ -601,7 +601,8 @@ static LRESULT
TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
POINT pt;
INT newItem, dummy;
INT newItem;
UINT dummy;
if (infoPtr->hwndToolTip)
TAB_RelayEvent (infoPtr->hwndToolTip, infoPtr->hwnd,
......
......@@ -163,7 +163,7 @@ BOOL FileIsPlaceable( LPCSTR szFileName )
HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
{
LPSTR lpData;
LPBYTE lpData;
METAHEADER mfHeader;
APMFILEHEADER APMHeader;
HFILE fh;
......@@ -191,7 +191,7 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
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);
if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment