From bba842587eeac6a008af5732c55fb895246356ab Mon Sep 17 00:00:00 2001 From: jossgray Date: Mon, 5 Dec 2016 19:01:02 +0000 Subject: [PATCH 1/3] Fix truncation from double to float warning. --- tests/teststops.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/teststops.cpp b/tests/teststops.cpp index e24c064..b388554 100644 --- a/tests/teststops.cpp +++ b/tests/teststops.cpp @@ -63,7 +63,7 @@ int pulse( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrame if ( status ) std::cout << "Stream over/underflow detected!" << std::endl; for ( i=0; iframeCounter % data->pulseCount == 0 ) sample = 0.9; + if ( data->frameCounter % data->pulseCount == 0 ) sample = 0.9f; else sample = 0.0; for ( j=0; jchannels; j++ ) *buffer++ = sample; From 03aef01e6c556834277b0b23c5659aa83fa7949b Mon Sep 17 00:00:00 2001 From: jossgray Date: Mon, 5 Dec 2016 20:31:32 +0000 Subject: [PATCH 2/3] Explicit casts to fix some warnings in msvc --- tests/teststops.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/teststops.cpp b/tests/teststops.cpp index b388554..6159b88 100644 --- a/tests/teststops.cpp +++ b/tests/teststops.cpp @@ -107,8 +107,8 @@ int main( int argc, char *argv[] ) // Let RtAudio print messages to stderr. adc->showWarnings( true ); - runtime = RUNTIME * 1000; - pausetime = PAUSETIME * 1000; + runtime = static_cast(RUNTIME * 1000); + pausetime = static_cast(PAUSETIME * 1000); // Set our stream parameters for a duplex stream. bufferFrames = 512; @@ -127,7 +127,7 @@ int main( int argc, char *argv[] ) oParams.deviceId = adc->getDefaultOutputDevice(); // First, test external stopStream() calls. - mydata.pulseCount = PULSE_RATE * fs; + mydata.pulseCount = static_cast(PULSE_RATE * fs); mydata.nFrames = 50 * fs; mydata.returnValue = 0; try { From fc1f79343be5129134921f9e47cab8ef360368e4 Mon Sep 17 00:00:00 2001 From: jossgray Date: Mon, 5 Dec 2016 20:37:38 +0000 Subject: [PATCH 3/3] Fix truncation to float warning in mscv --- tests/testall.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testall.cpp b/tests/testall.cpp index 419f27b..b94ce69 100644 --- a/tests/testall.cpp +++ b/tests/testall.cpp @@ -66,7 +66,7 @@ int sawni( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrame if ( status ) std::cout << "Stream underflow detected!" << std::endl; - float increment; + double increment; for ( j=0; j