From ce30394686a4ac2cfbda560c5d7113432d84314e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 5 Mar 2015 22:25:45 -0800 Subject: QtGui: Fix const correctness in old style casts Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qimage.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/gui/image/qimage.cpp') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index dba42d4698..8ca58d4e5e 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2053,7 +2053,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format, if (format == QImage::Format_Indexed8) { for (int y=0; y table = clut; table.resize(2); for (int y=0; y 0) @@ -2784,7 +2784,7 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const if (depth() == 32) { for (int h = 0; h < d->height; h++) { - const uint *sl = (uint *) scanLine(h); + const uint *sl = (const uint *) scanLine(h); for (int w = 0; w < d->width; w++) { if (sl[w] == color) *(s + (w >> 3)) |= (1 << (w & 7)); @@ -3877,7 +3877,7 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth case 16: // 16 bpp transform while (dptr < maxp) { if (trigx < maxws && trigy < maxhs) - *((ushort*)dptr) = *((ushort *)(sptr+sbpl*(trigy>>12) + + *((ushort*)dptr) = *((const ushort *)(sptr+sbpl*(trigy>>12) + ((trigx>>12)<<1))); trigx += m11; trigy += m12; @@ -3903,7 +3903,7 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth case 32: // 32 bpp transform while (dptr < maxp) { if (trigx < maxws && trigy < maxhs) - *((uint*)dptr) = *((uint *)(sptr+sbpl*(trigy>>12) + + *((uint*)dptr) = *((const uint *)(sptr+sbpl*(trigy>>12) + ((trigx>>12)<<2))); trigx += m11; trigy += m12; @@ -4050,7 +4050,7 @@ void QImage::setAlphaChannel(const QImage &alphaChannel) // Slight optimization since alphachannels are returned as 8-bit grays. if (alphaChannel.format() == QImage::Format_Alpha8 ||( alphaChannel.d->depth == 8 && alphaChannel.isGrayscale())) { const uchar *src_data = alphaChannel.d->data; - const uchar *dest_data = d->data; + uchar *dest_data = d->data; for (int y=0; ydata; - const uchar *dest_data = d->data; + uchar *dest_data = d->data; for (int y=0; y