From 9b5f4296026673d65dfd5f60b9086af743c0f237 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 3 Apr 2017 21:01:28 +0200 Subject: [PATCH] Fixed another bunch of warnings --- CMakeLists.txt | 2 +- rtengine/dcraw.cc | 4 ++++ rtengine/demosaic_algos.cc | 4 ++-- rtengine/dirpyr_equalizer.cc | 2 +- rtengine/gauss.cc | 4 ++-- rtengine/imageio.cc | 6 ++---- rtengine/improcfun.cc | 18 +++++++++--------- rtengine/ipretinex.cc | 2 +- rtengine/ipsharpen.cc | 2 +- rtengine/rawimagesource.cc | 4 ++-- rtgui/main.cc | 5 ----- 11 files changed, 25 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8dc38d01..a7e29e03a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,7 @@ endif (WITH_PROF) if (OPTION_OMP) find_package(OpenMP) if (OPENMP_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Werror=unknown-pragmas -Wall -Wno-unused-result -Wno-deprecated-declarations") endif (OPENMP_FOUND) endif (OPTION_OMP) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index f598b35a3..e55c0256b 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -3,6 +3,10 @@ #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wparentheses" +#if (__GNUC__ == 6) +#pragma GCC diagnostic ignored "-Wmisleading-indentation" +#endif #endif /*RT*/#include diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 7896219e5..847af784f 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1338,7 +1338,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array h3 /= hs; h4 /= hs; int passref = 0; - int iter; + int iter = 0; if(iterations <= 4) { iter = iterations - 1; @@ -4011,7 +4011,7 @@ void RawImageSource::xtrans_interpolate (const int passes, const bool useCieLab) // sgrow/sgcol is the offset in the sensor matrix of the solitary // green pixels - ushort sgrow, sgcol; + ushort sgrow = 0, sgcol = 0; const int height = H, width = W; diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index a3a6d81b0..e0527140b 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -149,7 +149,7 @@ SSEFUNCTION void ImProcFunctions :: dirpyr_equalizer(float ** src, float ** dst, level ++; } - float **tmpHue, **tmpChr; + float **tmpHue = nullptr, **tmpChr = nullptr; if(skinprot != 0.f) { // precalculate hue and chroma, use SSE, if available diff --git a/rtengine/gauss.cc b/rtengine/gauss.cc index 4b84a125a..c7be015dc 100644 --- a/rtengine/gauss.cc +++ b/rtengine/gauss.cc @@ -231,8 +231,8 @@ template void gaussHorizontal3 (T** src, T** dst, int W, int H, const f #ifdef __SSE2__ template SSEFUNCTION void gaussVertical3 (T** src, T** dst, int W, int H, const float c0, const float c1) { - vfloat Tv, Tm1v, Tp1v; - vfloat Tv1, Tm1v1, Tp1v1; + vfloat Tv = F2V(0.f), Tm1v, Tp1v; + vfloat Tv1 = F2V(0.f), Tm1v1, Tp1v1; vfloat c0v, c1v; c0v = F2V(c0); c1v = F2V(c1); diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index fea072594..197055858 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -216,9 +216,8 @@ int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, //reading PNG header unsigned char header[8]; - fread (header, 1, 8, file); - if (png_sig_cmp (header, 0, 8)) { + if (fread (header, 1, 8, file) != 8 || png_sig_cmp (header, 0, 8)) { fclose(file); return IMIO_HEADERERROR; } @@ -295,9 +294,8 @@ int ImageIO::loadPNG (Glib::ustring fname) //reading PNG header unsigned char header[8]; - fread (header, 1, 8, file); - if (png_sig_cmp (header, 0, 8)) { + if (fread (header, 1, 8, file) != 8 || png_sig_cmp (header, 0, 8)) { fclose(file); return IMIO_HEADERERROR; } diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 93a23d692..362fdc09a 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -1474,7 +1474,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int float Yw; Yw = 1.0; double Xw, Zw; - float f, nc, yb = 0.f, la, c, xw, yw, zw, f2, c2 = 1.f, nc2, yb2; + float f, nc, yb = 0.f, la, c, xw, yw, zw, f2 = 1.f, c2 = 1.f, nc2 = 1.f, yb2; float fl, n, nbb, ncb, aw; //d float xwd, ywd, zwd; int alg = 0; @@ -2952,7 +2952,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer } } - int h_th, s_th; + int h_th = 0, s_th = 0; if (shmap) { h_th = shmap->max_f - params->sh.htonalwidth * (shmap->max_f - shmap->avg) / 100; @@ -3007,10 +3007,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer params->chmixer.green[0] != 0 || params->chmixer.green[1] != 100 || params->chmixer.green[2] != 0 || params->chmixer.blue[0] != 0 || params->chmixer.blue[1] != 0 || params->chmixer.blue[2] != 100); - FlatCurve* hCurve; - FlatCurve* sCurve; - FlatCurve* vCurve; - FlatCurve* bwlCurve; + FlatCurve* hCurve = nullptr; + FlatCurve* sCurve = nullptr; + FlatCurve* vCurve = nullptr; + FlatCurve* bwlCurve = nullptr; FlatCurveType hCurveType = (FlatCurveType)params->hsvequalizer.hcurve.at(0); FlatCurveType sCurveType = (FlatCurveType)params->hsvequalizer.scurve.at(0); @@ -3064,7 +3064,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer std::shared_ptr hald_clut; bool clutAndWorkingProfilesAreSame = false; - TMatrix xyz2clut, clut2xyz; + TMatrix xyz2clut = {}, clut2xyz = {}; #ifdef __SSE2__ vfloat v_work2xyz[3][3] ALIGNED16; vfloat v_xyz2clut[3][3] ALIGNED16; @@ -3253,7 +3253,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer // For tonecurve histogram int toneCurveHistSize = histToneCurve ? histToneCurve.getSize() : 0; - int histToneCurveCompression; + int histToneCurveCompression = 0; if(toneCurveHistSize > 0) { histToneCurve.clear(); @@ -4650,7 +4650,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer twocol = false; } - float iplow, iphigh; + float iplow = 0.f, iphigh = 0.f; if(!twocol) { iplow = (float)ctColorCurve.low; diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 829810042..321298349 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -345,7 +345,7 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e src[i] = &srcBuffer[i * W_L]; } - int h_th, s_th; + int h_th = 0, s_th = 0; int shHighlights = deh.highlights; int shShadows = deh.shadows; diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index c1a2f479e..5b96fc971 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -934,7 +934,7 @@ void ImProcFunctions::sharpeningcam (CieImage* ncie, float** b2) // Rest is UNSHARP MASK int W = ncie->W, H = ncie->H; - float** b3; + float** b3 = nullptr; if (params->sharpening.edgesonly) { b3 = new float*[H]; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 9170628e0..731166117 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -672,7 +672,7 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima defGain = 0.0; // compute image area to render in order to provide the requested part of the image - int sx1, sy1, imwidth, imheight, fw, d1xHeightOdd; + int sx1, sy1, imwidth, imheight, fw, d1xHeightOdd = 0; transformRect (pp, tran, sx1, sy1, imwidth, imheight, fw); // check possible overflows @@ -2384,7 +2384,7 @@ void RawImageSource::retinex(ColorManagementParams cmp, RetinexParams deh, ToneC LUTf lutToneireti; lutToneireti(65536); - LUTf *retinexigamtab;//gamma before and after Retinex to restore tones + LUTf *retinexigamtab = nullptr;//gamma before and after Retinex to restore tones if(deh.gammaretinex == "low") { retinexigamtab = &(Color::igammatab_115_2); diff --git a/rtgui/main.cc b/rtgui/main.cc index 0af9082cf..155d9f3ba 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -21,8 +21,6 @@ #if defined(__FAST_MATH__) #error Using the -ffast-math CFLAG is known to lead to problems. Disable it to compile RawTherapee. #endif -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif #include "config.h" @@ -467,6 +465,3 @@ int processLineParams( int argc, char **argv ) return errors > 0 ? -2 : 0; } -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif // __GNUC__ \ No newline at end of file