changeset 28:b1bc4d045a4b vamp-plugin-tester-v1.0

* Solaris build fixes
author cannam
date Thu, 24 Sep 2009 14:11:14 +0000
parents 5dcdc86d45d4
children 4534c910639c
files Test.cpp TestDefaults.cpp TestInitialise.cpp TestMultipleRuns.cpp TestOutputs.cpp
diffstat 5 files changed, 57 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Test.cpp	Thu Sep 24 13:34:18 2009 +0000
+++ b/Test.cpp	Thu Sep 24 14:11:14 2009 +0000
@@ -46,6 +46,11 @@
 
 #include <math.h>
 
+#ifdef __SUNPRO_CC
+#include <ieeefp.h>
+#define isinf(x) (!finite(x))
+#endif
+
 Test::Test() { }
 Test::~Test() { }
 
--- a/TestDefaults.cpp	Thu Sep 24 13:34:18 2009 +0000
+++ b/TestDefaults.cpp	Thu Sep 24 14:11:14 2009 +0000
@@ -48,6 +48,10 @@
 #include <cmath>
 #include <time.h>
 
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+
 Tester::TestRegistrar<TestDefaultProgram>
 TestDefaultProgram::m_registrar("E1 Inconsistent default program");
 
@@ -75,7 +79,11 @@
         if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
         if (!data) data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
@@ -131,7 +139,11 @@
         if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
         if (!data) data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
--- a/TestInitialise.cpp	Thu Sep 24 13:34:18 2009 +0000
+++ b/TestInitialise.cpp	Thu Sep 24 14:11:14 2009 +0000
@@ -50,6 +50,10 @@
 
 #include <cmath>
 
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+
 Tester::TestRegistrar<TestSampleRates>
 TestSampleRates::m_registrar("F1 Different sample rates");
 
@@ -97,7 +101,11 @@
 
         data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
--- a/TestMultipleRuns.cpp	Thu Sep 24 13:34:18 2009 +0000
+++ b/TestMultipleRuns.cpp	Thu Sep 24 14:11:14 2009 +0000
@@ -47,6 +47,10 @@
 
 #include <cmath>
 
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+
 Tester::TestRegistrar<TestDistinctRuns>
 TestDistinctRuns::m_registrar("D1 Consecutive runs with separate instances");
 
@@ -76,7 +80,11 @@
         if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
         if (!data) data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
@@ -119,7 +127,11 @@
         else if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
         if (!data) data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
@@ -166,7 +178,11 @@
         if (!data) data = createTestAudio(channels, _step, count);
     }
     for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
         float *ptr[channels];
+#else
+        float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
         size_t idx = i * _step;
         for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
         RealTime timestamp = RealTime::frame2RealTime(idx, rate);
@@ -212,7 +228,11 @@
         if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
         if (!data) data = createTestAudio(channels, _step, count);
         for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
             float *ptr[channels];
+#else
+            float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
             size_t idx = i * _step;
             for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
             RealTime timestamp = RealTime::frame2RealTime(idx, rate);
--- a/TestOutputs.cpp	Thu Sep 24 13:34:18 2009 +0000
+++ b/TestOutputs.cpp	Thu Sep 24 14:11:14 2009 +0000
@@ -50,6 +50,10 @@
 
 #include <cmath>
 
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+
 Tester::TestRegistrar<TestOutputNumbers>
 TestOutputNumbers::m_registrar("B1 Output number mismatching");
 
@@ -72,7 +76,11 @@
     if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
     if (!data) data = createTestAudio(channels, _step, count);
     for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
         float *ptr[channels];
+#else
+        float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
         size_t idx = i * _step;
         for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
         RealTime timestamp = RealTime::frame2RealTime(idx, rate);
@@ -122,7 +130,11 @@
     if (!initDefaults(p.get(), channels, step, block, r)) return r;
     if (!data) data = createTestAudio(channels, block, count);
     for (size_t i = 0; i < count; ++i) {
+#ifdef __GNUC__
         float *ptr[channels];
+#else
+        float **ptr = (float **)alloca(channels * sizeof(float));
+#endif
         size_t idx = i * step;
         for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
         RealTime timestamp = RealTime::frame2RealTime(idx, rate);