From 48648170e9b8b64ba72ceb0b0c3cef317e7ae7cd Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Tue, 2 Jun 2020 19:46:13 +0200 Subject: [PATCH] Some more cleanups --- rtengine/ipwavelet.cc | 13 ++++--------- rtexif/rtexif.cc | 13 +++++-------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index f17c8f8b9..144b307e5 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -50,6 +50,7 @@ #endif #include "cplx_wavelet_dec.h" +#pragma GCC diagnostic warning "-Wdouble-promotion" namespace rtengine { @@ -2059,7 +2060,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * } if ((cp.conres >= 0.f || cp.conresH >= 0.f) && cp.resena && !cp.oldsh) { // cp.conres = 0.f and cp.comresH = 0.f means that all will be multiplied by 1.f, so we can skip this step - std::unique_ptr temp(new LabImage(W_L, H_L)); + const std::unique_ptr temp(new LabImage(W_L, H_L)); #ifdef _OPENMP #pragma omp parallel for num_threads(wavNestedLevels) if (wavNestedLevels>1) #endif @@ -2158,18 +2159,12 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * float *koeLi[12]; - std::unique_ptr koeLibuffer(new float[12 * H_L * W_L]); + const std::unique_ptr koeLibuffer(new float[12 * H_L * W_L]()); for (int i = 0; i < 12; i++) { koeLi[i] = &koeLibuffer[i * W_L * H_L]; } - for (int j = 0; j < 12; j++) { - for (int i = 0; i < W_L * H_L; i++) { - koeLi[j][i] = 0.f; - } - } - #ifdef _OPENMP #pragma omp parallel num_threads(wavNestedLevels) if (wavNestedLevels>1) #endif @@ -2187,7 +2182,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float * float maxkoeLi = 0.f; if (cp.detectedge) { //enabled Lipschitz control...more memory..more time... - std::unique_ptr tmCBuffer(new float[H_L * W_L]); + const std::unique_ptr tmCBuffer(new float[H_L * W_L]); float *tmC[H_L]; for (int i = 0; i < H_L; i++) { diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index b4a4650c9..c0038c067 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -3059,17 +3059,14 @@ void ExifManager::parse (bool isRaw, bool skipIgnored, bool parseJpeg) bool frameRootDetected = false; - std::vector risTagList = root->findTags("RawImageSegmentation"); - if (!risTagList.empty()) { - for (auto ris : risTagList) { - frames.push_back(ris->getParent()); - frameRootDetected = true; + for (auto ris : root->findTags("RawImageSegmentation")) { + frames.push_back(ris->getParent()); + frameRootDetected = true; #if PRINT_METADATA_TREE - printf("\n--------------- FRAME (RAWIMAGESEGMENTATION) ---------------\n\n"); - ris->getParent()->printAll (); + printf("\n--------------- FRAME (RAWIMAGESEGMENTATION) ---------------\n\n"); + ris->getParent()->printAll (); #endif - } } if(!frameRootDetected) {