Package: libportaudio0 Version: 18.1-6 Severity: important Tags: patch -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
this code is riddled with wordsize-related bugs. the best part is that they *tried* to do the right thing by having bit-size typedefs, but failed miserably: #ifndef uint32 typedef unsigned long uint32; #endif .... portaudio authors, meet int32_t. int32_t, meet portaudio authors. attached is a patch, which after applying lets me play transcend and mixxx (both portaudio apps) on my amd64 system without my ears bleeding from static. basically, i fixed the above typedefs, and then did something like: find . -type f \( -name '*.c' -o -name '*.h' \) -print0 | xargs -0 -n1 sed -i -e 's/unsigned long/uint32_t/g' across the source code (which is why there are some unused windows and mac files touched), and entered in inttypes.h in a few key locations. you might want to test this on an x86 before applying it, and also note that it probably breaks the ABI for the library so you may need to change your soname and have the reverse dependencies rebuilt. sean - -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.21-2-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages libportaudio0 depends on: ii libc6 2.6-2 GNU C Library: Shared libraries libportaudio0 recommends no packages. - -- no debconf information -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGm86YynjLPm522B0RAkAZAJ0cmhs8DoNDeFAMMps8PkJCbMG3OwCeMHfO GqCqSY44urN0PCBYiIzB9qM= =tTHW -----END PGP SIGNATURE-----
only in patch2: unchanged: --- portaudio-18.1.orig/pablio/pablio.c +++ portaudio-18.1/pablio/pablio.c @@ -57,7 +57,7 @@ /************************************************************************/ static int blockingIOCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); static PaError PABLIO_InitFIFO( RingBuffer *rbuf, long numFrames, long bytesPerFrame ); static PaError PABLIO_TermFIFO( RingBuffer *rbuf ); @@ -70,7 +70,7 @@ * Read and write data only if there is room in FIFOs. */ static int blockingIOCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { PABLIO_Stream *data = (PABLIO_Stream*)userData; @@ -173,7 +173,7 @@ } /************************************************************/ -static unsigned long RoundUpToNextPowerOf2( unsigned long n ) +static uint32_t RoundUpToNextPowerOf2( uint32_t n ) { long numBits = 0; if( ((n-1) & n) == 0) return n; /* Already Power of two. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_common/portaudio.h +++ portaudio-18.1/pa_common/portaudio.h @@ -39,6 +39,8 @@ * */ +#include <inttypes.h> + typedef int PaError; typedef enum { paNoError = 0, @@ -82,7 +84,7 @@ */ -long Pa_GetHostError( void ); +uint32_t Pa_GetHostError( void ); /* Pa_GetErrorText() translates the supplied PortAudio error number @@ -109,7 +111,7 @@ */ -typedef unsigned long PaSampleFormat; +typedef uint32_t PaSampleFormat; #define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ #define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ #define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ @@ -220,7 +222,7 @@ typedef int (PortAudioCallback)( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); @@ -236,7 +238,7 @@ #define paClipOff (1<<0) /* disable default clipping of out of range samples */ #define paDitherOff (1<<1) /* disable default dithering */ #define paPlatformSpecificFlags (0x00010000) -typedef unsigned long PaStreamFlags; +typedef uint32_t PaStreamFlags; /* A single PortAudioStream provides multiple channels of real-time @@ -332,8 +334,8 @@ PaSampleFormat outputSampleFormat, void *outputDriverInfo, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PaStreamFlags streamFlags, PortAudioCallback *callback, void *userData ); @@ -357,8 +359,8 @@ int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PortAudioCallback *callback, void *userData ); only in patch2: unchanged: --- portaudio-18.1.orig/pa_common/pa_host.h +++ portaudio-18.1/pa_common/pa_host.h @@ -49,16 +49,16 @@ #endif #ifndef int32 - typedef long int32; + typedef int32_t int32; #endif #ifndef uint32 - typedef unsigned long uint32; + typedef uint32_t uint32; #endif #ifndef int16 - typedef short int16; + typedef int16_t int16; #endif #ifndef uint16 - typedef unsigned short uint16; + typedef uint16_t uint16; #endif /* Used to convert between various sample formats. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_common/pa_lib.c +++ portaudio-18.1/pa_common/pa_lib.c @@ -141,9 +141,9 @@ PaSampleFormat outputSampleFormat, void *outputDriverInfo, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, - unsigned long streamFlags, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, + PaStreamFlags streamFlags, PortAudioCallback *callback, void *userData ) { @@ -307,8 +307,8 @@ int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PortAudioCallback *callback, void *userData ) { @@ -498,9 +498,9 @@ #define PA_DITHER_SCALE (1.0f / ((1<<PA_DITHER_BITS)-1)) long PaConvert_TriangularDither( void ) { - static unsigned long previous = 0; - static unsigned long randSeed1 = 22222; - static unsigned long randSeed2 = 5555555; + static uint32_t previous = 0; + static uint32_t randSeed1 = 22222; + static uint32_t randSeed2 = 5555555; long current, highPass; /* Generate two random numbers. */ randSeed1 = (randSeed1 * 196314165) + 907633515; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_sine8.c +++ portaudio-18.1/pa_tests/patest_sine8.c @@ -66,7 +66,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_mono.c +++ portaudio-18.1/pa_tests/patest_mono.c @@ -62,12 +62,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest1.c +++ portaudio-18.1/pa_tests/patest1.c @@ -21,14 +21,14 @@ } patest1data; static int patest1Callback( void *inputBuffer, void *outputBuffer, - unsigned long bufferFrames, + uint32_t bufferFrames, PaTimestamp outTime, void *userData ) { patest1data *data = (patest1data*)userData; float *in = (float*)inputBuffer; float *out = (float*)outputBuffer; int framesToCalc = bufferFrames; - unsigned long i; + uint32_t i; int finished = 0; /* Check to see if any input data is available. */ if(inputBuffer == NULL) return 0; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_test1.c +++ portaudio-18.1/pa_tests/debug_test1.c @@ -21,14 +21,14 @@ } patest1data; static int patest1Callback( void *inputBuffer, void *outputBuffer, - unsigned long bufferFrames, + uint32_t bufferFrames, PaTimestamp outTime, void *userData ) { patest1data *data = (patest1data*)userData; float *in = (float*)inputBuffer; float *out = (float*)outputBuffer; int framesToCalc = bufferFrames; - unsigned long i; + uint32_t i; int finished = 0; if(inputBuffer == NULL) return 0; if( data->sampsToGo < bufferFrames ) only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_record.c +++ portaudio-18.1/pa_tests/debug_record.c @@ -86,7 +86,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int recordCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; @@ -95,7 +95,7 @@ long framesToCalc; long i; int finished; - unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + uint32_t framesLeft = data->maxFrameIndex - data->frameIndex; (void) outputBuffer; /* Prevent unused variable warnings. */ (void) outTime; @@ -135,7 +135,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int playCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_multi_sine.c +++ portaudio-18.1/pa_tests/patest_multi_sine.c @@ -60,7 +60,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_multi_in.c +++ portaudio-18.1/pa_tests/debug_multi_in.c @@ -61,7 +61,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_ringmix.c +++ portaudio-18.1/pa_tests/patest_ringmix.c @@ -4,7 +4,7 @@ #include "portaudio.h" /* This will be called asynchronously by the PortAudio engine. */ static int myCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, PaTimestamp outTime, void *userData ) + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { float *out = (float *) outputBuffer; float *in = (float *) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_sine_time.c +++ portaudio-18.1/pa_tests/patest_sine_time.c @@ -62,7 +62,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_sync.c +++ portaudio-18.1/pa_tests/patest_sync.c @@ -67,12 +67,12 @@ int beepCount; } paTestData; -static unsigned long GenerateRandomNumber( void ); +static uint32_t GenerateRandomNumber( void ); /************************************************************/ /* Calculate pseudo-random 32 bit number based on linear congruential method. */ -static unsigned long GenerateRandomNumber( void ) +static uint32_t GenerateRandomNumber( void ) { - static unsigned long randSeed = 22222; /* Change this for different random sequences. */ + static uint32_t randSeed = 22222; /* Change this for different random sequences. */ randSeed = (randSeed * 196314165) + 907633515; return randSeed; } @@ -81,7 +81,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { /* Cast data passed through stream to our structure. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_multi_out.c +++ portaudio-18.1/pa_tests/debug_multi_out.c @@ -59,7 +59,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_srate.c +++ portaudio-18.1/pa_tests/debug_srate.c @@ -76,7 +76,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int recordCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData *) userData; @@ -95,7 +95,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int playCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData *) userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_two_rates.c +++ portaudio-18.1/pa_tests/patest_two_rates.c @@ -58,7 +58,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_dither.c +++ portaudio-18.1/pa_tests/patest_dither.c @@ -53,14 +53,14 @@ paTestData; PaError PlaySine( paTestData *data, PaStreamFlags flags, float amplitude ); static int sineCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /* This routine will be called by the PortAudio engine when audio is needed. ** It may called at interrupt level on some machines so don't do anything ** that could mess up the system like calling malloc() or free(). */ static int sineCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_sine_getchar.c +++ portaudio-18.1/pa_tests/debug_sine_getchar.c @@ -63,12 +63,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_record_reuse.c +++ portaudio-18.1/pa_tests/debug_record_reuse.c @@ -71,16 +71,16 @@ ** that could mess up the system like calling malloc() or free(). */ static int recordCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; SAMPLE *rptr = (SAMPLE*)inputBuffer; SAMPLE *wptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; long framesToCalc; - unsigned long i; + uint32_t i; int finished; - unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + uint32_t framesLeft = data->maxFrameIndex - data->frameIndex; (void) outputBuffer; /* Prevent unused variable warnings. */ (void) outTime; @@ -120,13 +120,13 @@ ** that could mess up the system like calling malloc() or free(). */ static int playCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; SAMPLE *rptr = &data->recordedSamples[data->frameIndex * data->samplesPerFrame]; SAMPLE *wptr = (SAMPLE*)outputBuffer; - unsigned long i; + uint32_t i; int finished; unsigned int framesLeft = data->maxFrameIndex - data->frameIndex; if( outputBuffer == NULL ) return 0; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_hang.c +++ portaudio-18.1/pa_tests/patest_hang.c @@ -58,12 +58,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; double phaseInc = 0.02; double phase = data->phase; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_saw.c +++ portaudio-18.1/pa_tests/patest_saw.c @@ -49,7 +49,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { /* Cast data passed through stream to our structure. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_toomanysines.c +++ portaudio-18.1/pa_tests/patest_toomanysines.c @@ -59,12 +59,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int j; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/pa_minlat.c +++ portaudio-18.1/pa_tests/pa_minlat.c @@ -55,7 +55,7 @@ /* Very simple synthesis routine to generate two sine waves. */ static int paminlatCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_underflow.c +++ portaudio-18.1/pa_tests/patest_underflow.c @@ -64,12 +64,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_pink.c +++ portaudio-18.1/pa_tests/patest_pink.c @@ -58,15 +58,15 @@ } PinkNoise; /* Prototypes */ -static unsigned long GenerateRandomNumber( void ); +static uint32_t GenerateRandomNumber( void ); void InitializePinkNoise( PinkNoise *pink, int numRows ); float GeneratePinkNoise( PinkNoise *pink ); /************************************************************/ /* Calculate pseudo-random 32 bit number based on linear congruential method. */ -static unsigned long GenerateRandomNumber( void ) +static uint32_t GenerateRandomNumber( void ) { /* Change this seed for different random sequences. */ - static unsigned long randSeed = 22222; + static uint32_t randSeed = 22222; randSeed = (randSeed * 196314165) + 907633515; return randSeed; } @@ -148,7 +148,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { int finished; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_sine_formats.c +++ portaudio-18.1/pa_tests/patest_sine_formats.c @@ -105,7 +105,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_stop.c +++ portaudio-18.1/pa_tests/patest_stop.c @@ -102,7 +102,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_sine.c +++ portaudio-18.1/pa_tests/debug_sine.c @@ -89,7 +89,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_clip.c +++ portaudio-18.1/pa_tests/patest_clip.c @@ -51,13 +51,13 @@ int right_phase; } paTestData; -PaError PlaySine( paTestData *data, unsigned long flags, float amplitude ); +PaError PlaySine( paTestData *data, uint32_t flags, float amplitude ); /* This routine will be called by the PortAudio engine when audio is needed. ** It may called at interrupt level on some machines so don't do anything ** that could mess up the system like calling malloc() or free(). */ static int sineCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; @@ -118,7 +118,7 @@ return 1; } /*****************************************************************************/ -PaError PlaySine( paTestData *data, unsigned long flags, float amplitude ) +PaError PlaySine( paTestData *data, uint32_t flags, float amplitude ) { PortAudioStream *stream; PaError err; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_latency.c +++ portaudio-18.1/pa_tests/patest_latency.c @@ -81,7 +81,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_record.c +++ portaudio-18.1/pa_tests/patest_record.c @@ -79,7 +79,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int recordCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; @@ -88,7 +88,7 @@ long framesToRecord; long i; int finished; - unsigned long framesLeft = data->maxFrameIndex - data->frameIndex; + uint32_t framesLeft = data->maxFrameIndex - data->frameIndex; int samplesToRecord; (void) outputBuffer; /* Prevent unused variable warnings. */ @@ -130,7 +130,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int playCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/paqa_errs.c +++ portaudio-18.1/pa_tests/paqa_errs.c @@ -45,7 +45,7 @@ #define NUM_BUFFERS (0) typedef struct PaQaData { - unsigned long framesLeft; + uint32_t framesLeft; int numChannels; int bytesPerSample; int mode; @@ -58,7 +58,7 @@ static int TestBadOpens( void ); static int TestBadActions( void ); static int QaCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /****************************************** Globals ***********/ static int gNumPassed = 0; @@ -95,10 +95,10 @@ ** that could mess up the system like calling malloc() or free(). */ static int QaCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { - unsigned long i; + uint32_t i; unsigned char *out = (unsigned char *) outputBuffer; PaQaData *data = (PaQaData *) userData; (void) inputBuffer; /* Prevent "unused variable" warnings. */ @@ -107,7 +107,7 @@ /* Zero out buffer so we don't hear terrible noise. */ if( data->mode == MODE_OUTPUT ) { - unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + uint32_t numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; for( i=0; i<numBytes; i++ ) { *out++ = 0; @@ -145,7 +145,7 @@ PaError result; PaQaData myData; /* Setup data for synthesis thread. */ - myData.framesLeft = (unsigned long) (SAMPLE_RATE * 100); /* 100 seconds */ + myData.framesLeft = (uint32_t) (SAMPLE_RATE * 100); /* 100 seconds */ myData.numChannels = 1; myData.mode = MODE_OUTPUT; HOPEFOR( "No devices specified.",( @@ -305,7 +305,7 @@ PaError result; PaQaData myData; /* Setup data for synthesis thread. */ - myData.framesLeft = (unsigned long) (SAMPLE_RATE * 100); /* 100 seconds */ + myData.framesLeft = (uint32_t) (SAMPLE_RATE * 100); /* 100 seconds */ myData.numChannels = 1; myData.mode = MODE_OUTPUT; /* Default output. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/pa_fuzz.c +++ portaudio-18.1/pa_tests/pa_fuzz.c @@ -49,7 +49,7 @@ float CubicAmplifier( float input ); static int fuzzCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /* Non-linear amplifier with soft distortion curve. */ @@ -77,7 +77,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int fuzzCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { SAMPLE *out = (SAMPLE*)outputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/paqa_devs.c +++ portaudio-18.1/pa_tests/paqa_devs.c @@ -44,7 +44,7 @@ #define MODE_OUTPUT (1) typedef struct PaQaData { - unsigned long framesLeft; + uint32_t framesLeft; int numChannels; int bytesPerSample; int mode; @@ -59,7 +59,7 @@ static int TestAdvance( int mode, PaDeviceID deviceID, double sampleRate, int numChannels, PaSampleFormat format ); static int QaCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /****************************************** Globals ***********/ @@ -90,10 +90,10 @@ ** that could mess up the system like calling malloc() or free(). */ static int QaCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { - unsigned long i; + uint32_t i; short phase; PaQaData *data = (PaQaData *) userData; (void) inputBuffer; @@ -152,7 +152,7 @@ default: { unsigned char *out = (unsigned char *) outputBuffer; - unsigned long numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; + uint32_t numBytes = framesPerBuffer * data->numChannels * data->bytesPerSample; for( i=0; i<numBytes; i++ ) { *out++ = 0; @@ -254,7 +254,7 @@ deviceID, sampleRate, numChannels, format); fflush(stdout); /* Setup data for synthesis thread. */ - myData.framesLeft = (unsigned long) (sampleRate * 100); /* 100 seconds */ + myData.framesLeft = (uint32_t) (sampleRate * 100); /* 100 seconds */ myData.numChannels = numChannels; myData.mode = mode; myData.format = format; @@ -292,7 +292,7 @@ if( stream ) { PaTimestamp oldStamp, newStamp; - unsigned long oldFrames; + uint32_t oldFrames; int minDelay = ( mode == MODE_INPUT ) ? 1000 : 400; int minNumBuffers = Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, sampleRate ); int msec = (int) ((minNumBuffers * 3 * 1000.0 * FRAMES_PER_BUFFER) / sampleRate); only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_wire.c +++ portaudio-18.1/pa_tests/patest_wire.c @@ -60,7 +60,7 @@ typedef short SAMPLE; #endif static int wireCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /* This routine will be called by the PortAudio engine when audio is needed. @@ -68,7 +68,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int wireCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { SAMPLE *out = (SAMPLE*)outputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_buffer.c +++ portaudio-18.1/pa_tests/patest_buffer.c @@ -58,14 +58,14 @@ PaError TestOnce( int buffersize ); static int paSineCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /* This routine will be called by the PortAudio engine when audio is needed. ** It may called at interrupt level on some machines so don't do anything ** that could mess up the system like calling malloc() or free(). */ static int paSineCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_longsine.c +++ portaudio-18.1/pa_tests/patest_longsine.c @@ -57,7 +57,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_leftright.c +++ portaudio-18.1/pa_tests/patest_leftright.c @@ -60,12 +60,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_convert.c +++ portaudio-18.1/pa_tests/debug_convert.c @@ -54,7 +54,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_dual.c +++ portaudio-18.1/pa_tests/debug_dual.c @@ -85,12 +85,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_maxsines.c +++ portaudio-18.1/pa_tests/patest_maxsines.c @@ -83,7 +83,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; @@ -91,7 +91,7 @@ float outSample; float scaler; int numForScale; - unsigned long i; + uint32_t i; int j; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_sine_amp.c +++ portaudio-18.1/pa_tests/debug_sine_amp.c @@ -61,7 +61,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_many.c +++ portaudio-18.1/pa_tests/patest_many.c @@ -53,14 +53,14 @@ paTestData; PaError TestOnce( void ); static int patest1Callback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); /* This routine will be called by the PortAudio engine when audio is needed. ** It may called at interrupt level on some machines so don't do anything ** that could mess up the system like calling malloc() or free(). */ static int patest1Callback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/patest_sine.c +++ portaudio-18.1/pa_tests/patest_sine.c @@ -64,12 +64,12 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; float *out = (float*)outputBuffer; - unsigned long i; + uint32_t i; int finished = 0; (void) outTime; /* Prevent unused variable warnings. */ (void) inputBuffer; only in patch2: unchanged: --- portaudio-18.1.orig/pa_tests/debug_sine_formats.c +++ portaudio-18.1/pa_tests/debug_sine_formats.c @@ -99,7 +99,7 @@ ** that could mess up the system like calling malloc() or free(). */ static int patestCallback( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ) { paTestData *data = (paTestData*)userData; only in patch2: unchanged: --- portaudio-18.1.orig/pa_dll_switch/portaudio.h +++ portaudio-18.1/pa_dll_switch/portaudio.h @@ -108,7 +108,7 @@ */ -typedef unsigned long PaSampleFormat; +typedef uint32_t PaSampleFormat; #define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ #define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ #define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ @@ -216,7 +216,7 @@ typedef int (PortAudioCallback)( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); @@ -233,7 +233,7 @@ #define paClipOff (1<<0) /* disable defult clipping of out of range samples */ #define paDitherOff (1<<1) /* disable default dithering */ #define paPlatformSpecificFlags (0x00010000) -typedef unsigned long PaStreamFlags; +typedef uint32_t PaStreamFlags; /* A single PortAudioStream provides multiple channels of real-time @@ -327,8 +327,8 @@ PaSampleFormat outputSampleFormat, void *outputDriverInfo, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PaStreamFlags streamFlags, PortAudioCallback *callback, void *userData ); @@ -351,8 +351,8 @@ int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PortAudioCallback *callback, void *userData ); only in patch2: unchanged: --- portaudio-18.1.orig/pa_dll_switch/PaDllEntry.h +++ portaudio-18.1/pa_dll_switch/PaDllEntry.h @@ -57,7 +57,7 @@ paInternalError } PaErrorNum; -typedef unsigned long PaSampleFormat; +typedef uint32_t PaSampleFormat; #define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ #define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ #define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ @@ -91,7 +91,7 @@ typedef int (PortAudioCallback)( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, + uint32_t framesPerBuffer, PaTimestamp outTime, void *userData ); @@ -99,7 +99,7 @@ #define paClipOff (1<<0) /* disable default clipping of out of range samples */ #define paDitherOff (1<<1) /* disable default dithering */ #define paPlatformSpecificFlags (0x00010000) -typedef unsigned long PaStreamFlags; +typedef uint32_t PaStreamFlags; typedef void PortAudioStream; #define PaStream PortAudioStream @@ -140,9 +140,9 @@ PaSampleFormat , void *, double , - unsigned long , - unsigned long , - unsigned long , + uint32_t , + uint32_t , + uint32_t , PortAudioCallback *, void * ); @@ -153,8 +153,8 @@ int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PortAudioCallback *callback, void *userData ); only in patch2: unchanged: --- portaudio-18.1.orig/pa_dll_switch/pa_lib.c +++ portaudio-18.1/pa_dll_switch/pa_lib.c @@ -136,9 +136,9 @@ PaSampleFormat outputSampleFormat, void *outputDriverInfo, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, - unsigned long streamFlags, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, + uint32_t streamFlags, PortAudioCallback *callback, void *userData ) { @@ -299,8 +299,8 @@ int numOutputChannels, PaSampleFormat sampleFormat, double sampleRate, - unsigned long framesPerBuffer, - unsigned long numberOfBuffers, + uint32_t framesPerBuffer, + uint32_t numberOfBuffers, PortAudioCallback *callback, void *userData ) { @@ -477,9 +477,9 @@ #define DITHER_SCALE (1.0f / ((1<<DITHER_BITS)-1)) static long Pa_TriangularDither( void ) { - static unsigned long previous = 0; - static unsigned long randSeed1 = 22222; - static unsigned long randSeed2 = 5555555; + static uint32_t previous = 0; + static uint32_t randSeed1 = 22222; + static uint32_t randSeed2 = 5555555; long current, highPass; /* Generate two random numbers. */ randSeed1 = (randSeed1 * 196314165) + 907633515; only in patch2: unchanged: --- portaudio-18.1.orig/pa_mac/pa_mac.c +++ portaudio-18.1/pa_mac/pa_mac.c @@ -1134,7 +1134,7 @@ PaMac_InitSoundHeader( past, &pahsc->pahsc_SoundHeaders[i] ); pahsc->pahsc_SoundHeaders[i].samplePtr = buf; - pahsc->pahsc_SoundHeaders[i].numFrames = (unsigned long) pahsc->pahsc_FramesPerHostBuffer; + pahsc->pahsc_SoundHeaders[i].numFrames = (uint32_t) pahsc->pahsc_FramesPerHostBuffer; } } @@ -1199,7 +1199,7 @@ goto error; } - tempF = ((unsigned long)past->past_SampleRate) << 16; + tempF = ((uint32_t)past->past_SampleRate) << 16; err = SPBSetDeviceInfo(mRefNum, siSampleRate, (Ptr) &tempF); if (err) { only in patch2: unchanged: --- portaudio-18.1.orig/pa_win_ds/pa_dsound.c +++ portaudio-18.1/pa_win_ds/pa_dsound.c @@ -675,7 +675,7 @@ goto error; } hr = DSW_InitOutputBuffer( dsw, - (unsigned long) (past->past_SampleRate + 0.5), + (uint32_t) (past->past_SampleRate + 0.5), past->past_NumOutputChannels, numBytes ); DBUG(("DSW_InitOutputBuffer() returns %x\n", hr)); if( hr != DS_OK ) @@ -717,7 +717,7 @@ goto error; } hr = DSW_InitInputBuffer( dsw, - (unsigned long) (past->past_SampleRate + 0.5), + (uint32_t) (past->past_SampleRate + 0.5), past->past_NumInputChannels, numBytes ); DBUG(("DSW_InitInputBuffer() returns %x\n", hr)); if( hr != DS_OK ) only in patch2: unchanged: --- portaudio-18.1.orig/pa_win_ds/dsound_wrapper.c +++ portaudio-18.1/pa_win_ds/dsound_wrapper.c @@ -87,7 +87,7 @@ } /************************************************************************************/ -HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, int nChannels, int bytesPerBuffer ) +HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, uint32_t nFrameRate, int nChannels, int bytesPerBuffer ) { DWORD dwDataLen; DWORD playCursor; @@ -366,7 +366,7 @@ return hr; } /************************************************************************************/ -HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, int nChannels, int bytesPerBuffer ) +HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, uint32_t nFrameRate, int nChannels, int bytesPerBuffer ) { DSCBUFFERDESC captureDesc; WAVEFORMATEX wfFormat; only in patch2: unchanged: --- portaudio-18.1.orig/pa_win_ds/dsound_wrapper.h +++ portaudio-18.1/pa_win_ds/dsound_wrapper.h @@ -81,7 +81,7 @@ DSoundWrapper; HRESULT DSW_Init( DSoundWrapper *dsw ); void DSW_Term( DSoundWrapper *dsw ); -HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, +HRESULT DSW_InitOutputBuffer( DSoundWrapper *dsw, uint32_t nFrameRate, int nChannels, int bufSize ); HRESULT DSW_StartOutput( DSoundWrapper *dsw ); HRESULT DSW_StopOutput( DSoundWrapper *dsw ); @@ -92,7 +92,7 @@ HRESULT DSW_Enumerate( DSoundWrapper *dsw ); #if SUPPORT_AUDIO_CAPTURE -HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, unsigned long nFrameRate, +HRESULT DSW_InitInputBuffer( DSoundWrapper *dsw, uint32_t nFrameRate, int nChannels, int bufSize ); HRESULT DSW_StartInput( DSoundWrapper *dsw ); HRESULT DSW_StopInput( DSoundWrapper *dsw ); only in patch2: unchanged: --- portaudio-18.1.orig/pa_unix_oss/pa_unix_oss.c +++ portaudio-18.1/pa_unix_oss/pa_unix_oss.c @@ -47,6 +47,8 @@ #include <machine/soundcard.h> /* JH20010905 */ #endif +#include <inttypes.h> + #ifndef AFMT_S16_NE #define AFMT_S16_NE Get_AFMT_S16_NE() only in patch2: unchanged: --- portaudio-18.1.orig/pa_unix_oss/pa_unix_oss.loT +++ portaudio-18.1/pa_unix_oss/pa_unix_oss.loT @@ -0,0 +1,7 @@ +# pa_unix_oss/pa_unix_oss.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.95 2004/04/11 05:50:42) Debian: 215 $ +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. only in patch2: unchanged: --- portaudio-18.1.orig/pa_unix_oss/pa_unix.h +++ portaudio-18.1/pa_unix_oss/pa_unix.h @@ -34,6 +34,8 @@ 20020621: pa_unix_oss.c split into pa_unix.c, pa_unix.h, pa_unix_oss.c by Augustus Saunders. See pa_unix.c for previous history. */ +#include <inttypes.h> + /* PROPOSED - should we add this to "portaudio.h". Problem with Pa_QueryDevice() not having same driver name os Pa_OpenStream(). @@ -48,7 +50,7 @@ int size; /* Can be used to request a specific device name. */ const char *name; - unsigned long data; + uint32_t data; } PaDriverInfo; only in patch2: unchanged: --- portaudio-18.1.orig/pa_unix_oss/pa_unix.c +++ portaudio-18.1/pa_unix_oss/pa_unix.c @@ -1116,7 +1116,7 @@ } /***********************************************************************/ -long Pa_GetHostError( void ) +uint32_t Pa_GetHostError( void ) { return (long) sPaHostError; } only in patch2: unchanged: --- portaudio-18.1.orig/pa_mac_core/pa_mac_core.c +++ portaudio-18.1/pa_mac_core/pa_mac_core.c @@ -286,7 +286,7 @@ } /**********************************************************************/ -static unsigned long RoundUpToNextPowerOf2( unsigned long n ) +static uint32_t RoundUpToNextPowerOf2( uint32_t n ) { long numBits = 0; if( ((n-1) & n) == 0) return n; /* Already Power of two. */