diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-15 19:25:44 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-18 13:59:27 +0200 |
commit | 624911e48174094c80df7e27b28cc2b2d46f4398 (patch) | |
tree | 9fea768422d24bbd3b2c1eed8f2d6a1d3daf7100 /src/gui/image/qpnghandler.cpp | |
parent | ed7b50fdb49dc40e891ae4ab1924a1e64f5481e1 (diff) |
Fix -Wclobbered warnings
GCC warns:
warning: argument 'x' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
Apparently, the real fix would be annotating the functions correctly
with noreturn and returns_twice attributes, but there's also workarounds
for these, at least in the png case, so adding volatile was the easier
way out here.
Needed a cast to lose the volatile again, passing the argument to qMin().
Change-Id: Id820cf9b65752359f3b8f268172ba71bc9a76784
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/image/qpnghandler.cpp')
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 04f3b4f332..cccb29bb7b 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -181,7 +181,7 @@ public: void setGamma(float); bool writeImage(const QImage& img, int x, int y); - bool writeImage(const QImage& img, int quality, const QString &description, int x, int y); + bool writeImage(const QImage& img, volatile int quality, const QString &description, int x, int y); bool writeImage(const QImage& img) { return writeImage(img, 0, 0); } bool writeImage(const QImage& img, int quality, const QString &description) @@ -801,7 +801,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, int off_x, int off_y) return writeImage(image, -1, QString(), off_x, off_y); } -bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, int quality_in, const QString &description, +bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, volatile int quality_in, const QString &description, int off_x_in, int off_y_in) { QPoint offset = image.offset(); |