From c3df0b1d86b44711836b323da70b19852b84d8f0 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 14 Feb 2021 17:48:10 +0100 Subject: [PATCH] LUT.h : fix cppcheck warnings --- rtengine/LUT.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rtengine/LUT.h b/rtengine/LUT.h index 416ae689a..b1dc4d26c 100644 --- a/rtengine/LUT.h +++ b/rtengine/LUT.h @@ -110,7 +110,7 @@ public: /// The user have to handle it itself, even if some method can (re)initialize it bool dirty; - LUT(int s, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE, bool initZero = false) + explicit LUT(int s, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE, bool initZero = false) { #ifndef NDEBUG @@ -141,7 +141,7 @@ public: } } - LUT(const std::vector& input, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE) : + explicit LUT(const std::vector& input, int flags = LUT_CLIP_BELOW | LUT_CLIP_ABOVE) : maxs(input.size() - 2), maxsf(maxs), data(new T[input.size() + 3]), // Add a few extra elements so [](vfloat) won't access out-of-bounds memory. @@ -362,11 +362,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = vmaxf(ZEROV, indexv) - _mm_cvtepi32_ps(indexes); - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // NOTE: This version requires LUTs which clip at upper and lower bounds @@ -394,11 +394,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = vclampf(indexv, ZEROV, sizev) - _mm_cvtepi32_ps(indexes); // this automagically uses ZEROV in case indexv is NaN - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // NOTE: This version requires LUTs which do not clip at upper and lower bounds @@ -425,11 +425,11 @@ public: // of [values[0][0] ... values[3][0]] and the second [values[0][1] ... values[3][1]]. __m128i temp0 = _mm_unpacklo_epi32(values[0], values[1]); __m128i temp1 = _mm_unpacklo_epi32(values[2], values[3]); - vfloat lower = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); - vfloat upper = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); + vfloat lowerVal = _mm_castsi128_ps(_mm_unpacklo_epi64(temp0, temp1)); + vfloat upperVal = _mm_castsi128_ps(_mm_unpackhi_epi64(temp0, temp1)); vfloat diff = indexv - _mm_cvtepi32_ps(indexes); - return vintpf(diff, upper, lower); + return vintpf(diff, upperVal, lowerVal); } // vectorized LUT access with integer indices. Clips at lower and upper bounds