[qgis] 02/05: Add patch to cast doubles to qreal to fix FTBFS on arm*.
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Mon Mar 9 19:18:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository qgis.
commit c194e1309909106cc132df29525602b0bc2b0205
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Thu Mar 5 22:51:35 2015 +0100
Add patch to cast doubles to qreal to fix FTBFS on arm*.
---
debian/changelog | 1 +
debian/patches/arm-qreal.patch | 205 +++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 207 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 5f24ecf..408b87c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ qgis (2.8.1+dfsg1-1~exp2) UNRELEASED; urgency=medium
* Don't build internal PySpatiaLite, use Debian package instead.
(closes: #779933)
+ * Add patch to cast doubles to qreal to fix FTBFS on arm*.
-- Bas Couwenberg <sebastic at debian.org> Thu, 05 Mar 2015 22:51:10 +0100
diff --git a/debian/patches/arm-qreal.patch b/debian/patches/arm-qreal.patch
new file mode 100644
index 0000000..3b23392
--- /dev/null
+++ b/debian/patches/arm-qreal.patch
@@ -0,0 +1,205 @@
+Description: Fix FTBFS on arm* by casting doubles to qreal.
+ In qt4 on arm architectures qreal is defined as float while on other
+ architectures it is defined as double.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/src/core/symbology-ng/qgsrendererv2.cpp
++++ b/src/core/symbology-ng/qgsrendererv2.cpp
+@@ -53,7 +53,10 @@ const unsigned char* QgsFeatureRendererV
+ context.coordinateTransform()->transformInPlace( x, y, z );
+ }
+
+- context.mapToPixel().transformInPlace( x, y );
++ qreal qx = (qreal) x;
++ qreal qy = (qreal) y;
++
++ context.mapToPixel().transformInPlace( qx, qy );
+
+ pt = QPointF( x, y );
+ return wkbPtr;
+--- a/src/core/qgsgeometry.cpp
++++ b/src/core/qgsgeometry.cpp
+@@ -4683,7 +4683,13 @@ void QgsGeometry::transformVertex( QgsWk
+
+ QgsWkbPtr tmp = wkbPtr;
+ tmp >> x >> y;
+- trans.map( x, y, &rotated_x, &rotated_y );
++
++ qreal qx = (qreal) x;
++ qreal qy = (qreal) y;
++ qreal qrx = (qreal) rotated_x;
++ qreal qry = (qreal) rotated_y;
++
++ trans.map( qx, qy, &qrx, &qry );
+ wkbPtr << rotated_x << rotated_y;
+
+ if ( hasZValue )
+--- a/src/core/qgsmaptopixel.cpp
++++ b/src/core/qgsmaptopixel.cpp
+@@ -124,7 +124,16 @@ QgsPoint QgsMapToPixel::toMapPoint( doub
+ QTransform matrix = mMatrix.inverted( &invertible );
+ assert( invertible );
+ double mx, my;
+- matrix.map( x, y, &mx, &my );
++
++ qreal qx = (qreal) x;
++ qreal qy = (qreal) y;
++ qreal qmx, qmy;
++
++ matrix.map( qx, qy, &qmx, &qmy );
++
++ mx = (double) qmx;
++ my = (double) qmy;
++
+ QgsPoint ret( mx, my );
+
+ //QgsDebugMsg(QString("XXX toMapPoint x:%1 y:%2 -> x:%3 y:%4").arg(x).arg(y).arg(mx).arg(my));
+@@ -238,7 +247,14 @@ QString QgsMapToPixel::showParameters()
+
+ QgsPoint QgsMapToPixel::transform( double x, double y ) const
+ {
+- transformInPlace( x, y );
++ qreal qx = (qreal) x;
++ qreal qy = (qreal) y;
++
++ transformInPlace( qx, qy );
++
++ x = (double) qx;
++ y = (double) qy;
++
+ return QgsPoint( x, y );
+ }
+
+@@ -246,7 +262,14 @@ QgsPoint QgsMapToPixel::transform( const
+ {
+ double dx = p.x();
+ double dy = p.y();
+- transformInPlace( dx, dy );
++
++ qreal qdx = (qreal) dx;
++ qreal qdy = (qreal) dy;
++
++ transformInPlace( qdx, qdy );
++
++ dx = (double) qdx;
++ dy = (double) qdy;
+
+ // QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p.x()).arg(dx).arg(p.y()).arg(dy));
+ return QgsPoint( dx, dy );
+@@ -256,7 +279,14 @@ void QgsMapToPixel::transform( QgsPoint*
+ {
+ double x = p->x();
+ double y = p->y();
+- transformInPlace( x, y );
++
++ qreal qx = (qreal) x;
++ qreal qy = (qreal) y;
++
++ transformInPlace( qx, qy );
++
++ x = (double) qx;
++ y = (double) qy;
+
+ #ifdef QGISDEBUG
+ // QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p->x()).arg(x).arg(p->y()).arg(y));
+@@ -267,7 +297,7 @@ void QgsMapToPixel::transform( QgsPoint*
+ void QgsMapToPixel::transformInPlace( qreal& x, qreal& y ) const
+ {
+ // Map 2 Pixel
+- double mx, my;
++ qreal mx, my;
+ mMatrix.map( x, y, &mx, &my );
+ //QgsDebugMsg(QString("XXX transformInPlace X : %1-->%2, Y: %3 -->%4").arg(x).arg(mx).arg(y).arg(my));
+ x = mx; y = my;
+--- a/src/core/qgspallabeling.cpp
++++ b/src/core/qgspallabeling.cpp
+@@ -2106,7 +2106,16 @@ void QgsPalLayerSettings::registerFeatur
+ t.rotate( -m2p.mapRotation() );
+ t.translate( -center.x(), -center.y() );
+ double xPosR, yPosR;
+- t.map( xPos, yPos, &xPosR, &yPosR );
++
++ qreal qxPos = (qreal) xPos;
++ qreal qyPos = (qreal) yPos;
++ qreal qxPosR, qyPosR;
++
++ t.map( qxPos, qyPos, &qxPosR, &qyPosR );
++
++ xPosR = (double) qxPosR;
++ yPosR = (double) qyPosR;
++
+ xPos = xPosR; yPos = yPosR;
+ }
+
+--- a/src/core/composer/qgscomposermapgrid.cpp
++++ b/src/core/composer/qgscomposermapgrid.cpp
+@@ -1886,10 +1886,10 @@ QgsComposerMapGrid::BorderSide QgsCompos
+
+ //otherwise, guess side based on closest map side to point
+ QList< QPair<double, QgsComposerMapGrid::BorderSide > > distanceToSide;
+- distanceToSide << qMakePair( p.x(), QgsComposerMapGrid::Left );
+- distanceToSide << qMakePair( mComposerMap->rect().width() - p.x(), QgsComposerMapGrid::Right );
+- distanceToSide << qMakePair( p.y(), QgsComposerMapGrid::Top );
+- distanceToSide << qMakePair( mComposerMap->rect().height() - p.y(), QgsComposerMapGrid::Bottom );
++ distanceToSide << qMakePair( (double)p.x(), QgsComposerMapGrid::Left );
++ distanceToSide << qMakePair( (double)(mComposerMap->rect().width() - p.x()), QgsComposerMapGrid::Right );
++ distanceToSide << qMakePair( (double)p.y(), QgsComposerMapGrid::Top );
++ distanceToSide << qMakePair( (double)(mComposerMap->rect().height() - p.y()), QgsComposerMapGrid::Bottom );
+
+ qSort( distanceToSide.begin(), distanceToSide.end(), sortByDistance );
+ return distanceToSide.at( 0 ).second;
+--- a/src/gui/qgsmapcanvasitem.cpp
++++ b/src/gui/qgsmapcanvasitem.cpp
+@@ -63,7 +63,7 @@ QgsPoint QgsMapCanvasItem::toMapCoordina
+
+ QPointF QgsMapCanvasItem::toCanvasCoordinates( const QgsPoint& point ) const
+ {
+- double x = point.x(), y = point.y();
++ qreal x = point.x(), y = point.y();
+ mMapCanvas->getCoordinateTransform()->transformInPlace( x, y );
+ return QPointF( x, y ) + mPanningOffset;
+ }
+--- a/src/gui/qgsmaptool.cpp
++++ b/src/gui/qgsmaptool.cpp
+@@ -68,7 +68,7 @@ QgsRectangle QgsMapTool::toLayerCoordina
+
+ QPoint QgsMapTool::toCanvasCoordinates( const QgsPoint& point )
+ {
+- double x = point.x(), y = point.y();
++ qreal x = point.x(), y = point.y();
+ mCanvas->getCoordinateTransform()->transformInPlace( x, y );
+ return QPoint( qRound( x ), qRound( y ) );
+ }
+--- a/src/app/qgsdecorationgrid.cpp
++++ b/src/app/qgsdecorationgrid.cpp
+@@ -605,7 +605,7 @@ int QgsDecorationGrid::xGridLines( QList
+ QLineF line( p0, p1 );
+ clipByRect( line, canvasPoly );
+ line = QLineF( m2p.transform( QgsPoint( line.pointAt( 0 ) ) ).toQPointF(), m2p.transform( QgsPoint( line.pointAt( 1 ) ) ).toQPointF() );
+- lines.push_back( qMakePair( p0.y(), line ) );
++ lines.push_back( qMakePair( (double)p0.y(), line ) );
+ dist += mGridIntervalY;
+ }
+
+@@ -652,7 +652,7 @@ int QgsDecorationGrid::yGridLines( QList
+ QLineF line( p0, p1 );
+ clipByRect( line, canvasPoly );
+ line = QLineF( m2p.transform( QgsPoint( line.pointAt( 0 ) ) ).toQPointF(), m2p.transform( QgsPoint( line.pointAt( 1 ) ) ).toQPointF() );
+- lines.push_back( qMakePair( p0.x(), line ) );
++ lines.push_back( qMakePair( (double)p0.x(), line ) );
+ dist += mGridIntervalX;
+ }
+
+--- a/src/app/qgsmapmouseevent.cpp
++++ b/src/app/qgsmapmouseevent.cpp
+@@ -86,8 +86,8 @@ void QgsMapMouseEvent::snapPoint()
+
+ QPoint QgsMapMouseEvent::mapToPixelCoordinates( QgsMapCanvas* canvas, const QgsPoint& point )
+ {
+- double x = point.x();
+- double y = point.y();
++ qreal x = point.x();
++ qreal y = point.y();
+
+ canvas->mapSettings().mapToPixel().transformInPlace( x, y );
+
diff --git a/debian/patches/series b/debian/patches/series
index 937e435..04f93b5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,5 +4,6 @@ disable-doxygen.patch
developersmap-use-debian-package.patch
exclude-dxf2shp-plugin.patch
exclude-elvensword-resources.patch
+arm-qreal.patch
0001-processing-correctly-handle-tiny-polygons-smaller-th.patch
0001-backport-ada01603cb7b10786436aa0ed2361743b52ce48f.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/qgis.git
More information about the Pkg-grass-devel
mailing list