Christian Costa : dmusic: Cleanup IDirectMusicCollection_GetInstrument.
Alexandre Julliard
julliard at winehq.org
Fri May 18 14:09:15 CDT 2012
Module: wine
Branch: master
Commit: 495e3288dbd53570ded60c0b458aa3457dff7729
URL: http://source.winehq.org/git/wine.git/?a=commit;h=495e3288dbd53570ded60c0b458aa3457dff7729
Author: Christian Costa <titan.costa at gmail.com>
Date: Fri May 18 12:01:44 2012 +0200
dmusic: Cleanup IDirectMusicCollection_GetInstrument.
---
dlls/dmusic/collection.c | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c
index 5ef7d35..67670b1 100644
--- a/dlls/dmusic/collection.c
+++ b/dlls/dmusic/collection.c
@@ -103,30 +103,30 @@ static ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_Release(LP
}
/* IDirectMusicCollection Interface follows: */
-static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstrument(LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument)
+static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstrument(LPDIRECTMUSICCOLLECTION iface, DWORD patch, IDirectMusicInstrument** instrument)
{
- IDirectMusicCollectionImpl *This = impl_from_IDirectMusicCollection(iface);
- DMUS_PRIVATE_INSTRUMENTENTRY *tmpEntry;
- struct list *listEntry;
- DWORD dwInstPatch;
+ IDirectMusicCollectionImpl *This = impl_from_IDirectMusicCollection(iface);
+ DMUS_PRIVATE_INSTRUMENTENTRY *inst_entry;
+ struct list *list_entry;
+ DWORD inst_patch;
+
+ TRACE("(%p/%p)->(%u, %p)\n", iface, This, patch, instrument);
+
+ LIST_FOR_EACH(list_entry, &This->Instruments) {
+ inst_entry = LIST_ENTRY(list_entry, DMUS_PRIVATE_INSTRUMENTENTRY, entry);
+ IDirectMusicInstrument_GetPatch(inst_entry->pInstrument, &inst_patch);
+ if (patch == inst_patch) {
+ *instrument = inst_entry->pInstrument;
+ IDirectMusicInstrument_AddRef(inst_entry->pInstrument);
+ IDirectMusicInstrumentImpl_Custom_Load(inst_entry->pInstrument, This->pStm);
+ TRACE(": returning instrument %p\n", *instrument);
+ return S_OK;
+ }
+ }
- TRACE("(%p, %d, %p)\n", This, dwPatch, ppInstrument);
-
- LIST_FOR_EACH (listEntry, &This->Instruments) {
- tmpEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry);
- IDirectMusicInstrument_GetPatch (tmpEntry->pInstrument, &dwInstPatch);
- if (dwPatch == dwInstPatch) {
- *ppInstrument = tmpEntry->pInstrument;
- IDirectMusicInstrument_AddRef (tmpEntry->pInstrument);
- IDirectMusicInstrumentImpl_Custom_Load (tmpEntry->pInstrument, This->pStm); /* load instrument before returning it */
- TRACE(": returning instrument %p\n", *ppInstrument);
- return S_OK;
- }
-
- }
- TRACE(": instrument not found\n");
-
- return DMUS_E_INVALIDPATCH;
+ TRACE(": instrument not found\n");
+
+ return DMUS_E_INVALIDPATCH;
}
static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_EnumInstrument(LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen)
More information about the wine-cvs
mailing list