From 4cdff7a0ea95a881bba859157e6eb847f6c10dc5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 5 Mar 2015 22:25:45 -0800 Subject: QtWidgets: Fix const correctness in old style casts Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c94684f8498f21 Reviewed-by: Giuseppe D'Angelo --- src/widgets/effects/qpixmapfilter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/effects') diff --git a/src/widgets/effects/qpixmapfilter.cpp b/src/widgets/effects/qpixmapfilter.cpp index 8956794e06..b21726400f 100644 --- a/src/widgets/effects/qpixmapfilter.cpp +++ b/src/widgets/effects/qpixmapfilter.cpp @@ -329,7 +329,7 @@ static void convolute( QRectF sbounded = srect.adjusted(-kernelWidth / 2, -kernelHeight / 2, (kernelWidth - 1) / 2, (kernelHeight - 1) / 2); QPoint srcStartPoint = sbounded.toAlignedRect().topLeft()+(targetRect.topLeft()-rect.topLeft()); - const uint *sourceStart = (uint*)processImage.scanLine(0); + const uint *sourceStart = (const uint*)processImage.scanLine(0); uint *outputStart = (uint*)destImage->scanLine(0); int yk = srcStartPoint.y(); @@ -946,7 +946,7 @@ static void grayscale(const QImage &image, QImage &dest, const QRect& rect = QRe destRect.moveTo(QPoint(0, 0)); } - unsigned int *data = (unsigned int *)image.bits(); + const unsigned int *data = (const unsigned int *)image.bits(); unsigned int *outData = (unsigned int *)dest.bits(); if (dest.size() == image.size() && image.rect() == srcRect) { @@ -959,7 +959,7 @@ static void grayscale(const QImage &image, QImage &dest, const QRect& rect = QRe } else { int yd = destRect.top(); for (int y = srcRect.top(); y <= srcRect.bottom() && y < image.height(); y++) { - data = (unsigned int*)image.scanLine(y); + data = (const unsigned int*)image.scanLine(y); outData = (unsigned int*)dest.scanLine(yd++); int xd = destRect.left(); for (int x = srcRect.left(); x <= srcRect.right() && x < image.width(); x++) { -- cgit v1.2.3