# HG changeset patch # User Chris Cannam # Date 1518026067 0 # Node ID fa66ee7dcf0807c24d71550471004959a4cb792f # Parent 63d6776904df0a8f1d703f7229abf6947388d7b7 VC build projects and fixes therefore. Interestingly the alloca() calls I'm replacing were all wrong diff -r 63d6776904df -r fa66ee7dcf08 .hgignore --- a/.hgignore Tue Jun 20 15:09:00 2017 +0100 +++ b/.hgignore Wed Feb 07 17:54:27 2018 +0000 @@ -5,3 +5,10 @@ *.dll *.exe vamp-plugin-tester +build/Release +build/x64/Release +build/Debug +build/x64/Debug +*.VC.db +*.VC.opendb +*.filters diff -r 63d6776904df -r fa66ee7dcf08 TestDefaults.cpp --- a/TestDefaults.cpp Tue Jun 20 15:09:00 2017 +0100 +++ b/TestDefaults.cpp Wed Feb 07 17:54:27 2018 +0000 @@ -48,10 +48,6 @@ #include #include -#ifndef __GNUC__ -#include -#endif - Tester::TestRegistrar TestDefaultProgram::m_registrar("E1", "Inconsistent default program"); @@ -82,15 +78,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); @@ -142,15 +135,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); @@ -256,15 +246,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); diff -r 63d6776904df -r fa66ee7dcf08 TestInitialise.cpp --- a/TestInitialise.cpp Tue Jun 20 15:09:00 2017 +0100 +++ b/TestInitialise.cpp Wed Feb 07 17:54:27 2018 +0000 @@ -51,10 +51,6 @@ #include #include -#ifndef __GNUC__ -#include -#endif - Tester::TestRegistrar TestSampleRates::m_registrar("F1", "Different sample rates"); @@ -105,15 +101,12 @@ data = createTestAudio(channels, step, count); for (size_t j = 0; j < count; ++j) { -#ifdef __GNUC__ - float *ptr[channels]; -#else - float **ptr = (float **)alloca(channels * sizeof(float)); -#endif + float **ptr = new float *[channels]; size_t idx = j * step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f, fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); diff -r 63d6776904df -r fa66ee7dcf08 TestMultipleRuns.cpp --- a/TestMultipleRuns.cpp Tue Jun 20 15:09:00 2017 +0100 +++ b/TestMultipleRuns.cpp Wed Feb 07 17:54:27 2018 +0000 @@ -47,10 +47,6 @@ #include -#ifndef __GNUC__ -#include -#endif - Tester::TestRegistrar TestDistinctRuns::m_registrar("D1", "Consecutive runs with separate instances"); @@ -80,15 +76,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); @@ -127,15 +120,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); @@ -178,11 +168,7 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); @@ -190,6 +176,7 @@ Plugin::FeatureSet fs = p[run]->process(ptr, timestamp); appendFeatures(f[run], fs); } + delete[] ptr; } for (int run = 0; run < 2; ++run) { Plugin::FeatureSet fs = p[run]->getRemainingFeatures(); @@ -228,16 +215,13 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); if (run == 1) timestamp = timestamp + RealTime::fromSeconds(10); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f[run], fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); diff -r 63d6776904df -r fa66ee7dcf08 TestOutputs.cpp --- a/TestOutputs.cpp Tue Jun 20 15:09:00 2017 +0100 +++ b/TestOutputs.cpp Wed Feb 07 17:54:27 2018 +0000 @@ -50,10 +50,6 @@ #include -#ifndef __GNUC__ -#include -#endif - Tester::TestRegistrar TestOutputNumbers::m_registrar("B1", "Output number mismatching"); @@ -76,15 +72,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * _step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f, fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); @@ -140,15 +133,12 @@ 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 + float **ptr = new float *[channels]; size_t idx = i * step; for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx; RealTime timestamp = RealTime::frame2RealTime(idx, rate); Plugin::FeatureSet fs = p->process(ptr, timestamp); + delete[] ptr; appendFeatures(f, fs); } Plugin::FeatureSet fs = p->getRemainingFeatures(); diff -r 63d6776904df -r fa66ee7dcf08 build/Makefile.mingw32 --- a/build/Makefile.mingw32 Tue Jun 20 15:09:00 2017 +0100 +++ b/build/Makefile.mingw32 Wed Feb 07 17:54:27 2018 +0000 @@ -6,8 +6,8 @@ AR = $(TOOLPREFIX)ar RANLIB = $(TOOLPREFIX)ranlib -LDFLAGS += -static -L../vamp-plugin-sdk -lvamp-hostsdk -CXXFLAGS += -I../vamp-plugin-sdk -g -Wall -Wextra +LDFLAGS += -static -L../vamp-plugin-sdk -lvamp-hostsdk -std=gnu++98 +CXXFLAGS += -I../vamp-plugin-sdk -g -Wall -Wextra -std=gnu++98 OBJECTS := vamp-plugin-tester.o Tester.o Test.o TestStaticData.o TestInputExtremes.o TestMultipleRuns.o TestOutputs.o TestDefaults.o TestInitialise.o diff -r 63d6776904df -r fa66ee7dcf08 build/vamp-plugin-tester.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/vamp-plugin-tester.sln Wed Feb 07 17:54:27 2018 +0000 @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vamp-plugin-tester", "vamp-plugin-tester.vcxproj", "{5E60958F-4DFC-4F22-B592-381749F60CFF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Debug|x64.ActiveCfg = Debug|x64 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Debug|x64.Build.0 = Debug|x64 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Debug|x86.ActiveCfg = Debug|Win32 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Debug|x86.Build.0 = Debug|Win32 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Release|x64.ActiveCfg = Release|x64 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Release|x64.Build.0 = Release|x64 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Release|x86.ActiveCfg = Release|Win32 + {5E60958F-4DFC-4F22-B592-381749F60CFF}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 63d6776904df -r fa66ee7dcf08 build/vamp-plugin-tester.vcxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/vamp-plugin-tester.vcxproj Wed Feb 07 17:54:27 2018 +0000 @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {5E60958F-4DFC-4F22-B592-381749F60CFF} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + + + + + WIN32;NDEBUG;_CONSOLE;_USE_MATH_DEFINES;%(PreprocessorDefinitions) + MultiThreaded + Level3 + ProgramDatabase + C:\Users\Chris\Documents\vamp-plugin-tester\vamp-plugin-sdk;%(AdditionalIncludeDirectories) + + + MachineX86 + true + Console + true + true + + + + + C:\Users\Chris\Documents\vamp-plugin-tester\vamp-plugin-sdk;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_USE_MATH_DEFINES;%(PreprocessorDefinitions) + MultiThreaded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file