Skip to content

Commit 61ebdbc

Browse files
rbernonjulliard
authored andcommitted
dmime: Remove unnecessary struct message members.
1 parent db9758f commit 61ebdbc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dlls/dmime/performance.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ struct performance
7272
struct message
7373
{
7474
struct list entry;
75-
BOOL bInUse;
76-
DWORD cb;
7775
DMUS_PMSG pMsg;
7876
};
7977

@@ -91,7 +89,7 @@ static struct message *ProceedMsg(struct performance *This, struct message *cur)
9189
SetEvent(This->hNotification);
9290
}
9391
list_remove(&cur->entry);
94-
cur->bInUse = FALSE;
92+
list_init(&cur->entry);
9593
switch (cur->pMsg.dwType) {
9694
case DMUS_PMSGT_WAVE:
9795
case DMUS_PMSGT_TEMPO:
@@ -406,7 +404,7 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
406404

407405
EnterCriticalSection(&This->safe);
408406

409-
if (message->bInUse)
407+
if (!list_empty(&message->entry))
410408
hr = DMUS_E_ALREADY_SENT;
411409
else
412410
{
@@ -429,7 +427,6 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
429427
if (next->pMsg.rtTime >= message->pMsg.rtTime) break;
430428
list_add_before(&next->entry, &message->entry);
431429

432-
message->bInUse = TRUE;
433430
hr = S_OK;
434431
}
435432

@@ -515,6 +512,7 @@ static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULO
515512

516513
if (!(message = calloc(1, size - sizeof(DMUS_PMSG) + sizeof(struct message)))) return E_OUTOFMEMORY;
517514
message->pMsg.dwSize = size;
515+
list_init(&message->entry);
518516
*msg = &message->pMsg;
519517

520518
return S_OK;
@@ -532,7 +530,7 @@ static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS
532530
message = DMUS_PMSGToItem(msg);
533531

534532
EnterCriticalSection(&This->safe);
535-
hr = message->bInUse ? DMUS_E_CANNOT_FREE : S_OK;
533+
hr = !list_empty(&message->entry) ? DMUS_E_CANNOT_FREE : S_OK;
536534
LeaveCriticalSection(&This->safe);
537535

538536
if (SUCCEEDED(hr))

0 commit comments

Comments
 (0)