wininet: Remove unneeded casts.

This commit is contained in:
Andrew Talbot 2008-02-04 22:07:57 +00:00 committed by Alexandre Julliard
parent 6436dd6169
commit 45481db078
5 changed files with 18 additions and 18 deletions

View File

@ -474,7 +474,7 @@ lend:
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD)bSuccess;
iar.dwResult = bSuccess;
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
&iar, sizeof(INTERNET_ASYNC_RESULT));
@ -1008,13 +1008,13 @@ lend:
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD)bSuccess;
iar.dwResult = bSuccess;
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
&iar, sizeof(INTERNET_ASYNC_RESULT));
}
return (DWORD) bSuccess;
return bSuccess;
}
/***********************************************************************

View File

@ -796,7 +796,7 @@ BOOL WINAPI HttpEndRequestA(HINTERNET hRequest,
FIXME("Do we need to translate info out of these buffer?\n");
HeapFree(GetProcessHeap(),0,(LPVOID)ptrW->lpvBuffer);
HeapFree(GetProcessHeap(),0,ptrW->lpvBuffer);
ptrW2 = ptrW->Next;
HeapFree(GetProcessHeap(),0,ptrW);
ptrW = ptrW2;

View File

@ -265,7 +265,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
URLCacheContainers_CreateDefaults();
WININET_hModule = (HMODULE)hinstDLL;
WININET_hModule = hinstDLL;
case DLL_THREAD_ATTACH:
break;
@ -568,7 +568,7 @@ lend:
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
{
HINTERNET rc = (HINTERNET)NULL;
HINTERNET rc = NULL;
INT len;
WCHAR *szAgent = NULL, *szProxy = NULL, *szBypass = NULL;
@ -851,7 +851,7 @@ HINTERNET WINAPI InternetConnectA(HINTERNET hInternet,
LPCSTR lpszUserName, LPCSTR lpszPassword,
DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
{
HINTERNET rc = (HINTERNET)NULL;
HINTERNET rc = NULL;
INT len = 0;
LPWSTR szServerName = NULL;
LPWSTR szUserName = NULL;
@ -1700,7 +1700,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer ,
LPWININETHANDLEHEADER lpwh;
TRACE("\n");
lpwh = (LPWININETHANDLEHEADER) WININET_GetObject( hFile );
lpwh = WININET_GetObject( hFile );
if (NULL == lpwh)
return FALSE;
@ -2544,7 +2544,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
LPWININETHANDLEHEADER lpwh;
INTERNET_STATUS_CALLBACK callback = *(INTERNET_STATUS_CALLBACK *)lpBuffer;
if (!(lpwh = (LPWININETHANDLEHEADER)WININET_GetObject(hInternet))) return FALSE;
if (!(lpwh = WININET_GetObject(hInternet))) return FALSE;
r = (set_status_callback(lpwh, callback, FALSE) != INTERNET_INVALID_STATUS_CALLBACK);
WININET_Release(lpwh);
return r;
@ -3104,7 +3104,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
{
HINTERNET rc = (HINTERNET)NULL;
HINTERNET rc = NULL;
INT lenUrl;
INT lenHeaders = 0;
@ -3117,16 +3117,16 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
lenUrl = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0 );
szUrl = HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(WCHAR));
if(!szUrl)
return (HINTERNET)NULL;
return NULL;
MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, lenUrl);
}
if(lpszHeaders) {
lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 );
szHeaders = HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(WCHAR));
if(!szHeaders) {
HeapFree(GetProcessHeap(), 0, szUrl);
return (HINTERNET)NULL;
return NULL;
}
MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, szHeaders, lenHeaders);
}

View File

@ -1125,7 +1125,7 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
HASH_CACHEFILE_ENTRY * pHashEntry;
DWORD dwHashTableNumber = 0;
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
@ -1147,7 +1147,7 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
for (i = 0; i < HASHTABLE_BLOCKSIZE; i++)
{
struct _HASH_ENTRY * pHashElement = &pHashEntry->HashTable[offset + i];
if (key == (DWORD)(pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
if (key == (pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
{
/* FIXME: we should make sure that this is the right element
* before returning and claiming that it is. We can do this
@ -1195,7 +1195,7 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru
*/
static BOOL URLCache_HashEntrySetUse(struct _HASH_ENTRY * pHashEntry, DWORD dwUseCount)
{
pHashEntry->dwHashKey = dwUseCount | (DWORD)(pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
pHashEntry->dwHashKey = dwUseCount | (pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
return TRUE;
}
@ -1238,7 +1238,7 @@ static BOOL URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, D
HASH_CACHEFILE_ENTRY * pHashEntry;
DWORD dwHashTableNumber = 0;
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);

View File

@ -162,7 +162,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
memset(psa,0,sizeof(struct sockaddr_in));
memcpy((char *)&psa->sin_addr, phe->h_addr, phe->h_length);
psa->sin_family = phe->h_addrtype;
psa->sin_port = htons((u_short)nServerPort);
psa->sin_port = htons(nServerPort);
return TRUE;
}