From d3dba4e56cc64199ea366c382f42c7ef9aaf8767 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 12 Sep 2005 10:52:38 +0000 Subject: [PATCH] Fixed gcc 4.0 warnings. --- dlls/winedos/int21.c | 18 +++++++++--------- dlls/winmm/mci.c | 12 ++++++------ dlls/winmm/message16.c | 8 ++++---- dlls/winmm/winemm.h | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index f08b1bc782..ba972e01d1 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -521,7 +521,7 @@ static void INT21_FillHeap( INT21_HEAP *heap ) */ heap->filename_size = 8 + strlen(terminators); heap->filename_illegal_size = strlen(terminators); - strcpy( heap->filename_illegal_table, terminators ); + memcpy( heap->filename_illegal_table, terminators, heap->filename_illegal_size ); heap->filename_reserved1 = 0x01; heap->filename_lowest = 0x00; @@ -1484,7 +1484,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context ) AL_result = 0x01; /* disk full */ } else { disk_transfer_area = INT21_GetCurrentDTA(context); - bytes_written = _lwrite((HFILE) handle, disk_transfer_area, fcb->logical_record_size); + bytes_written = _lwrite((HFILE) handle, (LPCSTR)disk_transfer_area, fcb->logical_record_size); if (bytes_written != fcb->logical_record_size) { TRACE("_lwrite(%d, %p, %d) failed with %d\n", fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written); @@ -1633,7 +1633,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context ) AL_result = 0x01; /* disk full */ } else { disk_transfer_area = INT21_GetCurrentDTA(context); - bytes_written = _lwrite((HFILE) handle, disk_transfer_area, fcb->logical_record_size); + bytes_written = _lwrite((HFILE) handle, (LPCSTR)disk_transfer_area, fcb->logical_record_size); if (bytes_written != fcb->logical_record_size) { TRACE("_lwrite(%d, %p, %d) failed with %d\n", fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written); @@ -1806,7 +1806,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context ) disk_transfer_area = INT21_GetCurrentDTA(context); records_requested = CX_reg(context); bytes_requested = (UINT) records_requested * fcb->logical_record_size; - bytes_written = _lwrite((HFILE) handle, disk_transfer_area, bytes_requested); + bytes_written = _lwrite((HFILE) handle, (LPCSTR)disk_transfer_area, bytes_requested); if (bytes_written != bytes_requested) { TRACE("_lwrite(%d, %p, %d) failed with %d\n", fcb->file_number, disk_transfer_area, bytes_requested, bytes_written); @@ -2591,8 +2591,8 @@ static void INT21_Ioctl_Block( CONTEXT86 *context ) GetVolumeInformationW(drivespec, label, 12, &serial, NULL, NULL, fsname, 9); *(WORD*)dataptr = 0; memcpy(dataptr+2,&serial,4); - WideCharToMultiByte(CP_OEMCP, 0, label, 11, dataptr + 6, 11, NULL, NULL); - WideCharToMultiByte(CP_OEMCP, 0, fsname, 8, dataptr + 17, 8, NULL, NULL); + WideCharToMultiByte(CP_OEMCP, 0, label, 11, (LPSTR)dataptr + 6, 11, NULL, NULL); + WideCharToMultiByte(CP_OEMCP, 0, fsname, 8, (LPSTR)dataptr + 17, 8, NULL, NULL); } break; @@ -3435,7 +3435,7 @@ static int INT21_GetDiskSerialNumber( CONTEXT86 *context ) *(WORD *)dataptr = 0; memcpy(dataptr + 2, &serial, sizeof(DWORD)); - WideCharToMultiByte(CP_OEMCP, 0, label, 11, dataptr + 6, 11, NULL, NULL); + WideCharToMultiByte(CP_OEMCP, 0, label, 11, (LPSTR)dataptr + 6, 11, NULL, NULL); memcpy(dataptr + 17, "FAT16 ", 8); return 1; } @@ -4776,7 +4776,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) context->SegDs, DX_reg(context), BX_reg(context), CX_reg(context) ); { - BYTE *ptr = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); + char *ptr = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); if (!DOSVM_IsWin16() && (BX_reg(context) == 1 || BX_reg(context) == 2)) @@ -4979,7 +4979,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */ { - BYTE *program = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); + char *program = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); BYTE *paramblk = CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Ebx); TRACE( "EXEC %s\n", program ); diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index 3a8175cba5..1ca44ccc78 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -68,10 +68,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(mci); -WINMM_MapType (*pFnMciMapMsg16To32W) (WORD,WORD,DWORD,DWORD*) /* = NULL */; -WINMM_MapType (*pFnMciUnMapMsg16To32W)(WORD,WORD,DWORD,DWORD) /* = NULL */; -WINMM_MapType (*pFnMciMapMsg32WTo16) (WORD,WORD,DWORD,DWORD*) /* = NULL */; -WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD) /* = NULL */; +WINMM_MapType (*pFnMciMapMsg16To32W) (WORD,WORD,DWORD,DWORD_PTR*) = NULL; +WINMM_MapType (*pFnMciUnMapMsg16To32W)(WORD,WORD,DWORD,DWORD_PTR) = NULL; +WINMM_MapType (*pFnMciMapMsg32WTo16) (WORD,WORD,DWORD,DWORD_PTR*) = NULL; +WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD_PTR) = NULL; /* First MCI valid device ID (0 means error) */ #define MCI_MAGIC 0x0001 @@ -819,7 +819,7 @@ static BOOL MCI_UnLoadMciDriver(LPWINE_MCIDRIVER wmd) /************************************************************************** * MCI_OpenMciDriver [internal] */ -static BOOL MCI_OpenMciDriver(LPWINE_MCIDRIVER wmd, LPCWSTR drvTyp, LPARAM lp) +static BOOL MCI_OpenMciDriver(LPWINE_MCIDRIVER wmd, LPCWSTR drvTyp, DWORD_PTR lp) { WCHAR libName[128]; @@ -890,7 +890,7 @@ static DWORD MCI_LoadMciDriver(LPCWSTR _strDevTyp, LPWINE_MCIDRIVER* lpwmd) modp.lpstrParams = NULL; - if (!MCI_OpenMciDriver(wmd, strDevTyp, (LPARAM)&modp)) { + if (!MCI_OpenMciDriver(wmd, strDevTyp, (DWORD_PTR)&modp)) { /* silence warning if all is used... some bogus program use commands like * 'open all'... */ diff --git a/dlls/winmm/message16.c b/dlls/winmm/message16.c index 3e3bbcc6e9..5a00851256 100644 --- a/dlls/winmm/message16.c +++ b/dlls/winmm/message16.c @@ -2522,7 +2522,7 @@ static WINMM_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlag /************************************************************************** * MCI_MapMsg16To32W [internal] */ -static WINMM_MapType MCI_MapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD* lParam) +static WINMM_MapType MCI_MapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD_PTR* lParam) { if (*lParam == 0) return WINMM_MAP_OK; @@ -2716,7 +2716,7 @@ static WINMM_MapType MCI_MapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlags, /************************************************************************** * MCI_UnMapMsg16To32W [internal] */ -static WINMM_MapType MCI_UnMapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD lParam) +static WINMM_MapType MCI_UnMapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD_PTR lParam) { switch (wMsg) { /* case MCI_CAPTURE */ @@ -3007,7 +3007,7 @@ static WINMM_MapType MCI_MsgMapper32WTo16_Destroy(void* ptr, int size16, DWORD m * * Map a 32W bit MCI message to a 16 bit MCI message. */ -static WINMM_MapType MCI_MapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD* lParam) +static WINMM_MapType MCI_MapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD_PTR* lParam) { int size; BOOLEAN keep = FALSE; @@ -3318,7 +3318,7 @@ static WINMM_MapType MCI_MapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlags, /************************************************************************** * MCI_UnMapMsg32WTo16 [internal] */ -static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD lParam) +static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DWORD_PTR lParam) { int size = 0; BOOLEAN kept = FALSE; /* there is no need to compute size when kept is FALSE */ diff --git a/dlls/winmm/winemm.h b/dlls/winmm/winemm.h index db22c25537..a17fa17470 100644 --- a/dlls/winmm/winemm.h +++ b/dlls/winmm/winemm.h @@ -300,10 +300,10 @@ extern WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16); extern LPWINE_DRIVER (*pFnOpenDriver16)(LPCWSTR,LPCWSTR,LPARAM); extern LRESULT (*pFnCloseDriver16)(UINT16,LPARAM,LPARAM); extern LRESULT (*pFnSendMessage16)(UINT16,UINT,LPARAM,LPARAM); -extern WINMM_MapType (*pFnMciMapMsg16To32W)(WORD,WORD,DWORD,DWORD*); -extern WINMM_MapType (*pFnMciUnMapMsg16To32W)(WORD,WORD,DWORD,DWORD); -extern WINMM_MapType (*pFnMciMapMsg32WTo16)(WORD,WORD,DWORD,DWORD*); -extern WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD); +extern WINMM_MapType (*pFnMciMapMsg16To32W)(WORD,WORD,DWORD,DWORD_PTR*); +extern WINMM_MapType (*pFnMciUnMapMsg16To32W)(WORD,WORD,DWORD,DWORD_PTR); +extern WINMM_MapType (*pFnMciMapMsg32WTo16)(WORD,WORD,DWORD,DWORD_PTR*); +extern WINMM_MapType (*pFnMciUnMapMsg32WTo16)(WORD,WORD,DWORD,DWORD_PTR); extern LRESULT (*pFnCallMMDrvFunc16)(DWORD /* in fact FARPROC16 */,WORD,WORD,LONG,LONG,LONG); extern unsigned (*pFnLoadMMDrvFunc16)(LPCSTR,LPWINE_DRIVER, LPWINE_MM_DRIVER); extern LRESULT (*pFnMmioCallback16)(DWORD,LPMMIOINFO,UINT,LPARAM,LPARAM);