0009-Fix-conversion-constructor-error-for-legacy-c-compil.patch 8.3 KB

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