Fix some coverity issues

This commit is contained in:
heckflosse
2017-06-14 13:50:46 +02:00
parent 2fcb7d9665
commit 18076077c0
8 changed files with 15 additions and 52 deletions

View File

@@ -428,7 +428,7 @@ void WhiteBalance::optChanged ()
equal->setEditedState (UnEdited);
tempBias->setEditedState (UnEdited);
} else {
int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI);
unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI);
WBEntry* currMethod = WBParams::wbEntries[methodId];
tempBias->set_sensitive(currMethod->type == WBT_AUTO);
@@ -792,7 +792,7 @@ void WhiteBalance::cache_customWB(int temp, double green)
cache_customGreen (green);
}
int WhiteBalance::findWBEntryId (Glib::ustring label, enum WB_LabelType lblType)
unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType)
{
for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) {
if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) {
@@ -800,7 +800,7 @@ int WhiteBalance::findWBEntryId (Glib::ustring label, enum WB_LabelType lblType)
}
}
return -1;
return 0; // default to camera wb
}
WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType)