Ken Thomases : winecoreaudio: Eliminate unnecessary variable, unreachable code, unused retval.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 21 10:36:32 CST 2006


Module: wine
Branch: master
Commit: aef21c19c1d7c97b129f13391d1d8b1c5b43322a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=aef21c19c1d7c97b129f13391d1d8b1c5b43322a

Author: Ken Thomases <ken at codeweavers.com>
Date:   Thu Dec 21 03:48:52 2006 -0600

winecoreaudio: Eliminate unnecessary variable, unreachable code, unused retval.

---

 dlls/winmm/winecoreaudio/audio.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c
index ac3095d..265b9af 100644
--- a/dlls/winmm/winecoreaudio/audio.c
+++ b/dlls/winmm/winecoreaudio/audio.c
@@ -179,7 +179,7 @@ static WINE_WAVEOUT WOutDev   [MAX_WAVEO
 
 static CFMessagePortRef Port_SendToMessageThread;
 
-static LPWAVEHDR wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo);
+static void wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo);
 static DWORD wodHelper_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force);
 
 extern int AudioUnit_CreateDefaultAudioUnit(void *wwo, AudioUnit *au);
@@ -888,22 +888,14 @@ static void wodHelper_CheckForLoopBegin(
 * Advance the play pointer to the next waveheader, looping if required.
 * Call from AudioUnit IO thread can't use Wine debug channels.
 */
-static LPWAVEHDR wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo)
+static void wodHelper_PlayPtrNext(WINE_WAVEOUT* wwo)
 {
-    LPWAVEHDR lpWaveHdr;
     BOOL didLoopBack = FALSE;
 
     pthread_mutex_lock(&wwo->lock);
     
-    lpWaveHdr = wwo->lpPlayPtr;
-    if (!lpWaveHdr)
-    {
-        pthread_mutex_unlock(&wwo->lock);
-        return NULL;
-    }
-
     wwo->dwPartialOffset = 0;
-    if ((lpWaveHdr->dwFlags & WHDR_ENDLOOP) && wwo->lpLoopPtr)
+    if ((wwo->lpPlayPtr->dwFlags & WHDR_ENDLOOP) && wwo->lpLoopPtr)
     {
         /* We're at the end of a loop, loop if required */
         if (wwo->dwLoops > 1)
@@ -920,11 +912,9 @@ static LPWAVEHDR wodHelper_PlayPtrNext(W
     if (!didLoopBack)
     {
         /* We didn't loop back.  Advance to the next wave header */
-        lpWaveHdr = lpWaveHdr->lpNext;
-
-        wwo->lpPlayPtr = lpWaveHdr;
+        wwo->lpPlayPtr = wwo->lpPlayPtr->lpNext;
 
-        if (!lpWaveHdr)
+        if (!wwo->lpPlayPtr)
         {
             OSStatus status;
             wwo->state = WINE_WS_STOPPED;
@@ -938,7 +928,6 @@ static LPWAVEHDR wodHelper_PlayPtrNext(W
     }
     
     pthread_mutex_unlock(&wwo->lock);
-    return lpWaveHdr;
 }
 
 /* if force is TRUE then notify the client that all the headers were completed




More information about the wine-cvs mailing list