summaryrefslogtreecommitdiff
path: root/libs/qm-dsp/maths
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-09-30 17:55:14 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-09-30 17:55:14 +0000
commit0938a42440cc82ce8d0cb064840c258c863714ab (patch)
tree19f58c31e65226d85c76d96647a6e300f7995c10 /libs/qm-dsp/maths
parent15e390ebe5611b5443eb1fb57631826389ffd021 (diff)
fixes for 98% of all the warnings/errors reported by OS X gcc on tiger
git-svn-id: svn://localhost/ardour2/branches/3.0@10179 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/qm-dsp/maths')
-rw-r--r--libs/qm-dsp/maths/CosineDistance.cpp2
-rw-r--r--libs/qm-dsp/maths/MathUtilities.cpp11
-rw-r--r--libs/qm-dsp/maths/Polyfit.h9
3 files changed, 11 insertions, 11 deletions
diff --git a/libs/qm-dsp/maths/CosineDistance.cpp b/libs/qm-dsp/maths/CosineDistance.cpp
index 13ab9ce0e8..fd2aeef3fe 100644
--- a/libs/qm-dsp/maths/CosineDistance.cpp
+++ b/libs/qm-dsp/maths/CosineDistance.cpp
@@ -34,7 +34,7 @@ double CosineDistance::distance(const vector<double> &v1,
}
else
{
- for(int i=0; i<v1.size(); i++)
+ for(unsigned int i=0; i<v1.size(); i++)
{
dSum1 += v1[i]*v2[i];
dDen1 += v1[i]*v1[i];
diff --git a/libs/qm-dsp/maths/MathUtilities.cpp b/libs/qm-dsp/maths/MathUtilities.cpp
index 809874121e..70a275912c 100644
--- a/libs/qm-dsp/maths/MathUtilities.cpp
+++ b/libs/qm-dsp/maths/MathUtilities.cpp
@@ -155,7 +155,7 @@ double MathUtilities::mean(const std::vector<double> &src,
{
double sum = 0.;
- for (int i = 0; i < count; ++i)
+ for (unsigned int i = 0; i < count; ++i)
{
sum += src[start + i];
}
@@ -167,7 +167,6 @@ void MathUtilities::getFrameMinMax(const double *data, unsigned int len, double
{
unsigned int i;
double temp = 0.0;
- double a=0.0;
if (len == 0) {
*min = *max = 0;
@@ -317,9 +316,9 @@ void MathUtilities::normalise(std::vector<double> &data, NormaliseType type)
case NormaliseUnitSum:
{
double sum = 0.0;
- for (int i = 0; i < data.size(); ++i) sum += data[i];
+ for (unsigned int i = 0; i < data.size(); ++i) sum += data[i];
if (sum != 0.0) {
- for (int i = 0; i < data.size(); ++i) data[i] /= sum;
+ for (unsigned int i = 0; i < data.size(); ++i) data[i] /= sum;
}
}
break;
@@ -327,11 +326,11 @@ void MathUtilities::normalise(std::vector<double> &data, NormaliseType type)
case NormaliseUnitMax:
{
double max = 0.0;
- for (int i = 0; i < data.size(); ++i) {
+ for (unsigned int i = 0; i < data.size(); ++i) {
if (fabs(data[i]) > max) max = fabs(data[i]);
}
if (max != 0.0) {
- for (int i = 0; i < data.size(); ++i) data[i] /= max;
+ for (unsigned int i = 0; i < data.size(); ++i) data[i] /= max;
}
}
break;
diff --git a/libs/qm-dsp/maths/Polyfit.h b/libs/qm-dsp/maths/Polyfit.h
index 86bb64cb1e..3fac62d1b2 100644
--- a/libs/qm-dsp/maths/Polyfit.h
+++ b/libs/qm-dsp/maths/Polyfit.h
@@ -105,13 +105,13 @@ double TPolyFit::PolyFit2 (const vector<double> &x,
// nterms = coefs.size()
// npoints = x.size()
{
- int i, j;
+ unsigned int i, j;
double xi, yi, yc, srs, sum_y, sum_y2;
Matrix xmatr; // Data matrix
Matrix a;
vector<double> g; // Constant vector
- const int npoints(x.size());
- const int nterms(coefs.size());
+ const unsigned int npoints(x.size());
+ const unsigned int nterms(coefs.size());
double correl_coef;
zeroise(g, nterms);
zeroise(a, nterms, nterms);
@@ -278,7 +278,8 @@ bool TPolyFit::GaussJordan2(Matrix &b,
double big, t;
double pivot;
double determ;
- int irow, icol;
+ int irow = 0;
+ int icol = 0;
int ncol(b.size());
int nv = 1; // single constant vector
for(int i = 0; i < ncol; ++i)