Fix some new Coverity warnings

This commit is contained in:
Flössie
2017-09-13 19:58:48 +02:00
parent c465655cb4
commit 05b97f5c50
3 changed files with 22 additions and 15 deletions

View File

@@ -789,18 +789,25 @@ void ImProcFunctions::transformGeneral(ImProcFunctions::TransformMode mode, Imag
bool enableCA = false;
switch (mode) {
case ImProcFunctions::TRANSFORM_HIGH_QUALITY_FULLIMAGE:
enableLCPCA = pLCPMap && params->lensProf.useCA && pLCPMap->isCACorrectionAvailable();
// no break on purpose
case ImProcFunctions::TRANSFORM_HIGH_QUALITY:
enableLCPDist = pLCPMap && params->lensProf.useDist;
if (enableLCPCA) {
enableLCPDist = false;
case ImProcFunctions::TRANSFORM_HIGH_QUALITY_FULLIMAGE: {
enableLCPCA = pLCPMap && params->lensProf.useCA && pLCPMap->isCACorrectionAvailable();
}
//no break on purpose
case ImProcFunctions::TRANSFORM_HIGH_QUALITY: {
enableLCPDist = pLCPMap && params->lensProf.useDist;
if (enableLCPCA) {
enableLCPDist = false;
}
enableCA = enableLCPCA || needsCA();
}
//no break on purpose
default:
case ImProcFunctions::TRANSFORM_PREVIEW: {
enableLCPDist = pLCPMap && params->lensProf.useDist;
break;
}
enableCA = enableLCPCA || needsCA();
default: // ImProcFunctions::TRANSFORM_PREVIEW
enableLCPDist = pLCPMap && params->lensProf.useDist;
break;
}
if (!enableCA) {

View File

@@ -650,8 +650,8 @@ int rtengine::LCPProfile::filterBadFrames(LCPCorrectionMode mode, double maxAvgD
}
}
if (settings->verbose) {
std::printf("Filtered %.1f%% frames for maxAvgDevFac %g leaving %i\n", filtered *100.f / count, maxAvgDevFac, count - filtered);
if (settings->verbose && count) {
std::printf("Filtered %.1f%% frames for maxAvgDevFac %g leaving %i\n", filtered * 100.f / count, maxAvgDevFac, count - filtered);
}
}
@@ -1030,7 +1030,7 @@ void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy
{
x += cx;
y += cy;
if (isFisheye) {
const double u = x * scale;
const double v = y * scale;

View File

@@ -85,7 +85,7 @@ public:
const rtexif::TagDirectory *getExifData() const { return NULL; }
bool hasIPTC() const { return false; }
const rtengine::procparams::IPTCPairs getIPTCData () const { return rtengine::procparams::IPTCPairs(); }
struct tm getDateTime () const { struct tm ret; return ret; }
tm getDateTime () const { return tm{}; }
time_t getDateTimeAsTS() const { return time_t(-1); }
int getISOSpeed() const { return iso; }
double getFNumber() const { return fnumber; }