Fix all - 2 cppcheck performance hints

This commit is contained in:
heckflosse 2016-07-06 13:04:24 +02:00
parent a991d53bf3
commit c8779c04f5
43 changed files with 114 additions and 146 deletions

View File

@ -428,7 +428,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float
std::map<int, struct camera_const_levels>::iterator best_it = mLevels[bw].begin();
if (iso > 0) {
for (it = mLevels[bw].begin(); it != mLevels[bw].end(); it++) {
for (it = mLevels[bw].begin(); it != mLevels[bw].end(); ++it) {
if (abs(it->first - iso) <= abs(best_it->first - iso)) {
best_it = it;
} else {
@ -487,7 +487,7 @@ CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float
if (it == mApertureScaling.end()) {
std::map<float, float>::reverse_iterator it;
for (it = mApertureScaling.rbegin(); it != mApertureScaling.rend(); it++) {
for (it = mApertureScaling.rbegin(); it != mApertureScaling.rend(); ++it) {
if (it->first > fnumber) {
scaling = it->second;
} else {

View File

@ -1361,12 +1361,10 @@ void Color::interpolateRGBColor (float realL, float iplow, float iphigh, int alg
float bal, balH, cal, calH, calm;
bal = balH = balance;
cal = calH = calm = 1.f - chromat;
float med = (iphigh + iplow) / 2.f;
float medH = (iphigh + iplow) / 2.f;
float med = 1.f;
float medH = 0.f;
float medL = (iphigh + iplow) / 2.f;
med = 1.f;
medH = 0.f; //new algo for 2 colors
float calan;
calan = chromat;

View File

@ -114,9 +114,8 @@ void ColorTemp::clip (double &temp, double &green, double &equal)
}
}
ColorTemp::ColorTemp (double mulr, double mulg, double mulb, double e) : equal(e)
ColorTemp::ColorTemp (double mulr, double mulg, double mulb, double e) : equal(e), method("Custom")
{
method = "Custom";
mul2temp (mulr, mulg, mulb, equal, temp, green);
}

View File

@ -888,14 +888,9 @@ void Crop::update (int todo)
realtile = 12;
}
int tilesize;
int overlap;
tilesize = 1024;
overlap = 128;
tilesize = 128 * realtile;
//overlap=(int) tilesize*params->wavelet.overl;
overlap = (int) tilesize * 0.125f;
// printf("overl=%d\n",overlap);
int tilesize = 128 * realtile;
int overlap = (int) tilesize * 0.125f;
int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip;
parent->ipf.Tile_calc (tilesize, overlap, kall, labnCrop->W, labnCrop->H, numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip);

View File

@ -158,7 +158,7 @@ void dfInfo::updateRawImage()
int nFiles = 1; // First file data already loaded
for( iName++; iName != pathNames.end(); iName++) {
for( ++iName; iName != pathNames.end(); ++iName) {
RawImage* temp = new RawImage(*iName);
if( !temp->loadRaw(true)) {
@ -300,7 +300,7 @@ void DFManager::init( Glib::ustring pathname )
}
// Where multiple shots exist for same group, move filename to list
for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) {
for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) {
dfInfo &i = iter->second;
if( !i.pathNames.empty() && !i.pathname.empty() ) {
@ -314,7 +314,7 @@ void DFManager::init( Glib::ustring pathname )
} else {
printf( "%s: MEAN of \n ", i.key().c_str());
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); iter++ ) {
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); ++iter ) {
printf( "%s, ", iter->c_str() );
}
@ -391,7 +391,7 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
iter = dfList.insert(std::pair< std::string, dfInfo>( key, n ) );
} else {
while( iter != dfList.end() && iter->second.key() == key && ABS(iter->second.timestamp - idata.getDateTimeAsTS()) > 60 * 60 * 6 ) { // 6 hour difference
iter++;
++iter;
}
if( iter != dfList.end() ) {
@ -414,7 +414,7 @@ void DFManager::getStat( int &totFiles, int &totTemplates)
totFiles = 0;
totTemplates = 0;
for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) {
for( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) {
dfInfo &i = iter->second;
if( i.pathname.empty() ) {
@ -443,7 +443,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso
dfList_t::iterator bestMatch = iter;
time_t bestDeltaTime = ABS(iter->second.timestamp - t);
for(iter++; iter != dfList.end() && !key.compare( iter->second.key() ); iter++ ) {
for(++iter; iter != dfList.end() && !key.compare( iter->second.key() ); ++iter ) {
time_t d = ABS(iter->second.timestamp - t );
if( d < bestDeltaTime ) {
@ -458,7 +458,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso
dfList_t::iterator bestMatch = iter;
double bestD = iter->second.distance( mak, mod, isospeed, shut );
for( iter++; iter != dfList.end(); iter++ ) {
for( ++iter; iter != dfList.end(); ++iter ) {
double d = iter->second.distance( mak, mod, isospeed, shut );
if( d < bestD ) {
@ -484,7 +484,7 @@ RawImage* DFManager::searchDarkFrame( const std::string &mak, const std::string
RawImage* DFManager::searchDarkFrame( const Glib::ustring filename )
{
for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) {
for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) {
if( iter->second.pathname.compare( filename ) == 0 ) {
return iter->second.getRawImage();
}
@ -500,7 +500,7 @@ RawImage* DFManager::searchDarkFrame( const Glib::ustring filename )
}
std::vector<badPix> *DFManager::getHotPixels ( const Glib::ustring filename )
{
for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); iter++ ) {
for ( dfList_t::iterator iter = dfList.begin(); iter != dfList.end(); ++iter ) {
if( iter->second.pathname.compare( filename ) == 0 ) {
return &iter->second.getHotPixels();
}

View File

@ -158,7 +158,7 @@ void ffInfo::updateRawImage()
int nFiles = 1; // First file data already loaded
for( iName++; iName != pathNames.end(); iName++) {
for( ++iName; iName != pathNames.end(); ++iName) {
RawImage* temp = new RawImage(*iName);
if( !temp->loadRaw(true)) {
@ -268,7 +268,7 @@ void FFManager::init( Glib::ustring pathname )
}
// Where multiple shots exist for same group, move filename to list
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
ffInfo &i = iter->second;
if( !i.pathNames.empty() && !i.pathname.empty() ) {
@ -282,7 +282,7 @@ void FFManager::init( Glib::ustring pathname )
} else {
printf( "%s: MEAN of \n ", i.key().c_str());
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); iter++ ) {
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); ++iter ) {
printf( "%s, ", iter->c_str() );
}
@ -361,7 +361,7 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool)
iter = ffList.insert(std::pair< std::string, ffInfo>( key, n ) );
} else {
while( iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) > 60 * 60 * 6 ) { // 6 hour difference
iter++;
++iter;
}
if( iter != ffList.end() ) {
@ -384,7 +384,7 @@ void FFManager::getStat( int &totFiles, int &totTemplates)
totFiles = 0;
totTemplates = 0;
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
ffInfo &i = iter->second;
if( i.pathname.empty() ) {
@ -413,7 +413,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s
ffList_t::iterator bestMatch = iter;
time_t bestDeltaTime = ABS(iter->second.timestamp - t);
for(iter++; iter != ffList.end() && !key.compare( iter->second.key() ); iter++ ) {
for(++iter; iter != ffList.end() && !key.compare( iter->second.key() ); ++iter ) {
time_t d = ABS(iter->second.timestamp - t );
if( d < bestDeltaTime ) {
@ -428,7 +428,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s
ffList_t::iterator bestMatch = iter;
double bestD = iter->second.distance( mak, mod, len, focal, apert );
for( iter++; iter != ffList.end(); iter++ ) {
for( ++iter; iter != ffList.end(); ++iter ) {
double d = iter->second.distance( mak, mod, len, focal, apert );
if( d < bestD ) {
@ -454,7 +454,7 @@ RawImage* FFManager::searchFlatField( const std::string &mak, const std::string
RawImage* FFManager::searchFlatField( const Glib::ustring filename )
{
for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
if( iter->second.pathname.compare( filename ) == 0 ) {
return iter->second.getRawImage();
}

View File

@ -136,7 +136,7 @@ void ImageIO::setMetadata (const rtexif::TagDirectory* eroot, const rtengine::pr
iptc = iptc_data_new ();
for (rtengine::procparams::IPTCPairs::const_iterator i = iptcc.begin(); i != iptcc.end(); i++) {
for (rtengine::procparams::IPTCPairs::const_iterator i = iptcc.begin(); i != iptcc.end(); ++i) {
if (i->first == "Keywords" && !(i->second.empty())) {
for (unsigned int j = 0; j < i->second.size(); j++) {
IptcDataSet * ds = iptc_dataset_new ();

View File

@ -611,8 +611,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh
Jpro = (CAMBrightCurveJ[(float)(Jpro * 327.68)]) / 327.68; //ligthness CIECAM02 + contrast
double sres;
double Sp = spro / 100.0;
double parsat = 1.5;
parsat = 1.5; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation)
double parsat = 1.5; //parsat=1.5 =>saturation ; 1.8 => chroma ; 2.5 => colorfullness (personal evaluation)
if(schr == -100.0) {
schr = -99.8;
@ -4964,7 +4963,6 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go
if(s > s_1) ksat=SQR((1.f/(s_1-1.f))*s - (1.f/(s_1-1.f)));
}
*/
ksat = 1.f;
float kl = 1.f;
float rlo = 1.f; //0.4 0.5
float rlm = 1.5f; //1.1
@ -5235,7 +5233,6 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
if(s > s_1) ksat=SQR((1.f/(s_1-1.f))*s - (1.f/(s_1-1.f)));
}
*/
ksat = 1.f;
float kl = 1.f;
float rlo = 1.f;
float rlh = 2.2f;
@ -5303,7 +5300,6 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g
//high tones
float kh = 1.f;
kh = 1.f;
float aa0, bb0;
//fixed value of reducac ==0.4;
secondeg_begin (reducac, iphigh, aa0, bb0);

View File

@ -574,15 +574,8 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int
realtile = 12;
}
int tilesize;
int overlap;
tilesize = 1024;
overlap = 128;
//tilesize=128*params->wavelet.tiles;
tilesize = 128 * realtile;
//overlap=(int) tilesize*params->wavelet.overl;
overlap = (int) tilesize * 0.125f;
// printf("overl=%d\n",overlap);
int tilesize = 128 * realtile;
int overlap = (int) tilesize * 0.125f;
int numtiles_W, numtiles_H, tilewidth, tileheight, tileWskip, tileHskip;
if(params->wavelet.Tilesmethod == "full") {
@ -1828,8 +1821,7 @@ void ImProcFunctions::WaveletcontAllL(LabImage * labco, float ** varhue, float *
float maxkoeLi[12];
float *koeLibuffer = NULL;
bool lipschitz = false;
lipschitz = true;
bool lipschitz = true;
if(lipschitz == true) {
for(int y = 0; y < 12; y++) {
@ -3262,8 +3254,6 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit
int ii = i / W_L;
int jj = i - ii * W_L;
float LL100 = labco->L[ii * 2][jj * 2] / 327.68f;
k1 = 600.f;
k2 = 300.f;
k1 = 0.3f * (waOpacityCurveW[6.f * LL100] - 0.5f); //k1 between 0 and 0.5 0.5==> 1/6=0.16
k2 = k1 * 2.f;
@ -3525,8 +3515,6 @@ void ImProcFunctions::ContAllAB (LabImage * labco, int maxlvl, float ** varhue,
int ii = i / W_ab;
int jj = i - ii * W_ab;
float LL100 = labco->L[ii * 2][jj * 2] / 327.68f;
k1 = 600.f;
k2 = 300.f;
k1 = 0.3f * (waOpacityCurveW[6.f * LL100] - 0.5f); //k1 between 0 and 0.5 0.5==> 1/6=0.16
k2 = k1 * 2.f;

View File

@ -68,18 +68,17 @@ int munmap(void *start, size_t length)
IMFILE* fopen (const char* fname)
{
int fd = -1;
int fd;
#ifdef WIN32
{
// First convert UTF8 to UTF16, then use Windows function to open the file and convert back to file descriptor.
std::unique_ptr<wchar_t, GFreeFunc> wfname (reinterpret_cast<wchar_t*>(g_utf8_to_utf16 (fname, -1, NULL, NULL, NULL)), g_free);
fd = -1;
// First convert UTF8 to UTF16, then use Windows function to open the file and convert back to file descriptor.
std::unique_ptr<wchar_t, GFreeFunc> wfname (reinterpret_cast<wchar_t*>(g_utf8_to_utf16 (fname, -1, NULL, NULL, NULL)), g_free);
HANDLE hFile = CreateFileW (wfname.get (), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
fd = _open_osfhandle((intptr_t)hFile, 0);
}
HANDLE hFile = CreateFileW (wfname.get (), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
fd = _open_osfhandle((intptr_t)hFile, 0);
}
#else

View File

@ -34,15 +34,11 @@ public:
procparams::ProcParams pparams;
ProcessingJobImpl (const Glib::ustring& fn, bool iR, const procparams::ProcParams& pp)
: fname(fn), isRaw(iR), initialImage(NULL)
{
pparams = pp;
}
: fname(fn), isRaw(iR), initialImage(NULL), pparams(pp) {}
ProcessingJobImpl (InitialImage* iImage, const procparams::ProcParams& pp)
: fname(""), initialImage(iImage)
: fname(""), initialImage(iImage), pparams(pp)
{
pparams = pp;
iImage->increaseRef();
}

View File

@ -3388,14 +3388,14 @@ int ProcParams::save (const Glib::ustring &fname, const Glib::ustring &fname2, b
// save exif change list
if (!pedited || pedited->exif) {
for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); i++) {
for (ExifPairs::const_iterator i = exif.begin(); i != exif.end(); ++i) {
keyFile.set_string ("Exif", i->first, i->second);
}
}
// save iptc change list
if (!pedited || pedited->iptc) {
for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); i++) {
for (IPTCPairs::const_iterator i = iptc.begin(); i != iptc.end(); ++i) {
Glib::ArrayHandle<Glib::ustring> values = i->second;
keyFile.set_string_list ("IPTC", i->first, values);
}
@ -7487,7 +7487,7 @@ int ProcParams::load (const Glib::ustring &fname, ParamsEdited* pedited)
for (
std::vector<Glib::ustring>::iterator currLoadedTagValue = currIptc.begin();
currLoadedTagValue != currIptc.end();
currLoadedTagValue++) {
++currLoadedTagValue) {
iptc[keys[i]].push_back(currLoadedTagValue->data());
}

View File

@ -19,7 +19,7 @@ namespace rtengine
extern const Settings* settings;
RawImage::RawImage( const Glib::ustring name )
RawImage::RawImage( const Glib::ustring &name )
: data(NULL)
, prefilters(0)
, filename(name)

View File

@ -99,7 +99,7 @@ class RawImage: public DCraw
{
public:
RawImage( const Glib::ustring name );
RawImage( const Glib::ustring &name );
~RawImage();
int loadRaw (bool loadData = true, bool closeFile = true, ProgressListener *plistener = 0, double progressRange = 1.0);

View File

@ -227,7 +227,7 @@ void SHMap::updateL (float** L, double radius, bool hq, int skip)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//experimental dirpyr shmap
float thresh = (100.f * radius); //1000;
int levrad = 16;
int levrad; // = 16;
levrad = 2; //for retinex - otherwise levrad = 16
// set up range function
// calculate size of Lookup table. That's possible because from a value k for all i>=k rangefn[i] will be exp(-10)

View File

@ -336,7 +336,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring
return true;
}
Glib::ustring TagDirectory::getDumpKey (int tagID, const Glib::ustring tagName)
Glib::ustring TagDirectory::getDumpKey (int tagID, const Glib::ustring &tagName)
{
Glib::ustring key;
@ -2841,7 +2841,7 @@ int ExifManager::createJPEGMarker (const TagDirectory* root, const rtengine::pro
cl = new TagDirectory (NULL, ifdAttribs, INTEL);
}
for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); i++) {
for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); ++i) {
cl->applyChange (i->first, i->second);
}
@ -2927,7 +2927,7 @@ int ExifManager::createTIFFHeader (const TagDirectory* root, const rtengine::pro
}
// apply list of changes
for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); i++) {
for (rtengine::procparams::ExifPairs::const_iterator i = changeList.begin(); i != changeList.end(); ++i) {
cl->applyChange (i->first, i->second);
}

View File

@ -101,7 +101,7 @@ protected:
const TagAttrib* attribs; // descriptor table to decode the tags
ByteOrder order; // byte order
TagDirectory* parent; // parent directory (NULL if root)
static Glib::ustring getDumpKey (int tagID, const Glib::ustring tagName);
static Glib::ustring getDumpKey (int tagID, const Glib::ustring &tagName);
public:
TagDirectory ();
@ -495,7 +495,7 @@ protected:
* Get the lens info (min/man focal, min/max aperture) and compare them to the possible choice
*/
if (lensInfoArray) {
for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ) {
for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) {
if( !extractLensInfo( r->second , f1, f2, a1, a2) ) {
continue;
}
@ -532,7 +532,7 @@ protected:
std::ostringstream candidates;
double deltaMin = 1000.;
for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); r++ ) {
for ( r = choices.lower_bound( lensID ); r != choices.upper_bound(lensID); ++r ) {
double lensAperture, dif;
if( !extractLensInfo( r->second , f1, f2, a1, a2) ) {

View File

@ -365,7 +365,7 @@ bool BatchQueue::loadBatchQueue ()
return !fd.empty ();
}
Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring filename )
Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring &filename )
{
timeval tv;
gettimeofday(&tv, 0);

View File

@ -63,7 +63,7 @@ protected:
BatchQueueListener* listener;
Glib::ustring autoCompleteFileName (const Glib::ustring& fileName, const Glib::ustring& format);
Glib::ustring getTempFilenameForParams( const Glib::ustring filename );
Glib::ustring getTempFilenameForParams( const Glib::ustring &filename );
bool saveBatchQueue ();
void notifyListener (bool queueEmptied);

View File

@ -32,11 +32,10 @@ Glib::RefPtr<Gdk::Pixbuf> BatchQueueEntry::savedAsIcon;
BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine::procparams::ProcParams& pparams, Glib::ustring fname, int prevw, int prevh, Thumbnail* thm)
: ThumbBrowserEntryBase(fname),
opreview(NULL), origpw(prevw), origph(prevh), opreviewDone(false),
job(pjob), progress(0), outFileName(""), sequence(0), forceFormatOpts(false)
job(pjob), progress(0), outFileName(""), sequence(0), forceFormatOpts(false), params(pparams)
{
thumbnail = thm;
params = pparams;
#if 1 //ndef WIN32
// The BatchQueueEntryIdleHelper tracks if an entry has been deleted while it was sitting waiting for "idle"

View File

@ -42,7 +42,7 @@ void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQ
// look up if an older version is in the queue
std::list<Job>::iterator i;
for (i = jqueue.begin(); i != jqueue.end(); i++)
for (i = jqueue.begin(); i != jqueue.end(); ++i)
if (i->oimg == oimg && i->listener == listener) {
i->ow = ow;
i->oh = oh;
@ -169,7 +169,7 @@ void BatchQueueEntryUpdater::removeJobs (BQEntryUpdateListener* listener)
ready = true;
std::list<Job>::iterator i;
for (i = jqueue.begin(); i != jqueue.end(); i++)
for (i = jqueue.begin(); i != jqueue.end(); ++i)
if (i->listener == listener) {
jqueue.erase (i);
ready = false;

View File

@ -100,7 +100,7 @@ void ColoredBar::draw()
break;
}
for (std::vector<GradientMilestone>::iterator i = bgGradient.begin(); i != bgGradient.end(); i++) {
for (std::vector<GradientMilestone>::iterator i = bgGradient.begin(); i != bgGradient.end(); ++i) {
bggradient->add_color_stop_rgb (i->position, i->r, i->g, i->b);
}

View File

@ -511,7 +511,7 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y)
state = SNormal;
for (std::list<CropWindowListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) {
for (std::list<CropWindowListener*>::iterator i = listeners.begin(); i != listeners.end(); ++i) {
(*i)->cropPositionChanged (this);
}
@ -2278,7 +2278,7 @@ void CropWindow::delCropWindowListener (CropWindowListener* l)
if (*i == l) {
i = listeners.erase (i);
} else {
i++;
++i;
}
}

View File

@ -181,7 +181,7 @@ void DirBrowser::addRoot (char letter)
void DirBrowser::updateDirTreeRoot ()
{
for (Gtk::TreeModel::iterator i = dirTreeModel->children().begin(); i != dirTreeModel->children().end(); i++) {
for (Gtk::TreeModel::iterator i = dirTreeModel->children().begin(); i != dirTreeModel->children().end(); ++i) {
updateDirTree (i);
}
}
@ -192,7 +192,7 @@ void DirBrowser::updateDirTree (const Gtk::TreeModel::iterator& iter)
if (dirtree->row_expanded (dirTreeModel->get_path (iter))) {
updateDir (iter);
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) {
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) {
updateDirTree (i);
}
}
@ -208,7 +208,7 @@ void DirBrowser::updateVolumes ()
for (int i = 0; i < 32; i++)
if (((volumes >> i) & 1) && !((nvolumes >> i) & 1)) { // volume i has been deleted
for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter != dirTreeModel->children().end(); iter++)
for (Gtk::TreeModel::iterator iter = dirTreeModel->children().begin(); iter != dirTreeModel->children().end(); ++iter)
if (iter->get_value (dtColumns.filename).c_str()[0] - 'A' == i) {
dirTreeModel->erase (iter);
break;
@ -333,7 +333,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter)
while (change) {
change = false;
for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end(); it++)
for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end(); ++it)
if (!Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS)
|| !Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) {
GThreadLock lock;
@ -350,7 +350,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter)
for (int i = 0; i < subDirs.size(); i++) {
bool found = false;
for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end() && !found ; it++) {
for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end() && !found ; ++it) {
found = (it->get_value (dtColumns.filename) == subDirs[i]);
}
@ -432,7 +432,7 @@ Gtk::TreePath DirBrowser::expandToDir (const Glib::ustring& absDirPath)
}
ix++;
i++;
++i;
}
count++;

View File

@ -227,7 +227,7 @@ bool EditWindow::on_delete_event(GdkEventAny* event)
// Check if any editor is still processing, and do NOT quit if so. Otherwise crashes and inconsistent caches
bool isProcessing = false;
for ( std::set <Glib::ustring>::iterator iter = filesEdited.begin(); iter != filesEdited.end() && !isProcessing; iter++ ) {
for ( std::set <Glib::ustring>::iterator iter = filesEdited.begin(); iter != filesEdited.end() && !isProcessing; ++iter ) {
if (epanels[*iter]->getIsProcessing()) {
isProcessing = true;
}
@ -237,7 +237,7 @@ bool EditWindow::on_delete_event(GdkEventAny* event)
return true;
}
for ( std::set <Glib::ustring>::iterator iter = filesEdited.begin(); iter != filesEdited.end(); iter++ ) {
for ( std::set <Glib::ustring>::iterator iter = filesEdited.begin(); iter != filesEdited.end(); ++iter ) {
mainNB->remove_page (*epanels[*iter]);
}

View File

@ -275,7 +275,7 @@ void ExifPanel::delIt (Gtk::TreeModel::iterator iter)
}
if (recursiveOp)
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) {
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) {
delIt (i);
}
}
@ -306,7 +306,7 @@ void ExifPanel::keepIt (Gtk::TreeModel::iterator iter)
}
if (recursiveOp)
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); i++) {
for (Gtk::TreeModel::iterator i = iter->children().begin(); i != iter->children().end(); ++i) {
keepIt (i);
}
}
@ -472,7 +472,7 @@ void ExifPanel::editTag (Gtk::TreeModel::Children root, Glib::ustring name, Glib
// look up first segment of the path
Gtk::TreeModel::iterator iter;
for (iter = root.begin(); iter != root.end(); iter++)
for (iter = root.begin(); iter != root.end(); ++iter)
if (iter->get_value (exifColumns.field_nopango) == fseg) {
break;
}
@ -581,7 +581,7 @@ void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string pre
Gtk::TreeModel::iterator iter;
for (iter = root.begin(); iter != root.end(); iter++) {
for (iter = root.begin(); iter != root.end(); ++iter) {
if (iter->get_value (exifColumns.edited) == true) {
changeList[ prefix + iter->get_value (exifColumns.field_nopango) ] = iter->get_value (exifColumns.value_nopango);
} else if (iter->get_value (exifColumns.action) == AC_WRITE && iter->get_value (exifColumns.icon) == delicon) {
@ -606,7 +606,7 @@ void ExifPanel::updateChangeList ()
void ExifPanel::applyChangeList ()
{
for (rtengine::procparams::ExifPairs::iterator i = changeList.begin(); i != changeList.end(); i++) {
for (rtengine::procparams::ExifPairs::iterator i = changeList.begin(); i != changeList.end(); ++i) {
editTag (exifTreeModel->children(), i->first, i->second);
}
}

View File

@ -97,7 +97,7 @@ void FavoritBrowser::addPressed ()
return;
}
iter++;
++iter;
}
Glib::RefPtr<Gio::File> hfile = Gio::File::create_for_parse_name (lastSelectedDir);

View File

@ -623,7 +623,7 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry)
std::vector<ThumbBrowserEntryBase*>::iterator i = fd.begin();
while (i != fd.end() && *entry < * ((FileBrowserEntry*)*i)) {
i++;
++i;
}
fd.insert (i, entry);
@ -640,7 +640,7 @@ FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname)
{
MYWRITERLOCK(l, entryRW);
for (std::vector<ThumbBrowserEntryBase*>::iterator i = fd.begin(); i != fd.end(); i++)
for (std::vector<ThumbBrowserEntryBase*>::iterator i = fd.begin(); i != fd.end(); ++i)
if ((*i)->filename == fname) {
ThumbBrowserEntryBase* entry = *i;
entry->selected = false;

View File

@ -212,7 +212,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
expcomp->clear_items();
curefs.expcomp.clear();
for (std::set<std::string>::iterator i = defefs.expcomp.begin(); i != defefs.expcomp.end(); i++) {
for (std::set<std::string>::iterator i = defefs.expcomp.begin(); i != defefs.expcomp.end(); ++i) {
expcomp->append_text (*i);
curefs.expcomp.insert(*i);
}
@ -222,7 +222,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
lens->clear_items();
curefs.lenses.clear();
for (std::set<std::string>::iterator i = defefs.lenses.begin(); i != defefs.lenses.end(); i++) {
for (std::set<std::string>::iterator i = defefs.lenses.begin(); i != defefs.lenses.end(); ++i) {
lens->append_text (*i);
curefs.lenses.insert(*i);
}
@ -232,7 +232,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
camera->clear_items();
curefs.cameras.clear();
for (std::set<std::string>::iterator i = defefs.cameras.begin(); i != defefs.cameras.end(); i++) {
for (std::set<std::string>::iterator i = defefs.cameras.begin(); i != defefs.cameras.end(); ++i) {
camera->append_text(*i);
curefs.cameras.insert(*i);
}
@ -242,14 +242,14 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
filetype->clear_items();
curefs.filetypes.clear();
for (std::set<std::string>::iterator i = defefs.filetypes.begin(); i != defefs.filetypes.end(); i++) {
for (std::set<std::string>::iterator i = defefs.filetypes.begin(); i != defefs.filetypes.end(); ++i) {
filetype->append_text(*i);
curefs.filetypes.insert(*i);
}
ftselection->select_all();
} else {
for( Gtk::TreeModel::Children::iterator iter = expcomp->get_model()->children().begin(); iter != expcomp->get_model()->children().end(); iter++) {
for( Gtk::TreeModel::Children::iterator iter = expcomp->get_model()->children().begin(); iter != expcomp->get_model()->children().end(); ++iter) {
Glib::ustring v;
iter->get_value(0, v);
@ -260,7 +260,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
}
}
for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end(); iter++) {
for( Gtk::TreeModel::Children::iterator iter = lens->get_model()->children().begin(); iter != lens->get_model()->children().end(); ++iter) {
Glib::ustring v;
iter->get_value(0, v);
@ -271,7 +271,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
}
}
for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end(); iter++) {
for( Gtk::TreeModel::Children::iterator iter = camera->get_model()->children().begin(); iter != camera->get_model()->children().end(); ++iter) {
Glib::ustring v;
iter->get_value(0, v);
@ -282,7 +282,7 @@ void FilterPanel::setFilter (ExifFilterSettings& defefs, bool updateLists)
}
}
for( Gtk::TreeModel::Children::iterator iter = filetype->get_model()->children().begin(); iter != filetype->get_model()->children().end(); iter++) {
for( Gtk::TreeModel::Children::iterator iter = filetype->get_model()->children().begin(); iter != filetype->get_model()->children().end(); ++iter) {
Glib::ustring v;
iter->get_value(0, v);

View File

@ -222,7 +222,7 @@ void History::procParamsChanged (ProcParams* params, ProcEvent ev, Glib::ustring
// remove all rows after the selection
if (iter) {
iter++;
++iter;
while (iter) {
iter = historyModel->erase (iter);
@ -356,7 +356,7 @@ void History::redo ()
Gtk::TreeModel::iterator iter = selection->get_selected();
if (iter) {
iter++;
++iter;
if (iter != historyModel->children().end()) {
selection->select (iter);

View File

@ -213,7 +213,7 @@ bool ImageArea::on_expose_event(GdkEventExpose* event)
cr->fill ();
}
for (std::list<CropWindow*>::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); i++) {
for (std::list<CropWindow*>::reverse_iterator i = cropWins.rbegin(); i != cropWins.rend(); ++i) {
(*i)->expose (cr);
}

View File

@ -402,7 +402,7 @@ void IPTCPanel::addKeyWord ()
keyword->prepend_text (keyword->get_entry()->get_text());
std::vector<Glib::ustring> items;
for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i != keyword->get_model()->children().end(); i++) {
for (Gtk::TreeModel::iterator i = keyword->get_model()->children().begin(); i != keyword->get_model()->children().end(); ++i) {
Glib::ustring s;
i->get_value (0, s);
items.push_back (s);
@ -454,7 +454,7 @@ void IPTCPanel::addSuppCategory ()
suppCategory->prepend_text (suppCategory->get_entry()->get_text());
std::vector<Glib::ustring> items;
for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i != suppCategory->get_model()->children().end(); i++) {
for (Gtk::TreeModel::iterator i = suppCategory->get_model()->children().begin(); i != suppCategory->get_model()->children().end(); ++i) {
Glib::ustring s;
i->get_value (0, s);
items.push_back (s);
@ -557,7 +557,7 @@ void IPTCPanel::applyChangeList ()
keyword->get_entry()->set_text ("");
suppCategory->get_entry()->set_text ("");
for (rtengine::procparams::IPTCPairs::iterator i = changeList.begin(); i != changeList.end(); i++) {
for (rtengine::procparams::IPTCPairs::iterator i = changeList.begin(); i != changeList.end(); ++i) {
if (i->first == "Caption" && !i->second.empty()) {
captionText->set_text (i->second.at(0));
} else if (i->first == "CaptionWriter" && !i->second.empty()) {

View File

@ -21,10 +21,9 @@
#include <cstring>
#include <gdkmm/types.h>
MyCurve::MyCurve () : pipetteR(-1.f), pipetteG(-1.f), pipetteB(-1.f), pipetteVal(-1.f), listener(NULL)
MyCurve::MyCurve () : pipetteR(-1.f), pipetteG(-1.f), pipetteB(-1.f), pipetteVal(-1.f), listener(NULL), cursor_type( CSArrow)
{
cursor_type = CSArrow;
graphX = get_allocation().get_width() - RADIUS * 2;
graphY = get_allocation().get_height() - RADIUS * 2;
prevGraphW = graphW;

View File

@ -591,8 +591,8 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
ity = curve.y.begin();
for (int i = 0; i < closest_point; i++) {
itx++;
ity++;
++itx;
++ity;
}
curve.x.insert (itx, 0);
@ -1111,8 +1111,8 @@ bool MyDiagonalCurve::pipetteButton1Pressed(EditDataProvider *provider, int modi
ity = curve.y.begin();
for (int i = 0; i < closest_point; i++) {
itx++;
ity++;
++itx;
++ity;
}
lit_point = closest_point;

View File

@ -641,10 +641,10 @@ bool MyFlatCurve::handleEvents (GdkEvent* event)
itrt = curve.rightTangent.begin();
for (int i = 0; i < closest_point; i++) {
itx++;
ity++;
itlt++;
itrt++;
++itx;
++ity;
++itlt;
++itrt;
}
curve.x.insert (itx, 0);
@ -1327,10 +1327,10 @@ bool MyFlatCurve::pipetteButton1Pressed(EditDataProvider *provider, int modifier
itrt = curve.rightTangent.begin();
for (int i = 0; i < closest_point; i++) {
itx++;
ity++;
itlt++;
itrt++;
++itx;
++ity;
++itlt;
++itrt;
}
curve.x.insert (itx, 0);

View File

@ -2765,13 +2765,13 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
// Exif changes are added to the existing ones
if (exif)
for (procparams::ExifPairs::const_iterator i = mods.exif.begin(); i != mods.exif.end(); i++) {
for (procparams::ExifPairs::const_iterator i = mods.exif.begin(); i != mods.exif.end(); ++i) {
toEdit.exif[i->first] = i->second;
}
// IPTC changes are added to the existing ones
if (iptc)
for (procparams::IPTCPairs::const_iterator i = mods.iptc.begin(); i != mods.iptc.end(); i++) {
for (procparams::IPTCPairs::const_iterator i = mods.iptc.begin(); i != mods.iptc.end(); ++i) {
toEdit.iptc[i->first] = i->second;
}
}

View File

@ -239,7 +239,7 @@ Glib::RefPtr<Gdk::Pixbuf> PreviewHandler::getRoughImage (int desiredW, int desir
void PreviewHandler::previewImageChanged ()
{
for (std::list<PreviewListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) {
for (std::list<PreviewListener*>::iterator i = listeners.begin(); i != listeners.end(); ++i) {
(*i)->previewImageChanged ();
}
}

View File

@ -252,7 +252,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath
int ProfileStore::findFolderId(const Glib::ustring &path)
{
for (std::vector<Glib::ustring>::iterator i = folders.begin(); i != folders.end(); i++) {
for (std::vector<Glib::ustring>::iterator i = folders.begin(); i != folders.end(); ++i) {
if (*i == path) {
return i - folders.begin();
}

View File

@ -670,7 +670,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event)
Gtk::Widget *w = mainNB->get_nth_page(page);
bool optionsWritten = false;
for (std::map<Glib::ustring, EditorPanel*>::iterator i = epanels.begin(); i != epanels.end(); i++) {
for (std::map<Glib::ustring, EditorPanel*>::iterator i = epanels.begin(); i != epanels.end(); ++i) {
if (i->second == w) {
i->second->writeOptions();
optionsWritten = true;

View File

@ -272,16 +272,16 @@ bool ThresholdSelector::on_expose_event(GdkEventExpose* event)
if (pts.size() >= 4) {
std::vector<double>::iterator i = pts.begin();
double x = *i;
i++;
++i;
double y = *i;
i++;
++i;
cr->move_to (hb + hwslider + iw * x + 0.5, (yEnd - yStart)*y + yStart);
for (; i < pts.end(); ) {
x = *i;
i++;
++i;
y = *i;
i++;
++i;
cr->line_to (hb + hwslider + iw * x + 0.5, (yEnd - yStart)*y + yStart);
}
} else {

View File

@ -25,9 +25,8 @@
using namespace std;
ThumbBrowserBase::ThumbBrowserBase ()
: lastClicked(NULL), previewHeight(options.thumbSize), numOfCols(1), inspector(NULL), isInspectorActive(false)
: lastClicked(NULL), previewHeight(options.thumbSize), numOfCols(1), inspector(NULL), isInspectorActive(false), location(THLOC_FILEBROWSER)
{
location = THLOC_FILEBROWSER;
inW = -1;
inH = -1;

View File

@ -903,7 +903,7 @@ Glib::ustring Thumbnail::getCacheFileName (const Glib::ustring& subdir, const Gl
return cachemgr->getCacheFileName (subdir, fname, fext, cfs.md5);
}
void Thumbnail::setFileName (const Glib::ustring fn)
void Thumbnail::setFileName (const Glib::ustring &fn)
{
fname = fn;

View File

@ -146,7 +146,7 @@ public:
{
return fname;
}
void setFileName (const Glib::ustring fn);
void setFileName (const Glib::ustring &fn);
bool isSupported ();