diff --git a/rtengine/LUT.h b/rtengine/LUT.h index d83a431ca..eb22ff7f9 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -579,7 +579,7 @@ public: numVals = std::min(numVals, passThrough.getSize()); float mult = dest.size - 1; - for (int i = 0; i < numVals; i++) { + for (unsigned int i = 0; i < numVals; i++) { int hi = (int)(mult * passThrough[i]); dest[hi] += this->data[i] ; } diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 8f2aa03d3..3096f19f4 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -45,7 +45,7 @@ using namespace std; namespace rtengine { -Curve::Curve () : N(0), ppn(0), x(nullptr), y(nullptr), mc(0.0), mfc(0.0), msc(0.0), mhc(0.0), ypp(nullptr), x1(0.0), y1(0.0), x2(0.0), y2(0.0), x3(0.0), y3(0.0), firstPointIncluded(false), increment(0.0), nbr_points(0), hashSize(1000 /* has to be initialized to the maximum value */) {} +Curve::Curve () : N(0), ppn(0), x(nullptr), y(nullptr), mc(0.0), mfc(0.0), msc(0.0), mhc(0.0), hashSize(1000 /* has to be initialized to the maximum value */), ypp(nullptr), x1(0.0), y1(0.0), x2(0.0), y2(0.0), x3(0.0), y3(0.0), firstPointIncluded(false), increment(0.0), nbr_points(0) {} void Curve::AddPolygons () { @@ -104,7 +104,7 @@ void Curve::fillHash() milestone = 0.; polyIter = 0; - for (unsigned int i = 0; i < (hashSize + 1);) { + for (unsigned int i = 0; i < hashSize + 1u;) { while(poly_x[polyIter] < (milestone + increment)) { ++polyIter; } @@ -1376,7 +1376,7 @@ void ColorGradientCurve::SetXYZ(const Curve *pCurve, const double xyz_rgb[3][3], } float r, g, b, xx, yy, zz; - float lr1, lr2; + float lr1, lr2 = 0.f; int upperBound = lut1.getUpperBound(); if (pCurve->isIdentity()) { @@ -1765,7 +1765,7 @@ float PerceptualToneCurve::get_curve_val(float x, float range[2], float lut[], s int idx = (int)xm; - if (idx >= lut_size - 1) { + if (idx >= static_cast(lut_size) - 1) { return lut[lut_size - 1]; } @@ -1790,7 +1790,7 @@ float PerceptualToneCurve::calculateToneCurveContrastValue() const const float xd = 0.07; const float tx[] = { 0.30, 0.35, 0.40, 0.45 }; // we only look in the midtone range - for (int i = 0; i < sizeof(tx) / sizeof(tx[0]); i++) { + for (size_t i = 0; i < sizeof(tx) / sizeof(tx[0]); i++) { float x0 = tx[i] - xd; float y0 = CurveFactory::gamma2(lutToneCurve[CurveFactory::igamma2(x0) * 65535.f] / 65535.f) - k * x0; float x1 = tx[i] + xd; @@ -1807,7 +1807,7 @@ float PerceptualToneCurve::calculateToneCurveContrastValue() const { const float tx[] = { 0.20, 0.25, 0.50, 0.55 }; // we only look in the midtone range - for (int i = 0; i < sizeof(tx) / sizeof(tx[0]); i++) { + for (size_t i = 0; i < sizeof(tx) / sizeof(tx[0]); i++) { float x0 = tx[i] - xd; float y0 = CurveFactory::gamma2(lutToneCurve[CurveFactory::igamma2(x0) * 65535.f] / 65535.f) - k * x0; float x1 = tx[i] + xd;