Skip to content

Commit 419ab92

Browse files
rbernonjulliard
authored andcommitted
dmime: Get rid of the DMUS_PMSGItem typedef.
1 parent 6cd1c4e commit 419ab92

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

dlls/dmime/performance.c

+22-21
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ struct performance
6262
DWORD procThreadId;
6363
BOOL procThreadTicStarted;
6464
CRITICAL_SECTION safe;
65-
struct DMUS_PMSGItem *head;
66-
struct DMUS_PMSGItem *imm_head;
65+
struct message *head;
66+
struct message *imm_head;
6767

6868
IReferenceClock *master_clock;
6969
REFERENCE_TIME init_time;
7070
};
7171

72-
typedef struct DMUS_PMSGItem DMUS_PMSGItem;
73-
struct DMUS_PMSGItem {
74-
DMUS_PMSGItem* next;
75-
DMUS_PMSGItem* prev;
72+
struct message
73+
{
74+
struct message *next;
75+
struct message *prev;
7676

77-
BOOL bInUse;
78-
DWORD cb;
79-
DMUS_PMSG pMsg;
77+
BOOL bInUse;
78+
DWORD cb;
79+
DMUS_PMSG pMsg;
8080
};
8181

82-
#define DMUS_PMSGToItem(pMSG) ((DMUS_PMSGItem *)(((unsigned char *)pMSG) - offsetof(DMUS_PMSGItem, pMsg)))
82+
#define DMUS_PMSGToItem(pMSG) ((struct message *)(((unsigned char *)pMSG) - offsetof(struct message, pMsg)))
8383
#define DMUS_ItemRemoveFromQueue(This,pItem) \
8484
{\
8585
if (pItem->prev) pItem->prev->next = pItem->next;\
@@ -95,7 +95,8 @@ struct DMUS_PMSGItem {
9595
#define PROCESSMSG_ADD (WM_APP + 4)
9696

9797

98-
static DMUS_PMSGItem* ProceedMsg(struct performance *This, DMUS_PMSGItem* cur) {
98+
static struct message *ProceedMsg(struct performance *This, struct message *cur)
99+
{
99100
if (cur->pMsg.dwType == DMUS_PMSGT_NOTIFICATION) {
100101
SetEvent(This->hNotification);
101102
}
@@ -117,9 +118,9 @@ static DWORD WINAPI ProcessMsgThread(LPVOID lpParam) {
117118
MSG msg;
118119
HRESULT hr;
119120
REFERENCE_TIME rtCurTime;
120-
DMUS_PMSGItem* it = NULL;
121-
DMUS_PMSGItem* cur = NULL;
122-
DMUS_PMSGItem* it_next = NULL;
121+
struct message *it = NULL;
122+
struct message *cur = NULL;
123+
struct message *it_next = NULL;
123124

124125
while (TRUE) {
125126
DWORD dwDec = This->rtLatencyTime + This->dwBumperLength;
@@ -401,10 +402,10 @@ static HRESULT WINAPI performance_GetBumperLength(IDirectMusicPerformance8 *ifac
401402
static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *msg)
402403
{
403404
struct performance *This = impl_from_IDirectMusicPerformance8(iface);
404-
DMUS_PMSGItem *message;
405-
DMUS_PMSGItem *it = NULL;
406-
DMUS_PMSGItem *prev_it = NULL;
407-
DMUS_PMSGItem **queue;
405+
struct message *message;
406+
struct message *it = NULL;
407+
struct message *prev_it = NULL;
408+
struct message **queue;
408409
HRESULT hr;
409410

410411
FIXME("(%p, %p): semi-stub\n", This, msg);
@@ -535,14 +536,14 @@ static HRESULT WINAPI performance_GetTime(IDirectMusicPerformance8 *iface, REFER
535536
static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULONG size, DMUS_PMSG **msg)
536537
{
537538
struct performance *This = impl_from_IDirectMusicPerformance8(iface);
538-
DMUS_PMSGItem *message;
539+
struct message *message;
539540

540541
TRACE("(%p, %ld, %p)\n", This, size, msg);
541542

542543
if (!msg) return E_POINTER;
543544
if (size < sizeof(DMUS_PMSG)) return E_INVALIDARG;
544545

545-
if (!(message = calloc(1, size - sizeof(DMUS_PMSG) + sizeof(DMUS_PMSGItem)))) return E_OUTOFMEMORY;
546+
if (!(message = calloc(1, size - sizeof(DMUS_PMSG) + sizeof(struct message)))) return E_OUTOFMEMORY;
546547
message->pMsg.dwSize = size;
547548
*msg = &message->pMsg;
548549

@@ -552,7 +553,7 @@ static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULO
552553
static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *msg)
553554
{
554555
struct performance *This = impl_from_IDirectMusicPerformance8(iface);
555-
DMUS_PMSGItem *message;
556+
struct message *message;
556557
HRESULT hr;
557558

558559
TRACE("(%p, %p)\n", This, msg);

0 commit comments

Comments
 (0)