diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 2e78254f9..4da57c5f5 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -106,8 +106,8 @@ void RawImageSource::CA_correct_RT() { #define PIX_SORT(a,b) { if ((a)>(b)) {temp=(a);(a)=(b);(b)=temp;} } #define SQR(x) ((x)*(x)) - //static const float pre_mul[3] = {MIN(ri->red_multiplier,ri->green_multiplier), ri->green_multiplier, \ - MIN(ri->blue_multiplier,ri->green_multiplier)}; + /*static const float pre_mul[3] = {MIN(ri->red_multiplier,ri->green_multiplier), ri->green_multiplier, \ + MIN(ri->blue_multiplier,ri->green_multiplier)};*/ static const float clip_pt = ri->defgain; diff --git a/rtengine/amaze_interpolate_RT.cc b/rtengine/amaze_interpolate_RT.cc index a223ddea5..d3ce7a1aa 100644 --- a/rtengine/amaze_interpolate_RT.cc +++ b/rtengine/amaze_interpolate_RT.cc @@ -793,15 +793,15 @@ void RawImageSource::amaze_demosaic_RT() { rbvarp = epssq + (gausseven[0]*(Dgrbpsq1[indx-v1]+Dgrbpsq1[indx-1]+Dgrbpsq1[indx+1]+Dgrbpsq1[indx+v1]) + \ gausseven[1]*(Dgrbpsq1[indx-v2-1]+Dgrbpsq1[indx-v2+1]+Dgrbpsq1[indx-2-v1]+Dgrbpsq1[indx+2-v1]+ \ Dgrbpsq1[indx-2+v1]+Dgrbpsq1[indx+2+v1]+Dgrbpsq1[indx+v2-1]+Dgrbpsq1[indx+v2+1])); - //rbvarp -= SQR( (gausseven[0]*(Dgrbp1[indx-v1]+Dgrbp1[indx-1]+Dgrbp1[indx+1]+Dgrbp1[indx+v1]) + \ - gausseven[1]*(Dgrbp1[indx-v2-1]+Dgrbp1[indx-v2+1]+Dgrbp1[indx-2-v1]+Dgrbp1[indx+2-v1]+ \ - Dgrbp1[indx-2+v1]+Dgrbp1[indx+2+v1]+Dgrbp1[indx+v2-1]+Dgrbp1[indx+v2+1]))); + /*rbvarp -= SQR( (gausseven[0]*(Dgrbp1[indx-v1]+Dgrbp1[indx-1]+Dgrbp1[indx+1]+Dgrbp1[indx+v1]) + \ + gausseven[1]*(Dgrbp1[indx-v2-1]+Dgrbp1[indx-v2+1]+Dgrbp1[indx-2-v1]+Dgrbp1[indx+2-v1]+ \ + Dgrbp1[indx-2+v1]+Dgrbp1[indx+2+v1]+Dgrbp1[indx+v2-1]+Dgrbp1[indx+v2+1])));*/ rbvarm = epssq + (gausseven[0]*(Dgrbmsq1[indx-v1]+Dgrbmsq1[indx-1]+Dgrbmsq1[indx+1]+Dgrbmsq1[indx+v1]) + \ gausseven[1]*(Dgrbmsq1[indx-v2-1]+Dgrbmsq1[indx-v2+1]+Dgrbmsq1[indx-2-v1]+Dgrbmsq1[indx+2-v1]+ \ Dgrbmsq1[indx-2+v1]+Dgrbmsq1[indx+2+v1]+Dgrbmsq1[indx+v2-1]+Dgrbmsq1[indx+v2+1])); - //rbvarm -= SQR( (gausseven[0]*(Dgrbm1[indx-v1]+Dgrbm1[indx-1]+Dgrbm1[indx+1]+Dgrbm1[indx+v1]) + \ - gausseven[1]*(Dgrbm1[indx-v2-1]+Dgrbm1[indx-v2+1]+Dgrbm1[indx-2-v1]+Dgrbm1[indx+2-v1]+ \ - Dgrbm1[indx-2+v1]+Dgrbm1[indx+2+v1]+Dgrbm1[indx+v2-1]+Dgrbm1[indx+v2+1]))); + /*rbvarm -= SQR( (gausseven[0]*(Dgrbm1[indx-v1]+Dgrbm1[indx-1]+Dgrbm1[indx+1]+Dgrbm1[indx+v1]) + \ + gausseven[1]*(Dgrbm1[indx-v2-1]+Dgrbm1[indx-v2+1]+Dgrbm1[indx-2-v1]+Dgrbm1[indx+2-v1]+ \ + Dgrbm1[indx-2+v1]+Dgrbm1[indx+2+v1]+Dgrbm1[indx+v2-1]+Dgrbm1[indx+v2+1])));*/ diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index a0177cd98..7a7cff322 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -751,6 +751,7 @@ bool Thumbnail::readImage (const Glib::ustring& fname) { } return true; } + return false; } bool Thumbnail::readData (const Glib::ustring& fname) { diff --git a/rtexif/fujiattribs.cc b/rtexif/fujiattribs.cc index 1dbedb984..062cf9a4f 100644 --- a/rtexif/fujiattribs.cc +++ b/rtexif/fujiattribs.cc @@ -222,42 +222,42 @@ FAPictureModeInterpreter faPictureModeInterpreter; const TagAttrib fujiAttribs[] = { - 0, 1, 0, 0, 0x0000, "Version", &stdInterpreter, - 0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter, - 0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter, - 0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter, - 0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter, - 0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter, - 0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter, - 0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter, - 0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter, - 0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter, - 0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter, - 0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter, - 0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter, - 0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter, - 0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter, - 0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter, - 0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter, - 0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter, - 0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter, - 0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter, - 0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter, - 0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter, - 0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter, - 0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter, - 0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter, - 0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter, - 0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter, - 0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter, - 0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter, - -1, 0, 0, 0, 0, "", NULL}; + {0, 1, 0, 0, 0x0000, "Version", &stdInterpreter}, + {0, 1, 0, 0, 0x0010, "InternalSerialNumber", &stdInterpreter}, + {0, 1, 0, 0, 0x1000, "Quality", &stdInterpreter}, + {0, 1, 0, 0, 0x1001, "Sharpness", &faSharpnessInterpreter}, + {0, 1, 0, 0, 0x1002, "WhiteBalance", &faWhiteBalanceInterpreter}, + {0, 1, 0, 0, 0x1003, "Saturation", &faSaturationInterpreter}, + {0, 1, 0, 0, 0x1004, "Contrast", &faContrastInterpreter}, + {0, 1, 0, 0, 0x1005, "ColorTemperature", &stdInterpreter}, + {0, 1, 0, 0, 0x1006, "Contrast2", &faContrast2Interpreter}, + {0, 1, 0, 0, 0x100a, "WhiteBalanceFineTune", &stdInterpreter}, + {0, 1, 0, 0, 0x100b, "NoiseReduction", &faNoiseReductionInterpreter}, + {0, 1, 0, 0, 0x100b, "FujiFlashMode", &faFlashInterpreter}, + {0, 1, 0, 0, 0x1011, "FlashExposureComp", &stdInterpreter}, + {0, 1, 0, 0, 0x1020, "Macro", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1021, "FocusMode", &faFocusModeInterpreter}, + {0, 1, 0, 0, 0x1023, "FocusPixel", &stdInterpreter}, + {0, 1, 0, 0, 0x1030, "SlowSync", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1031, "PictureMode", &faPictureModeInterpreter}, + {0, 1, 0, 0, 0x1100, "AutoBracketing", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1101, "SequenceNumber", &stdInterpreter}, + {0, 1, 0, 0, 0x1210, "ColorMode", &faColorModeInterpreter}, + {0, 1, 0, 0, 0x1300, "BlurWarning", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1301, "FocusWarning", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1302, "ExposureWarning", &faOnOffInterpreter}, + {0, 1, 0, 0, 0x1400, "DynamicRange", &faDynamicRangeInterpreter}, + {0, 1, 0, 0, 0x1401, "FilmMode", &faFilmModeInterpreter}, + {0, 1, 0, 0, 0x1402, "DynamicRangeSetting", &faDRSettingInterpreter}, + {0, 1, 0, 0, 0x1403, "DevelopmentDynamicRange", &stdInterpreter}, + {0, 1, 0, 0, 0x1404, "MinFocalLength", &stdInterpreter}, + {0, 1, 0, 0, 0x1405, "MaxFocalLength", &stdInterpreter}, + {0, 1, 0, 0, 0x1406, "MaxApertureAtMinFocal", &stdInterpreter}, + {0, 1, 0, 0, 0x1407, "MaxApertureAtMaxFocal", &stdInterpreter}, + {0, 1, 0, 0, 0x8000, "FileSource", &stdInterpreter}, + {0, 1, 0, 0, 0x8002, "OrderNumber", &stdInterpreter}, + {0, 1, 0, 0, 0x8003, "FrameNumber", &stdInterpreter}, + {-1, 0, 0, 0, 0, "", NULL}}; }; #endif diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc index ab5ffa360..0733fdb8c 100644 --- a/rtexif/nikonattribs.cc +++ b/rtexif/nikonattribs.cc @@ -158,9 +158,10 @@ class NAAFInfoInterpreter : public Interpreter { else if (aff&512) if (af.str()=="") af << "Far Left"; else af << ", Far Left"; - else if (aff&1024) + else if (aff&1024) { if (af.str()=="") af << "Far Right"; else af << ", Far Right"; + } str << "AFPointsInFocus = " << af.str(); return str.str(); diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index b87b001c9..f41090c82 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -946,7 +946,7 @@ public: case 2: str << "AF-C";break; case 3: str << "AF-A";break; } - if( c & 0xF0 == 0) str << ", Point Selection Auto"; + if( (c & 0xF0) == 0) str << ", Point Selection Auto"; else if( c & 0x20 ) str << ", Fixed Center Point Selected"; else if( c & 0x10 ) str << ", Point Selected"; return str.str(); diff --git a/rtgui/cacorrection.cc b/rtgui/cacorrection.cc index 79fc2c603..382b963bb 100644 --- a/rtgui/cacorrection.cc +++ b/rtgui/cacorrection.cc @@ -85,7 +85,7 @@ void CACorrection::adjusterChanged (Adjuster* a, double newval) { void CACorrection::setAdjusterBehavior (bool badd) { - if (!vAdd && badd || vAdd && !badd) { + if ((!vAdd && badd) || (vAdd && !badd)) { red->setLimits (-0.005, 0.005, 0.0001, 0); blue->setLimits (-0.005, 0.005, 0.0001, 0); } diff --git a/rtgui/colorboost.cc b/rtgui/colorboost.cc index c70ce4311..2b2ecff79 100644 --- a/rtgui/colorboost.cc +++ b/rtgui/colorboost.cc @@ -177,7 +177,7 @@ void ColorBoost::adjusterChanged (Adjuster* a, double newval) { void ColorBoost::setAdjusterBehavior (bool bcbadd) { - if (!cbAdd && bcbadd || cbAdd && !bcbadd) + if ((!cbAdd && bcbadd) || (cbAdd && !bcbadd)) colorboost->setLimits (-100, 100, 1, 0); cbAdd = bcbadd; diff --git a/rtgui/colorshift.cc b/rtgui/colorshift.cc index a3429792b..4568df63a 100644 --- a/rtgui/colorshift.cc +++ b/rtgui/colorshift.cc @@ -90,10 +90,10 @@ void ColorShift::adjusterChanged (Adjuster* a, double newval) { void ColorShift::setAdjusterBehavior (bool baadd, bool bbadd) { - if (!aAdd && baadd || aAdd && !baadd) + if ((!aAdd && baadd) || (aAdd && !baadd)) ashift->setLimits (-25, 25, 0.1, 0); - if (!bAdd && bbadd || bAdd && !bbadd) + if ((!bAdd && bbadd) || (bAdd && !bbadd)) bshift->setLimits (-25, 25, 0.1, 0); aAdd = baadd; diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 0511a382d..206758e9b 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -31,21 +31,21 @@ struct ZoomStep { int czoom; }; -ZoomStep zoomSteps[] = {"10%", 0.1, 10, - "12.5%", 0.125, 8, - "16.6%", 1.0/6.0, 6, - "20%", 0.2, 5, - "25%", 0.25, 4, - "33%", 1.0/3.0, 3, - "50%", 0.5, 2, - "100%", 1.0, 1000, - "200%", 2.0, 2000, - "300%", 3.0, 3000, - "400%", 4.0, 4000, - "500%", 5.0, 5000, - "600%", 6.0, 6000, - "700%", 7.0, 7000, - "800%", 8.0, 8000}; +ZoomStep zoomSteps[] = {{"10%", 0.1, 10}, + {"12.5%", 0.125, 8}, + {"16.6%", 1.0/6.0, 6}, + {"20%", 0.2, 5}, + {"25%", 0.25, 4}, + {"33%", 1.0/3.0, 3}, + {"50%", 0.5, 2}, + {"100%", 1.0, 1000}, + {"200%", 2.0, 2000}, + {"300%", 3.0, 3000}, + {"400%", 4.0, 4000}, + {"500%", 5.0, 5000}, + {"600%", 6.0, 6000}, + {"700%", 7.0, 7000}, + {"800%", 8.0, 8000}}; #define MAXZOOMSTEPS 14 #define ZOOM11INDEX 7 diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc index 25ba08a05..df9e12949 100644 --- a/rtgui/distortion.cc +++ b/rtgui/distortion.cc @@ -69,7 +69,7 @@ void Distortion::adjusterChanged (Adjuster* a, double newval) { void Distortion::setAdjusterBehavior (bool bvadd) { - if (!distAdd && bvadd || distAdd && !bvadd) + if ((!distAdd && bvadd) || (distAdd && !bvadd)) distor->setLimits (-0.5, 0.5, 0.001, 0); distAdd = bvadd; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 9cd012d48..0c17312da 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -260,9 +260,9 @@ void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring selectedDirectory = dir->get_parse_name(); fileNameList = getFileList (); - for (int i=0; i f = Gio::File::create_for_path(fileNameList[i]); - if (f->get_parse_name() != openfile) // if we opened a file at the beginning dont add it again + if (f->get_parse_name() != openfile) // if we opened a file at the beginning don't add it again checkAndAddFile (f); } @@ -326,10 +326,10 @@ void FileCatalog::previewReady (FileBrowserEntry* fdn) { dirEFS.shutterFrom = cfs->shutter; if (cfs->shutter > dirEFS.shutterTo) dirEFS.shutterTo = cfs->shutter; - if (cfs->iso>0 && cfs->iso < dirEFS.isoFrom) - dirEFS.isoFrom = cfs->iso; - if (cfs->iso>0 && cfs->iso > dirEFS.isoTo) - dirEFS.isoTo = cfs->iso; + if (cfs->iso>0 && (int)cfs->iso < dirEFS.isoFrom) + dirEFS.isoFrom = (int)cfs->iso; + if (cfs->iso>0 && (int)cfs->iso > dirEFS.isoTo) + dirEFS.isoTo = (int)cfs->iso; if (cfs->focalLen < dirEFS.focalFrom) dirEFS.focalFrom = cfs->focalLen; if (cfs->focalLen > dirEFS.focalTo) @@ -423,7 +423,7 @@ void FileCatalog::_openImage (std::vector tmb) { if (enabled && listener!=NULL) { previewLoader.stop (); thumbImageUpdater.stop (); - for (int i=0; igetFileName())==editedFiles.end()) listener->fileSelected (tmb[i]); tmb[i]->decreaseRef (); @@ -453,7 +453,7 @@ void FileCatalog::openRequested (std::vector tmb) { FCOIParams* params = new FCOIParams; params->catalog = this; params->tmb = tmb; - for (int i=0; iincreaseRef (); g_idle_add (fcopenimg, params); } @@ -467,7 +467,7 @@ void FileCatalog::deleteRequested (std::vector tbe) { msd.set_secondary_text(Glib::ustring::compose (M("FILEBROWSER_DELETEDLGMSG"), tbe.size())); if (msd.run()==Gtk::RESPONSE_YES) { - for (int i=0; ifilename; // remove from browser FileBrowserEntry* t = fileBrowser->delEntry (fname); @@ -492,7 +492,7 @@ void FileCatalog::developRequested (std::vector tbe) { if (listener) { thumbImageUpdater.stop (); - for (int i=0; ithumbnail->getProcParams(); rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (tbe[i]->filename, tbe[i]->thumbnail->getType()==FT_Raw, params); double tmpscale; @@ -519,7 +519,7 @@ void FileCatalog::renameRequested (std::vector tbe) { RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel()); - for (int i=0; iinitName (Glib::path_get_basename (tbe[i]->filename), tbe[i]->thumbnail->getCacheImageData()); Glib::ustring ofname = tbe[i]->filename; @@ -683,7 +683,7 @@ void FileCatalog::categoryButtonToggled (Gtk::ToggleButton* b) { for (int i=0; i<5; i++) { bool active_now, active_before; active_now = bRank[i]->get_active(); - active_before = buttons & (1 << i+2); + active_before = buttons & (1 << (i+2)); if ( active_now && !active_before) bRank[i]->set_image (*iranked[i]); else if (!active_now && active_before) bRank[i]->set_image (*igranked[i]); } @@ -743,16 +743,16 @@ int FileCatalog::reparseDirectory () { // check if a thumbnailed file has been deleted const std::vector& t = fileBrowser->getEntries (); std::vector fileNamesToDel; - for (int i=0; ifilename, Glib::FILE_TEST_EXISTS)) fileNamesToDel.push_back (t[i]->filename); - for (int i=0; idelEntry (fileNamesToDel[i]); cacheMgr.deleteEntry (fileNamesToDel[i]); } // check if a new file has been added - for (int i=0; i file) { Glib::RefPtr info = safe_query_file_info(file); if (info && info->get_file_type() != Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || !options.fbShowHidden)) { int lastdot = info->get_name().find_last_of ('.'); - if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ + if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ previewLoader.add (DirEntry (file->get_parse_name())); previewsToLoad++; } @@ -817,7 +817,7 @@ void FileCatalog::addAndOpenFile (const Glib::ustring& fname) { if( !info ) return; int lastdot = info->get_name().find_last_of ('.'); - if (options.is_extention_enabled(lastdot!=Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ + if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){ // if supported, load thumbnail first Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name()); if (tmb) { @@ -837,7 +837,7 @@ void FileCatalog::emptyTrash () { const std::vector t = fileBrowser->getEntries (); std::vector toDel; - for (int i=0; ithumbnail->getStage()==1) toDel.push_back (((FileBrowserEntry*)t[i])); deleteRequested (toDel); @@ -846,7 +846,7 @@ void FileCatalog::emptyTrash () { bool FileCatalog::trashIsEmpty () { const std::vector t = fileBrowser->getEntries (); - for (int i=0; ithumbnail->getStage()==1) return false; diff --git a/rtgui/lcurve.cc b/rtgui/lcurve.cc index 1291d7ed5..55bea0a9b 100644 --- a/rtgui/lcurve.cc +++ b/rtgui/lcurve.cc @@ -129,9 +129,9 @@ void LCurve::setBatchMode (bool batchMode) { void LCurve::setAdjusterBehavior (bool bradd, bool contradd) { - if (!brAdd && bradd || brAdd && !bradd) + if ((!brAdd && bradd) || (brAdd && !bradd)) brightness->setLimits (-100, 100, 1, 0); - if (!contrAdd && contradd || contrAdd && !contradd) + if ((!contrAdd && contradd) || (contrAdd && !contradd)) contrast->setLimits (-100, 100, 1, 0); brAdd = bradd; diff --git a/rtgui/multilangmgr.cc b/rtgui/multilangmgr.cc index bbdf17ead..850350ffe 100644 --- a/rtgui/multilangmgr.cc +++ b/rtgui/multilangmgr.cc @@ -38,7 +38,7 @@ bool MultiLangMgr::load (Glib::ustring fname, MultiLangMgr* fb) { char* buffer = new char[2048]; - while (buffer = fgets (buffer, 2048, f)) { + while ((buffer = fgets (buffer, 2048, f))) { // find separator int seppos = 0; while (buffer[seppos]!=0 && buffer[seppos]!=';') diff --git a/rtgui/mycurve.cc b/rtgui/mycurve.cc index 09c7f6469..ff079b1d4 100644 --- a/rtgui/mycurve.cc +++ b/rtgui/mycurve.cc @@ -68,7 +68,7 @@ std::vector MyCurve::get_vector (int veclen) { double prev =- 1.0; int active = 0; int firstact = -1; - for (int i = 0; i < curve.x.size(); ++i) + for (int i = 0; i < (int)curve.x.size(); ++i) if (curve.x[i] > prev) { if (firstact < 0) firstact = i; @@ -154,8 +154,8 @@ void MyCurve::draw (int handle) { // histogram in the background if (bghistvalid) { - // find heighest bin - int histheight = 0; + // find highest bin + unsigned int histheight = 0; for (int i=0; i<256; i++) if (bghist[i]>histheight) histheight = bghist[i]; @@ -165,7 +165,7 @@ void MyCurve::draw (int handle) { cr->move_to (RADIUS, innerHeight-1+RADIUS); cr->set_source_rgb (0.75, 0.75, 0.75); for (int i=0; i<256; i++) { - double val = bghist[i] * (double)(innerHeight-2) / histheight; + double val = bghist[i] * (double)(innerHeight-2) / (double)histheight; if (val>innerHeight-1) val = innerHeight-1; if (i>0) @@ -275,204 +275,206 @@ bool MyCurve::handleEvents (GdkEvent* event) { return false; switch (event->type) { - case Gdk::CONFIGURE: - if (pixmap) - pixmap.clear (); + case Gdk::CONFIGURE: + if (pixmap) + pixmap.clear (); + retval = true; + break; - case Gdk::EXPOSE: - if (!pixmap) { - pixmap = Gdk::Pixmap::create (get_window(), get_allocation().get_width(), get_allocation().get_height()); - interpolate (); - } - draw (lit_point); - break; + case Gdk::EXPOSE: + if (!pixmap) { + pixmap = Gdk::Pixmap::create (get_window(), get_allocation().get_width(), get_allocation().get_height()); + interpolate (); + } + draw (lit_point); + retval = true; + break; - case Gdk::BUTTON_PRESS: - if (curve.type!=Parametric) { - if (event->button.button == 1) { - buttonPressed = true; - add_modal_grab (); + case Gdk::BUTTON_PRESS: + if (curve.type!=Parametric) { + if (event->button.button == 1) { + buttonPressed = true; + add_modal_grab (); - // get the pointer position - getCursorPosition(event); - findClosestPoint(); + // get the pointer position + getCursorPosition(event); + findClosestPoint(); - new_type = CSMove; - if (distanceX > minDistanceX) { - /* insert a new control point */ - if (num > 0) { - if (clampedX > curve.x[closest_point]) - ++closest_point; - } - itx = curve.x.begin(); - ity = curve.y.begin(); - for (int i=0; i minDistanceX) { + /* insert a new control point */ + if (num > 0) { + if (clampedX > curve.x[closest_point]) + ++closest_point; } - grab_point = closest_point; - lit_point = closest_point; - ugpX = curve.x[closest_point]; - ugpY = curve.y[closest_point]; - } - } - retval = true; - break; - - case Gdk::BUTTON_RELEASE: - if (curve.type!=Parametric) { - if (event->button.button == 1) { - buttonPressed = false; - } - if (!buttonPressed) { - /* get the pointer position */ - getCursorPosition(event); - findClosestPoint(); - - remove_modal_grab (); - int previous_lit_point = lit_point; - /* delete inactive points: */ itx = curve.x.begin(); ity = curve.y.begin(); - for (src = dst = 0; src < num; ++src) - if (curve.x[src] >= 0.0) { - curve.x[dst] = curve.x[src]; - curve.y[dst] = curve.y[src]; - ++dst; - ++itx; - ++ity; - } - if (dst < src) { - curve.x.erase (itx, curve.x.end()); - curve.y.erase (ity, curve.y.end()); - if (!curve.x.size()) { - curve.x.push_back (0); - curve.y.push_back (0); - interpolate (); - draw (lit_point); - } + for (int i=0; ibutton.button == 1) { + buttonPressed = false; + /* get the pointer position */ + getCursorPosition(event); + findClosestPoint(); + + remove_modal_grab (); + int previous_lit_point = lit_point; + /* delete inactive points: */ + itx = curve.x.begin(); + ity = curve.y.begin(); + for (src = dst = 0; src < num; ++src) + if (curve.x[src] >= 0.0) { + curve.x[dst] = curve.x[src]; + curve.y[dst] = curve.y[src]; + ++dst; + ++itx; + ++ity; } - if (distanceX <= minDistanceX) { - new_type = CSMove; - lit_point = closest_point; - } - else { - new_type = CSPlus; - lit_point = -1; - } - if (lit_point != previous_lit_point) + if (dst < src) { + curve.x.erase (itx, curve.x.end()); + curve.y.erase (ity, curve.y.end()); + if (!curve.x.size()) { + curve.x.push_back (0); + curve.y.push_back (0); + interpolate (); draw (lit_point); - grab_point = -1; - retval = true; + } + } + if (distanceX <= minDistanceX) { + new_type = CSMove; + lit_point = closest_point; + } + else { + new_type = CSPlus; + lit_point = -1; + } + if (lit_point != previous_lit_point) + draw (lit_point); + grab_point = -1; + retval = true; + notifyListener (); + } + } + break; + + case Gdk::LEAVE_NOTIFY: + // Pointer can LEAVE even when dragging the point, so we don't modify the cursor in this case + // The cursor will have to LEAVE another time after the drag... + if (!buttonPressed) + if (grab_point == -1) { + new_type = CSArrow; + lit_point = -1; + draw (lit_point); + } + retval = true; + break; + + case Gdk::MOTION_NOTIFY: + if (curve.type == Linear || curve.type == Spline || curve.type == NURBS) { + // get the pointer position + getCursorPosition(event); + + if (grab_point == -1) { + // there's no point currently being moved + int previous_lit_point = lit_point; + findClosestPoint(); + if (distanceX <= minDistanceX) { + new_type = CSMove; + lit_point = closest_point; + } + else { + new_type = CSPlus; + lit_point = -1; + } + if (lit_point != previous_lit_point) + draw (lit_point); + } + else { + // a point is being moved + + // bounds of the grabbed point + double leftBound = (grab_point == 0 ) ? 0. : curve.x[grab_point-1]; + double rightBound = (grab_point == num-1) ? 1. : curve.x[grab_point+1]; + double const bottomBound = 0.; + double const topBound = 1.; + + double leftDeletionBound = leftBound - minDistanceX; + double rightDeletionBound = rightBound + minDistanceX; + double bottomDeletionBound = bottomBound - minDistanceY; + double topDeletionBound = topBound + minDistanceY; + + // we memorize the previous position of the point, for optimization purpose + double prevPosX = curve.x[grab_point]; + double prevPosY = curve.y[grab_point]; + + // we memorize the previous position of the point, for optimization purpose + ugpX += deltaX; + ugpY += deltaY; + + // handling limitations along X axis + if (ugpX >= rightDeletionBound && (grab_point > 0 && grab_point < (num-1))) { + curve.x[grab_point] = -1.; + } + else if (ugpX <= leftDeletionBound && (grab_point > 0 && grab_point < (num-1))) { + curve.x[grab_point] = -1.; + } + else + // nextPosX is in bounds + curve.x[grab_point] = CLAMP(ugpX, leftBound, rightBound); + + // Handling limitations along Y axis + if (ugpY >= topDeletionBound && grab_point != 0 && grab_point != num-1) { + curve.x[grab_point] = -1.; + } + else if (ugpY <= bottomDeletionBound && grab_point != 0 && grab_point != num-1) { + curve.x[grab_point] = -1.; + } + else + // nextPosY is in the bounds + curve.y[grab_point] = CLAMP(ugpY, 0.0, 1.0); + + if (curve.x[grab_point] != prevPosX || curve.y[grab_point] != prevPosY) { + // we recalculate the curve only if we have to + interpolate (); + draw (lit_point); notifyListener (); } } - break; + } - case Gdk::LEAVE_NOTIFY: - // Pointer can LEAVE even when dragging the point, so we don't modify the cursor in this case - // The cursor will have to LEAVE another time after the drag... - if (!buttonPressed) - if (grab_point == -1) { - new_type = CSArrow; - lit_point = -1; - draw (lit_point); - } - break; + retval = true; + break; - case Gdk::MOTION_NOTIFY: - if (curve.type == Linear || curve.type == Spline || curve.type == NURBS) { - // get the pointer position - getCursorPosition(event); - - if (grab_point == -1) { - // there's no point currently being moved - int previous_lit_point = lit_point; - findClosestPoint(); - if (distanceX <= minDistanceX) { - new_type = CSMove; - lit_point = closest_point; - } - else { - new_type = CSPlus; - lit_point = -1; - } - if (lit_point != previous_lit_point) - draw (lit_point); - } - else { - // a point is being moved - - // bounds of the grabbed point - double leftBound = (grab_point == 0 ) ? 0. : curve.x[grab_point-1]; - double rightBound = (grab_point == num-1) ? 1. : curve.x[grab_point+1]; - double const bottomBound = 0.; - double const topBound = 1.; - - double leftDeletionBound = leftBound - minDistanceX; - double rightDeletionBound = rightBound + minDistanceX; - double bottomDeletionBound = bottomBound - minDistanceY; - double topDeletionBound = topBound + minDistanceY; - - // we memorize the previous position of the point, for optimization purpose - double prevPosX = curve.x[grab_point]; - double prevPosY = curve.y[grab_point]; - - // we memorize the previous position of the point, for optimization purpose - ugpX += deltaX; - ugpY += deltaY; - - // handling limitations along X axis - if (ugpX >= rightDeletionBound && (grab_point > 0 && grab_point < (num-1))) { - curve.x[grab_point] = -1.; - } - else if (ugpX <= leftDeletionBound && (grab_point > 0 && grab_point < (num-1))) { - curve.x[grab_point] = -1.; - } - else - // nextPosX is in bounds - curve.x[grab_point] = CLAMP(ugpX, leftBound, rightBound); - - // Handling limitations along Y axis - if (ugpY >= topDeletionBound && grab_point != 0 && grab_point != num-1) { - curve.x[grab_point] = -1.; - } - else if (ugpY <= bottomDeletionBound && grab_point != 0 && grab_point != num-1) { - curve.x[grab_point] = -1.; - } - else - // nextPosY is in the bounds - curve.y[grab_point] = CLAMP(ugpY, 0.0, 1.0); - - if (curve.x[grab_point] != prevPosX || curve.y[grab_point] != prevPosY) { - // we recalculate the curve only if we have to - interpolate (); - draw (lit_point); - notifyListener (); - } - } - } - - retval = true; - break; - - default: - break; - } - if (new_type != cursor_type) { - cursor_type = new_type; - cursorManager.setCursor(cursor_type); - } - return retval; + default: + break; + } + if (new_type != cursor_type) { + cursor_type = new_type; + cursorManager.setCursor(cursor_type); + } + return retval; } void MyCurve::getCursorPosition(GdkEvent* event) { diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc index 92f1c1ea8..e03212f05 100644 --- a/rtgui/perspective.cc +++ b/rtgui/perspective.cc @@ -84,7 +84,7 @@ void PerspCorrection::adjusterChanged (Adjuster* a, double newval) { void PerspCorrection::setAdjusterBehavior (bool badd) { - if (!vAdd && badd || vAdd && !badd) { + if ((!vAdd && badd) || (vAdd && !badd)) { // horiz->setLimits (-0.005, 0.005, 0.0001, 0); // vert->setLimits (-0.005, 0.005, 0.0001, 0); } diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 1a5d54b11..6bfaa815d 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -175,7 +175,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) { get_window()->set_cursor (*cCropMoving); else get_window()->set_cursor (*cNormal); - + return true; } bool PreviewWindow::on_button_press_event (GdkEventButton* event) { @@ -201,6 +201,7 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event) { } get_window()->set_cursor (*cCropMoving); } + return true; } bool PreviewWindow::on_button_release_event (GdkEventButton* event) { @@ -213,4 +214,5 @@ bool PreviewWindow::on_button_release_event (GdkEventButton* event) { get_window()->set_cursor (*cNormal); mainCropWin->remoteMoveReady (); } + return true; } diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc index 8c13b467e..2678a84e6 100644 --- a/rtgui/rotate.cc +++ b/rtgui/rotate.cc @@ -101,7 +101,7 @@ void Rotate::setBatchMode (bool batchMode) { void Rotate::setAdjusterBehavior (bool brotadd) { - if (!degAdd && brotadd || degAdd && !brotadd) + if ((!degAdd && brotadd) || (degAdd && !brotadd)) degree->setLimits (-45, 45, 0.01, 0); degAdd = brotadd; diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index e25633667..c0efb25f6 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -347,9 +347,9 @@ void ToneCurve::setAdjusterBehavior (bool expadd, bool bradd, bool blackadd, boo black->setLimits (0, 16384, 1, 0); else if (blackAdd && !blackadd) black->setLimits (0, 32768, 1, 0); - if (!brAdd && bradd || brAdd && !bradd) + if ((!brAdd && bradd) || (brAdd && !bradd)) brightness->setLimits (-100, 100, 1, 0); - if (!contrAdd && contradd || contrAdd && !contradd) + if ((!contrAdd && contradd) || (contrAdd && !contradd)) contrast->setLimits (-100, 100, 1, 0); expAdd = expadd; diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc index 6bec226be..622885f19 100644 --- a/rtgui/vignetting.cc +++ b/rtgui/vignetting.cc @@ -77,7 +77,7 @@ void Vignetting::adjusterChanged (Adjuster* a, double newval) { void Vignetting::setAdjusterBehavior (bool bvadd) { - if (!vigAdd && bvadd || vigAdd && !bvadd) + if ((!vigAdd && bvadd) || (vigAdd && !bvadd)) amount->setLimits (-100, 100, 1, 0); vigAdd = bvadd;