]> Repos - portaudio/commitdiff
remove trailing whitespace from end of lines
authorRoss Bencina <rossb@audiomulch.com>
Fri, 26 Aug 2016 09:33:31 +0000 (19:33 +1000)
committerRoss Bencina <rossb@audiomulch.com>
Fri, 26 Aug 2016 09:33:31 +0000 (19:33 +1000)
src/common/pa_front.c

index 06327109efc4435e31c8f6b3d220da9115870101..782879bd3235505a287f8189d64a96fa751d2f70 100644 (file)
  */
 
 /*
- * The text above constitutes the entire PortAudio license; however, 
+ * The text above constitutes the entire PortAudio license; however,
  * the PortAudio community also makes the following non-binding requests:
  *
  * Any person wishing to distribute modifications to the Software is
  * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
  * license above.
  */
 
 /** @file
  @ingroup common_src
 
- @brief Implements PortAudio API functions defined in portaudio.h, checks 
+ @brief Implements PortAudio API functions defined in portaudio.h, checks
  some errors, delegates platform-specific behavior to host API implementations.
- Implements the functions defined in the PortAudio API (portaudio.h), 
- validates some parameters and checks for state inconsistencies before 
- forwarding API requests to specific Host API implementations (via the 
- interface declared in pa_hostapi.h), and Streams (via the interface 
+
+ Implements the functions defined in the PortAudio API (portaudio.h),
+ validates some parameters and checks for state inconsistencies before
+ forwarding API requests to specific Host API implementations (via the
+ interface declared in pa_hostapi.h), and Streams (via the interface
  declared in pa_stream.h).
 
  This file manages initialization and termination of Host API
 
 /**
  * This is a combination of paVersionMajor, paVersionMinor and paVersionSubMinor.
- * It will always increase so that version numbers can be compared as integers to 
+ * It will always increase so that version numbers can be compared as integers to
  * see which is later.
  */
 #define paVersion  paMakeVersionNumber(paVersionMajor, paVersionMinor, paVersionSubMinor)
@@ -209,7 +209,7 @@ static PaError InitializeHostApis( void )
     if( !hostApis_ )
     {
         result = paInsufficientMemory;
-        goto error; 
+        goto error;
     }
 
     hostApisCount_ = 0;
@@ -235,11 +235,11 @@ static PaError InitializeHostApis( void )
             assert( hostApi->info.defaultInputDevice < hostApi->info.deviceCount );
             assert( hostApi->info.defaultOutputDevice < hostApi->info.deviceCount );
 
-            /* the first successfully initialized host API with a default input *or* 
+            /* the first successfully initialized host API with a default input *or*
                output device is used as the default host API.
             */
             if( (defaultHostApiIndex_ == -1) &&
-                    ( hostApi->info.defaultInputDevice != paNoDevice 
+                    ( hostApi->info.defaultInputDevice != paNoDevice
                         || hostApi->info.defaultOutputDevice != paNoDevice ) )
             {
                 defaultHostApiIndex_ = hostApisCount_;
@@ -277,7 +277,7 @@ error:
     <device> belongs and returns it. if <hostSpecificDeviceIndex> is
     non-null, the host specific device index is returned in it.
     returns -1 if <device> is out of range.
+
 */
 static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex )
 {
@@ -367,7 +367,7 @@ PaError Pa_Initialize( void )
     {
         PA_VALIDATE_TYPE_SIZES;
         PA_VALIDATE_ENDIANNESS;
-        
+
         PaUtil_InitializeClock();
         PaUtil_ResetTraceMessages();
 
@@ -454,11 +454,11 @@ const char *Pa_GetErrorText( PaError errorCode )
     case paCanNotWriteToAnInputOnlyStream:      result = "Can't write to an input only stream"; break;
     case paIncompatibleStreamHostApi: result = "Incompatible stream host API"; break;
     case paBadBufferPtr:             result = "Bad buffer pointer"; break;
-    default:                         
+    default:
                if( errorCode > 0 )
-                       result = "Invalid error code (value greater than zero)"; 
+                       result = "Invalid error code (value greater than zero)";
         else
-                       result = "Invalid error code"; 
+                       result = "Invalid error code";
         break;
     }
     return result;
@@ -469,7 +469,7 @@ PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type )
 {
     PaHostApiIndex result;
     int i;
-    
+
     PA_LOGAPI_ENTER_PARAMS( "Pa_HostApiTypeIdToHostApiIndex" );
     PA_LOGAPI(("\tPaHostApiTypeId type: %d\n", type ));
 
@@ -480,14 +480,14 @@ PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type )
     else
     {
         result = paHostApiNotFound;
-        
+
         for( i=0; i < hostApisCount_; ++i )
         {
             if( hostApis_[i]->info.type == type )
             {
                 result = i;
                 break;
-            }         
+            }
         }
     }
 
