1 From ea46f47fb3c475ba2d7581c15185b8d43e63b8c2 Mon Sep 17 00:00:00 2001
2 From: Peter Seiderer <ps.report@gmx.net>
3 Date: Fri, 27 Feb 2015 21:30:52 +0100
4 Subject: [PATCH] Fix conversion/constructor error for legacy c++ compiler.
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Fixes the following compile error with legacy c++ compiler:
11 error: in C++98 ‘blitRect’ must be initialized by constructor, not by ‘{...}’
13 Signed-off-by: Peter Seiderer <ps.report@gmx.net>
15 src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 14 +++++++-------
16 src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 6 +++---
17 src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 6 +++---
18 src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 2 +-
19 4 files changed, 14 insertions(+), 14 deletions(-)
21 diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
22 index 876d0c2..ed69386 100644
23 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
24 +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
25 @@ -942,7 +942,7 @@ void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize,
26 IDirectFBSurface *src = d->surfaceCache->getSurface(buffer, bufsize);
27 // ### how does this play with setDFBColor
28 src->SetColor(src, 0, 0, 0, const_alpha);
29 - const DFBRectangle rect = { 0, 0, length, 1 };
30 + const DFBRectangle rect = (DFBRectangle_C){ 0, 0, length, 1 };
31 d->surface->Blit(d->surface, src, &rect, x, y);
34 @@ -1223,14 +1223,14 @@ void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s,
35 const QRect dr = engine->state()->matrix.mapRect(dest).toRect();
38 - const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() };
39 + const DFBRectangle sRect = (DFBRectangle_C){ sr.x(), sr.y(), sr.width(), sr.height() };
42 if (dr.size() == sr.size()) {
43 result = surface->Blit(surface, s, &sRect, dr.x(), dr.y());
45 Q_ASSERT(supportsStretchBlit());
46 - const DFBRectangle dRect = { dr.x(), dr.y(), dr.width(), dr.height() };
47 + const DFBRectangle dRect = (DFBRectangle_C){ dr.x(), dr.y(), dr.width(), dr.height() };
48 result = surface->StretchBlit(surface, s, &sRect, &dRect);
51 @@ -1261,7 +1261,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
55 - const DFBRegion clip = {
56 + const DFBRegion clip = (DFBRegion_C){
60 @@ -1295,7 +1295,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
61 while (y <= destinationRect.bottom()) {
63 while (x <= destinationRect.right()) {
64 - const DFBRectangle destination = { qRound(x), qRound(y), mappedSize.width(), mappedSize.height() };
65 + const DFBRectangle destination = (DFBRectangle_C){ qRound(x), qRound(y), (int)mappedSize.width(), (int)mappedSize.height() };
66 surface->StretchBlit(surface, sourceSurface, 0, &destination);
67 x += mappedSize.width();
69 @@ -1337,7 +1337,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
70 if (currentClip.isEmpty()) {
71 surface->SetClip(surface, 0);
73 - const DFBRegion clip = {
74 + const DFBRegion clip = (DFBRegion_C){
78 @@ -1356,7 +1356,7 @@ void QDirectFBPaintEnginePrivate::updateClip()
79 surface->SetClip(surface, NULL);
81 } else if (clipData->hasRectClip) {
82 - const DFBRegion r = {
83 + const DFBRegion r = (DFBRegion_C){
84 clipData->clipRect.x(),
85 clipData->clipRect.y(),
86 clipData->clipRect.right(),
87 diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
88 index 412e684..c59c47d 100644
89 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
90 +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
91 @@ -363,7 +363,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
93 dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
95 - const DFBRectangle blitRect = { rect.x(), rect.y(),
96 + const DFBRectangle blitRect = (DFBRectangle_C){ rect.x(), rect.y(),
97 rect.width(), rect.height() };
100 @@ -465,7 +465,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
102 data->dfbSurface->SetBlittingFlags(data->dfbSurface, flags);
104 - const DFBRectangle destRect = { 0, 0, size.width(), size.height() };
105 + const DFBRectangle destRect = (DFBRectangle_C){ 0, 0, size.width(), size.height() };
106 data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect);
107 data->w = size.width();
108 data->h = size.height();
109 @@ -551,7 +551,7 @@ bool QDirectFBPixmapData::scroll(int dx, int dy, const QRect &rect)
113 - const DFBRectangle source = { rect.x(), rect.y(), rect.width(), rect.height() };
114 + const DFBRectangle source = (DFBRectangle_C){ rect.x(), rect.y(), rect.width(), rect.height() };
115 result = dfbSurface->Blit(dfbSurface, dfbSurface, &source, source.x + dx, source.y + dy);
116 if (result != DFB_OK) {
117 DirectFBError("QDirectFBPixmapData::scroll", result);
118 diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
119 index eab9580..d26e5bf 100644
120 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
121 +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
122 @@ -1635,7 +1635,7 @@ void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion)
123 static inline void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect)
126 - const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() };
127 + const DFBRegion region = (DFBRegion_C){ rect.left(), rect.top(), rect.right(), rect.bottom() };
128 // could just reinterpret_cast this to a DFBRegion
129 surface->SetClip(surface, ®ion);
130 surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha());
131 @@ -1716,14 +1716,14 @@ void QDirectFBScreen::flipSurface(IDirectFBSurface *surface, DFBSurfaceFlipFlags
132 const DFBSurfaceFlipFlags nonWaitFlags = flipFlags & ~DSFLIP_WAIT;
133 for (int i=0; i<rects.size(); ++i) {
134 const QRect &r = rects.at(i);
135 - const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
136 + const DFBRegion dfbReg = (DFBRegion_C){ r.x() + offset.x(), r.y() + offset.y(),
137 r.right() + offset.x(),
138 r.bottom() + offset.y() };
139 surface->Flip(surface, &dfbReg, i + 1 < rects.size() ? nonWaitFlags : flipFlags);
142 const QRect r = region.boundingRect();
143 - const DFBRegion dfbReg = { r.x() + offset.x(), r.y() + offset.y(),
144 + const DFBRegion dfbReg = (DFBRegion_C){ r.x() + offset.x(), r.y() + offset.y(),
145 r.right() + offset.x(),
146 r.bottom() + offset.y() };
147 surface->Flip(surface, &dfbReg, flipFlags);
148 diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
149 index 4dff907..25ad06b 100644
150 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
151 +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
152 @@ -333,7 +333,7 @@ bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy)
154 dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
155 const QRect r = region.boundingRect();
156 - const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
157 + const DFBRectangle rect = (DFBRectangle_C){ r.x(), r.y(), r.width(), r.height() };
158 dfbSurface->Blit(dfbSurface, dfbSurface, &rect, r.x() + dx, r.y() + dy);