Fix cppcheck issues: knownConditionTrueFalse

v0.27.3
Luis Díaz Más 7 years ago
parent ab35759de8
commit 4216dcd0c2

@ -327,11 +327,8 @@ namespace Action {
// Exposure time // Exposure time
// From ExposureTime, failing that, try ShutterSpeedValue // From ExposureTime, failing that, try ShutterSpeedValue
bool done = false;
printLabel(_("Exposure time")); printLabel(_("Exposure time"));
if (!done) { bool done = 0 != printTag(exifData, "Exif.Photo.ExposureTime");
done = 0 != printTag(exifData, "Exif.Photo.ExposureTime");
}
if (!done) { if (!done) {
done = 0 != printTag(exifData, "Exif.Photo.ShutterSpeedValue"); done = 0 != printTag(exifData, "Exif.Photo.ShutterSpeedValue");
} }
@ -341,10 +338,7 @@ namespace Action {
// Get if from FNumber and, failing that, try ApertureValue // Get if from FNumber and, failing that, try ApertureValue
{ {
printLabel(_("Aperture")); printLabel(_("Aperture"));
bool done = false; bool done = 0 != printTag(exifData, "Exif.Photo.FNumber");
if (!done) {
done = 0 != printTag(exifData, "Exif.Photo.FNumber");
}
if (!done) { if (!done) {
done = 0 != printTag(exifData, "Exif.Photo.ApertureValue"); done = 0 != printTag(exifData, "Exif.Photo.ApertureValue");
} }
@ -380,10 +374,7 @@ namespace Action {
// Subject distance // Subject distance
{ {
printLabel(_("Subject distance")); printLabel(_("Subject distance"));
bool done = false; bool done = 0 != printTag(exifData, "Exif.Photo.SubjectDistance");
if (!done) {
done = 0 != printTag(exifData, "Exif.Photo.SubjectDistance");
}
if (!done) { if (!done) {
printTag(exifData, "Exif.CanonSi.SubjectDistance"); printTag(exifData, "Exif.CanonSi.SubjectDistance");
printTag(exifData, "Exif.CanonFi.FocusDistanceLower"); printTag(exifData, "Exif.CanonFi.FocusDistanceLower");
@ -1050,7 +1041,7 @@ namespace Action {
bool bStdout = Params::instance().target_ & Params::ctStdInOut?true:false; bool bStdout = Params::instance().target_ & Params::ctStdInOut?true:false;
if (bStdout) { _setmode(_fileno(stdout), _O_BINARY) ; } if (bStdout) { _setmode(_fileno(stdout), _O_BINARY) ; }
if (!rc && Params::instance().target_ & Params::ctThumb) { if (Params::instance().target_ & Params::ctThumb) {
rc = writeThumbnail(); rc = writeThumbnail();
} }
if (!rc && Params::instance().target_ & Params::ctPreview) { if (!rc && Params::instance().target_ & Params::ctPreview) {
@ -1356,9 +1347,8 @@ namespace Action {
{ {
int rc = 0; int rc = 0;
// test path exists // test path exists
if (rc==0 && !Exiv2::fileExists(path, true)) { if (!Exiv2::fileExists(path, true)) {
std::cerr << path std::cerr << path << ": " << _("Failed to open the file\n");
<< ": " << _("Failed to open the file\n");
rc=-1; rc=-1;
} }

Loading…
Cancel
Save