summaryrefslogtreecommitdiffstats
path: root/package/qt/0009-Fix-conversion-constructor-error-for-legacy-c-compil.patch
blob: d7d387a78da9678c059669c20ccc50e81c06440b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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 &region)
 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, &region);
     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 &region, 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

OpenPOWER on IntegriCloud