# HG changeset patch # User Chris Cannam # Date 1252608285 0 # Node ID be5c35d3f4098a1430d7a835d686860ba9d1a80b # Parent 1dd2cddc32ebef6cc0b867f64fb8bcbe82c04f14 * solaris build fixes diff -r 1dd2cddc32eb -r be5c35d3f409 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/layer/Colour3DPlotLayer.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -30,6 +30,10 @@ #include +#ifndef __GNUC__ +#include +#endif + //#define DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1 @@ -1372,7 +1376,11 @@ float epsilon = 0.000001; +#ifdef __GNUC__ float sxa[w * 2]; +#else + float *sxa = (float *)alloca(w * 2 * sizeof(float)); +#endif for (int x = 0; x < w; ++x) { xf = nxf; diff -r 1dd2cddc32eb -r be5c35d3f409 layer/Layer.cpp --- a/layer/Layer.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/layer/Layer.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -554,7 +554,7 @@ int xd = focusPoint.x() - cx; int yd = focusPoint.y() - cy; - float d = sqrt(xd * xd + yd * yd); + float d = sqrt(float(xd * xd + yd * yd)); if (focusRectItr == m_measureRects.end() || d < frDist) { focusRectItr = i; diff -r 1dd2cddc32eb -r be5c35d3f409 layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/layer/SpectrogramLayer.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -45,6 +45,10 @@ #include #include +#ifndef __GNUC__ +#include +#endif + //#define DEBUG_SPECTROGRAM_REPAINT 1 SpectrogramLayer::SpectrogramLayer(Configuration config) : @@ -2256,8 +2260,13 @@ bufwid = w; } +#ifdef __GNUC__ int binforx[bufwid]; float binfory[h]; +#else + int *binforx = (int *)alloca(bufwid * sizeof(int)); + float *binfory = (float *)alloca(h * sizeof(float)); +#endif bool usePeaksCache = false; @@ -2502,7 +2511,12 @@ FFTModel::PeakSet peakfreqs; int px = -1, psx = -1; + +#ifdef __GNUC__ float values[maxbin - minbin + 1]; +#else + float *values = (float *)alloca((maxbin - minbin + 1) * sizeof(float)); +#endif for (int x = 0; x < w; ++x) { @@ -2642,10 +2656,17 @@ } int psx = -1; + +#ifdef __GNUC__ float autoarray[maxbin - minbin + 1]; + float peaks[h]; +#else + float *autoarray = (float *)alloca((maxbin - minbin + 1) * sizeof(float)); + float *peaks = (float *)alloca(h * sizeof(float)); +#endif + const float *values = autoarray; DenseThreeDimensionalModel::Column c; - float peaks[h]; for (int x = 0; x < w; ++x) { diff -r 1dd2cddc32eb -r be5c35d3f409 view/View.cpp --- a/view/View.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/view/View.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -38,6 +38,8 @@ #include #include +#include + //#define DEBUG_VIEW_WIDGET_PAINT 1 using std::cerr; diff -r 1dd2cddc32eb -r be5c35d3f409 widgets/PluginParameterDialog.cpp --- a/widgets/PluginParameterDialog.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/widgets/PluginParameterDialog.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -423,7 +423,7 @@ blockSizeCombo->addItem(QString("%1").arg(size)); blockSizeCombo->setCurrentIndex(blockSizeCombo->count() - 1); } - blockSizeCombo->setValidator(new QIntValidator(1, int(pow(2, 18)), this)); + blockSizeCombo->setValidator(new QIntValidator(1, int(pow(2., 18)), this)); connect(blockSizeCombo, SIGNAL(editTextChanged(const QString &)), this, SLOT(blockSizeComboChanged(const QString &))); windowLayout->addWidget(blockSizeCombo, 0, 1); @@ -445,7 +445,7 @@ incrementCombo->addItem(QString("%1").arg(increment)); incrementCombo->setCurrentIndex(incrementCombo->count() - 1); } - incrementCombo->setValidator(new QIntValidator(1, int(pow(2, 18)), this)); + incrementCombo->setValidator(new QIntValidator(1, int(pow(2., 18)), this)); connect(incrementCombo, SIGNAL(editTextChanged(const QString &)), this, SLOT(incrementComboChanged(const QString &))); windowLayout->addWidget(incrementCombo, 1, 1); diff -r 1dd2cddc32eb -r be5c35d3f409 widgets/WindowShapePreview.cpp --- a/widgets/WindowShapePreview.cpp Tue Aug 18 11:01:57 2009 +0000 +++ b/widgets/WindowShapePreview.cpp Thu Sep 10 18:44:45 2009 +0000 @@ -26,6 +26,10 @@ #include +#ifndef __GNUC__ +#include +#endif + WindowShapePreview::WindowShapePreview(QWidget *parent) : QFrame(parent), m_windowType(WindowType(999)) @@ -67,7 +71,12 @@ path = QPainterPath(); +#ifdef __GNUC__ float acc[w]; +#else + float *acc = (float *)alloca(w * sizeof(float)); +#endif + for (int i = 0; i < w; ++i) acc[i] = 0.f; for (int j = 0; j < 3; ++j) { for (int i = 0; i < step * 2; ++i) {