diff --git a/CMakeLists.txt b/CMakeLists.txt index 70f6d15e2..5b07b6078 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,14 +321,14 @@ if(USE_CLANG) SET (CMAKE_C_COMPILER ${CLANG_CMD}) SET (CMAKE_C_FLAGS "") #-Wall - SET (CMAKE_C_FLAGS_DEBUG "-g") + SET (CMAKE_C_FLAGS_DEBUG "-O0 -g") SET (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") SET (CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") SET (CMAKE_CXX_COMPILER ${CLANGPP_CMD}) SET (CMAKE_CXX_FLAGS "") #-Wall - SET (CMAKE_CXX_FLAGS_DEBUG "-g") + SET (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") SET (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 0c050b72a..c8848d9f1 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -103,8 +103,6 @@ void RawImageSource::CA_correct_RT(double cared, double cablue) { #define PIX_SORT(a,b) { if ((a)>(b)) {temp=(a);(a)=(b);(b)=temp;} } #define SQR(x) ((x)*(x)) - const float clip_pt = initialGain; - // local variables int width=W, height=H; //temporary array to store simple interpolation of G diff --git a/rtengine/EdgePreservingDecomposition.h b/rtengine/EdgePreservingDecomposition.h index ca1e68ab6..b3b832823 100644 --- a/rtengine/EdgePreservingDecomposition.h +++ b/rtengine/EdgePreservingDecomposition.h @@ -89,7 +89,7 @@ public: //This is the same as above, but designed to take this class as a pass through variable. By this way you can feed //the meat of this class into an independent function, such as SparseConjugateGradient. static void PassThroughVectorProduct(float *Product, float *x, void *Pass){ - ((MultiDiagonalSymmetricMatrix *)Pass)->VectorProduct(Product, x); + (static_cast(Pass))->VectorProduct(Product, x); }; /* CreateIncompleteCholeskyFactorization creates another matrix which is an incomplete (or complete if MaxFillAbove is big enough) @@ -102,7 +102,7 @@ public: MultiDiagonalSymmetricMatrix *IncompleteCholeskyFactorization; static void PassThroughCholeskyBackSolve(float *Product, float *x, void *Pass){ - ((MultiDiagonalSymmetricMatrix *)Pass)->CholeskyBackSolve(Product, x); + (static_cast(Pass))->CholeskyBackSolve(Product, x); }; }; diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 5f7438269..8f409c640 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -40,8 +40,6 @@ namespace rtengine { void ImProcFunctions::PF_correct_RT(LabImage * src, LabImage * dst, double radius, int thresh) { - - float threshsqr = SQR(thresh); int halfwin = ceil(2*radius)+1; #define SQR(x) ((x)*(x)) diff --git a/rtengine/amaze_demosaic_RT.cc b/rtengine/amaze_demosaic_RT.cc index d3961e82f..32e522d03 100644 --- a/rtengine/amaze_demosaic_RT.cc +++ b/rtengine/amaze_demosaic_RT.cc @@ -52,9 +52,6 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh) { //shifts of pointer value to access pixels in vertical and diagonal directions static const int v1=TS, v2=2*TS, v3=3*TS, p1=-TS+1, p2=-2*TS+2, p3=-3*TS+3, m1=TS+1, m2=2*TS+2, m3=3*TS+3; - //neighborhood of a pixel - static const int nbr[5] = {-v2,-2,2,v2,0}; - //tolerance to avoid dividing by zero static const float eps=1e-5, epssq=1e-10; //tolerance to avoid dividing by zero @@ -62,18 +59,12 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh) { static const float arthresh=0.75; //nyquist texture test threshold static const float nyqthresh=0.5; - //diagonal interpolation test threshold - static const float pmthresh=0.25; - //factors for bounding interpolation in saturated regions - static const float lbd=1.0, ubd=1.0; //lbd=0.66, ubd=1.5 alternative values; //gaussian on 5x5 quincunx, sigma=1.2 static const float gaussodd[4] = {0.14659727707323927f, 0.103592713382435f, 0.0732036125103057f, 0.0365543548389495f}; //gaussian on 5x5, sigma=1.2 static const float gaussgrad[6] = {0.07384411893421103f, 0.06207511968171489f, 0.0521818194747806f, 0.03687419286733595f, 0.03099732204057846f, 0.018413194161458882f}; - //gaussian on 3x3, sigma =0.7 - static const float gauss1[3] = {0.3376688223162362f, 0.12171198028231786f, 0.04387081413862306f}; //gaussian on 5x5 alt quincunx, sigma=1.5 static const float gausseven[2] = {0.13719494435797422f, 0.05640252782101291f}; //guassian on quincunx grid @@ -246,8 +237,6 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh) { int c; //pointer counters within the tile int indx, indx1; - //direction counter for nbrs[] - int dir; //dummy indices int i, j; // +1 or -1 @@ -267,8 +256,6 @@ void RawImageSource::amaze_demosaic_RT(int winx, int winy, int winw, int winh) { float Ginthar, Ginthha, Gintvar, Gintvha; //color difference (G-R or G-B) variance in up/down/left/right directions float Dgrbvvaru, Dgrbvvard, Dgrbhvarl, Dgrbhvarr; - //gradients in various directions - float gradp, gradm, gradv, gradh, gradpm, gradhv; //color difference variances in vertical and horizontal directions float vcdvar, hcdvar, vcdvar1, hcdvar1, hcdaltvar, vcdaltvar; //adaptive interpolation weight using variance of color differences diff --git a/rtengine/calc_distort.cc b/rtengine/calc_distort.cc index 842ee6076..f71942265 100644 --- a/rtengine/calc_distort.cc +++ b/rtengine/calc_distort.cc @@ -35,7 +35,6 @@ double calcDistortion(unsigned char* img1, unsigned char* img2, int ncols, int n KLT_TrackingContext tc; KLT_FeatureList fl; KLT_FeatureTable ft; - int nFeatures = N_FEATURES; int i,n; double radius, wc, hc; diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 37ad193f0..8b276add3 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -59,7 +59,6 @@ void RawImageSource::CLASS cfa_linedn(float noise) { // local variables int height=H, width=W; - int verbose=1; const float clip_pt = 0.8*initialGain* 65535.0; diff --git a/rtengine/curves.cc b/rtengine/curves.cc index 189b6553c..f2846906d 100644 --- a/rtengine/curves.cc +++ b/rtengine/curves.cc @@ -661,7 +661,6 @@ namespace rtengine { // create a curve if needed DiagonalCurve* tcurve = NULL; - bool histNeeded = false; if (!curvePoints.empty() && curvePoints[0]!=0) { tcurve = new DiagonalCurve (curvePoints, CURVES_MIN_POLY_POINTS/skip); } diff --git a/rtengine/curves.h b/rtengine/curves.h index af1b11e77..b86bc7797 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -259,7 +259,7 @@ class DiagonalCurve : public Curve { public: DiagonalCurve (const std::vector& points, int ppn=CURVES_MIN_POLY_POINTS); - ~DiagonalCurve (); + virtual ~DiagonalCurve (); double getVal (double t); void getVal (const std::vector& t, std::vector& res); @@ -279,7 +279,7 @@ class FlatCurve : public Curve { public: FlatCurve (const std::vector& points, bool isPeriodic = true, int ppn=CURVES_MIN_POLY_POINTS); - ~FlatCurve (); + virtual ~FlatCurve (); double getVal (double t); void getVal (const std::vector& t, std::vector& res); diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index 306cacf01..fde11bedc 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -226,7 +226,7 @@ void phase_one_load_raw(); // ph1_bithuff(int nbits, ushort *huff); class ph1_bithuff_t { public: - ph1_bithuff_t(DCraw *p,IMFILE *&i,short &o):parent(p),bitbuf(0),vbits(0),ifp(i),order(o){} + ph1_bithuff_t(DCraw *p,IMFILE *&i,short &o):parent(p),order(o),ifp(i),bitbuf(0),vbits(0){} unsigned operator()(int nbits, ushort *huff); private: unsigned get4(){ diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 41c8cbaaa..717b3aff6 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -61,9 +61,6 @@ void Crop::setListener (DetailedCropListener* il) { void Crop::update (int todo) { Glib::Mutex::Lock lock(cropMutex); - //flag for testing color accuracy - bool colortest = false; - ProcParams& params = parent->params; diff --git a/rtengine/dcrop.h b/rtengine/dcrop.h index f11179dc3..5647d91a2 100644 --- a/rtengine/dcrop.h +++ b/rtengine/dcrop.h @@ -63,7 +63,7 @@ class Crop : public DetailedCrop { public: Crop (ImProcCoordinator* parent); - ~Crop (); + virtual ~Crop (); bool hasListener () { return cropImageListener; } void update (int todo); @@ -73,7 +73,7 @@ class Crop : public DetailedCrop { void fullUpdate (); // called via thread void setListener (DetailedCropListener* il); - void destroy () { delete this; } + void destroy () {} int get_skip () { return skip;} }; } diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index b44f7724b..9218acd6c 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -134,8 +134,6 @@ void RawImageSource::eahd_demosaic () { homv[1][j] = 0; } - const static int delta = 1; - int dLmaph[9]; int dLmapv[9]; int dCamaph[9]; @@ -595,7 +593,7 @@ void RawImageSource::vng4_demosaic () { int row, col, x, y, x1, x2, y1, y2, t, weight, grads, color, diag; int g, diff, thold, num, c, width=W, height=H, colors=4; float (*image)[4]; - int lcode[16][16][32], shift, i, j; + int lcode[16][16][32], shift, i; image = (float (*)[4]) calloc (H*W, sizeof *image); for (int ii=0; iisetProgressStr ("Demosaicing..."); @@ -905,7 +902,6 @@ void RawImageSource::ahd_demosaic(int winx, int winy, int winw, int winh) }; const float d65_white[3] = { 0.950456, 1, 1.088754 }; - const float d50_white[3] = { 0.96422, 1, 0.82521 }; if (plistener) { plistener->setProgressStr ("AHD Demosaicing..."); @@ -1119,7 +1115,6 @@ void RawImageSource::refinement_lassus() // Reinforce interpolated green pixels on RED/BLUE pixel locations #pragma omp for for (int row=6; row *DFManager::getHotPixels ( const std::string &mak, const std:: { dfInfo *df = find( mak, mod, iso, shut, t ); if( df ){ - if( settings->verbose ) - if( !df->pathname.empty() ) + if( settings->verbose ) { + if( !df->pathname.empty() ) { printf( "Searched hotpixels from %s\n",df->pathname.c_str()); - else if( !df->pathNames.empty() ) + } else { + if( !df->pathNames.empty() ) { printf( "Searched hotpixels from template (first %s)\n",df->pathNames.begin()->c_str()); + } + } + } return &df->getHotPixels(); }else return 0; diff --git a/rtengine/dirpyrLab_denoise.cc b/rtengine/dirpyrLab_denoise.cc index d25ea7e68..ec159f7cd 100644 --- a/rtengine/dirpyrLab_denoise.cc +++ b/rtengine/dirpyrLab_denoise.cc @@ -311,7 +311,6 @@ namespace rtengine { for(int j = 0, j1=0; j < width; j+=pitch, j1++) { float dirwt_l, dirwt_ab, norm_l, norm_ab; - float Lmed,Lhmf; //float lops,aops,bops; float Lout, aout, bout; norm_l = norm_ab = 0;//if we do want to include the input pixel in the sum @@ -414,7 +413,6 @@ namespace rtengine { #endif for(int i = 0; i < height; i++) for(int j = 0; j < width; j++) { - double wtdsum[3], norm; float hipass[3], hpffluct[3], tonefactor, nrfactor; tonefactor = (nrwt_l[data_coarse->L[i][j]]); @@ -469,7 +467,7 @@ namespace rtengine { //nrfctrave = nrfactorL[i][j]; //nrfctrave=1; - float hipass[3],p[9],temp,median; + float hipass[3]; //luma @@ -663,7 +661,7 @@ namespace rtengine { //nrfctrave=1; - float hipass[3],p[9],temp,median; + float hipass[3]; //luma diff --git a/rtengine/ex2simple.cc b/rtengine/ex2simple.cc index ed6b68f76..f78c4a967 100644 --- a/rtengine/ex2simple.cc +++ b/rtengine/ex2simple.cc @@ -32,7 +32,7 @@ class PListener : public rtengine::ProgressListener { } }; -clas MyPrevImgListener : public rtengine::PreviewImageListener { +class MyPrevImgListener : public rtengine::PreviewImageListener { IImage8* i; diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 7a6f2048e..68237f488 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -179,10 +179,9 @@ void FFManager::init( Glib::ustring pathname ) ffList.clear(); for (int i=0; isetProgressStr ("HL reconstruction..."); plistener->setProgress (0.0); } - float progress = 0.0; - int height = H; int width = W; @@ -205,7 +203,7 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b //%%%%%%%%%%%%%%%%%%%% //for blend algorithm: - static const float clipthresh = 0.95, blendthresh=1.0; + static const float blendthresh=1.0; const int ColorCount=3; // Transform matrixes rgb>lab and back static const float trans[2][ColorCount][ColorCount] = @@ -260,7 +258,6 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b sat -= black; float camwb[4]; for (int c=0; c<4; c++) camwb[c]=ri->get_cam_mul(c); - float min = MIN(MIN(camwb[0],camwb[1]),camwb[2]); multi_array2D channelblur(width,height,ARRAY2D_CLEAR_DATA); @@ -483,7 +480,6 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // now reconstruct clipped channels using color ratios - const float Yclip = (0.299*max[0] + 0.587*max[1] + 0.114*max[2]); //const float Yclip = 0.3333*(max[0] + max[1] + max[2]); //float sumwt=0, counts=0; @@ -514,16 +510,16 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b } // Calculate the lightness correction ratio (chratio) - for (int i=0; i<2; i++) { + for (int i2=0; i2<2; i2++) { FOREACHCOLOR { - lab[i][c]=0; + lab[i2][c]=0; for (int j=0; j < ColorCount; j++) - lab[i][c] += trans[ColorCount-3][c][j] * cam[i][j]; + lab[i2][c] += trans[ColorCount-3][c][j] * cam[i2][j]; } - sum[i]=0; + sum[i2]=0; for (int c=1; c < ColorCount; c++) - sum[i] += SQR(lab[i][c]); + sum[i2] += SQR(lab[i2][c]); } chratio = sqrt(sum[1]/sum[0]); @@ -556,7 +552,7 @@ void RawImageSource :: HLRecovery_inpaint (float** red, float** green, float** b //there are clipped highlights //first, determine weighted average of unclipped extensions (weighting is by 'hue' proximity) - float dirwt, factor, Y, I, Q; + float dirwt, factor, Y; float totwt=0;//0.0003; float clipfix[3]={0,0,0};//={totwt*rgb_blend[0],totwt*rgb_blend[1],totwt*rgb_blend[2]}; for (int dir=0; dir2) || (phase==3 && count[0]>1)) { rec[c1][i][j] = - (int) ((double)rec[co][i][j] / ratio[0] * count[0]); changed++; @@ -224,7 +222,6 @@ void RawImageSource::HLRecovery_ColorPropagation (float* red, float* green, floa if (blr<0 || blr>=H/HR_SCALE-2) return; double mr1 = 1.0 - ((double)((i+HR_SCALE/2) % HR_SCALE) / HR_SCALE + 0.5 / HR_SCALE); - int jx = 0; int maxcol = W/HR_SCALE-2; for (int j=sx1, jx=0; jx getIPTCData () const; diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 8592ff97e..df012bca7 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -219,9 +219,6 @@ int ImageIO::loadPNG (Glib::ustring fname) { else png_set_gamma(png,2.0, 0.45455); - int bps = getBPS (); - - // if (bps==8 && bit_depth==16) png_set_strip_16(png); //updating png info struct @@ -293,7 +290,6 @@ int ImageIO::loadJPEGFromMemory (const char* buffer, int bufsize) //jpeg_memory_src (&cinfo,buffer,bufsize); jpeg_read_header(&cinfo, TRUE); - unsigned int proflen; if( loadedProfileData ){ delete [] loadedProfileData; loadedProfileData = NULL; @@ -371,7 +367,6 @@ int ImageIO::loadJPEG (Glib::ustring fname) { return IMIO_READERROR; } - unsigned int proflen; delete loadedProfileData; loadedProfileData = NULL; bool hasprofile = read_icc_profile (&cinfo, (JOCTET**)&loadedProfileData, (unsigned int*)&loadedProfileLength); diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 03107b70e..9211da117 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -178,10 +178,10 @@ void ImProcFunctions::firstAnalysis (Imagefloat* original, const ProcParams* par memset (hist[i], 0, 65536*sizeof(int)); } - int H = original->height; #ifdef _OPENMP #pragma omp parallel if (multiThread) { + int H = original->height; int tid = omp_get_thread_num(); int nthreads = omp_get_num_threads(); int blk = H/nthreads; @@ -673,7 +673,6 @@ fclose(f);*/ void ImProcFunctions::getAutoExp (LUTu & histogram, int histcompr, double defgain, double clip, double& expcomp, int& bright, int& contr, int& black, int& hlcompr, int& hlcomprthresh) { - double corr = 1;//pow(2.0, defgain);//defgain may be redundant legacy of superceded code??? float scale = 65536.0; float midgray=0.15;//0.18445f;//middle gray in linear gamma = 0.18445*65535 @@ -789,7 +788,6 @@ fclose(f);*/ //now tune hlcompr to bring back rawmax to 65535 hlcomprthresh = 33; - float shoulder = ((scale/MAX(1,gain))*(hlcomprthresh/200.0))+0.1; //this is a series approximation of the actual formula for comp, //which is a transcendental equation float comp = (gain*((float)whiteclip)/scale - 1)*2;//*(1-shoulder/scale); @@ -1019,7 +1017,7 @@ fclose(f);*/ void ImProcFunctions::calcGamma (double pwr, double ts, int mode, int imax, double &gamma0, double &gamma1, double &gamma2, double &gamma3, double &gamma4, double &gamma5) { {//from Dcraw (D.Coffin) int i; - double g[6], bnd[2]={0,0}, r; + double g[6], bnd[2]={0,0}; g[0] = pwr; g[1] = ts; diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 21cf4b5d9..d30c34879 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -65,7 +65,6 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { #pragma omp parallel for for (int i=0; iH; i++) { float buffer[3*lab->W]; - float g; const int ix = i * 3 * lab->W; int iy = 0; @@ -102,7 +101,6 @@ void ImProcFunctions::lab2rgb (LabImage* lab, Image8* image) { float* ra = lab->a[i]; float* rb = lab->b[i]; int ix = i * 3 * lab->W; - float g; float R,G,B; float fy,fx,fz,x_,y_,z_; @@ -158,7 +156,6 @@ Image8* ImProcFunctions::lab2rgb (LabImage* lab, int cx, int cy, int cw, int ch, #pragma omp parallel for for (int i=cy; iL[i]; float* ra = lab->a[i]; @@ -246,7 +242,6 @@ Image16* ImProcFunctions::lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int if (oprof) { #pragma omp parallel for if (multiThread) for (int i=cy; iL[i]; float* ra = lab->a[i]; float* rb = lab->b[i]; @@ -279,7 +274,6 @@ Image16* ImProcFunctions::lab2rgb16 (LabImage* lab, int cx, int cy, int cw, int } else { #pragma omp parallel for if (multiThread) for (int i=cy; iL[i]; float* ra = lab->a[i]; @@ -317,7 +311,6 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int if (cy+ch>lab->H) ch = lab->H-cy; Image16* image = new Image16 (cw, ch); - cmsBool rc = TRUE; float p1,p2,p3,p4,p5,p6;//primaries //double ga0,ga1,ga2,ga3,ga4,ga5=0.0,ga6=0.0;//gamma parameters double g_a0,g_a1,g_a2,g_a3,g_a4,g_a5;//gamma parameters @@ -388,7 +381,6 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int if (oprofdef) { #pragma omp parallel for if (multiThread) for (int i=cy; iL[i]; float* ra = lab->a[i]; float* rb = lab->b[i]; @@ -422,7 +414,6 @@ Image16* ImProcFunctions::lab2rgb16b (LabImage* lab, int cx, int cy, int cw, int // #pragma omp parallel for if (multiThread) for (int i=cy; iL[i]; float* ra = lab->a[i]; diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index bd91c21a2..6fb6a25e4 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -254,7 +254,7 @@ void ImProcFunctions::MLsharpen (LabImage* lab) { int offset,c,i,j,p,width2; int width = lab->W, height = lab->H; - float *L,lumH,lumV,lumD1,lumD2,v,contrast,med,s; + float *L,lumH,lumV,lumD1,lumD2,v,contrast,s; float difL,difR,difT,difB,difLT,difRB,difLB,difRT,wH,wV,wD1,wD2,chmax[3]; float f1,f2,f3,f4; float templab; @@ -431,7 +431,7 @@ void ImProcFunctions::MLmicrocontrast(LabImage* lab) { // k=2 matrix 5x5 k=1 matrix 3x3 int offset,offset2,c,i,j,col,row,n; float temp,temp2,temp3,temp4,tempL; - float *LM,v,s,contrast,w; + float *LM,v,s,contrast; int signs[25]; int width = lab->W, height = lab->H; float uniform = params->sharpenMicro.uniformity;//between 0 to 100 @@ -476,7 +476,7 @@ void ImProcFunctions::MLmicrocontrast(LabImage* lab) { LM[offset] = lab->L[j][i]/327.68f;// adjust to 0.100 and to RT variables } -#pragma omp parallel for private(j,i,offset,s,signs,v,n,row,col,offset2,contrast,temp,w,temp2,temp3,tempL,temp4) shared(lab,LM,amount,chmax,unif,k,L98,L95,L92,L90,L87,L83,L80,L75,L70,L63,L58,Cont0,Cont1,Cont2,Cont3,Cont4,Cont5) +#pragma omp parallel for private(j,i,offset,s,signs,v,n,row,col,offset2,contrast,temp,temp2,temp3,tempL,temp4) shared(lab,LM,amount,chmax,unif,k,L98,L95,L92,L90,L87,L83,L80,L75,L70,L63,L58,Cont0,Cont1,Cont2,Cont3,Cont4,Cont5) for(j=k; jheight; y++) { double vig_y_d = (double) (y + cy) - vig_h2 ; - int val; for (int x=0; xwidth; x++) { double vig_x_d = (double) (x + cx) - vig_w2 ; double r = sqrt(vig_x_d*vig_x_d + vig_y_d*vig_y_d); diff --git a/rtengine/klt/trackFeatures.cc b/rtengine/klt/trackFeatures.cc index 4c9b063fa..2b6b81f5f 100644 --- a/rtengine/klt/trackFeatures.cc +++ b/rtengine/klt/trackFeatures.cc @@ -195,7 +195,6 @@ static void _computeGradientSumLightingInsensitive( float g1, g2, sum1_squared = 0, sum2_squared = 0; int i, j; - float sum1 = 0, sum2 = 0; float mean1, mean2, alpha; for (j = -hh ; j <= hh ; j++) for (i = -hw ; i <= hw ; i++) { diff --git a/rtengine/processingjob.cc b/rtengine/processingjob.cc index bbf7e46f8..6b1c30d28 100644 --- a/rtengine/processingjob.cc +++ b/rtengine/processingjob.cc @@ -32,7 +32,7 @@ ProcessingJob* ProcessingJob::create (InitialImage* initialImage, const procpara void ProcessingJob::destroy (ProcessingJob* job) { - delete (ProcessingJobImpl*) job; + delete static_cast(job); } } diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 4bab16460..2c7e54850 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -45,7 +45,7 @@ RawImage::~RawImage() int RawImage::get_colorsCoeff( float *pre_mul_, float *scale_mul_, float *cblack_) { - unsigned row, col, ur, uc, i, x, y, c, sum[8]; + unsigned row, col, x, y, c, sum[8]; unsigned W = this->get_width(); unsigned H = this->get_height(); int val, dark, sat; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 61513bcf7..90610e01f 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -432,7 +432,7 @@ void RawImageSource::getImage (ColorTemp ctemp, int tran, Imagefloat* image, Pre // Color correction (only when running on full resolution) if (ri->isBayer() && pp.skip==1) processFalseColorCorrection (image, raw.ccSteps); - colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, ((const ImageData*)getMetaData())->getCamera(), defGain); + colorSpaceConversion (image, cmp, embProfile, camProfile, xyz_cam, (static_cast(getMetaData()))->getCamera(), defGain); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1222,7 +1222,7 @@ void RawImageSource::copyOriginalPixels(const RAWParams &raw, RawImage *src, Raw else //(raw.ff_BlurType == RAWParams::ff_BlurTypestring[RAWParams::area_ff]) cfaboxblur(riFlatFile, cfablur, BS, BS); - float refctrval,reflocval,refcolor[2][2],vignettecorr,colorcastcorr; + float refcolor[2][2],vignettecorr; //find center ave values by channel for (int m=0; m<2; m++) for (int n=0; n<2; n++) { @@ -1297,7 +1297,6 @@ void RawImageSource::cfaboxblur(RawImage *riFlatFile, float* cfablur, int boxH, float (*cfatmp); cfatmp = (float (*)) calloc (H*W, sizeof *cfatmp); - float clean0, clean1; float hotdeadthresh = 0.5; for (int i=0; ilock (); cmsHTRANSFORM hTransform = cmsCreateTransform (in, (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|PLANAR_SH(1)), out, (FLOAT_SH(1)|COLORSPACE_SH(PT_RGB)|CHANNELS_SH(3)|BYTES_SH(4)|PLANAR_SH(1)), INTENT_RELATIVE_COLORIMETRIC, // float is clipless, so don't trim it @@ -2093,7 +2088,6 @@ void RawImageSource::HLRecovery_CIELab (float* rin, float* gin, float* bin, floa // lookup table for Lab conversion // perhaps should be centralized, universally defined so we don't keep remaking it??? - ImProcFunctions::cachef; /*for (int ix=0; ix < 0x10000; ix++) { float rx = ix / 65535.0; fv[ix] = rx > 0.008856 ? exp(1.0/3 * log(rx)) : 7.787*rx + 16/116.0; diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index c15cf910c..f170889b5 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -95,6 +95,8 @@ namespace rtengine { /** Functions to convert between floating point and string representation of exposure compensation */ static std::string expcompToString (double expcomp, bool maskZeroexpcomp); + virtual ~ImageMetaData () {} + /** Reads metadata from file. * @param fname is the name of the file * @param rml is a struct containing information about metadata location. Use it only for raw files. In case @@ -147,6 +149,7 @@ namespace rtengine { * (the last one deletes the instance automatically). */ virtual void decreaseRef () {} + virtual ~InitialImage () {} /** Loads an image into the memory. * @param fname the name of the file diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 68e21c086..b2906c56b 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -263,9 +263,6 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->greenMultiplier = ri->get_pre_mul(1); tpp->blueMultiplier = ri->get_pre_mul(2); - float pre_mul[4], scale_mul[4]; - int cblack[4]; - ri->scale_colors(); ri->pre_interpolate(); @@ -306,7 +303,6 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati if (!ri->get_model().compare("D1X")) hskip *= 2; - int ix = 0; int rofs = 0; int tmpw = (width - 2) / hskip; int tmph = (height - 2) / vskip; @@ -362,8 +358,6 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati continue; double fr = r - ur; double fc = c - uc; - int oofs = (ur * tmpw + uc) * 3; - int fofs = (row * wide + col) * 3; fImg->r[row][col] = (tmpImg->r[ur][uc] * (1 - fc) + tmpImg->r[ur][uc + 1] * fc) * (1 - fr) + (tmpImg->r[ur + 1][uc] * (1 - fc) @@ -1150,7 +1144,6 @@ bool Thumbnail::writeImage (const Glib::ustring& fname, int format) { jpeg_set_quality (&cinfo, 87, true); jpeg_start_compress(&cinfo, TRUE); - int rowlen = thumbImg->width*3; while (cinfo.next_scanline < cinfo.image_height) { unsigned char* row = tmpdata + cinfo.next_scanline*thumbImg->width*3; if (jpeg_write_scanlines (&cinfo, &row, 1) < 1) { diff --git a/rtengine/safegtk.cc b/rtengine/safegtk.cc index 3b3f499d7..f31965c11 100644 --- a/rtengine/safegtk.cc +++ b/rtengine/safegtk.cc @@ -262,12 +262,6 @@ bool safe_spawn_command_line_async (const Glib::ustring& cmd_utf8) bool safe_spawn_command_line_sync (const Glib::ustring& cmd_utf8) { - std::string cmd; - std::string stdOut; - std::string stdErr; - - //bool success = false; // unused - int exitStatus=-1; try { //cmd = Glib::filename_from_utf8(cmd_utf8); diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 403e7302e..112de6ddf 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -41,7 +41,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p errorCode = 0; - ProcessingJobImpl* job = (ProcessingJobImpl*) pjob; + ProcessingJobImpl* job = static_cast(pjob); if (pl) { pl->setProgressStr ("PROGRESSBAR_PROCESSING"); diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 8a8ecf0f6..50d7f6dcf 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -1418,6 +1418,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const std::vector< TagDirectory* cl; if (root) + //FIXME: static_cast needed here cl = ((TagDirectory*)root)->clone (NULL); else cl = new TagDirectory (NULL, ifdAttribs, INTEL); @@ -1454,6 +1455,7 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const std::vector< TagDirectory* cl; if (root) + //FIXME: static_cast needed here cl = ((TagDirectory*)root)->clone (NULL); else cl = new TagDirectory (NULL, ifdAttribs, INTEL); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 72d949981..43334a8c2 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -229,8 +229,8 @@ Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring filename int cancelItemUI (void* data) { - safe_g_remove( ((BatchQueueEntry*)data)->savedParamsFile ); - delete (BatchQueueEntry*)data; + safe_g_remove( (static_cast(data))->savedParamsFile ); + delete static_cast(data); return 0; } @@ -344,7 +344,7 @@ void BatchQueue::startProcessing () { Glib::RWLock::WriterLock l(entryRW); #endif - next = (BatchQueueEntry*)fd[0]; + next = static_cast(fd[0]); // tag it as processing next->processing = true; processing = next; @@ -425,7 +425,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { queueEmptied=true; } else if (listener && listener->canStartNext ()) { - BatchQueueEntry* next = (BatchQueueEntry*)fd[0]; + BatchQueueEntry* next = static_cast(fd[0]); // tag it as selected next->processing = true; processing = next; @@ -588,7 +588,7 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c } int setProgressUI (void* p) { - ((BatchQueue*)p)->redraw(); + (static_cast(p))->redraw(); return 0; } @@ -603,7 +603,7 @@ void BatchQueue::setProgress (double p) { void BatchQueue::buttonPressed (LWButton* button, int actionCode, void* actionData) { std::vector bqe; - bqe.push_back ((BatchQueueEntry*)actionData); + bqe.push_back (static_cast(actionData)); if (actionCode==10) // cancel cancelItems (&bqe); diff --git a/rtgui/crop.cc b/rtgui/crop.cc index 43e52a6ad..d510b038c 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -462,12 +462,12 @@ void Crop::enabledChanged () { } int notifyListenerUI (void* data) { - ((Crop*)data)->notifyListener (); + (static_cast(data))->notifyListener (); return 0; } int refreshSpinsUI (void* data) { - RefreshSpinHelper* rsh = (RefreshSpinHelper*) data; + RefreshSpinHelper* rsh = static_cast(data); rsh->crop->refreshSpins (rsh->notify); delete rsh; return 0; diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index e2054f3dd..71082a79a 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -732,7 +732,6 @@ void CropWindow::expose (Cairo::RefPtr cr) { float sum_L, sum_L2; float sumsq_L, sumsq_L2; //sum of deviations squared float stdDev_L, stdDev_L2; - float focus_gradation, focus_coef; float focus_thresh, focus_thresh2; int kernel_size, kernel_size2;// count of pixels in the blur kernel float opacity = 0.9;//TODO: implement opacity diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index 19eb44380..b049f3fd5 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -96,7 +96,7 @@ class CropWindow : public LWButtonListener, public CropHandlerListener { public: CropHandler cropHandler; CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_, bool isLowUpdatePriority_); - ~CropWindow (); + virtual ~CropWindow (); void setDecorated (bool decorated) { this->decorated = decorated; } void setFitZoomEnabled (bool fze) { fitZoomEnabled = fze; } diff --git a/rtgui/curveeditor.cc b/rtgui/curveeditor.cc index c2468b877..ed4acc613 100644 --- a/rtgui/curveeditor.cc +++ b/rtgui/curveeditor.cc @@ -28,7 +28,7 @@ extern Glib::ustring argv0; -DiagonalCurveEditor::DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup) : CurveEditor::CurveEditor(text, (CurveEditorGroup*) ceGroup, ceSubGroup) { +DiagonalCurveEditor::DiagonalCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup) : CurveEditor::CurveEditor(text, static_cast(ceGroup), ceSubGroup) { // Order set in the same order than "enum DiagonalCurveType". Shouldn't change, for compatibility reason curveType->addEntry("curveType-linear.png", M("CURVEEDITOR_LINEAR")); // 0 Linear @@ -56,7 +56,7 @@ std::vector DiagonalCurveEditor::getCurve () { } } -FlatCurveEditor::FlatCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup, bool isPeriodic) : CurveEditor::CurveEditor(text, (CurveEditorGroup*) ceGroup, ceSubGroup) { +FlatCurveEditor::FlatCurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEditorSubGroup* ceSubGroup, bool isPeriodic) : CurveEditor::CurveEditor(text, static_cast(ceGroup), ceSubGroup) { periodic = isPeriodic; diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index 17b8b2b18..d321f1130 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -66,14 +66,14 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe if (!diagonalSubGroup) { diagonalSubGroup = new DiagonalCurveEditorSubGroup(this); } - return (CurveEditor*)diagonalSubGroup->addCurve(curveLabel); + return (static_cast(diagonalSubGroup->addCurve(curveLabel))); case (CT_Flat): if (!flatSubGroup) { flatSubGroup = new FlatCurveEditorSubGroup(this); } - return (CurveEditor*)flatSubGroup->addCurve(curveLabel, periodic); + return (static_cast(flatSubGroup->addCurve(curveLabel, periodic))); default: - return (CurveEditor*)NULL; + return (static_cast(NULL)); break; } } @@ -238,7 +238,7 @@ void CurveEditorGroup::setCurveExternal (CurveEditor* ce, const std::vectorsubGroup->storeCurveValues(ce, c); // The new curve is saved in the CurveEditor (ce)->selected = c[0]; // We set the selected curve type in the CurveEditor to the one of the specified curve } - updateGUI((CurveEditor*)ce); // And we update the GUI if necessary + updateGUI(static_cast(ce)); // And we update the GUI if necessary } /* diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc index 2a678fb90..e4795e13b 100644 --- a/rtgui/diagonalcurveeditorsubgroup.cc +++ b/rtgui/diagonalcurveeditorsubgroup.cc @@ -254,7 +254,7 @@ void DiagonalCurveEditorSubGroup::switchGUI() { removeEditor(); - DiagonalCurveEditor* dCurve = (DiagonalCurveEditor*)(parent->displayedCurve); + DiagonalCurveEditor* dCurve = static_cast(parent->displayedCurve); if (dCurve) { @@ -507,13 +507,13 @@ void DiagonalCurveEditorSubGroup::storeCurveValues (CurveEditor* ce, const std:: switch (t) { case (DCT_Spline): - ((DiagonalCurveEditor*)ce)->customCurveEd = p; + (static_cast(ce))->customCurveEd = p; break; case (DCT_Parametric): - ((DiagonalCurveEditor*)ce)->paramCurveEd = p; + (static_cast(ce))->paramCurveEd = p; break; case (DCT_NURBS): - ((DiagonalCurveEditor*)ce)->NURBSCurveEd = p; + (static_cast(ce))->NURBSCurveEd = p; break; default: break; diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index d6b227f85..cadf0dee7 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -61,7 +61,7 @@ protected: public: DiagonalCurveEditorSubGroup(CurveEditorGroup* prt); - ~DiagonalCurveEditorSubGroup(); + virtual ~DiagonalCurveEditorSubGroup(); DiagonalCurveEditor* addCurve(Glib::ustring curveLabel = ""); virtual void updateBackgroundHistogram (CurveEditor* ce); diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index ab1604ef2..d9f05914a 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -161,11 +161,11 @@ void DirBrowser::updateVolumes () { } int updateVolumesUI (void* br) { - ((DirBrowser*)br)->updateVolumes (); + (static_cast(br))->updateVolumes (); return 1; } int updateDirTreeUI (void* br) { - ((DirBrowser*)br)->updateDirTreeRoot (); + (static_cast(br))->updateDirTreeRoot (); return 0; } @@ -282,8 +282,6 @@ Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath) { Gtk::TreeModel::Path path; path.append_index(0); - int end = 0; - int beg = 0; char* dcpy = strdup (absDirPath.c_str()); char* dir = strtok (dcpy, "/\\"); int count = 0; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 170f2ad84..744fc23a6 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -609,7 +609,7 @@ void EditorPanel::refreshProcessingState (bool inProcessingP) { s->val = 1.0; #ifdef WIN32 - if (!firstProcessingDone && (RTWindow*)parent->getIsFullscreen()) { parent->fullscreen(); } + if (!firstProcessingDone && static_cast(parent)->getIsFullscreen()) { parent->fullscreen(); } #endif firstProcessingDone = true; } diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index f87e9e80f..57b3fe695 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -114,7 +114,7 @@ bool EditWindow::on_window_state_event(GdkEventWindowState* event) { void EditWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) { if (page_num > 1) { - EditorPanel *ep = (EditorPanel *)mainNB->get_nth_page(page_num); + EditorPanel *ep = static_cast(mainNB->get_nth_page(page_num)); ep->setAspect(); } } @@ -175,7 +175,7 @@ bool EditWindow::keyPressed (GdkEventKey* event) { toggleFullscreen(); return true; } else { - EditorPanel* ep = (EditorPanel*)mainNB->get_nth_page (mainNB->get_current_page()); + EditorPanel* ep = static_cast(mainNB->get_nth_page (mainNB->get_current_page())); return ep->handleShortcutKey (event); } } diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 4bc333a71..b696ab641 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -198,6 +198,7 @@ Gtk::TreeModel::Children ExifPanel::addTag (const Gtk::TreeModel::Children& root void ExifPanel::addDirectory (const TagDirectory* dir, Gtk::TreeModel::Children root) { for (int i=0; igetCount(); i++) { + //FIXME: static_cast needed here Tag* t = ((TagDirectory*)dir)->getTagByIndex (i); if (t->getAttrib() && t->getAttrib()->action==SYSTEM) continue; diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index a558572b2..737e9004d 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -224,12 +224,12 @@ void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry) { trash->set_sensitive (false); untrash->set_sensitive (false); for (int i=0; ithumbnail->getStage()==1) { + if ((static_cast(selected[i]))->thumbnail->getStage()==1) { untrash->set_sensitive (true); break; } for (int i=0; ithumbnail->getStage()==0) { + if ((static_cast(selected[i]))->thumbnail->getStage()==0) { trash->set_sensitive (true); break; } @@ -304,7 +304,7 @@ void FileBrowser::doubleClicked (ThumbBrowserEntryBase* entry) { if (tbl && entry) { std::vector entries; - entries.push_back (((FileBrowserEntry*)entry)->thumbnail); + entries.push_back ((static_cast(entry))->thumbnail); tbl->openRequested (entries); } } @@ -406,7 +406,7 @@ FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname) { lastClicked = NULL; redraw (); - return (FileBrowserEntry*)entry; + return (static_cast(entry)); } return NULL; } @@ -446,7 +446,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { std::vector mselected; for (int i=0; i(selected[i])); if (!tbl || (m!=selall && mselected.empty()) ) return; @@ -622,14 +622,14 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) { void FileBrowser::copyProfile () { if (selected.size()==1) - clipboard.setProcParams (((FileBrowserEntry*)selected[0])->thumbnail->getProcParams()); + clipboard.setProcParams ((static_cast(selected[0]))->thumbnail->getProcParams()); } void FileBrowser::pasteProfile () { std::vector mselected; for (int i=0; i(selected[i])); if (!tbl || mselected.empty()) return; @@ -644,7 +644,7 @@ void FileBrowser::partPasteProfile () { std::vector mselected; for (int i=0; i(selected[i])); if (!tbl || mselected.empty()) return; @@ -665,7 +665,7 @@ void FileBrowser::partPasteProfile () { void FileBrowser::openDefaultViewer (int destination) { if (selected.size()==1) - ((FileBrowserEntry*)selected[0])->thumbnail->openDefaultViewer(destination); + (static_cast(selected[0]))->thumbnail->openDefaultViewer(destination); } bool FileBrowser::keyPressed (GdkEventKey* event) { @@ -729,7 +729,7 @@ void FileBrowser::applyMenuItemActivated (Glib::ustring ppname) { rtengine::procparams::ProcParams* pparams = profileStore.getProfile (ppname); if (pparams && !selected.empty()) { for (int i=0; ithumbnail->setProcParams (*pparams, FILEBROWSER); + (static_cast(selected[i]))->thumbnail->setProcParams (*pparams, FILEBROWSER); queue_draw (); } } @@ -747,9 +747,9 @@ void FileBrowser::applyPartialMenuItemActivated (Glib::ustring ppname) { for (int i=0; ithumbnail->createProcParamsForUpdate(false, false); // this can execute customprofilebuilder to generate param file - rtengine::procparams::ProcParams params = ((FileBrowserEntry*)selected[i])->thumbnail->getProcParams (); + rtengine::procparams::ProcParams params = (static_cast(selected[i]))->thumbnail->getProcParams (); partialPasteDlg.applyPaste (¶ms, pparams); - ((FileBrowserEntry*)selected[i])->thumbnail->setProcParams (params, FILEBROWSER); + (static_cast(selected[i]))->thumbnail->setProcParams (params, FILEBROWSER); } queue_draw (); } @@ -791,7 +791,7 @@ void FileBrowser::applyFilter (const BrowserFilter& filter) { bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) { // true -> entry complies filter - FileBrowserEntry* entry = (FileBrowserEntry*)entryb; + FileBrowserEntry* entry = static_cast(entryb); // return false if basic filter settings are not satisfied if ((filter.showRanked[entry->thumbnail->getRank()]==false ) || (filter.showCLabeled[entry->thumbnail->getColorLabel()]==false ) || @@ -926,17 +926,17 @@ void FileBrowser::buttonPressed (LWButton* button, int actionCode, void* actionD if (actionCode>=0 && actionCode<=5) { // rank std::vector tbe; - tbe.push_back ((FileBrowserEntry*)actionData); + tbe.push_back (static_cast(actionData)); rankingRequested (tbe, actionCode); } else if (actionCode==6 && tbl) { // to processing queue std::vector tbe; - tbe.push_back ((FileBrowserEntry*)actionData); + tbe.push_back (static_cast(actionData)); tbl->developRequested (tbe, false); // not a fast, but a FULL mode } else if (actionCode==7) { // to trash / undelete std::vector tbe; - FileBrowserEntry* entry = (FileBrowserEntry*)actionData; + FileBrowserEntry* entry = static_cast(actionData); tbe.push_back (entry); if (entry->thumbnail->getStage()==0) toTrashRequested (tbe); @@ -956,13 +956,13 @@ void FileBrowser::openNextImage () { if (editedFiles.find (fd[i]->filename)!=editedFiles.end()) if (i entries; - entries.push_back (((FileBrowserEntry*)fd[i+1])->thumbnail); + entries.push_back ((static_cast(fd[i+1]))->thumbnail); tbl->openRequested (entries); return; } if (tbl) { std::vector entries; - entries.push_back (((FileBrowserEntry*)fd[0])->thumbnail); + entries.push_back ((static_cast(fd[0]))->thumbnail); tbl->openRequested (entries); } } @@ -979,20 +979,20 @@ void FileBrowser::openPrevImage () { if (editedFiles.find (fd[i]->filename)!=editedFiles.end()) if (i>0 && tbl) { std::vector entries; - entries.push_back (((FileBrowserEntry*)fd[i-1])->thumbnail); + entries.push_back ((static_cast(fd[i-1]))->thumbnail); tbl->openRequested (entries); return; } if (tbl) { std::vector entries; - entries.push_back (((FileBrowserEntry*)fd[fd.size()-1])->thumbnail); + entries.push_back ((static_cast(fd[fd.size()-1]))->thumbnail); tbl->openRequested (entries); } } } int refreshThumbImagesUI (void* data) { - ((FileBrowser*)data)->_thumbRearrangementNeeded (); + (static_cast(data))->_thumbRearrangementNeeded (); return 0; } @@ -1014,7 +1014,7 @@ void FileBrowser::notifySelectionListener () { if (tbl) { std::vector thm; for (int i=0; ithumbnail); + thm.push_back ((static_cast(selected[i]))->thumbnail); tbl->selectionChanged (thm); } } diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 48888b766..eba3c3731 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -137,7 +137,7 @@ void FileBrowserEntry::getIconSize (int& w, int& h) { FileThumbnailButtonSet* FileBrowserEntry::getThumbButtonSet () { - return (FileThumbnailButtonSet*)buttonSet; + return (static_cast(buttonSet)); } void FileBrowserEntry::procParamsChanged (Thumbnail* thm, int whoChangedIt) { diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 339c735af..1dd9c3b78 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -559,7 +559,7 @@ void FileCatalog::_refreshProgressBar () { } int refreshProgressBarUI (void* data) { - ((FileCatalog*)data)->_refreshProgressBar (); + (static_cast(data))->_refreshProgressBar (); return 0; } @@ -611,7 +611,7 @@ void FileCatalog::previewReadyUI (int dir_id, FileBrowserEntry* fdn) { int prevfinished (void* data) { GThreadLock lock; - ((FileCatalog*)data)->previewsFinishedUI (); + (static_cast(data))->previewsFinishedUI (); return 0; } @@ -807,7 +807,7 @@ void FileCatalog::copyMoveRequested (std::vector tbe, bool m // re-attach cache files cacheMgr->renameEntry (src_fPath, tbe[i]->thumbnail->getMD5(), dest_fPath); // remove from browser - FileBrowserEntry* t = fileBrowser->delEntry (src_fPath); + fileBrowser->delEntry (src_fPath); previewsLoaded--; } @@ -1352,7 +1352,7 @@ void FileCatalog::reparseDirectory () { #ifdef WIN32 int winDirChangedUITread (void* cat) { - ((FileCatalog*)cat)->reparseDirectory (); + (static_cast(cat))->reparseDirectory (); return 0; } @@ -1426,8 +1426,8 @@ void FileCatalog::emptyTrash () { const std::vector t = fileBrowser->getEntries (); std::vector toDel; for (size_t i=0; ithumbnail->getStage()==1) - toDel.push_back (((FileBrowserEntry*)t[i])); + if ((static_cast(t[i]))->thumbnail->getStage()==1) + toDel.push_back (static_cast(t[i])); deleteRequested (toDel, false); trashChanged(); } @@ -1435,7 +1435,7 @@ void FileCatalog::emptyTrash () { bool FileCatalog::trashIsEmpty () { const std::vector t = fileBrowser->getEntries (); for (size_t i=0; ithumbnail->getStage()==1) + if ((static_cast(t[i]))->thumbnail->getStage()==1) return false; return true; diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 4e0863752..34041a40d 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -22,7 +22,7 @@ #include "../rtengine/safegtk.h" int FilePanelInitUI (void* data) { - ((FilePanel*)data)->init (); + (static_cast(data))->init (); return 0; } diff --git a/rtgui/flatcurveeditorsubgroup.cc b/rtgui/flatcurveeditorsubgroup.cc index 3835beeae..7974395b1 100644 --- a/rtgui/flatcurveeditorsubgroup.cc +++ b/rtgui/flatcurveeditorsubgroup.cc @@ -90,7 +90,7 @@ void FlatCurveEditorSubGroup::switchGUI() { removeEditor(); - FlatCurveEditor* dCurve = (FlatCurveEditor*)(parent->displayedCurve); + FlatCurveEditor* dCurve = static_cast(parent->displayedCurve); if (dCurve) { @@ -202,12 +202,12 @@ void FlatCurveEditorSubGroup::restoreDisplayedHistogram() { void FlatCurveEditorSubGroup::storeCurveValues (CurveEditor* ce, const std::vector& p) { if (!p.empty()) { - FlatCurveType t = (FlatCurveType)p[0]; + FlatCurveType t = static_cast(p[0]); for (int i=0; i<(int)p.size(); i++) switch (t) { case (FCT_MinMaxCPoints): - ((FlatCurveEditor*)ce)->controlPointsCurveEd = p; + static_cast(ce)->controlPointsCurveEd = p; break; default: break; diff --git a/rtgui/flatcurveeditorsubgroup.h b/rtgui/flatcurveeditorsubgroup.h index 542e32956..78e9cdbf2 100644 --- a/rtgui/flatcurveeditorsubgroup.h +++ b/rtgui/flatcurveeditorsubgroup.h @@ -38,7 +38,7 @@ protected: public: FlatCurveEditorSubGroup(CurveEditorGroup* prt); - ~FlatCurveEditorSubGroup(); + virtual ~FlatCurveEditorSubGroup(); FlatCurveEditor* addCurve(Glib::ustring curveLabel = "", bool periodic = true); //virtual void updateBackgroundHistogram (CurveEditor* ce); diff --git a/rtgui/hsvequalizer.cc b/rtgui/hsvequalizer.cc index 959424483..7ea4b62d7 100644 --- a/rtgui/hsvequalizer.cc +++ b/rtgui/hsvequalizer.cc @@ -31,9 +31,9 @@ HSVEqualizer::HSVEqualizer () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG->setCurveListener (this); curveEditorG->setColorProvider (this); - hshape = (FlatCurveEditor*)curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_HUE")); - sshape = (FlatCurveEditor*)curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_SAT")); - vshape = (FlatCurveEditor*)curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_VAL")); + hshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_HUE"))); + sshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_SAT"))); + vshape = static_cast(curveEditorG->addCurve(CT_Flat, M("TP_HSVEQUALIZER_VAL"))); // This will add the reset button at the end of the curveType buttons curveEditorG->curveListComplete(); diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc index ae62dca78..32a03a2cf 100644 --- a/rtgui/labcurve.cc +++ b/rtgui/labcurve.cc @@ -71,9 +71,9 @@ LCurve::LCurve () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG->setCurveListener (this); curveEditorG->setColorProvider (this); - lshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "L"); - ashape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "a"); - bshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, "b"); + lshape = static_cast(curveEditorG->addCurve(CT_Diagonal, "L")); + ashape = static_cast(curveEditorG->addCurve(CT_Diagonal, "a")); + bshape = static_cast(curveEditorG->addCurve(CT_Diagonal, "b")); // This will add the reset button at the end of the curveType buttons curveEditorG->curveListComplete(); diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 7902bd2ed..c80b77d27 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -703,7 +703,7 @@ void MyDiagonalCurve::setActiveParam (int ac) { int diagonalmchistupdateUI (void* data) { - MyCurveIdleHelper* mcih = (MyCurveIdleHelper*)data; + MyCurveIdleHelper* mcih = static_cast(data); if (mcih->destroyed) { if (mcih->pending == 1) diff --git a/rtgui/previewhandler.h b/rtgui/previewhandler.h index 955363a37..da7bcee88 100644 --- a/rtgui/previewhandler.h +++ b/rtgui/previewhandler.h @@ -55,7 +55,7 @@ class PreviewHandler : public rtengine::PreviewImageListener { public: PreviewHandler (); - ~PreviewHandler (); + virtual ~PreviewHandler (); void addPreviewImageListener (PreviewListener* l) { listeners.push_back (l); } diff --git a/rtgui/rgbcurves.cc b/rtgui/rgbcurves.cc index 2970d9126..03b4979d9 100644 --- a/rtgui/rgbcurves.cc +++ b/rtgui/rgbcurves.cc @@ -28,9 +28,9 @@ RGBCurves::RGBCurves () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG->setCurveListener (this); curveEditorG->setColorProvider (this); - Rshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_RED")); - Gshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_GREEN")); - Bshape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_BLUE")); + Rshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_RED"))); + Gshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_GREEN"))); + Bshape = static_cast(curveEditorG->addCurve(CT_Diagonal, M("TP_RGBCURVES_BLUE"))); // This will add the reset button at the end of the curveType buttons curveEditorG->curveListComplete(); diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index e5895378c..e1dc40d42 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -27,9 +27,9 @@ RTWindow::RTWindow () :mainNB(NULL) ,bpanel(NULL) +,splash(NULL) ,epanel(NULL) ,fpanel(NULL) -,splash(NULL) { cacheMgr->init (); @@ -282,7 +282,7 @@ void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) { if (page_num > 1) { if (isSingleTabMode()) MoveFileBrowserToEditor(); - EditorPanel *ep = (EditorPanel *)mainNB->get_nth_page(page_num); + EditorPanel *ep = static_cast(mainNB->get_nth_page(page_num)); ep->setAspect(); } else { // in single tab mode with command line filename epanel does not exist yet @@ -401,7 +401,7 @@ bool RTWindow::keyPressed (GdkEventKey* event) { return false; } else { - EditorPanel* ep = (EditorPanel*)mainNB->get_nth_page (mainNB->get_current_page()); + EditorPanel* ep = static_cast(mainNB->get_nth_page (mainNB->get_current_page())); return ep->handleShortcutKey (event); } return false; @@ -433,7 +433,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) { // First and second are file browser and batch queue if (pageCount>2) { for (int i=2;iget_nth_page(i))->getIsProcessing(); + isProcessing |= (static_cast(mainNB->get_nth_page(i)))->getIsProcessing(); } } diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index 38e142dbd..6484f704f 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -185,7 +185,6 @@ void ThumbBrowserBase::arrangeFiles () { int availWidth = internal.get_width(); // initial number of columns int numOfCols = 0; - int currColNum = 0; int colsWidth = 0; for (int i=0; ifiltered && colsWidth + fd[i]->getMinimalWidth() <= availWidth) { diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index c35b34767..594115f56 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -88,7 +88,7 @@ ToneCurve::ToneCurve () : Gtk::VBox(), FoldableToolPanel(this) { curveEditorG = new CurveEditorGroup (M("TP_EXPOSURE_CURVEEDITOR")); curveEditorG->setCurveListener (this); - shape = (DiagonalCurveEditor*)curveEditorG->addCurve(CT_Diagonal, ""); + shape = static_cast(curveEditorG->addCurve(CT_Diagonal, "")); // This will add the reset button at the end of the curveType buttons curveEditorG->curveListComplete(); @@ -358,7 +358,7 @@ void ToneCurve::waitForAutoExp () { } int autoExpChangedUI (void* data) { - ((ToneCurve*)data)->autoExpComputed_ (); + (static_cast(data))->autoExpComputed_ (); return 0; } diff --git a/rtgui/toolpanel.cc b/rtgui/toolpanel.cc index c98d39357..93f0022e3 100644 --- a/rtgui/toolpanel.cc +++ b/rtgui/toolpanel.cc @@ -52,8 +52,8 @@ FoldableToolPanel::FoldableToolPanel(Gtk::Box* content) : ToolPanel(), parentCon void FoldableToolPanel::foldThemAll (GdkEventButton* event) { if (event->button == 3) { if (listener) - ((ToolPanelCoordinator*)listener)->foldAllButOne( parentContainer, this); + (static_cast(listener))->foldAllButOne( parentContainer, this); else - ((ToolPanelCoordinator*)tmp)->foldAllButOne( parentContainer, this); + (static_cast(tmp))->foldAllButOne( parentContainer, this); } } diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 5e19e240b..d94046945 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -506,7 +506,7 @@ void ToolPanelCoordinator::foldAllButOne (Gtk::Box* parent, FoldableToolPanel* o FoldableToolPanel* currentTP; for (int i=0; i(toolPanels[i]); if (currentTP->getParent() == parent) { // Section in the same tab, we unfold it if it's not the one that has been clicked if (currentTP != openedSection) { diff --git a/rtgui/toolpanelcoord.h b/rtgui/toolpanelcoord.h index b1f1502fb..fee45d1b6 100644 --- a/rtgui/toolpanelcoord.h +++ b/rtgui/toolpanelcoord.h @@ -172,7 +172,7 @@ class ToolPanelCoordinator : public ToolPanelListener, Gtk::Notebook* toolPanelNotebook; ToolPanelCoordinator (); - ~ToolPanelCoordinator (); + virtual ~ToolPanelCoordinator (); bool getChangedState () { return hasChanged; } void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma);