Skip to content

Commit 1aff733

Browse files
committed
fix arm build
1 parent 22ddae1 commit 1aff733

15 files changed

+56
-62
lines changed

src/app/qgsdecorationgrid.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ void QgsDecorationGrid::render( QPainter * p )
217217

218218
// p->setPen( mGridPen );
219219

220-
QList< QPair< double, QLineF > > verticalLines;
220+
QList< QPair< qreal, QLineF > > verticalLines;
221221
yGridLines( verticalLines );
222-
QList< QPair< double, QLineF > > horizontalLines;
222+
QList< QPair< qreal, QLineF > > horizontalLines;
223223
xGridLines( horizontalLines );
224224
//QgsDebugMsg( QString("grid has %1 vertical and %2 horizontal lines").arg( verticalLines.size() ).arg( horizontalLines.size() ) );
225225

226-
QList< QPair< double, QLineF > >::const_iterator vIt = verticalLines.constBegin();
227-
QList< QPair< double, QLineF > >::const_iterator hIt = horizontalLines.constBegin();
226+
QList< QPair< qreal, QLineF > >::const_iterator vIt = verticalLines.constBegin();
227+
QList< QPair< qreal, QLineF > >::const_iterator hIt = horizontalLines.constBegin();
228228

229229
//simpler approach: draw vertical lines first, then horizontal ones
230230
if ( mGridStyle == QgsDecorationGrid::Line )
@@ -338,15 +338,15 @@ void QgsDecorationGrid::render( QPainter * p )
338338
}
339339
}
340340

341-
void QgsDecorationGrid::drawCoordinateAnnotations( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines )
341+
void QgsDecorationGrid::drawCoordinateAnnotations( QPainter* p, const QList< QPair< qreal, QLineF > >& hLines, const QList< QPair< qreal, QLineF > >& vLines )
342342
{
343343
if ( !p )
344344
{
345345
return;
346346
}
347347

348348
QString currentAnnotationString;
349-
QList< QPair< double, QLineF > >::const_iterator it = hLines.constBegin();
349+
QList< QPair< qreal, QLineF > >::const_iterator it = hLines.constBegin();
350350
for ( ; it != hLines.constEnd(); ++it )
351351
{
352352
currentAnnotationString = QString::number( it->first, 'f', mGridAnnotationPrecision );
@@ -566,7 +566,7 @@ QPolygonF canvasExtent()
566566
return poly;
567567
}
568568

569-
int QgsDecorationGrid::xGridLines( QList< QPair< double, QLineF > >& lines ) const
569+
int QgsDecorationGrid::xGridLines( QList< QPair< qreal, QLineF > >& lines ) const
570570
{
571571
// prepare horizontal lines
572572
lines.clear();
@@ -612,7 +612,7 @@ int QgsDecorationGrid::xGridLines( QList< QPair< double, QLineF > >& lines ) con
612612
return 0;
613613
}
614614

615-
int QgsDecorationGrid::yGridLines( QList< QPair< double, QLineF > >& lines ) const
615+
int QgsDecorationGrid::yGridLines( QList< QPair< qreal, QLineF > >& lines ) const
616616
{
617617
// prepare vertical lines
618618

src/app/qgsdecorationgrid.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class APP_EXPORT QgsDecorationGrid: public QgsDecorationItem
199199
@param p drawing painter
200200
@param hLines horizontal coordinate lines in item coordinates
201201
@param vLines vertical coordinate lines in item coordinates*/
202-
void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines );
202+
void drawCoordinateAnnotations( QPainter* p, const QList< QPair< qreal, QLineF > >& hLines, const QList< QPair< qreal, QLineF > >& vLines );
203203
void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString );
204204
/**Draws a single annotation
205205
@param p drawing painter
@@ -209,10 +209,10 @@ class APP_EXPORT QgsDecorationGrid: public QgsDecorationItem
209209
void drawAnnotation( QPainter* p, const QPointF& pos, int rotation, const QString& annotationText );
210210
/**Returns the grid lines with associated coordinate value
211211
@return 0 in case of success*/
212-
int xGridLines( QList< QPair< double, QLineF > >& lines ) const;
212+
int xGridLines( QList< QPair< qreal, QLineF > >& lines ) const;
213213
/**Returns the grid lines for the y-coordinates. Not vertical in case of rotation
214214
@return 0 in case of success*/
215-
int yGridLines( QList< QPair< double, QLineF > >& lines ) const;
215+
int yGridLines( QList< QPair< qreal, QLineF > >& lines ) const;
216216
/**Returns the item border of a point (in item coordinates)*/
217217
Border borderForLineCoord( const QPointF& point, QPainter* p ) const;
218218

