]> Repos - portaudio/commitdiff
pa_mac_core: fix whitespace and missing semicolon
authorPhil Burk <philburk@mobileer.com>
Sat, 24 Sep 2016 15:53:28 +0000 (08:53 -0700)
committerPhil Burk <philburk@mobileer.com>
Sat, 24 Sep 2016 15:53:28 +0000 (08:53 -0700)
It compiled without the semicolon because it was followed by a VDBUG,
which was followed by a semicolon. The VDBUG was disabled so its
semicolon finished the line above.

src/hostapi/coreaudio/pa_mac_core.c
src/hostapi/coreaudio/pa_mac_core_blocking.c
test/patest_write_stop_hang_illegal.c

index 3fba82a3d7a5958c79a8c546b3d0b28ab0a5c9e2..257e9dedc3f66248b1108537d63bae7128c5e87f 100644 (file)
@@ -2789,12 +2789,12 @@ static PaError StopStream( PaStream *s )
     /* Tell WriteStream to stop filling the buffer. */
     stream->state = STOPPING;
 
-    if (stream->userOutChan > 0) /* Does this stream do output? */
+    if( stream->userOutChan > 0 ) /* Does this stream do output? */
     {
-        size_t maxHostFrames = MAX(stream->inputFramesPerBuffer, stream->outputFramesPerBuffer)
+        size_t maxHostFrames = MAX( stream->inputFramesPerBuffer, stream->outputFramesPerBuffer );
         VDBUG( ("Waiting for write buffer to be drained.\n") );
         paErr = waitUntilBlioWriteBufferIsEmpty( &stream->blio, stream->sampleRate,
-                                                maxHostFrames);
+                                                maxHostFrames );
         VDBUG( ( "waitUntilBlioWriteBufferIsEmpty returned %d\n", paErr ) );
     }
     return FinishStoppingStream( stream );
index 149d82c9cad6065fd6146b7bf09ed2a0a4cb389c..679c6ba0aec3e17a30bf9f6fae0434133852b65a 100644 (file)
@@ -500,7 +500,7 @@ PaError WriteStream( PaStream* stream,
                             unsigned long framesRequested )
 {
     PaMacCoreStream *macStream = (PaMacCoreStream*)stream;
-    PaMacBlio *blio = & macStream -> blio;
+    PaMacBlio *blio = &macStream->blio;
     char *cbuf = (char *) buffer;
     PaError ret = paNoError;
     VVDBUG(("WriteStream()\n"));
@@ -575,9 +575,10 @@ PaError WriteStream( PaStream* stream,
         ret = blio->statusFlags & paOutputUnderflow;
 
         /* report underflow only once: */
-        if( ret ) {
-          OSAtomicAnd32( (uint32_t)(~paOutputUnderflow), &blio->statusFlags );
-          ret = paOutputUnderflowed;
+        if( ret )
+        {
+            OSAtomicAnd32( (uint32_t)(~paOutputUnderflow), &blio->statusFlags );
+            ret = paOutputUnderflowed;
         }
     }
 
index 71e17de4e1d70b1027177e6030a48cd6f9b9eb8e..ed93425e33b9051e7e06b97706e0a055f0ebb874 100644 (file)
@@ -43,6 +43,7 @@
  */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <math.h>
 #include <memory.h>
 /* pthread may only be available on Mac and Linux. */