@@ -502,7 +502,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
 {
     PaError result;
     int i;
-    
+
     if( !PA_IS_INITIALISED_ )
     {
         result = paNotInitialized;
@@ -510,7 +510,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
     else
     {
         result = paHostApiNotFound;
-                
+
         for( i=0; i < hostApisCount_; ++i )
         {
             if( hostApis_[i]->info.type == type )
@@ -531,7 +531,7 @@ PaError PaUtil_DeviceIndexToHostApiDeviceIndex(
 {
     PaError result;
     PaDeviceIndex x;
-    
+
     x = device - hostApi->privatePaFrontInfo.baseDeviceIndex;
 
     if( x < 0 || x >= hostApi->info.deviceCount )
@@ -616,7 +616,7 @@ const PaHostApiInfo* Pa_GetHostApiInfo( PaHostApiIndex hostApi )
     else if( hostApi < 0 || hostApi >= hostApisCount_ )
     {
         info = NULL;
-        
+
         PA_LOGAPI(("Pa_GetHostApiInfo returned:\n" ));
         PA_LOGAPI(("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n" ));
 
@@ -725,7 +725,7 @@ PaDeviceIndex Pa_GetDefaultOutputDevice( void )
 {
     PaHostApiIndex hostApi;
     PaDeviceIndex result;
-    
+
     PA_LOGAPI_ENTER( "Pa_GetDefaultOutputDevice" );
 
     hostApi = Pa_GetDefaultHostApi();
@@ -809,7 +809,7 @@ static int SampleFormatIsValid( PaSampleFormat format )
     ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream()
     conform to the expected values as described below. This function is
     also designed to be used with the proposed Pa_IsFormatSupported() function.
-    
+
     There are basically two types of validation that could be performed:
     Generic conformance validation, and device capability mismatch
     validation. This function performs only generic conformance validation.
@@ -818,21 +818,21 @@ static int SampleFormatIsValid( PaSampleFormat format )
     combinations of parameters - for example, even if the sampleRate
     seems ok, it might not be for a duplex stream - we have no way of
     checking this in an API-neutral way, so we don't try.
+
     On success the function returns PaNoError and fills in hostApi,
     hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure
     the function returns an error code indicating the first encountered
     parameter error.
+
+
     If ValidateOpenStreamParameters() returns paNoError, the following
     assertions are guaranteed to be true.
+
     - at least one of inputParameters & outputParmeters is valid (not NULL)
 
     - if inputParameters & outputParameters are both valid, that
         inputParameters->device & outputParameters->device  both use the same host api
+
     PaDeviceIndex inputParameters->device
         - is within range (0 to Pa_GetDeviceCount-1) Or:
         - is paUseHostApiSpecificDeviceSpecification and
@@ -842,30 +842,30 @@ static int SampleFormatIsValid( PaSampleFormat format )
     int inputParameters->channelCount
         - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0
         - upper bound is NOT validated against device capabilities
+
     PaSampleFormat inputParameters->sampleFormat
         - is one of the sample formats defined in portaudio.h
 
     void *inputParameters->hostApiSpecificStreamInfo
         - if supplied its hostApi field matches the input device's host Api
+
     PaDeviceIndex outputParmeters->device
         - is within range (0 to Pa_GetDeviceCount-1)
+
     int outputParmeters->channelCount
         - if inputDevice is valid, channelCount is > 0
         - upper bound is NOT validated against device capabilities
+
     PaSampleFormat outputParmeters->sampleFormat
         - is one of the sample formats defined in portaudio.h
-        
+
     void *outputParmeters->hostApiSpecificStreamInfo
         - if supplied its hostApi field matches the output device's host Api
+
     double sampleRate
         - is not an 'absurd' rate (less than 1000. or greater than 384000.)
         - sampleRate is NOT validated against device capabilities
+
     PaStreamFlags streamFlags
         - unused platform neutral flags are zero
         - paNeverDropInput is only used for full-duplex callback streams with
@@ -992,7 +992,7 @@ static PaError ValidateOpenStreamParameters(
                         != (*hostApi)->info.type )
                     return paIncompatibleHostApiSpecificStreamInfo;
             }
-        }   
+        }
 
         if( (inputParameters != NULL) && (outputParameters != NULL) )
         {
@@ -1001,8 +1001,8 @@ static PaError ValidateOpenStreamParameters(
                 return paBadIODeviceCombination;
         }
     }
-    
-    
+
+
     /* Check for absurd sample rates. */
     if( (sampleRate < 1000.0) || (sampleRate > 384000.0) )
         return paInvalidSampleRate;
@@ -1024,7 +1024,7 @@ static PaError ValidateOpenStreamParameters(
         if( framesPerBuffer != paFramesPerBufferUnspecified )
             return paInvalidFlag;
     }
-    
+
     return paNoError;
 }
 
@@ -1064,7 +1064,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
         PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
         PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
     }
-    
+
     PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
 #endif
 
@@ -1087,7 +1087,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
         PA_LOGAPI_EXIT_PAERROR( "Pa_IsFormatSupported", result );
         return result;
     }
-    
+
 
     if( inputParameters )
     {
@@ -1174,7 +1174,7 @@ PaError Pa_OpenStream( PaStream** stream,
         PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
         PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
     }
-    
+
     PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
     PA_LOGAPI(("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ));
     PA_LOGAPI(("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ));
@@ -1221,7 +1221,7 @@ PaError Pa_OpenStream( PaStream** stream,
         PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ));
         return result;
     }
-    
+
 
     if( inputParameters )
     {
@@ -1295,8 +1295,8 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
     {
         hostApiInputParameters.device = Pa_GetDefaultInputDevice();
                if( hostApiInputParameters.device == paNoDevice )
-                       return paDeviceUnavailable; 
-       
+                       return paDeviceUnavailable;
+
         hostApiInputParameters.channelCount = inputChannelCount;
         hostApiInputParameters.sampleFormat = sampleFormat;
         /* defaultHighInputLatency is used below instead of
@@ -1304,7 +1304,7 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
            stream to work reliably than it is for it to work with the lowest
            latency.
          */
-        hostApiInputParameters.suggestedLatency = 
+        hostApiInputParameters.suggestedLatency =
              Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency;
         hostApiInputParameters.hostApiSpecificStreamInfo = NULL;
         hostApiInputParametersPtr = &hostApiInputParameters;
@@ -1318,7 +1318,7 @@ PaError Pa_OpenDefaultStream( PaStream** stream,
     {
         hostApiOutputParameters.device = Pa_GetDefaultOutputDevice();
                if( hostApiOutputParameters.device == paNoDevice )
-                       return paDeviceUnavailable; 
+                       return paDeviceUnavailable;
 
         hostApiOutputParameters.channelCount = outputChannelCount;
         hostApiOutputParameters.sampleFormat = sampleFormat;
@@ -1702,7 +1702,7 @@ PaError Pa_WriteStream( PaStream* stream,
             else if( result == 1 )
             {
                 result = paStreamIsStopped;
-            }  
+            }
         }
     }