Revision 28:b1bc4d045a4b TestOutputs.cpp

View differences:

TestOutputs.cpp
50 50

  
51 51
#include <cmath>
52 52

  
53
#ifndef __GNUC__
54
#include <alloca.h>
55
#endif
56

  
53 57
Tester::TestRegistrar<TestOutputNumbers>
54 58
TestOutputNumbers::m_registrar("B1 Output number mismatching");
55 59

  
......
72 76
    if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
73 77
    if (!data) data = createTestAudio(channels, _step, count);
74 78
    for (size_t i = 0; i < count; ++i) {
79
#ifdef __GNUC__
75 80
        float *ptr[channels];
81
#else
82
        float **ptr = (float **)alloca(channels * sizeof(float));
83
#endif
76 84
        size_t idx = i * _step;
77 85
        for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
78 86
        RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
122 130
    if (!initDefaults(p.get(), channels, step, block, r)) return r;
123 131
    if (!data) data = createTestAudio(channels, block, count);
124 132
    for (size_t i = 0; i < count; ++i) {
133
#ifdef __GNUC__
125 134
        float *ptr[channels];
135
#else
136
        float **ptr = (float **)alloca(channels * sizeof(float));
137
#endif
126 138
        size_t idx = i * step;
127 139
        for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
128 140
        RealTime timestamp = RealTime::frame2RealTime(idx, rate);

Also available in: Unified diff