gdi32: Fix compilation warnings in 64-bit mode.

This commit is contained in:
Dmitry Timoshkov 2007-05-30 17:51:47 +09:00 committed by Alexandre Julliard
parent e98ec6db4c
commit edbc6e7b8a
6 changed files with 15 additions and 15 deletions

View File

@ -392,7 +392,7 @@ HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont, HANDLE gdiFont )
/******************************************************************
* EMFDRV_CreatePenIndirect
*/
static HPEN EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen )
static DWORD EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen)
{
EMRCREATEPEN emr;
DWORD index = 0;
@ -423,7 +423,7 @@ static HPEN EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen )
if(!EMFDRV_WriteRecord( dev, &emr.emr ))
index = 0;
return (HPEN)index;
return index;
}
/******************************************************************
@ -453,7 +453,7 @@ HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen )
if((index = EMFDRV_FindObject(dev, hPen)) != 0)
goto found;
if (!(index = (DWORD)EMFDRV_CreatePenIndirect(dev, hPen ))) return 0;
if (!(index = EMFDRV_CreatePenIndirect(dev, hPen))) return 0;
GDI_hdc_using_object(hPen, physDev->hdc);
found:

View File

@ -356,7 +356,7 @@ DWORD WINAPI GdiGetCodePage( HDC hdc )
int charset = GetTextCharset(hdc);
/* Hmm, nicely designed api this one! */
if(TranslateCharsetInfo((DWORD*)charset, &csi, TCI_SRCCHARSET))
if(TranslateCharsetInfo(ULongToPtr(charset), &csi, TCI_SRCCHARSET))
cp = csi.ciACP;
else {
switch(charset) {
@ -2653,7 +2653,7 @@ DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs,
}
charset = GetTextCharset(hDC);
if (!TranslateCharsetInfo((DWORD *)charset, &csi, TCI_SRCCHARSET))
if (!TranslateCharsetInfo(ULongToPtr(charset), &csi, TCI_SRCCHARSET))
{
FIXME("Can't find codepage for charset %d\n", charset);
return 0;
@ -2762,10 +2762,10 @@ BOOL WINAPI TranslateCharsetInfo(
while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
break;
case TCI_SRCCODEPAGE:
while ((UINT) (lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++;
while (PtrToUlong(lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++;
break;
case TCI_SRCCHARSET:
while ((UINT) (lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++;
while (PtrToUlong(lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++;
break;
default:
return FALSE;

View File

@ -485,7 +485,7 @@ static UINT get_default_charset( void )
uACP = GetACP();
csi.ciCharset = ANSI_CHARSET;
if ( ! TranslateCharsetInfo( (LPDWORD)uACP, &csi, TCI_SRCCODEPAGE ) )
if ( !TranslateCharsetInfo( ULongToPtr(uACP), &csi, TCI_SRCCODEPAGE ) )
{
FIXME( "unhandled codepage %u - use ANSI_CHARSET for default stock objects\n", uACP );
return ANSI_CHARSET;
@ -1157,7 +1157,7 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj )
if (header->funcs && header->funcs->pSelectObject)
{
ret = header->funcs->pSelectObject( hObj, header, hdc );
if (ret && ret != hObj && (INT)ret > COMPLEXREGION)
if (ret && ret != hObj && HandleToULong(ret) > COMPLEXREGION)
{
inc_ref_count( hObj );
dec_ref_count( ret );

View File

@ -87,7 +87,7 @@ MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
int charset = GetTextCharset(physDev->hdc);
UINT cp = CP_ACP;
if(TranslateCharsetInfo((DWORD*)charset, &csi, TCI_SRCCHARSET))
if(TranslateCharsetInfo(ULongToPtr(charset), &csi, TCI_SRCCHARSET))
cp = csi.ciACP;
else {
switch(charset) {

View File

@ -804,7 +804,7 @@ DWORD WINAPI DrvGetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
strcpy(RegStr_Printer, Printers);
strcat(RegStr_Printer, lpPrinter);
if (((DWORD)lpProfile == INT_PD_DEFAULT_DEVMODE) || (HIWORD(lpProfile) &&
if ((PtrToUlong(lpProfile) == INT_PD_DEFAULT_DEVMODE) || (HIWORD(lpProfile) &&
(!strcmp(lpProfile, DefaultDevMode)))) {
size = DrvGetPrinterDataInternal(RegStr_Printer, lpPrinterData, cbData,
INT_PD_DEFAULT_DEVMODE);
@ -816,7 +816,7 @@ DWORD WINAPI DrvGetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
else res = ERROR_INVALID_PRINTER_NAME;
}
else
if (((DWORD)lpProfile == INT_PD_DEFAULT_MODEL) || (HIWORD(lpProfile) &&
if ((PtrToUlong(lpProfile) == INT_PD_DEFAULT_MODEL) || (HIWORD(lpProfile) &&
(!strcmp(lpProfile, PrinterModel)))) {
*lpNeeded = 32;
if (!lpPrinterData) goto failed;
@ -890,7 +890,7 @@ DWORD WINAPI DrvSetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
TRACE("lpType %08x\n",lpType);
if ((!lpPrinter) || (!lpProfile) ||
((DWORD)lpProfile == INT_PD_DEFAULT_MODEL) || (HIWORD(lpProfile) &&
(PtrToUlong(lpProfile) == INT_PD_DEFAULT_MODEL) || (HIWORD(lpProfile) &&
(!strcmp(lpProfile, PrinterModel))))
return ERROR_INVALID_PARAMETER;
@ -899,7 +899,7 @@ DWORD WINAPI DrvSetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile,
strcpy(RegStr_Printer, Printers);
strcat(RegStr_Printer, lpPrinter);
if (((DWORD)lpProfile == INT_PD_DEFAULT_DEVMODE) || (HIWORD(lpProfile) &&
if ((PtrToUlong(lpProfile) == INT_PD_DEFAULT_DEVMODE) || (HIWORD(lpProfile) &&
(!strcmp(lpProfile, DefaultDevMode)))) {
if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, RegStr_Printer, &hkey)
!= ERROR_SUCCESS ||

View File

@ -551,7 +551,7 @@ static BOOL REGION_DeleteObject( HGDIOBJ handle, void *obj )
*/
static HGDIOBJ REGION_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
{
return (HGDIOBJ)SelectClipRgn( hdc, handle );
return ULongToHandle(SelectClipRgn( hdc, handle ));
}