fixed more warnings in rtgui (reported by gcc but not clang)

This commit is contained in:
Alberto Griggio
2017-04-01 16:43:32 +02:00
parent a3561049ed
commit 27e822fdae
14 changed files with 34 additions and 34 deletions

View File

@@ -781,7 +781,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam
if (options.savePathTemplate[ix] == 'p') { if (options.savePathTemplate[ix] == 'p') {
ix++; ix++;
int i = options.savePathTemplate[ix] - '0'; unsigned int i = options.savePathTemplate[ix] - '0';
if (i < pa.size()) { if (i < pa.size()) {
path = path + pa[pa.size() - i - 1] + '/'; path = path + pa[pa.size() - i - 1] + '/';
@@ -790,7 +790,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam
ix++; ix++;
} else if (options.savePathTemplate[ix] == 'd') { } else if (options.savePathTemplate[ix] == 'd') {
ix++; ix++;
int i = options.savePathTemplate[ix] - '0'; unsigned i = options.savePathTemplate[ix] - '0';
if (i < da.size()) { if (i < da.size()) {
path = path + da[da.size() - i - 1]; path = path + da[da.size() - i - 1];

View File

@@ -35,7 +35,7 @@ CheckBox::CheckBox (Glib::ustring label, bool const& multiImageVal)
void CheckBox::buttonToggled () void CheckBox::buttonToggled ()
{ {
CheckValue newValue; CheckValue newValue = CheckValue::unchanged;
if (multiImage) { if (multiImage) {
if (get_inconsistent()) { if (get_inconsistent()) {

View File

@@ -1627,7 +1627,7 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
int delta = 0; int delta = 0;
// for efficiency, pre-calculate currWS_L as it may be needed in both // for efficiency, pre-calculate currWS_L as it may be needed in both
// if (showch) and if (showcs) branches // if (showch) and if (showcs) branches
int currWS_L; int currWS_L = 0;
if (showL && (showch || showcs)) { if (showL && (showch || showcs)) {
currWS_L = (int)(0.299f * currWS[0] + 0.587f * currWS[1] + 0.114f * currWS[2]); currWS_L = (int)(0.299f * currWS[0] + 0.587f * currWS[1] + 0.114f * currWS[2]);

View File

@@ -348,7 +348,7 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter)
auto dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname)); auto dir = Gio::File::create_for_path (iter->get_value (dtColumns.dirname));
auto subDirs = listSubDirs (dir, options.fbShowHidden); auto subDirs = listSubDirs (dir, options.fbShowHidden);
for (int i = 0; i < subDirs.size(); i++) { for (size_t i = 0; i < subDirs.size(); i++) {
bool found = false; 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) {

View File

@@ -36,8 +36,8 @@ public:
double shutterTo; double shutterTo;
double focalFrom; double focalFrom;
double focalTo; double focalTo;
int isoFrom; unsigned isoFrom;
int isoTo; unsigned isoTo;
bool filterFNumber; bool filterFNumber;
bool filterShutter; bool filterShutter;

View File

@@ -405,7 +405,7 @@ FileBrowser::FileBrowser ()
colorlabel[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), colorlabel[i])); colorlabel[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), colorlabel[i]));
} }
for (int i = 0; i < mMenuExtProgs.size(); i++) { for (size_t i = 0; i < mMenuExtProgs.size(); i++) {
amiExtProg[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), amiExtProg[i])); amiExtProg[i]->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), amiExtProg[i]));
} }
@@ -730,14 +730,14 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m)
return; return;
} }
for (int j = 0; j < mMenuExtProgs.size(); j++) { for (size_t j = 0; j < mMenuExtProgs.size(); j++) {
if (m == amiExtProg[j]) { if (m == amiExtProg[j]) {
const auto pAct = mMenuExtProgs[m->get_label()]; const auto pAct = mMenuExtProgs[m->get_label()];
// Build vector of all file names // Build vector of all file names
std::vector<Glib::ustring> selFileNames; std::vector<Glib::ustring> selFileNames;
for (int i = 0; i < mselected.size(); i++) { for (size_t i = 0; i < mselected.size(); i++) {
Glib::ustring fn = mselected[i]->thumbnail->getFileName(); Glib::ustring fn = mselected[i]->thumbnail->getFileName();
// Maybe batch processed version // Maybe batch processed version
@@ -1505,11 +1505,11 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry
int iFilenameMatch = 0; int iFilenameMatch = 0;
std::vector<Glib::ustring> vFilterStrings = Glib::Regex::split_simple(",", decodedQueryFileName.uppercase()); std::vector<Glib::ustring> vFilterStrings = Glib::Regex::split_simple(",", decodedQueryFileName.uppercase());
for(int i = 0; i < vFilterStrings.size(); i++) { for(size_t i = 0; i < vFilterStrings.size(); i++) {
// ignore empty vFilterStrings. Otherwise filter will always return true if // ignore empty vFilterStrings. Otherwise filter will always return true if
// e.g. filter.queryFileName ends on "," and will stop being a filter // e.g. filter.queryFileName ends on "," and will stop being a filter
if (!vFilterStrings.at(i).empty()) { if (!vFilterStrings.at(i).empty()) {
if (FileName.find(vFilterStrings.at(i)) != -1) { if (FileName.find(vFilterStrings.at(i)) != Glib::ustring::npos) {
iFilenameMatch++; iFilenameMatch++;
} }
} }

View File

@@ -748,12 +748,12 @@ void FileCatalog::previewReady (int dir_id, FileBrowserEntry* fdn)
dirEFS.shutterTo = cfs->shutter; dirEFS.shutterTo = cfs->shutter;
} }
if (cfs->iso > 0 && (int)cfs->iso < dirEFS.isoFrom) { if (cfs->iso > 0 && cfs->iso < dirEFS.isoFrom) {
dirEFS.isoFrom = (int)cfs->iso; dirEFS.isoFrom = cfs->iso;
} }
if (cfs->iso > 0 && (int)cfs->iso > dirEFS.isoTo) { if (cfs->iso > 0 && cfs->iso > dirEFS.isoTo) {
dirEFS.isoTo = (int)cfs->iso; dirEFS.isoTo = cfs->iso;
} }
if (cfs->focalLen < dirEFS.focalFrom) { if (cfs->focalLen < dirEFS.focalFrom) {

View File

@@ -1478,7 +1478,7 @@ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int src
return; return;
} }
for (unsigned int i = 0; i < (unsigned int)(srcH); ++i) { for (int i = 0; i < srcH; ++i) {
if (dstY + i >= surfH) { if (dstY + i >= surfH) {
break; break;
} }
@@ -1486,7 +1486,7 @@ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int src
src = srcData + i * srcRowStride; src = srcData + i * srcRowStride;
dst = dstData + ((dstY + i) * surfW + dstX) * 4; dst = dstData + ((dstY + i) * surfW + dstX) * 4;
for (unsigned int j = 0; j < (unsigned int)(srcW); ++j) { for (int j = 0; j < srcW; ++j) {
if (dstX + j >= surfW) { if (dstX + j >= surfW) {
break; break;
} }

View File

@@ -114,7 +114,7 @@ public:
class ConnectionBlocker class ConnectionBlocker
{ {
public: public:
explicit ConnectionBlocker (Gtk::Widget *associatedWidget, sigc::connection& connection) : connection (associatedWidget ? &connection : nullptr) explicit ConnectionBlocker (Gtk::Widget *associatedWidget, sigc::connection& connection) : connection (associatedWidget ? &connection : nullptr), wasBlocked(false)
{ {
if (this->connection) { if (this->connection) {
wasBlocked = connection.block(); wasBlocked = connection.block();

View File

@@ -1007,7 +1007,7 @@ SSEFUNCTION void HistogramArea::updateBackBuffer ()
// does not take into account 0 and 255 values // does not take into account 0 and 255 values
// them are handled separately // them are handled separately
int fullhistheight = 0; unsigned int fullhistheight = 0;
for (int i = 1; i < 255; i++) { for (int i = 1; i < 255; i++) {
if (needLuma && lhisttemp[i] > fullhistheight) { if (needLuma && lhisttemp[i] > fullhistheight) {
@@ -1042,7 +1042,7 @@ SSEFUNCTION void HistogramArea::updateBackBuffer ()
vint iv = (vint)ZEROV; vint iv = (vint)ZEROV;
#endif #endif
for (int i = 0; i < fullhistheight; i++) { for (unsigned i = 0; i < fullhistheight; i++) {
#ifdef __SSE2__ #ifdef __SSE2__
vint areatempv = (vint)ZEROV; vint areatempv = (vint)ZEROV;

View File

@@ -175,7 +175,7 @@ bool MyCurve::snapCoordinateY(double testedVal, double realVal)
float MyCurve::getVal(LUTf &curve, int x) float MyCurve::getVal(LUTf &curve, int x)
{ {
if ((graphW - 2) == curve.getSize()) { if (size_t(graphW - 2) == curve.getSize()) {
return curve[x]; return curve[x];
} else { } else {
return curve.getVal01(float(x) / (graphW - 3)); return curve.getVal01(float(x) / (graphW - 3));

View File

@@ -398,7 +398,7 @@ void MyDiagonalCurve::draw (int handle)
double y2 = double(graphY) - 1.5 - double(graphH - 3) * points[pos + 1]; // project (curve.y.at(i), 0, 1, graphH); double y2 = double(graphY) - 1.5 - double(graphH - 3) * points[pos + 1]; // project (curve.y.at(i), 0, 1, graphH);
// set the color of the line when the point is snapped to the cage // set the color of the line when the point is snapped to the cage
if (curve.x.size() == nbPoints && snapToElmt >= 1000 && ((i == (snapToElmt - 1000)) || (i == (snapToElmt - 999)))) { if (curve.x.size() == nbPoints && snapToElmt >= 1000 && ((int(i) == (snapToElmt - 1000)) || (int(i) == (snapToElmt - 999)))) {
cr->set_source_rgb (1.0, 0.0, 0.0); cr->set_source_rgb (1.0, 0.0, 0.0);
} else { } else {
cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue()); cr->set_source_rgb (c.get_red(), c.get_green(), c.get_blue());
@@ -606,7 +606,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
edited_point = lit_point; edited_point = lit_point;
std::vector<CoordinateAdjuster::Boundaries> newBoundaries(2); std::vector<CoordinateAdjuster::Boundaries> newBoundaries(2);
unsigned int size = curve.x.size(); int size = curve.x.size();
if (edited_point == 0) { if (edited_point == 0) {
newBoundaries.at(0).minVal = 0.; newBoundaries.at(0).minVal = 0.;
@@ -655,7 +655,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
draw (lit_point); draw (lit_point);
std::vector<CoordinateAdjuster::Boundaries> newBoundaries; std::vector<CoordinateAdjuster::Boundaries> newBoundaries;
newBoundaries.resize(2); newBoundaries.resize(2);
unsigned int size = curve.x.size(); int size = curve.x.size();
if (edited_point == 0) { if (edited_point == 0) {
newBoundaries.at(0).minVal = 0.; newBoundaries.at(0).minVal = 0.;
@@ -888,7 +888,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
} else { } else {
// snapping point to specific values // snapping point to specific values
if (snapTo && curve.x.at(grab_point) != -1.) { if (snapTo && curve.x.at(grab_point) != -1.) {
if (grab_point > 0 && grab_point < (curve.y.size() - 1)) { if (grab_point > 0 && unsigned(grab_point) < (curve.y.size() - 1)) {
double prevX = curve.x.at(grab_point - 1); double prevX = curve.x.at(grab_point - 1);
double prevY = curve.y.at(grab_point - 1); double prevY = curve.y.at(grab_point - 1);
double nextX = curve.x.at(grab_point + 1); double nextX = curve.x.at(grab_point + 1);
@@ -910,7 +910,7 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event)
} }
} }
if (grab_point < (curve.y.size() - 1)) { if (grab_point < int(curve.y.size() - 1)) {
int nextP = grab_point + 1; int nextP = grab_point + 1;
if (snapCoordinateY(curve.y.at(nextP), ugpY)) { if (snapCoordinateY(curve.y.at(nextP), ugpY)) {
@@ -1208,7 +1208,7 @@ void MyDiagonalCurve::pipetteDrag(EditDataProvider *provider, int modifierKey)
// snapping point to specific values // snapping point to specific values
if (snapTo && curve.x.at(grab_point) != -1.) { if (snapTo && curve.x.at(grab_point) != -1.) {
if (grab_point > 0 && grab_point < (curve.y.size() - 1)) { if (grab_point > 0 && unsigned(grab_point) < (curve.y.size() - 1)) {
double prevX = curve.x.at(grab_point - 1); double prevX = curve.x.at(grab_point - 1);
double prevY = curve.y.at(grab_point - 1); double prevY = curve.y.at(grab_point - 1);
double nextX = curve.x.at(grab_point + 1); double nextX = curve.x.at(grab_point + 1);
@@ -1230,7 +1230,7 @@ void MyDiagonalCurve::pipetteDrag(EditDataProvider *provider, int modifierKey)
} }
} }
if (grab_point < (curve.y.size() - 1)) { if (grab_point < int(curve.y.size() - 1)) {
int nextP = grab_point + 1; int nextP = grab_point + 1;
if (snapCoordinateY(curve.y.at(nextP), ugpY)) { if (snapCoordinateY(curve.y.at(nextP), ugpY)) {

View File

@@ -711,7 +711,7 @@ bool MyFlatCurve::handleEvents (GdkEvent* event)
setDirty(true); setDirty(true);
draw (); draw ();
std::vector<CoordinateAdjuster::Boundaries> newBoundaries(4); std::vector<CoordinateAdjuster::Boundaries> newBoundaries(4);
unsigned int size = curve.x.size(); int size = curve.x.size();
if (edited_point == 0) { if (edited_point == 0) {
newBoundaries.at(0).minVal = 0.; newBoundaries.at(0).minVal = 0.;
@@ -761,7 +761,7 @@ bool MyFlatCurve::handleEvents (GdkEvent* event)
setDirty(true); setDirty(true);
draw (); draw ();
std::vector<CoordinateAdjuster::Boundaries> newBoundaries(4); std::vector<CoordinateAdjuster::Boundaries> newBoundaries(4);
unsigned int size = curve.x.size(); int size = curve.x.size();
if (edited_point == 0) { if (edited_point == 0) {
newBoundaries.at(0).minVal = 0.; newBoundaries.at(0).minVal = 0.;
@@ -1544,7 +1544,7 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag)
} }
if (curve.y.size() > 2) { if (curve.y.size() > 2) {
if (lit_point == (curve.y.size() - 1)) { if (lit_point == int(curve.y.size()) - 1) {
if (snapCoordinateY(curve.y.at(0), ugpY)) { if (snapCoordinateY(curve.y.at(0), ugpY)) {
snapToElmt = 0; snapToElmt = 0;
} }

View File

@@ -107,8 +107,8 @@ void PopUpCommon::entrySelected (int i)
void PopUpCommon::setItemSensitivity (int index, bool isSensitive) { void PopUpCommon::setItemSensitivity (int index, bool isSensitive) {
const auto items = menu->get_children (); const auto items = menu->get_children ();
if (index < items.size ()) { if (size_t(index) < items.size ()) {
items[index]->set_sensitive (isSensitive); items[size_t(index)]->set_sensitive (isSensitive);
} }
} }