diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d51503d6..13c648de0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -402,7 +402,7 @@ if(WITH_PROF) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Wcast-qual -Wno-deprecated-declarations -Wno-unused-result -Wunused-macros") if(OPTION_OMP) find_package(OpenMP) if(OPENMP_FOUND) diff --git a/rtengine/FTblockDN.cc b/rtengine/FTblockDN.cc index 121c8189d..b13920c2a 100644 --- a/rtengine/FTblockDN.cc +++ b/rtengine/FTblockDN.cc @@ -56,7 +56,6 @@ #define TS 64 // Tile size #define offset 25 // shift between tiles -#define fTS ((TS/2+1)) // second dimension of Fourier tiles #define blkrad 1 // radius of block averaging #define epsilon 0.001f/(TS*TS) //tolerance diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 0284b3f1d..537bf1334 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -94,7 +94,6 @@ #ifdef WIN32 #include #include -#define snprintf _snprintf #define strcasecmp stricmp #define strncasecmp strnicmp typedef __int64 INT64; @@ -158,7 +157,6 @@ const float d65_white[3] = { 0.950456, 1, 1.088754 }; #define MIN(a,b) rtengine::min(a,static_cast<__typeof__(a)>(b)) #define MAX(a,b) rtengine::max(a,static_cast<__typeof__(a)>(b)) #define LIM(x,min,max) rtengine::LIM(x,static_cast<__typeof__(x)>(min),static_cast<__typeof__(x)>(max)) -#define ULIM(x,y,z) rtengine::median(x,static_cast<__typeof__(x)>(y),static_cast<__typeof__(x)>(z)) #define CLIP(x) rtengine::CLIP(x) #define SWAP(a,b) { a=a+b; b=a-b; a=a-b; } @@ -11022,7 +11020,6 @@ void CLASS nikon_14bit_load_raw() /*RT*/#undef MIN /*RT*/#undef ABS /*RT*/#undef LIM -/*RT*/#undef ULIM /*RT*/#undef CLIP #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index aea03664e..9d7024bff 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -43,7 +43,6 @@ #include "color.h" #include "cJSON.h" -#define inkc_constant 0x696E6B43 namespace { diff --git a/rtengine/image16.cc b/rtengine/image16.cc index a98d64d51..4bcd9d5c0 100644 --- a/rtengine/image16.cc +++ b/rtengine/image16.cc @@ -187,8 +187,6 @@ void Image16::getStdImage(const ColorTemp &ctemp, int tran, Imagefloat* image, P gm /= area; bm /= area; -#define GCLIP( x ) Color::gamma_srgb(CLIP(x)) - #ifdef _OPENMP #pragma omp parallel { diff --git a/rtengine/image8.cc b/rtengine/image8.cc index 66ad8b60f..8784c962e 100644 --- a/rtengine/image8.cc +++ b/rtengine/image8.cc @@ -151,8 +151,6 @@ void Image8::getStdImage (const ColorTemp &ctemp, int tran, Imagefloat* image, P gm /= area; bm /= area; -#define GCLIP( x ) Color::gamma_srgb(CLIP(x)) - #ifdef _OPENMP #pragma omp parallel { diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 6749ff305..1bb7e417a 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -55,9 +55,6 @@ #include "mytime.h" #endif -#undef CLIPD -#define CLIPD(a) ((a)>0.0f?((a)<1.0f?(a):1.0f):0.0f) - namespace { using namespace rtengine; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 7c0dc368b..be64be0fc 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -50,13 +50,6 @@ #include "cplx_wavelet_dec.h" -#define TS 64 // Tile size -#define offset 25 // shift between tiles -#define fTS ((TS/2+1)) // second dimension of Fourier tiles -#define blkrad 1 // radius of block averaging - -#define epsilon 0.001f/(TS*TS) //tolerance - namespace rtengine { diff --git a/rtengine/jdatasrc.cc b/rtengine/jdatasrc.cc index 8c04a14a2..e461b60f5 100644 --- a/rtengine/jdatasrc.cc +++ b/rtengine/jdatasrc.cc @@ -25,11 +25,6 @@ #define JFREAD(file,buf,sizeofbuf) \ ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) - - - /* Expanded data source object for stdio input */ namespace diff --git a/rtengine/klt/selectGoodFeatures.cc b/rtengine/klt/selectGoodFeatures.cc index 20e67fb2e..ccd7681db 100644 --- a/rtengine/klt/selectGoodFeatures.cc +++ b/rtengine/klt/selectGoodFeatures.cc @@ -9,7 +9,6 @@ #include /* fflush() */ #include /* memset() */ #include /* fsqrt() */ -#define fsqrt(X) sqrt(X) /* Our includes */ #include "base.h" diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 9da601e2a..a25f70749 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -511,8 +511,6 @@ Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataL ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==0 || !filter) #define FISGREEN(filter,row,col) \ ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==1 || !filter) -#define FISBLUE(filter,row,col) \ - ((filter >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3)==2 || !filter) RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname) { diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 1cb11e94d..271818303 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -53,7 +53,6 @@ template T** allocArray (int W, int H) return t; } -#define HR_SCALE 2 StdImageSource::StdImageSource () : ImageSource(), img(nullptr), plistener(nullptr), full(false), max{}, rgbSourceModified(false) { diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index ee451c7d7..c434634dc 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _CANONATTRIBS_ -#define _CANONATTRIBS_ #include #include @@ -2142,5 +2140,4 @@ const TagAttrib canonAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index 0eaa505f6..ffbf3a0be 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _FUJIATTRIBS_ -#define _FUJIATTRIBS_ #include "rtexif.h" @@ -312,5 +310,4 @@ const TagAttrib fujiAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif diff --git a/rtexif/kodakattribs.cc b/rtexif/kodakattribs.cc index a9c168a70..619925760 100644 --- a/rtexif/kodakattribs.cc +++ b/rtexif/kodakattribs.cc @@ -1,8 +1,6 @@ /* * This file is part of RawTherapee. */ -#ifndef _KODAKATTRIBS_ -#define _KODAKATTRIBS_ #include #include "rtexif.h" @@ -161,5 +159,4 @@ const TagAttrib kodakIfdAttribs[] = { }; } -#endif diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index 2ef37b8fb..9c52f3b8a 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _NIKONATTRIBS_ -#define _NIKONATTRIBS_ #include #include @@ -1229,5 +1227,3 @@ const TagAttrib nikon3Attribs[] = { }; } -#endif - diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index f590b8154..ec7ab98c7 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _OLYMPUSATTRIBS_ -#define _OLYMPUSATTRIBS_ #include #include @@ -850,5 +848,3 @@ const TagAttrib olympusAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } -#endif - diff --git a/rtexif/panasonicattribs.cc b/rtexif/panasonicattribs.cc index 3062824cf..4ebcf2447 100644 --- a/rtexif/panasonicattribs.cc +++ b/rtexif/panasonicattribs.cc @@ -1,8 +1,6 @@ /* * This file is part of RawTherapee. */ -#ifndef _PANASONICATTRIBS_ -#define _PANASONICATTRIBS_ #include #include "rtexif.h" @@ -138,5 +136,3 @@ const TagAttrib panasonicRawAttribs[] = { }; } -#endif - diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index 0e866b09f..abc25b7a1 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -16,8 +16,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _PENTAXATTRIBS_ -#define _PENTAXATTRIBS_ #include #include @@ -2216,7 +2214,6 @@ const TagAttrib pentaxCameraInfoAttribs[] = { }; } -#endif diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 722b11faf..ee41b2a9b 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -15,8 +15,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _SONYMINOLTAATTRIBS_ -#define _SONYMINOLTAATTRIBS_ #include @@ -2499,6 +2497,4 @@ const TagAttrib sonyCameraSettingsAttribs3[] = { {-1, AC_DONTWRITE, 0, 0, 0, AUTO, "", NULL}};*/ } -#endif - diff --git a/rtexif/stdattribs.cc b/rtexif/stdattribs.cc index 8e076152d..be7a28a5c 100644 --- a/rtexif/stdattribs.cc +++ b/rtexif/stdattribs.cc @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#ifndef _STDATTRIBS_ -#define _STDATTRIBS_ #include #include @@ -927,5 +925,3 @@ const TagAttrib ifdAttribs[] = { { -1, AC_DONTWRITE, 0, nullptr, 0, AUTO, "", nullptr} }; } - -#endif diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index bb34072e2..102c17daf 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -45,8 +45,6 @@ using namespace std; -#define CHECKTIME 2000 - FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : filepanel(filepanel), selectedDirectoryId(1),