src/app/qgsmapmouseevent.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ void QgsMapMouseEvent::snapPoint()
8686

8787
QPoint QgsMapMouseEvent::mapToPixelCoordinates( QgsMapCanvas* canvas, const QgsPoint& point )
8888
{
89-
double x = point.x();
90-
double y = point.y();
89+
qreal x = point.x(), y = point.y();
9190

9291
canvas->mapSettings().mapToPixel().transformInPlace( x, y );
9392

src/core/composer/qgscomposermapgrid.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ bool QgsComposerMapGrid::shouldShowDivisionForDisplayMode( const QgsComposerMapG
18381838
|| ( mode == QgsComposerMapGrid::LongitudeOnly && coordinate == QgsComposerMapGrid::Longitude );
18391839
}
18401840

1841-
bool sortByDistance( const QPair<double, QgsComposerMapGrid::BorderSide>& a, const QPair<double, QgsComposerMapGrid::BorderSide>& b )
1841+
bool sortByDistance( const QPair<qreal , QgsComposerMapGrid::BorderSide>& a, const QPair<qreal , QgsComposerMapGrid::BorderSide>& b )
18421842
{
18431843
return a.first < b.first;
18441844
}
@@ -1885,7 +1885,7 @@ QgsComposerMapGrid::BorderSide QgsComposerMapGrid::borderForLineCoord( const QPo
18851885
}
18861886

18871887
//otherwise, guess side based on closest map side to point
1888-
QList< QPair<double, QgsComposerMapGrid::BorderSide > > distanceToSide;
1888+
QList< QPair<qreal, QgsComposerMapGrid::BorderSide > > distanceToSide;
18891889
distanceToSide << qMakePair( p.x(), QgsComposerMapGrid::Left );
18901890
distanceToSide << qMakePair( mComposerMap->rect().width() - p.x(), QgsComposerMapGrid::Right );
18911891
distanceToSide << qMakePair( p.y(), QgsComposerMapGrid::Top );

src/core/qgsgeometry.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4679,7 +4679,7 @@ bool QgsGeometry::convertToMultiType()
46794679

46804680
void QgsGeometry::transformVertex( QgsWkbPtr &wkbPtr, const QTransform& trans, bool hasZValue )
46814681
{
4682-
double x, y, rotated_x, rotated_y;
4682+
qreal x, y, rotated_x, rotated_y;
46834683

46844684
QgsWkbPtr tmp = wkbPtr;
46854685
tmp >> x >> y;

src/core/qgsgeometry.h

+9
Original file line numberDiff line numberDiff line change
@@ -686,12 +686,18 @@ class CORE_EXPORT QgsWkbPtr
686686
inline const QgsWkbPtr &operator>>( unsigned int &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
687687
inline const QgsWkbPtr &operator>>( char &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
688688
inline const QgsWkbPtr &operator>>( QGis::WkbType &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
689+
#ifdef QT_ARCH_ARM
690+
inline const QgsWkbPtr &operator>>( qreal &v ) const { double d; memcpy( &d, mP, sizeof( d ) ); mP += sizeof( d ); v=d; return *this; }
691+
#endif
689692

690693
inline QgsWkbPtr &operator<<( const double &v ) { memcpy( mP, &v, sizeof( v ) ); mP += sizeof( v ); return *this; }
691694
inline QgsWkbPtr &operator<<( const int &v ) { memcpy( mP, &v, sizeof( v ) ); mP += sizeof( v ); return *this; }
692695
inline QgsWkbPtr &operator<<( const unsigned int &v ) { memcpy( mP, &v, sizeof( v ) ); mP += sizeof( v ); return *this; }
693696
inline QgsWkbPtr &operator<<( const char &v ) { memcpy( mP, &v, sizeof( v ) ); mP += sizeof( v ); return *this; }
694697
inline QgsWkbPtr &operator<<( const QGis::WkbType &v ) { memcpy( mP, &v, sizeof( v ) ); mP += sizeof( v ); return *this; }
698+
#ifdef QT_ARCH_ARM
699+
inline QgsWkbPtr &operator<<( const qreal &v ) { double d = v; memcpy( mP, &d, sizeof( d ) ); mP += sizeof( d ); return *this; }
700+
#endif
695701

696702
inline void operator+=( int n ) { mP += n; }
697703

@@ -710,6 +716,9 @@ class CORE_EXPORT QgsConstWkbPtr
710716
inline const QgsConstWkbPtr &operator>>( unsigned int &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
711717
inline const QgsConstWkbPtr &operator>>( char &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
712718
inline const QgsConstWkbPtr &operator>>( QGis::WkbType &v ) const { memcpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; }
719+
#ifdef QT_ARCH_ARM
720+
inline const QgsConstWkbPtr &operator>>( qreal &v ) const { double d; memcpy( &d, mP, sizeof( d ) ); mP += sizeof( d ); v=d; return *this; }
721+
#endif
713722

714723
inline void operator+=( int n ) { mP += n; }
715724

src/core/qgsmaptopixel.cpp

+13-25
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,18 @@ void QgsMapToPixel::updateMatrix()
114114
mMatrix = QTransform::fromTranslate( cx, cy )
115115
.rotate( rotation )
116116
.scale( 1 / mMapUnitsPerPixel, -1 / mMapUnitsPerPixel )
117-
.translate( -xCenter, -yCenter )
118-
;
117+
.translate( -xCenter, -yCenter );
119118
}
120119

121-
QgsPoint QgsMapToPixel::toMapPoint( double x, double y ) const
120+
QgsPoint QgsMapToPixel::toMapPoint( qreal x, qreal y ) const
122121
{
123122
bool invertible;
124123
QTransform matrix = mMatrix.inverted( &invertible );
125124
assert( invertible );
126-
double mx, my;
125+
qreal mx, my;
127126
matrix.map( x, y, &mx, &my );
128-
QgsPoint ret( mx, my );
129-
130127
//QgsDebugMsg(QString("XXX toMapPoint x:%1 y:%2 -> x:%3 y:%4").arg(x).arg(y).arg(mx).arg(my));
131-
132-
return ret;
128+
return QgsPoint( mx, my );
133129
}
134130

135131
QgsPoint QgsMapToPixel::toMapCoordinates( QPoint p ) const
@@ -232,42 +228,34 @@ QString QgsMapToPixel::showParameters() const
232228
<< " rotation: " << mRotation
233229
<< " size: " << mWidth << "x" << mHeight;
234230
return rep;
235-
236231
}
237232

238-
239-
QgsPoint QgsMapToPixel::transform( double x, double y ) const
233+
QgsPoint QgsMapToPixel::transform( qreal x, qreal y ) const
240234
{
241235
transformInPlace( x, y );
242236
return QgsPoint( x, y );
243237
}
244238

245-
QgsPoint QgsMapToPixel::transform( const QgsPoint& p ) const
239+
QgsPoint QgsMapToPixel::transform( const QgsPoint &p ) const
246240
{
247-
double dx = p.x();
248-
double dy = p.y();
249-
transformInPlace( dx, dy );
250-
241+
qreal x = p.x(), y = p.y();
242+
transformInPlace( x, y );
251243
// QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p.x()).arg(dx).arg(p.y()).arg(dy));
252-
return QgsPoint( dx, dy );
244+
return QgsPoint( x, y );
253245
}
254246

255-
void QgsMapToPixel::transform( QgsPoint* p ) const
247+
void QgsMapToPixel::transform( QgsPoint *p ) const
256248
{
257-
double x = p->x();
258-
double y = p->y();
249+
qreal x = p->x(), y = p->y();
259250
transformInPlace( x, y );
260-
261-
#ifdef QGISDEBUG
262251
// QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p->x()).arg(x).arg(p->y()).arg(y));
263-
#endif
264252
p->set( x, y );
265253
}
266254

267-
void QgsMapToPixel::transformInPlace( qreal& x, qreal& y ) const
255+
void QgsMapToPixel::transformInPlace( qreal &x, qreal &y ) const
268256
{
269257
// Map 2 Pixel
270-
double mx, my;
258+
qreal mx, my;
271259
mMatrix.map( x, y, &mx, &my );
272260
//QgsDebugMsg(QString("XXX transformInPlace X : %1-->%2, Y: %3 -->%4").arg(x).arg(mx).arg(y).arg(my));
273261
x = mx; y = my;

src/core/qgsmaptopixel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class CORE_EXPORT QgsMapToPixel
7474
* @param y y coordinate of point to transform
7575
* @return QgsPoint in device coordinates
7676
*/
77-
QgsPoint transform( double x, double y ) const;
77+
QgsPoint transform( qreal x, qreal y ) const;
7878
/*! Transform device coordinates to map (world) coordinates
7979
* @param x x coordinate of point to be converted to map cooordinates
8080
* @param y y coordinate of point to be converted to map cooordinates
@@ -110,7 +110,7 @@ class CORE_EXPORT QgsMapToPixel
110110
*/
111111
QgsPoint toMapCoordinates( QPoint p ) const;
112112

113-
QgsPoint toMapPoint( double x, double y ) const;
113+
QgsPoint toMapPoint( qreal x, qreal y ) const;
114114

115115
/*! Set map units per pixel
116116
* @param mapUnitsPerPixel Map units per pixel

src/core/qgspallabeling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
21052105
QTransform t = QTransform::fromTranslate( center.x(), center.y() );
21062106
t.rotate( -m2p.mapRotation() );
21072107
t.translate( -center.x(), -center.y() );
2108-
double xPosR, yPosR;
2108+
qreal xPosR, yPosR;
21092109
t.map( xPos, yPos, &xPosR, &yPosR );
21102110
xPos = xPosR; yPos = yPosR;
21112111
}

src/core/qgspointlocator.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ struct _CohenSutherland
268268
y = y0 + ( y1 - y0 ) * ( mRect.xMinimum() - x0 ) / ( x1 - x0 );
269269
x = mRect.xMinimum();
270270
}
271+
else
272+
break;
271273

272274
// Now we move outside point to intersection point to clip
273275
// and get ready for next pass.
@@ -536,13 +538,13 @@ class QgsPointLocator_DumpTree : public SpatialIndex::IQueryStrategy
536538
if ( !n )
537539
return;
538540

539-
qDebug( "NODE: %ld", n->getIdentifier() );
541+
QgsDebugMsg( QString( "NODE: %1" ).arg( n->getIdentifier() ) );
540542
if ( n->getLevel() > 0 )
541543
{
542544
// inner nodes
543545
for ( uint32_t cChild = 0; cChild < n->getChildrenCount(); cChild++ )
544546
{
545-
qDebug( "- CH: %ld", n->getChildIdentifier( cChild ) );
547+
QgsDebugMsg( QString( "- CH: %1" ).arg( n->getChildIdentifier( cChild ) ) );
546548
ids.push( n->getChildIdentifier( cChild ) );
547549
}
548550
}
@@ -551,7 +553,7 @@ class QgsPointLocator_DumpTree : public SpatialIndex::IQueryStrategy
551553
// leaves
552554
for ( uint32_t cChild = 0; cChild < n->getChildrenCount(); cChild++ )
553555
{
554-
qDebug( "- L: %ld", n->getChildIdentifier( cChild ) );
556+
QgsDebugMsg( QString( "- L: %1" ).arg( n->getChildIdentifier( cChild ) ) );
555557
}
556558
}
557559

src/core/symbology-ng/qgsrendererv2.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,19 @@ const unsigned char* QgsFeatureRendererV2::_getPoint( QPointF& pt, QgsRenderCont
3939
{
4040
QgsConstWkbPtr wkbPtr( wkb + 1 );
4141
unsigned int wkbType;
42-
wkbPtr >> wkbType;
43-
44-
double x, y;
45-
wkbPtr >> x >> y;
42+
wkbPtr >> wkbType >> pt.rx() >> pt.ry();
4643

4744
if ( wkbType == QGis::WKBPoint25D )
4845
wkbPtr += sizeof( double );
4946

5047
if ( context.coordinateTransform() )
5148
{
5249
double z = 0; // dummy variable for coordiante transform
53-
context.coordinateTransform()->transformInPlace( x, y, z );
50+
context.coordinateTransform()->transformInPlace( pt.rx(), pt.ry(), z );
5451
}
5552

56-
context.mapToPixel().transformInPlace( x, y );
53+
context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
5754

58-
pt = QPointF( x, y );
5955
return wkbPtr;
6056
}
6157

@@ -65,7 +61,7 @@ const unsigned char* QgsFeatureRendererV2::_getLineString( QPolygonF& pts, QgsRe
6561
unsigned int wkbType, nPoints;
6662
wkbPtr >> wkbType >> nPoints;
6763

68-
bool hasZValue = ( wkbType == QGis::WKBLineString25D );
64+
bool hasZValue = wkbType == QGis::WKBLineString25D;
6965

7066
double x, y;
7167
const QgsCoordinateTransform* ct = context.coordinateTransform();

src/gui/qgsmapcanvasitem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ QgsPoint QgsMapCanvasItem::toMapCoordinates( const QPoint& point ) const
6363

6464
QPointF QgsMapCanvasItem::toCanvasCoordinates( const QgsPoint& point ) const
6565
{
66-
double x = point.x(), y = point.y();
66+
qreal x = point.x(), y = point.y();
6767
mMapCanvas->getCoordinateTransform()->transformInPlace( x, y );
6868
return QPointF( x, y ) + mPanningOffset;
6969
}

src/gui/qgsmaptool.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ QgsRectangle QgsMapTool::toLayerCoordinates( QgsMapLayer* layer, const QgsRectan
6868

6969
QPoint QgsMapTool::toCanvasCoordinates( const QgsPoint& point )
7070
{
71-
double x = point.x(), y = point.y();
71+
qreal x = point.x(), y = point.y();
7272
mCanvas->getCoordinateTransform()->transformInPlace( x, y );
7373
return QPoint( qRound( x ), qRound( y ) );
7474
}

src/providers/wcs/qgswcsprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
516516
// TODO: set block to null values, move that to function and call only if fails
517517
memset( block, 0, pixelWidth * pixelHeight * QgsRasterBlock::typeSize( dataType( bandNo ) ) );
518518

519-
// Requested extent must at least partialy overlap coverage extent, otherwise
519+
// Requested extent must at least partially overlap coverage extent, otherwise
520520
// server gives error. QGIS usually does not request blocks outside raster extent
521521
// (higher level checks) but it is better to do check here as well
522522
if ( !viewExtent.intersects( mCoverageExtent ) )

tests/src/core/testqgsatlascomposition.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ void TestQgsAtlasComposition::predefinedscales_render()
308308
mAtlasMap->setAtlasDriven( true );
309309
mAtlasMap->setAtlasScalingMode( QgsComposerMap::Predefined );
310310

311-
QVector<double> scales;
312-
scales << 1800000;
313-
scales << 5000000;
311+
QVector<qreal> scales;
312+
scales << 1800000.0;
313+
scales << 5000000.0;
314314
mAtlas->setPredefinedScales( scales );
315315

316316
{
317-
const QVector<double>& setScales = mAtlas->predefinedScales();
317+
const QVector<qreal> &setScales = mAtlas->predefinedScales();
318318
for ( int i = 0; i < setScales.size(); i++ )
319319
{
320320
QVERIFY( setScales[i] == scales[i] );

0 commit comments

Comments
 (0)