164 lines
8.3 KiB
Diff
164 lines
8.3 KiB
Diff
|
From ea46f47fb3c475ba2d7581c15185b8d43e63b8c2 Mon Sep 17 00:00:00 2001
|
|||
|
From: Peter Seiderer <ps.report@gmx.net>
|
|||
|
Date: Fri, 27 Feb 2015 21:30:52 +0100
|
|||
|
Subject: [PATCH] Fix conversion/constructor error for legacy c++ compiler.
|
|||
|
MIME-Version: 1.0
|
|||
|
Content-Type: text/plain; charset=UTF-8
|
|||
|
Content-Transfer-Encoding: 8bit
|
|||
|
|
|||
|
Fixes the following compile error with legacy c++ compiler:
|
|||
|
|
|||
|
error: in C++98 ‘blitRect’ must be initialized by constructor, not by ‘{...}’
|
|||
|
|
|||
|
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
|||
|
---
|
|||
|
src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 14 +++++++-------
|
|||
|
src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 6 +++---
|
|||
|
src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 6 +++---
|
|||
|
src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 +-
|
|||
|
4 files changed, 14 insertions(+), 14 deletions(-)
|
|||
|
|
|||
|
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
|
|||
|
index 876d0c2..ed69386 100644
|
|||
|
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
|
|||
|
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
|
|||
|
@@ -942,7 +942,7 @@ void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize,
|
|||
|
IDirectFBSurface *src = d->surfaceCache->getSurface(buffer, bufsize);
|
|||
|
// ### how does this play with setDFBColor
|
|||
|
src->SetColor(src, 0, 0, 0, const_alpha);
|
|||
|
- const DFBRectangle rect = { 0, 0, length, 1 };
|
|||
|
+ const DFBRectangle rect = (DFBRectangle_C){ 0, 0, length, 1 };
|
|||
|
d->surface->Blit(d->surface, src, &rect, x, y);
|
|||
|
}
|
|||
|
|
|||
|
@@ -1223,14 +1223,14 @@ void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s,
|
|||
|
const QRect dr = engine->state()->matrix.mapRect(dest).toRect();
|
|||
|
if (dr.isEmpty())
|
|||
|
return;
|
|||
|
- const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() };
|
|||
|
+ const DFBRectangle sRect = (DFBRectangle_C){ sr.x(), sr.y(), sr.width(), sr.height() };
|
|||
|
DFBResult result;
|
|||
|
|
|||
|
if (dr.size() == sr.size()) {
|
|||
|
result = surface->Blit(surface, s, &sRect, dr.x(), dr.y());
|
|||
|
} else {
|
|||
|
Q_ASSERT(supportsStretchBlit());
|
|||
|
- const DFBRectangle dRect = { dr.x(), dr.y(), dr.width(), dr.height() };
|
|||
|
+ const DFBRectangle dRect = (DFBRectangle_C){ dr.x(), dr.y(), dr.width(), dr.height() };
|
|||
|
result = surface->StretchBlit(surface, s, &sRect, &dRect);
|
|||
|
}
|
|||
|
if (result != DFB_OK)
|
|||
|
@@ -1261,7 +1261,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
|
|||
|
if (newClip.isNull())
|
|||
|
return;
|
|||
|
|
|||
|
- const DFBRegion clip = {
|
|||
|
+ const DFBRegion clip = (DFBRegion_C){
|
|||
|
newClip.x(),
|
|||
|
newClip.y(),
|
|||
|
newClip.right(),
|
|||
|
@@ -1295,7 +1295,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
|
|||
|
while (y <= destinationRect.bottom()) {
|
|||
|
qreal x = startX;
|
|||
|
while (x <= destinationRect.right()) {
|
|||
|
- const DFBRectangle destination = { qRound(x), qRound(y), mappedSize.width(), mappedSize.height() };
|
|||
|
+ const DFBRectangle destination = (DFBRectangle_C){ qRound(x), qRound(y), (int)mappedSize.width(), (int)mappedSize.height() };
|
|||
|
surface->StretchBlit(surface, sourceSurface, 0, &destination);
|
|||
|
x += mappedSize.width();
|
|||
|
}
|
|||
|
@@ -1337,7 +1337,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
|
|||
|
if (currentClip.isEmpty()) {
|
|||
|
surface->SetClip(surface, 0);
|
|||
|
} else {
|
|||
|
- const DFBRegion clip = {
|
|||
|
+ const DFBRegion clip = (DFBRegion_C){
|
|||
|
currentClip.x(),
|
|||
|
currentClip.y(),
|
|||
|
currentClip.right(),
|
|||
|
@@ -1356,7 +1356,7 @@ void QDirectFBPaintEnginePrivate::updateClip()
|
|||
|
surface->SetClip(surface, NULL);
|
|||
|
clipType = NoClip;
|
|||
|
} else if (clipData->hasRectClip) {
|
|||
|
- const DFBRegion r = {
|
|||
|
+ const DFBRegion r = (DFBRegion_C){
|
|||
|
clipData->clipRect.x(),
|
|||
|
clipData->clipRect.y(),
|
|||
|
clipData->clipRect.right(),
|
|||
|
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
|
|||
|
index 412e684..c59c47d 100644
|
|||
|
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
|
|||
|
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
|
|||
|
@@ -363,7 +363,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
|
|||
|
} else {
|
|||
|
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
|
|||
|
}
|
|||
|
- const DFBRectangle blitRect = { rect.x(), rect.y(),
|
|||
|
+ const DFBRectangle blitRect = (DFBRectangle_C){ rect.x(), rect.y(),
|
|||
|
rect.width(), rect.height() };
|
|||
|
w = rect.width();
|
|||
|
h = rect.height();
|
|||
|
@@ -465,7 +465,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
|
|||
|
}
|
|||
|
data->dfbSurface->SetBlittingFlags(data->dfbSurface, flags);
|
|||
|
|
|||
|
- const DFBRectangle destRect = { 0, 0, size.width(), size.height() };
|
|||
|
+ const DFBRectangle destRect = (DFBRectangle_C){ 0, 0, size.width(), size.height() };
|
|||
|
data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect);
|
|||
|
data->w = size.width();
|
|||
|
data->h = size.height();
|
|||
|
@@ -551,7 +551,7 @@ bool QDirectFBPixmapData::scroll(int dx, int dy, const QRect &rect)
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
- const DFBRectangle source = { rect.x(), rect.y(), rect.width(), rect.height() };
|
|||
|
+ const DFBRectangle source = (DFBRectangle_C){ rect.x(), rect.y(), rect.width(), rect.height() };
|
|||
|
result = dfbSurface->Blit(dfbSurface, dfbSurface, &source, source.x + dx, source.y + dy);
|
|||
|
if (result != DFB_OK) {
|
|||
|
DirectFBError("QDirectFBPixmapData::scroll", result);
|
|||
|
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
|
|||
|
index eab9580..d26e5bf 100644
|
|||
|
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
|
|||
|
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
|
|||
|
@@ -1635,7 +1635,7 @@ void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion)
|
|||
|
static inline void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect)
|
|||
|
{
|
|||
|
Q_ASSERT(surface);
|
|||
|
- const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() };
|
|||
|
+ const DFBRegion region = (DFBRegion_C){ rect.left(), rect.top(), rect.right(), rect.bottom() };
|
|||
|
// could just reinterpret_cast this to a DFBRegion
|
|||
|
surface->SetClip(surface, ®ion);
|
|||
|
surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha());
|
|||
|
@@ -1716,14 +1716,14 @@ void QDirectFBScreen::flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags
|
|||
|
const DFBSurfaceFlipFlags nonWaitFlags = flipFlags & ~DSFLIP_WAIT;
|
|||
|
for (int i=0; i<rects.size(); ++i) {
|
|||
|
const QRect &r = rects.at(i);
|
|||
|
- const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
|
|||
|
+ const DFBRegion dfbReg = (DFBRegion_C){ r.x() + offset.x(), r.y() + offset.y(),
|
|||
|
r.right() + offset.x(),
|
|||
|
r.bottom() + offset.y() };
|
|||
|
surface->Flip(surface, &dfbReg, i + 1 < rects.size() ? nonWaitFlags : flipFlags);
|
|||
|
}
|
|||
|
} else {
|
|||
|
const QRect r = region.boundingRect();
|
|||
|
- const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
|
|||
|
+ const DFBRegion dfbReg = (DFBRegion_C){ r.x() + offset.x(), r.y() + offset.y(),
|
|||
|
r.right() + offset.x(),
|
|||
|
r.bottom() + offset.y() };
|
|||
|
surface->Flip(surface, &dfbReg, flipFlags);
|
|||
|
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
|
|||
|
index 4dff907..25ad06b 100644
|
|||
|
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
|
|||
|
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
|
|||
|
@@ -333,7 +333,7 @@ bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy)
|
|||
|
}
|
|||
|
dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
|
|||
|
const QRect r = region.boundingRect();
|
|||
|
- const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
|
|||
|
+ const DFBRectangle rect = (DFBRectangle_C){ r.x(), r.y(), r.width(), r.height() };
|
|||
|
dfbSurface->Blit(dfbSurface, dfbSurface, &rect, r.x() + dx, r.y() + dy);
|
|||
|
return true;
|
|||
|
}
|
|||
|
--
|
|||
|
2.1.4
|
|||
|
|