Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PaStream type-safe #917

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/portaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
Pa_GetStreamTime, Pa_GetStreamCpuLoad

*/
typedef void PaStream;
typedef struct PaStream PaStream;


/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream()
Expand Down
2 changes: 1 addition & 1 deletion src/common/pa_front.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static void CloseOpenStreams( void )
logic is used for automatically closed streams */

while( firstOpenStream_ != NULL )
Pa_CloseStream( firstOpenStream_ );
Pa_CloseStream( (PaStream*)firstOpenStream_ );
}


Expand Down
4 changes: 2 additions & 2 deletions src/hostapi/alsa/pa_linux_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@ static PaError StartStream( PaStream *s )
error:
if( streamStarted )
{
AbortStream( stream );
AbortStream( (PaStream*)stream );
}
stream->isActive = 0;

Expand Down Expand Up @@ -4549,7 +4549,7 @@ static PaError WriteStream( PaStream* s, const void *buffer, unsigned long frame
/* Start stream after one period of samples worth */

/* Frames residing in buffer */
PA_ENSURE( err = GetStreamWriteAvailable( stream ) );
PA_ENSURE( err = GetStreamWriteAvailable( (PaStream*)stream ) );
framesAvail = err;
hwAvail = stream->playback.alsaBufferSize - framesAvail;

Expand Down
2 changes: 1 addition & 1 deletion src/hostapi/coreaudio/pa_mac_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
return result;

error:
CloseStream( stream );
CloseStream( (PaStream*)stream );
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hostapi/jack/pa_jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ static PaError RealStop( PaJackStream *stream, int abort )
int i;

if( stream->isBlockingStream )
BlockingWaitEmpty ( stream );
BlockingWaitEmpty ( (PaStream*)stream );

ASSERT_CALL( pthread_mutex_lock( &stream->hostApi->mtx ), 0 );
if( abort )
Expand Down
2 changes: 1 addition & 1 deletion src/hostapi/pulseaudio/pa_linux_pulseaudio_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ PaError PaPulseAudio_StartStreamCb( PaStream * s )

if( pulseaudioPlaybackStarted || pulseaudioRecordStarted )
{
PaPulseAudio_AbortStreamCb( stream );
PaPulseAudio_AbortStreamCb( (PaStream*)stream );
}

stream->isActive = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/hostapi/sndio/pa_sndio.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream
sndioStream->mode = mode;
sndioStream->hdl = hdl;
sndioStream->par = par;
*paStream = sndioStream;
*paStream = (PaStream*)sndioStream;
PA_DEBUG( ( "OpenStream: done\n" ) );
return paNoError;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hostapi/wasapi/pa_win_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4134,7 +4134,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
error:

if (stream != NULL)
CloseStream(stream);
CloseStream((PaStream*)stream);

return result;
}
Expand Down
Loading