Commit 38111eb3 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winmm: Avoid explicitly casting the pointer returned from Heap(Re)Alloc.

parent c57f5d98
...@@ -334,6 +334,8 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) ...@@ -334,6 +334,8 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg)
DWORD ret; DWORD ret;
UINT count = 0; UINT count = 0;
int i, k; int i, k;
WINE_MLD *mem;
TRACE("(%p, %04x, %04x)\n", lpDrv, type, wMsg); TRACE("(%p, %04x, %04x)\n", lpDrv, type, wMsg);
part->nIDMin = part->nIDMax = 0; part->nIDMin = part->nIDMax = 0;
...@@ -370,14 +372,14 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) ...@@ -370,14 +372,14 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg)
part->nIDMin, part->nIDMax, llTypes[type].wMaxId, part->nIDMin, part->nIDMax, llTypes[type].wMaxId,
lpDrv->drvname, llTypes[type].typestr); lpDrv->drvname, llTypes[type].typestr);
/* realloc translation table */ /* realloc translation table */
if (llTypes[type].lpMlds) if (llTypes[type].lpMlds) {
llTypes[type].lpMlds = (LPWINE_MLD) mem = llTypes[type].lpMlds - 1;
HeapReAlloc(GetProcessHeap(), 0, llTypes[type].lpMlds - 1, mem = HeapReAlloc(GetProcessHeap(), 0, mem, sizeof(WINE_MLD) * (llTypes[type].wMaxId + 1));
sizeof(WINE_MLD) * (llTypes[type].wMaxId + 1)) + 1; llTypes[type].lpMlds = mem + 1;
else } else {
llTypes[type].lpMlds = (LPWINE_MLD) mem = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_MLD) * (llTypes[type].wMaxId + 1));
HeapAlloc(GetProcessHeap(), 0, llTypes[type].lpMlds = mem + 1;
sizeof(WINE_MLD) * (llTypes[type].wMaxId + 1)) + 1; }
/* re-build the translation table */ /* re-build the translation table */
if (lpDrv->bIsMapper) { if (lpDrv->bIsMapper) {
......
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