From 4b97a5cf3c0d124c90fb8eae989facefff8024c5 Mon Sep 17 00:00:00 2001
From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
Date: Mon, 5 Sep 2022 18:05:35 -0700
Subject: [PATCH] Placate some GCC warnings (#6563)
---
rtengine/imagedata.cc | 3 ++-
rtengine/imageio.cc | 23 ++++++++++++-----------
rtgui/myflatcurve.cc | 8 ++------
rtgui/rtimage.cc | 2 +-
4 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc
index 3c10e7dc0..5d3fef80b 100644
--- a/rtengine/imagedata.cc
+++ b/rtengine/imagedata.cc
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see .
*/
+#include
#include
#include
@@ -601,7 +602,7 @@ FrameData::FrameData(rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
// ----------------------- Special file type detection (HDR, PixelShift) ------------------------
- uint16 bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0;
+ uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0;
const rtexif::Tag* const bps = frameRootDir->findTag("BitsPerSample");
const rtexif::Tag* const spp = frameRootDir->findTag("SamplesPerPixel");
const rtexif::Tag* const sf = frameRootDir->findTag("SampleFormat");
diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc
index ca41aa007..39ab679e9 100644
--- a/rtengine/imageio.cc
+++ b/rtengine/imageio.cc
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -664,7 +665,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
return IMIO_CANNOTREADFILE;
}
- uint16 bitspersample = 0, samplesperpixel = 0, sampleformat = 0;
+ uint16_t bitspersample = 0, samplesperpixel = 0, sampleformat = 0;
int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
@@ -689,7 +690,7 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
sampleformat = SAMPLEFORMAT_UINT;
}
- uint16 config;
+ uint16_t config;
TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config);
if (config == PLANARCONFIG_CONTIG) {
@@ -701,14 +702,14 @@ int ImageIO::getTIFFSampleFormat (const Glib::ustring &fname, IIOSampleFormat &s
return IMIO_VARIANTNOTSUPPORTED;
}
- uint16 photometric;
+ uint16_t photometric;
if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric)) {
TIFFClose(in);
return IMIO_VARIANTNOTSUPPORTED;
}
- uint16 compression;
+ uint16_t compression;
if (photometric == PHOTOMETRIC_LOGLUV)
if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &compression)) {
@@ -786,7 +787,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
- uint16 bitspersample, samplesperpixel;
+ uint16_t bitspersample, samplesperpixel;
int hasTag = TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample);
hasTag &= TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
@@ -798,7 +799,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
return IMIO_VARIANTNOTSUPPORTED;
}
- uint16 config;
+ uint16_t config;
TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config);
if (config != PLANARCONFIG_CONTIG) {
@@ -819,7 +820,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
*/
if (settings->verbose) {
printf("Information of \"%s\":\n", fname.c_str());
- uint16 tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit;
+ uint16_t tiffDefaultScale, tiffBaselineExposure, tiffLinearResponseLimit;
if (TIFFGetField(in, TIFFTAG_DEFAULTSCALE, &tiffDefaultScale)) {
printf(" DefaultScale: %d\n", tiffDefaultScale);
}
@@ -836,7 +837,7 @@ int ImageIO::loadTIFF (const Glib::ustring &fname)
else
printf(" No LinearResponseLimit value!\n");
- uint16 tiffMinValue, tiffMaxValue;
+ uint16_t tiffMinValue, tiffMaxValue;
if (TIFFGetField(in, TIFFTAG_SMINSAMPLEVALUE, &tiffMinValue)) {
printf(" MinValue: %d\n", tiffMinValue);
}
@@ -1556,15 +1557,15 @@ int ImageIO::saveTIFF (const Glib::ustring &fname, int bps, bool isFloat, bool u
*/
if (applyExifPatch) {
unsigned char b[10];
- uint16 tagCount = 0;
+ uint16_t tagCount = 0;
lseek(fileno, 4, SEEK_SET);
read(fileno, b, 4);
- uint32 ifd0Offset = rtexif::sget4(b, exifRoot->getOrder());
+ uint32_t ifd0Offset = rtexif::sget4(b, exifRoot->getOrder());
lseek(fileno, ifd0Offset, SEEK_SET);
read(fileno, b, 2);
tagCount = rtexif::sget2(b, exifRoot->getOrder());
for (size_t i = 0; i < tagCount ; ++i) {
- uint16 tagID = 0;
+ uint16_t tagID = 0;
read(fileno, b, 2);
tagID = rtexif::sget2(b, exifRoot->getOrder());
if (tagID == 0x8769) {
diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc
index 11d89ebd8..8ccc28c21 100644
--- a/rtgui/myflatcurve.cc
+++ b/rtgui/myflatcurve.cc
@@ -1643,7 +1643,8 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag)
void MyFlatCurve::getCursorPosition(Gdk::EventType evType, bool isHint, int evX, int evY, Gdk::ModifierType modifierKey)
{
int tx, ty;
- int prevCursorX, prevCursorY;
+ int prevCursorX = cursorX;
+ int prevCursorY = cursorY;
double incrementX = 1. / double(graphW);
double incrementY = 1. / double(graphH);
@@ -1672,11 +1673,6 @@ void MyFlatCurve::getCursorPosition(Gdk::EventType evType, bool isHint, int evX,
break;
}
- if (editedHandle != FCT_EditedHandle_None) {
- prevCursorX = cursorX;
- prevCursorY = cursorY;
- }
-
cursorX = tx - graphX;
cursorY = graphY - ty;
diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc
index 49551d5e6..13dd22a7b 100644
--- a/rtgui/rtimage.cc
+++ b/rtgui/rtimage.cc
@@ -38,7 +38,7 @@ int RTImage::scaleBack = 0;
RTImage::RTImage () {}
-RTImage::RTImage (RTImage &other) : Gtk::Image(), surface(other.surface), pixbuf(other.pixbuf)
+RTImage::RTImage (RTImage &other) : sigc::trackable(), Glib::ObjectBase(), Gtk::Image(), surface(other.surface), pixbuf(other.pixbuf)
{
if (pixbuf) {
set(pixbuf);