diff audioio/AudioPortAudioTarget.cpp @ 366:0876ea394902 warnfix_no_size_t

Remove size_t's, fix compiler warnings
author Chris Cannam
date Tue, 17 Jun 2014 16:23:06 +0100
parents 068235cf5bf7
children 1162c93e7688
line wrap: on
line diff
--- a/audioio/AudioPortAudioTarget.cpp	Tue Jun 03 11:03:09 2014 +0100
+++ b/audioio/AudioPortAudioTarget.cpp	Tue Jun 17 16:23:06 2014 +0100
@@ -218,10 +218,10 @@
     assert(nframes <= m_bufferSize);
 
     static float **tmpbuf = 0;
-    static size_t tmpbufch = 0;
-    static size_t tmpbufsz = 0;
+    static int tmpbufch = 0;
+    static int tmpbufsz = 0;
 
-    size_t sourceChannels = m_source->getSourceChannelCount();
+    int sourceChannels = m_source->getSourceChannelCount();
 
     // Because we offer pan, we always want at least 2 channels
     if (sourceChannels < 2) sourceChannels = 2;
@@ -229,7 +229,7 @@
     if (!tmpbuf || tmpbufch != sourceChannels || int(tmpbufsz) < m_bufferSize) {
 
 	if (tmpbuf) {
-	    for (size_t i = 0; i < tmpbufch; ++i) {
+	    for (int i = 0; i < tmpbufch; ++i) {
 		delete[] tmpbuf[i];
 	    }
 	    delete[] tmpbuf;
@@ -239,23 +239,23 @@
 	tmpbufsz = m_bufferSize;
 	tmpbuf = new float *[tmpbufch];
 
-	for (size_t i = 0; i < tmpbufch; ++i) {
+	for (int i = 0; i < tmpbufch; ++i) {
 	    tmpbuf[i] = new float[tmpbufsz];
 	}
     }
 	
-    size_t received = m_source->getSourceSamples(nframes, tmpbuf);
+    int received = m_source->getSourceSamples(nframes, tmpbuf);
 
     float peakLeft = 0.0, peakRight = 0.0;
 
-    for (size_t ch = 0; ch < 2; ++ch) {
+    for (int ch = 0; ch < 2; ++ch) {
 	
 	float peak = 0.0;
 
 	if (ch < sourceChannels) {
 
 	    // PortAudio samples are interleaved
-	    for (size_t i = 0; i < nframes; ++i) {
+	    for (int i = 0; i < nframes; ++i) {
                 if (i < received) {
                     output[i * 2 + ch] = tmpbuf[ch][i] * m_outputGain;
                     float sample = fabsf(output[i * 2 + ch]);
@@ -267,7 +267,7 @@
 
 	} else if (ch == 1 && sourceChannels == 1) {
 
-	    for (size_t i = 0; i < nframes; ++i) {
+	    for (int i = 0; i < nframes; ++i) {
                 if (i < received) {
                     output[i * 2 + ch] = tmpbuf[0][i] * m_outputGain;
                     float sample = fabsf(output[i * 2 + ch]);
@@ -278,7 +278,7 @@
 	    }
 
 	} else {
-	    for (size_t i = 0; i < nframes; ++i) {
+	    for (int i = 0; i < nframes; ++i) {
 		output[i * 2 + ch] = 0;
 	    }
 	}