Index: src/app/legend/qgslegend.cpp =================================================================== --- src/app/legend/qgslegend.cpp (revision 14711) +++ src/app/legend/qgslegend.cpp (working copy) @@ -1688,7 +1688,7 @@ QgsDebugMsg( "Raster units per pixel : " + QString::number( layer->rasterUnitsPerPixel() ) ); QgsDebugMsg( "MapUnitsPerPixel before : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) ); - mMapCanvas->zoomByFactor( fabs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel() ) ); + mMapCanvas->zoomByFactor( qAbs( layer->rasterUnitsPerPixel() / mMapCanvas->mapUnitsPerPixel() ) ); mMapCanvas->refresh(); QgsDebugMsg( "MapUnitsPerPixel after : " + QString::number( mMapCanvas->mapUnitsPerPixel() ) ); Index: src/app/qgsdisplayangle.cpp =================================================================== --- src/app/qgsdisplayangle.cpp (revision 14711) +++ src/app/qgsdisplayangle.cpp (working copy) @@ -15,12 +15,7 @@ #include "qgsdisplayangle.h" #include - -#ifndef Q_OS_MACX #include -#else -#include -#endif QgsDisplayAngle::QgsDisplayAngle( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ) { Index: src/app/qgsmaptoolsimplify.cpp =================================================================== --- src/app/qgsmaptoolsimplify.cpp (revision 14711) +++ src/app/qgsmaptoolsimplify.cpp (working copy) @@ -446,7 +446,7 @@ } else { // calculate perpendicular distance to line (pythagorean theorem): - dist_to_seg = sqrt( fabs( seg_len * seg_len - proj * proj ) ); + dist_to_seg = sqrt( qAbs( seg_len * seg_len - proj * proj ) ); } if ( max_dist < dist_to_seg ) { Index: src/app/qgsmaptoolnodetool.cpp =================================================================== --- src/app/qgsmaptoolnodetool.cpp (revision 14711) +++ src/app/qgsmaptoolnodetool.cpp (working copy) @@ -21,7 +21,7 @@ #include "qgsvectordataprovider.h" #include "qgstolerance.h" #include "qgsgeometry.h" -#include +#include #include #include #include "qgslogger.h" Index: src/app/qgslabeldialog.cpp =================================================================== --- src/app/qgslabeldialog.cpp (revision 14711) +++ src/app/qgslabeldialog.cpp (working copy) @@ -330,7 +330,7 @@ int QgsLabelDialog::itemNoForField( QString theFieldName, QStringList theFieldList ) { //if no matches assume first item in list is blank and return that - return std::max( 0, theFieldList.indexOf( theFieldName ) ); + return qMax( 0, theFieldList.indexOf( theFieldName ) ); } QgsLabelDialog::~QgsLabelDialog() Index: src/app/qgsmaptoolmeasureangle.cpp =================================================================== --- src/app/qgsmaptoolmeasureangle.cpp (revision 14711) +++ src/app/qgsmaptoolmeasureangle.cpp (working copy) @@ -22,12 +22,7 @@ #include "qgsrubberband.h" #include #include - -#ifndef Q_OS_MACX #include -#else -#include -#endif QgsMapToolMeasureAngle::QgsMapToolMeasureAngle( QgsMapCanvas* canvas ): QgsMapTool( canvas ), mRubberBand( 0 ), mResultDisplay( 0 ) { @@ -57,9 +52,9 @@ double azimutOne = distArea->bearing( mAnglePoints.at( 1 ), mAnglePoints.at( 0 ) ); double azimutTwo = distArea->bearing( mAnglePoints.at( 1 ), point ); double resultAngle = azimutTwo - azimutOne; - QgsDebugMsg( QString::number( fabs( resultAngle ) ) ); + QgsDebugMsg( QString::number( qAbs( resultAngle ) ) ); QgsDebugMsg( QString::number( M_PI ) ); - if ( fabs( resultAngle ) > M_PI ) + if ( qAbs( resultAngle ) > M_PI ) { if ( resultAngle < 0 ) { Index: src/app/qgsvectorlayerproperties.cpp =================================================================== --- src/app/qgsvectorlayerproperties.cpp (revision 14711) +++ src/app/qgsvectorlayerproperties.cpp (working copy) @@ -141,7 +141,7 @@ for ( ; it != overlayPluginList.constEnd(); ++it ) { QgsApplyDialog* d = ( *it )->dialog( lyr ); - position = tabWidget->insertTab( tabWidget->count(), qobject_cast( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay")); + position = tabWidget->insertTab( tabWidget->count(), qobject_cast( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay" ) ); tabWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess mOverlayDialogs.push_back( d ); } @@ -172,8 +172,8 @@ tblAttributes->setHorizontalHeaderItem( attrEditTypeCol, new QTableWidgetItem( tr( "Edit widget" ) ) ); tblAttributes->setHorizontalHeaderItem( attrAliasCol, new QTableWidgetItem( tr( "Alias" ) ) ); - tblAttributes->horizontalHeader()->setResizeMode(1,QHeaderView::Stretch); - tblAttributes->horizontalHeader()->setResizeMode(7,QHeaderView::Stretch); + tblAttributes->horizontalHeader()->setResizeMode( 1, QHeaderView::Stretch ); + tblAttributes->horizontalHeader()->setResizeMode( 7, QHeaderView::Stretch ); tblAttributes->setSelectionBehavior( QAbstractItemView::SelectRows ); tblAttributes->setSelectionMode( QAbstractItemView::MultiSelection ); @@ -805,7 +805,7 @@ QString xMin, yMin, xMax, yMax; double changeoverValue = 99999; // The 'largest' 5 digit number - if ( fabs( myExtent.xMinimum() ) > changeoverValue ) + if ( qAbs( myExtent.xMinimum() ) > changeoverValue ) { xMin = QString( "%1" ).arg( myExtent.xMinimum(), 0, 'f', 2 ); } @@ -814,7 +814,7 @@ xMin = QString( "%1" ).arg( myExtent.xMinimum() ); } - if ( fabs( myExtent.yMinimum() ) > changeoverValue ) + if ( qAbs( myExtent.yMinimum() ) > changeoverValue ) { yMin = QString( "%1" ).arg( myExtent.yMinimum(), 0, 'f', 2 ); } @@ -823,7 +823,7 @@ yMin = QString( "%1" ).arg( myExtent.yMinimum() ); } - if ( fabs( myExtent.xMaximum() ) > changeoverValue ) + if ( qAbs( myExtent.xMaximum() ) > changeoverValue ) { xMax = QString( "%1" ).arg( myExtent.xMaximum(), 0, 'f', 2 ); } @@ -832,7 +832,7 @@ xMax = QString( "%1" ).arg( myExtent.xMaximum() ); } - if ( fabs( myExtent.yMaximum() ) > changeoverValue ) + if ( qAbs( myExtent.yMaximum() ) > changeoverValue ) { yMax = QString( "%1" ).arg( myExtent.yMaximum(), 0, 'f', 2 ); } Index: src/app/qgspointrotationitem.cpp =================================================================== --- src/app/qgspointrotationitem.cpp (revision 14711) +++ src/app/qgspointrotationitem.cpp (working copy) @@ -15,12 +15,7 @@ #include "qgspointrotationitem.h" #include - -#ifndef Q_OS_MACX #include -#else -#include -#endif QgsPointRotationItem::QgsPointRotationItem( QgsMapCanvas* canvas ): QgsMapCanvasItem( canvas ), mOrientation( Clockwise ), mRotation( 0.0 ) { Index: src/plugins/grass/qgsgrassnewmapset.cpp =================================================================== --- src/plugins/grass/qgsgrassnewmapset.cpp (revision 14711) +++ src/plugins/grass/qgsgrassnewmapset.cpp (working copy) @@ -1111,7 +1111,7 @@ double x1 = points[i].x(); double x2 = points[i+1].x(); - if ( fabs( x2 - x1 ) > 150 ) + if ( qAbs( x2 - x1 ) > 150 ) { if ( x2 < x1 ) { Index: src/plugins/grass/qgsgrassedit.cpp =================================================================== --- src/plugins/grass/qgsgrassedit.cpp (revision 14711) +++ src/plugins/grass/qgsgrassedit.cpp (working copy) @@ -854,7 +854,7 @@ for ( int i = 0; i < nlines; i++ ) { - int line = abs( mProvider->nodeLine( node, i ) ); + int line = qAbs( mProvider->nodeLine( node, i ) ); int type = mProvider->readLine( NULL, NULL, line ); if ( type & GV_LINES ) Index: src/plugins/grass/qtermwidget/TerminalDisplay.cpp =================================================================== --- src/plugins/grass/qtermwidget/TerminalDisplay.cpp (revision 14711) +++ src/plugins/grass/qtermwidget/TerminalDisplay.cpp (working copy) @@ -743,16 +743,16 @@ if ( lines == 0 || _image == 0 || !region.isValid() - || ( region.top() + abs( lines ) ) >= region.bottom() + || ( region.top() + qAbs( lines ) ) >= region.bottom() || this->_lines <= region.height() ) return; QRect scrollRect; void* firstCharPos = &_image[ region.top() * this->_columns ]; - void* lastCharPos = &_image[( region.top() + abs( lines ) ) * this->_columns ]; + void* lastCharPos = &_image[( region.top() + qAbs( lines ) ) * this->_columns ]; int top = _topMargin + ( region.top() * _fontHeight ); - int linesToMove = region.height() - abs( lines ); + int linesToMove = region.height() - qAbs( lines ); int bytesToMove = linesToMove * this->_columns * sizeof( Character ); @@ -789,7 +789,7 @@ //set region of the display to scroll, making sure that //the region aligns correctly to the character grid - QPoint topPoint( _leftMargin , top + abs( lines )*_fontHeight ); + QPoint topPoint( _leftMargin , top + qAbs( lines )*_fontHeight ); scrollRect = QRect( topPoint , QSize( this->_usedColumns * _fontWidth , Index: src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp =================================================================== --- src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp (revision 14711) +++ src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp (working copy) @@ -1226,7 +1226,7 @@ double x = toReal( values[11], 0.0 ); double y = toReal( values[21], 0.0 ); - if ( fabs( x ) < 1.0e-6 ) + if ( qAbs( x ) < 1.0e-6 ) { if ( y > 0.0 ) { @@ -1821,9 +1821,9 @@ double dist = sqrt( pow( x2 - x1, 2 ) + pow( y2 - y1, 2 ) ) / 2.0; // alpha can't be 0.0 at this point - radius = fabs( dist / sin( alpha / 2.0 ) ); + radius = qAbs( dist / sin( alpha / 2.0 ) ); - double wu = fabs( pow( radius, 2.0 ) - pow( dist, 2.0 ) ); + double wu = qAbs( pow( radius, 2.0 ) - pow( dist, 2.0 ) ); double h = sqrt( wu ); double angle = acos(( x2 - x1 ) / dist ); @@ -1836,7 +1836,7 @@ angle -= M_PI / 2.0; } - if ( fabs( alpha ) > M_PI ) + if ( qAbs( alpha ) > M_PI ) { h *= -1.0; } @@ -2470,7 +2470,7 @@ { dw.dxfReal( 10, data.x ); dw.dxfReal( 20, data.y ); - if ( fabs( data.bulge ) > 1.0e-10 ) + if ( qAbs( data.bulge ) > 1.0e-10 ) { dw.dxfReal( 42, data.bulge ); } @@ -2481,7 +2481,7 @@ //dw.entityAttributes(attrib); dw.dxfString( 8, polylineLayer ); dw.coord( VERTEX_COORD_CODE, data.x, data.y ); - if ( fabs( data.bulge ) > 1.0e-10 ) + if ( qAbs( data.bulge ) > 1.0e-10 ) { dw.dxfReal( 42, data.bulge ); } Index: src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp =================================================================== --- src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp (revision 14711) +++ src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp (working copy) @@ -25,16 +25,17 @@ #include "qgsvectorlayer.h" #include #include - -#ifndef Q_OS_MACX #include -#else -#include -#endif -QgsPointDisplacementRenderer::QgsPointDisplacementRenderer( const QString& labelAttributeName ): QgsFeatureRendererV2( "pointDisplacement" ), \ - mLabelAttributeName( labelAttributeName ), mLabelIndex( -1 ), mTolerance( 0.00001 ), mCircleWidth( 0.4 ), mCircleColor( QColor( 125, 125, 125 ) ), mCircleRadiusAddition( 0 ), \ - mMaxLabelScaleDenominator( -1 ) +QgsPointDisplacementRenderer::QgsPointDisplacementRenderer( const QString& labelAttributeName ) + : QgsFeatureRendererV2( "pointDisplacement" ) + , mLabelAttributeName( labelAttributeName ) + , mLabelIndex( -1 ) + , mTolerance( 0.00001 ) + , mCircleWidth( 0.4 ) + , mCircleColor( QColor( 125, 125, 125 ) ) + , mCircleRadiusAddition( 0 ) + , mMaxLabelScaleDenominator( -1 ) { mRenderer = QgsFeatureRendererV2::defaultRenderer( QGis::Point ); mCenterSymbol = new QgsMarkerSymbolV2(); //the symbol for the center of a displacement group @@ -149,7 +150,7 @@ QgsSymbolV2RenderContext symbolContext( context, QgsSymbolV2::MM, 1.0, selected ); double circleAdditionPainterUnits = symbolContext.outputLineWidth( mCircleRadiusAddition ); - double radius = std::max(( diagonal / 2 ), labelAttributeList.size() * diagonal / 2 / M_PI ) + circleAdditionPainterUnits; + double radius = qMax(( diagonal / 2 ), labelAttributeList.size() * diagonal / 2 / M_PI ) + circleAdditionPainterUnits; //draw Circle drawCircle( radius, symbolContext, pt, symbolList.size() ); Index: src/plugins/georeferencer/qgsresidualplotitem.cpp =================================================================== --- src/plugins/georeferencer/qgsresidualplotitem.cpp (revision 14711) +++ src/plugins/georeferencer/qgsresidualplotitem.cpp (working copy) @@ -18,11 +18,7 @@ #include "qgsgeorefdatapoint.h" #include #include -#ifndef Q_OS_MACX #include -#else -#include -#endif QgsResidualPlotItem::QgsResidualPlotItem( QgsComposition* c ): QgsComposerItem( c ), mConvertScaleToMapUnits( false ) { Index: src/plugins/georeferencer/qgsimagewarper.cpp =================================================================== --- src/plugins/georeferencer/qgsimagewarper.cpp (revision 14711) +++ src/plugins/georeferencer/qgsimagewarper.cpp (working copy) @@ -332,7 +332,7 @@ int CPL_STDCALL QgsImageWarper::updateWarpProgress( double dfComplete, const char *pszMessage, void *pProgressArg ) { QProgressDialog *progress = static_cast( pProgressArg ); - progress->setValue( std::min( 100u, ( uint )( dfComplete*100.0 ) ) ); + progress->setValue( qMin( 100u, ( uint )( dfComplete*100.0 ) ) ); qApp->processEvents(); // TODO: call QEventLoop manually to make "cancel" button more responsive if ( progress->wasCanceled() ) Index: src/plugins/georeferencer/qgsgeorefplugingui.cpp =================================================================== --- src/plugins/georeferencer/qgsgeorefplugingui.cpp (revision 14711) +++ src/plugins/georeferencer/qgsgeorefplugingui.cpp (working copy) @@ -1878,10 +1878,10 @@ case 3: src = QgsPoint( dX, oY + ( double )s*stepY ); break; } t.transform( src, raster, rasterToWorld ); - minX = std::min( raster.x(), minX ); - maxX = std::max( raster.x(), maxX ); - minY = std::min( raster.y(), minY ); - maxY = std::max( raster.y(), maxY ); + minX = qMin( raster.x(), minX ); + maxX = qMax( raster.x(), maxX ); + minY = qMin( raster.y(), minY ); + maxY = qMax( raster.y(), maxY ); } } return QgsRectangle( minX, minY, maxX, maxY ); Index: src/plugins/georeferencer/qgsgeoreftransform.cpp =================================================================== --- src/plugins/georeferencer/qgsgeoreftransform.cpp (revision 14711) +++ src/plugins/georeferencer/qgsgeoreftransform.cpp (working copy) @@ -23,7 +23,6 @@ #include "qgsleastsquares.h" #include -using std::abs; using std::cos; using std::sin; using std::pow; @@ -454,7 +453,7 @@ else { // Guard against division by zero - if ( abs( s ) < std::numeric_limits::epsilon() ) + if ( qAbs( s ) < std::numeric_limits::epsilon() ) { for ( int i = 0; i < nPointCount; ++i ) { @@ -479,7 +478,7 @@ return true; } -QgsGDALGeorefTransform::QgsGDALGeorefTransform( bool useTPS, unsigned int polynomialOrder ) : mPolynomialOrder( std::min( 3u, polynomialOrder ) ), mIsTPSTransform( useTPS ) +QgsGDALGeorefTransform::QgsGDALGeorefTransform( bool useTPS, unsigned int polynomialOrder ) : mPolynomialOrder( qMin( 3u, polynomialOrder ) ), mIsTPSTransform( useTPS ) { mGDALTransformer = NULL; mGDALTransformerArgs = NULL; Index: src/plugins/georeferencer/qgsleastsquares.cpp =================================================================== --- src/plugins/georeferencer/qgsleastsquares.cpp (revision 14711) +++ src/plugins/georeferencer/qgsleastsquares.cpp (working copy) @@ -245,7 +245,7 @@ // GSL does not support a full SVD, so we artificially add a linear dependent row // to the matrix in case the system is underconstrained. - uint m = std::max( 9u, ( uint )mapCoords.size() * 2u ); + uint m = qMax( 9u, ( uint )mapCoords.size() * 2u ); uint n = 9; gsl_matrix *S = gsl_matrix_alloc( m, n ); Index: src/analysis/raster/qgsrastermatrix.cpp =================================================================== --- src/analysis/raster/qgsrastermatrix.cpp (revision 14711) +++ src/analysis/raster/qgsrastermatrix.cpp (working copy) @@ -18,18 +18,14 @@ #include "qgsrastermatrix.h" #include -#ifndef Q_OS_MACX #include -#else -#include -#endif QgsRasterMatrix::QgsRasterMatrix(): mColumns( 0 ), mRows( 0 ), mData( 0 ) { } QgsRasterMatrix::QgsRasterMatrix( int nCols, int nRows, float* data, double nodataValue ): - mColumns( nCols ), mRows( nRows ), mData( data ), mNodataValue( nodataValue ) + mColumns( nCols ), mRows( nRows ), mData( data ), mNodataValue( nodataValue ) { } @@ -163,22 +159,22 @@ bool QgsRasterMatrix::oneArgumentOperation( OneArgOperator op ) { - if( !mData ) + if ( !mData ) { return false; } int nEntries = mColumns * mRows; double value; - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { value = mData[i]; - if( value != mNodataValue ) + if ( value != mNodataValue ) { - switch( op ) + switch ( op ) { case opSQRT: - if( value < 0 ) //no complex numbers + if ( value < 0 ) //no complex numbers { mData[i] = static_cast( mNodataValue ); } @@ -213,15 +209,15 @@ bool QgsRasterMatrix::twoArgumentOperation( TwoArgOperator op, const QgsRasterMatrix& other ) { - if( isNumber() && other.isNumber() ) //operation on two 1x1 matrices + if ( isNumber() && other.isNumber() ) //operation on two 1x1 matrices { //operations with nodata values always generate nodata - if( mData[0] == mNodataValue || other.number() == other.nodataValue() ) + if ( mData[0] == mNodataValue || other.number() == other.nodataValue() ) { mData[0] = static_cast( mNodataValue ); return true; } - switch( op ) + switch ( op ) { case opPLUS: mData[0] = static_cast( number() + other.number() ); @@ -233,7 +229,7 @@ mData[0] = static_cast( number() * other.number() ); break; case opDIV: - if( other.number() == 0 ) + if ( other.number() == 0 ) { mData[0] = static_cast( mNodataValue ); } @@ -243,7 +239,7 @@ } break; case opPOW: - if( !testPowerValidity( mData[0], ( float ) other.number() ) ) + if ( !testPowerValidity( mData[0], ( float ) other.number() ) ) { mData[0] = static_cast( mNodataValue ); } @@ -275,22 +271,22 @@ } //two matrices - if( !isNumber() && !other.isNumber() ) + if ( !isNumber() && !other.isNumber() ) { float* matrix = other.mData; int nEntries = mColumns * mRows; double value1, value2; - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { value1 = mData[i]; value2 = matrix[i]; - if( value1 == mNodataValue || value2 == other.mNodataValue ) + if ( value1 == mNodataValue || value2 == other.mNodataValue ) { mData[i] = static_cast( mNodataValue ); } else { - switch( op ) + switch ( op ) { case opPLUS: mData[i] = static_cast( value1 + value2 ); @@ -302,7 +298,7 @@ mData[i] = static_cast( value1 * value2 ); break; case opDIV: - if( value2 == 0 ) + if ( value2 == 0 ) { mData[i] = static_cast( mNodataValue ); } @@ -312,7 +308,7 @@ } break; case opPOW: - if( !testPowerValidity( value1, value2 ) ) + if ( !testPowerValidity( value1, value2 ) ) { mData[i] = static_cast( mNodataValue ); } @@ -346,7 +342,7 @@ } //this matrix is a single number and the other one a real matrix - if( isNumber() ) + if ( isNumber() ) { float* matrix = other.mData; int nEntries = other.nColumns() * other.nRows(); @@ -355,24 +351,24 @@ mData = new float[nEntries]; mColumns = other.nColumns(); mRows = other.nRows(); mNodataValue = other.nodataValue(); - if( value == mNodataValue ) + if ( value == mNodataValue ) { - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { mData[i] = static_cast( mNodataValue ); } return true; } - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { - if( matrix[i] == other.mNodataValue ) + if ( matrix[i] == other.mNodataValue ) { mData[i] = static_cast( mNodataValue ); continue; } - switch( op ) + switch ( op ) { case opPLUS: mData[i] = static_cast( value + matrix[i] ); @@ -384,7 +380,7 @@ mData[i] = static_cast( value * matrix[i] ); break; case opDIV: - if( matrix[i] == 0 ) + if ( matrix[i] == 0 ) { mData[i] = static_cast( mNodataValue ); } @@ -394,7 +390,7 @@ } break; case opPOW: - if( !testPowerValidity( value, matrix[i] ) ) + if ( !testPowerValidity( value, matrix[i] ) ) { mData[i] = static_cast( mNodataValue ); } @@ -430,23 +426,23 @@ double value = other.number(); int nEntries = mColumns * mRows; - if( other.number() == other.mNodataValue ) + if ( other.number() == other.mNodataValue ) { - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { mData[i] = static_cast( mNodataValue ); } return true; } - for( int i = 0; i < nEntries; ++i ) + for ( int i = 0; i < nEntries; ++i ) { - if( mData[i] == mNodataValue ) + if ( mData[i] == mNodataValue ) { continue; } - switch( op ) + switch ( op ) { case opPLUS: mData[i] = static_cast( mData[i] + value ); @@ -458,7 +454,7 @@ mData[i] = static_cast( mData[i] * value ); break; case opDIV: - if( value == 0 ) + if ( value == 0 ) { mData[i] = static_cast( mNodataValue ); } @@ -468,7 +464,7 @@ } break; case opPOW: - if( !testPowerValidity( mData[i], value ) ) + if ( !testPowerValidity( mData[i], value ) ) { mData[i] = static_cast( mNodataValue ); } @@ -503,7 +499,7 @@ bool QgsRasterMatrix::testPowerValidity( double base, double power ) { - if(( base == 0 && power < 0 ) || ( power < 0 && ( power - floor( power ) ) > 0 ) ) + if (( base == 0 && power < 0 ) || ( power < 0 && ( power - floor( power ) ) > 0 ) ) { return false; } Index: src/analysis/interpolation/DualEdgeTriangulation.cc =================================================================== --- src/analysis/interpolation/DualEdgeTriangulation.cc (revision 14711) +++ src/analysis/interpolation/DualEdgeTriangulation.cc (working copy) @@ -383,7 +383,7 @@ //Take the higher z-Value in case of two equal points Point3D* newPoint = mPointVector[mPointVector.count()-1]; Point3D* existingPoint = mPointVector[mTwiceInsPoint]; - existingPoint->setZ( std::max( newPoint->getZ(), existingPoint->getZ() ) ); + existingPoint->setZ( qMax( newPoint->getZ(), existingPoint->getZ() ) ); mPointVector.remove( mPointVector.count() - 1 ); delete newPoint; Index: src/analysis/interpolation/MathUtils.h =================================================================== --- src/analysis/interpolation/MathUtils.h (revision 14711) +++ src/analysis/interpolation/MathUtils.h (working copy) @@ -17,11 +17,7 @@ #ifndef MATHUTILS_H #define MATHUTILS_H -#ifndef Q_OS_MACX #include -#else -#include -#endif #include "Vector3D.h" #include "Point3D.h" Index: src/analysis/interpolation/Point3D.h =================================================================== --- src/analysis/interpolation/Point3D.h (revision 14711) +++ src/analysis/interpolation/Point3D.h (working copy) @@ -17,11 +17,7 @@ #ifndef POINT3D_H #define POINT3D_H -#ifndef Q_OS_MACX #include -#else -#include -#endif #include /**Point3D is a class to represent a three dimensional point*/ Index: src/analysis/interpolation/Vector3D.h =================================================================== --- src/analysis/interpolation/Vector3D.h (revision 14711) +++ src/analysis/interpolation/Vector3D.h (working copy) @@ -17,11 +17,7 @@ #ifndef VECTOR3D_H #define VECTOR3D_H -#ifndef Q_OS_MACX #include -#else -#include -#endif class ANALYSIS_EXPORT Vector3D /** Index: src/analysis/interpolation/MathUtils.cc =================================================================== --- src/analysis/interpolation/MathUtils.cc (revision 14711) +++ src/analysis/interpolation/MathUtils.cc (working copy) @@ -205,7 +205,7 @@ double a = normal.getX(); double b = normal.getY(); double c = -( normal.getX() * p2->getX() + normal.getY() * p2->getY() ); - double distance = fabs(( a * thepoint->getX() + b * thepoint->getY() + c ) / ( sqrt( a * a + b * b ) ) ); + double distance = qAbs(( a * thepoint->getX() + b * thepoint->getY() + c ) / ( sqrt( a * a + b * b ) ) ); return distance; } else @@ -479,7 +479,7 @@ return 1; } double tmp = a; - for ( int i = 2; i <= fabs(( double )b ); i++ ) + for ( int i = 2; i <= qAbs(( double )b ); i++ ) { a *= tmp; Index: src/analysis/interpolation/CloughTocherInterpolator.cc =================================================================== --- src/analysis/interpolation/CloughTocherInterpolator.cc (revision 14711) +++ src/analysis/interpolation/CloughTocherInterpolator.cc (working copy) @@ -16,11 +16,8 @@ #include "CloughTocherInterpolator.h" #include "qgslogger.h" -#ifndef Q_OS_MACX + #include -#else -#include -#endif double CloughTocherInterpolator::calcBernsteinPoly( int n, int i, int j, int k, double u, double v, double w ) { Index: src/gui/qgsmapcanvas.cpp =================================================================== --- src/gui/qgsmapcanvas.cpp (revision 14711) +++ src/gui/qgsmapcanvas.cpp (working copy) @@ -717,8 +717,8 @@ // Don't want to interfer with mouse events QgsRectangle currentExtent = mMapRenderer->extent(); - double dx = fabs(( currentExtent.xMaximum() - currentExtent.xMinimum() ) / 4 ); - double dy = fabs(( currentExtent.yMaximum() - currentExtent.yMinimum() ) / 4 ); + double dx = qAbs(( currentExtent.xMaximum() - currentExtent.xMinimum() ) / 4 ); + double dy = qAbs(( currentExtent.yMaximum() - currentExtent.yMinimum() ) / 4 ); switch ( e->key() ) { @@ -1289,8 +1289,8 @@ QgsPoint start = getCoordinateTransform()->toMapCoordinates( mCanvasProperties->rubberStartPoint ); QgsPoint end = getCoordinateTransform()->toMapCoordinates( releasePoint ); - double dx = fabs( end.x() - start.x() ); - double dy = fabs( end.y() - start.y() ); + double dx = qAbs( end.x() - start.x() ); + double dy = qAbs( end.y() - start.y() ); // modify the extent QgsRectangle r = mMapRenderer->extent(); Index: src/gui/qgsannotationitem.cpp =================================================================== --- src/gui/qgsannotationitem.cpp (revision 14711) +++ src/gui/qgsannotationitem.cpp (working copy) @@ -107,10 +107,10 @@ halfSymbolSize = scaledSymbolSize() / 2.0; } - double xMinPos = std::min( -halfSymbolSize, mOffsetFromReferencePoint.x() - mFrameBorderWidth ); - double xMaxPos = std::max( halfSymbolSize, mOffsetFromReferencePoint.x() + mFrameSize.width() + mFrameBorderWidth ); - double yMinPos = std::min( -halfSymbolSize, mOffsetFromReferencePoint.y() - mFrameBorderWidth ); - double yMaxPos = std::max( halfSymbolSize, mOffsetFromReferencePoint.y() + mFrameSize.height() + mFrameBorderWidth ); + double xMinPos = qMin( -halfSymbolSize, mOffsetFromReferencePoint.x() - mFrameBorderWidth ); + double xMaxPos = qMax( halfSymbolSize, mOffsetFromReferencePoint.x() + mFrameSize.width() + mFrameBorderWidth ); + double yMinPos = qMin( -halfSymbolSize, mOffsetFromReferencePoint.y() - mFrameBorderWidth ); + double yMaxPos = qMax( halfSymbolSize, mOffsetFromReferencePoint.y() + mFrameSize.height() + mFrameBorderWidth ); mBoundingRect = QRectF( xMinPos, yMinPos, xMaxPos - xMinPos, yMaxPos - yMinPos ); } @@ -283,16 +283,16 @@ int cursorSensitivity = 7; - if ( abs( itemPos.x() ) < cursorSensitivity && abs( itemPos.y() ) < cursorSensitivity ) //move map point if position is close to the origin + if ( qAbs( itemPos.x() ) < cursorSensitivity && qAbs( itemPos.y() ) < cursorSensitivity ) //move map point if position is close to the origin { return MoveMapPosition; } bool left, right, up, down; - left = abs( itemPos.x() - mOffsetFromReferencePoint.x() ) < cursorSensitivity; - right = abs( itemPos.x() - ( mOffsetFromReferencePoint.x() + mFrameSize.width() ) ) < cursorSensitivity; - up = abs( itemPos.y() - mOffsetFromReferencePoint.y() ) < cursorSensitivity; - down = abs( itemPos.y() - ( mOffsetFromReferencePoint.y() + mFrameSize.height() ) ) < cursorSensitivity; + left = qAbs( itemPos.x() - mOffsetFromReferencePoint.x() ) < cursorSensitivity; + right = qAbs( itemPos.x() - ( mOffsetFromReferencePoint.x() + mFrameSize.width() ) ) < cursorSensitivity; + up = qAbs( itemPos.y() - mOffsetFromReferencePoint.y() ) < cursorSensitivity; + down = qAbs( itemPos.y() - ( mOffsetFromReferencePoint.y() + mFrameSize.height() ) ) < cursorSensitivity; if ( left && up ) { Index: src/core/qgspoint.cpp =================================================================== --- src/core/qgspoint.cpp (revision 14711) +++ src/core/qgspoint.cpp (working copy) @@ -136,12 +136,12 @@ QString QgsPoint::toDegreesMinutesSeconds( int thePrecision ) const { - int myDegreesX = int( std::abs( m_x ) ); + int myDegreesX = int( qAbs( m_x ) ); float myFloatMinutesX = float(( qAbs( m_x ) - myDegreesX ) * 60 ); int myIntMinutesX = int( myFloatMinutesX ); float mySecondsX = float( myFloatMinutesX - myIntMinutesX ) * 60; - int myDegreesY = int( std::abs( m_y ) ); + int myDegreesY = int( qAbs( m_y ) ); float myFloatMinutesY = float(( qAbs( m_y ) - myDegreesY ) * 60 ); int myIntMinutesY = int( myFloatMinutesY ); float mySecondsY = float( myFloatMinutesY - myIntMinutesY ) * 60; @@ -220,8 +220,8 @@ { //algorithm from 'graphics GEMS', A. Paeth: 'A Fast 2D Point-on-line test' if ( - fabs(( b.y() - a.y() ) *( m_x - a.x() ) - ( m_y - a.y() ) *( b.x() - a.x() ) ) - >= qMax( fabs( b.x() - a.x() ), fabs( b.y() - a.y() ) ) + qAbs(( b.y() - a.y() ) *( m_x - a.x() ) - ( m_y - a.y() ) *( b.x() - a.x() ) ) + >= qMax( qAbs( b.x() - a.x() ), qAbs( b.y() - a.y() ) ) ) { return 0; Index: src/core/qgsvectorlayer.cpp =================================================================== --- src/core/qgsvectorlayer.cpp (revision 14711) +++ src/core/qgsvectorlayer.cpp (working copy) @@ -668,10 +668,10 @@ for ( int i = 0; i < pa.size(); ++i ) { - largestX = std::max( largestX, pa.point( i ).x() ); - smallestX = std::min( smallestX, pa.point( i ).x() ); - largestY = std::max( largestY, pa.point( i ).y() ); - smallestY = std::min( smallestY, pa.point( i ).y() ); + largestX = qMax( largestX, pa.point( i ).x() ); + smallestX = qMin( smallestX, pa.point( i ).x() ); + largestY = qMax( largestY, pa.point( i ).y() ); + smallestY = qMin( smallestY, pa.point( i ).y() ); } QgsDebugMsg( QString( "Largest X coordinate was %1" ).arg( largestX ) ); QgsDebugMsg( QString( "Smallest X coordinate was %1" ).arg( smallestX ) ); Index: src/core/qgsscalecalculator.cpp =================================================================== --- src/core/qgsscalecalculator.cpp (revision 14711) +++ src/core/qgsscalecalculator.cpp (working copy) @@ -17,8 +17,7 @@ ***************************************************************************/ /* $Id$ */ -#include -#include +#include #include "qgslogger.h" #include "qgsrectangle.h" #include "qgsscalecalculator.h" @@ -84,7 +83,7 @@ delta = calculateGeographicDistance( mapExtent ); break; default: - assert( "bad map units" ); + Q_ASSERT( "bad map units" ); break; } QgsDebugMsg( "Using conversionFactor of " + QString::number( conversionFactor ) ); Index: src/core/raster/qgscolorrampshader.cpp =================================================================== --- src/core/raster/qgscolorrampshader.cpp (revision 14711) +++ src/core/raster/qgscolorrampshader.cpp (working copy) @@ -23,7 +23,7 @@ #include "qgscolorrampshader.h" -#include +#include QgsColorRampShader::QgsColorRampShader( double theMinimumValue, double theMaximumValue ) : QgsRasterShaderFunction( theMinimumValue, theMaximumValue ) { @@ -63,7 +63,7 @@ { //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex ); - myTinyDiff = fabs( theValue - myColorRampItem.value ); + myTinyDiff = qAbs( theValue - myColorRampItem.value ); //If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted) if ( mCurrentColorRampItemIndex != 0 && theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value ) { @@ -105,7 +105,7 @@ { //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex ); - myTinyDiff = fabs( theValue - myColorRampItem.value ); + myTinyDiff = qAbs( theValue - myColorRampItem.value ); if ( theValue == myColorRampItem.value || myTinyDiff <= DOUBLE_DIFF_THRESHOLD ) { *theReturnRedValue = myColorRampItem.color.red(); @@ -154,7 +154,7 @@ { //Start searching from the last index - assumtion is that neighboring pixels tend to be similar values myColorRampItem = mColorRampItemList.value( mCurrentColorRampItemIndex ); - myTinyDiff = fabs( theValue - myColorRampItem.value ); + myTinyDiff = qAbs( theValue - myColorRampItem.value ); //If the previous entry is less, then search closer to the top of the list (assumes mColorRampItemList is sorted) if ( mCurrentColorRampItemIndex != 0 && theValue <= mColorRampItemList.at( mCurrentColorRampItemIndex - 1 ).value ) { Index: src/core/raster/qgsrasterlayer.cpp =================================================================== --- src/core/raster/qgsrasterlayer.cpp (revision 14711) +++ src/core/raster/qgsrasterlayer.cpp (working copy) @@ -819,7 +819,7 @@ { double myValue = readValue( myData, myDataType, iX + ( iY * myXBlockSize ) ); - if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) + if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) { continue; // NULL } @@ -887,7 +887,7 @@ { double myValue = readValue( myData, myDataType, iX + ( iY * myXBlockSize ) ); - if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) + if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) { continue; // NULL } @@ -1278,7 +1278,7 @@ for ( int myColumn = 0; myColumn < mLastViewPort.drawableAreaXDim; ++myColumn ) { myValue = readValue( myGdalScanData, myDataType, myRow * mLastViewPort.drawableAreaXDim + myColumn ); - if ( mValidNoDataValue && ( fabs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) + if ( mValidNoDataValue && ( qAbs( myValue - mNoDataValue ) <= TINY_VALUE || myValue != myValue ) ) { continue; } @@ -1443,8 +1443,8 @@ // calculate raster pixel offsets from origin to clipped rect // we're only interested in positive offsets where the origin of the raster // is northwest of the origin of the view - myRasterViewPort->rectXOffsetFloat = ( theViewExtent.xMinimum() - mLayerExtent.xMinimum() ) / fabs( mGeoTransform[1] ); - myRasterViewPort->rectYOffsetFloat = ( mLayerExtent.yMaximum() - theViewExtent.yMaximum() ) / fabs( mGeoTransform[5] ); + myRasterViewPort->rectXOffsetFloat = ( theViewExtent.xMinimum() - mLayerExtent.xMinimum() ) / qAbs( mGeoTransform[1] ); + myRasterViewPort->rectYOffsetFloat = ( mLayerExtent.yMaximum() - theViewExtent.yMaximum() ) / qAbs( mGeoTransform[5] ); if ( myRasterViewPort->rectXOffsetFloat < 0 ) { @@ -1512,8 +1512,8 @@ myRasterViewPort->topLeftPoint = theQgsMapToPixel.transform( myRasterExtent.xMinimum(), myRasterExtent.yMaximum() ); myRasterViewPort->bottomRightPoint = theQgsMapToPixel.transform( myRasterExtent.xMaximum(), myRasterExtent.yMinimum() ); - myRasterViewPort->drawableAreaXDim = static_cast( fabs(( myRasterViewPort->clippedWidth / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) ) + 0.5 ); - myRasterViewPort->drawableAreaYDim = static_cast( fabs(( myRasterViewPort->clippedHeight / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5 ); + myRasterViewPort->drawableAreaXDim = static_cast( qAbs(( myRasterViewPort->clippedWidth / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) ) + 0.5 ); + myRasterViewPort->drawableAreaYDim = static_cast( qAbs(( myRasterViewPort->clippedHeight / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5 ); //the drawable area can start to get very very large when you get down displaying 2x2 or smaller, this is becasue //theQgsMapToPixel.mapUnitsPerPixel() is less then 1, @@ -1573,9 +1573,9 @@ //fetch image in several parts if it is too memory consuming //also some WMS servers have a pixel limit, so it's better to make several requests - int totalPixelWidth = fabs(( myRasterViewPort->clippedXMax - myRasterViewPort->clippedXMin ) + int totalPixelWidth = qAbs(( myRasterViewPort->clippedXMax - myRasterViewPort->clippedXMin ) / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[1] ) + 1; - int totalPixelHeight = fabs(( myRasterViewPort->clippedYMax - myRasterViewPort->clippedYMin ) + int totalPixelHeight = qAbs(( myRasterViewPort->clippedYMax - myRasterViewPort->clippedYMin ) / theQgsMapToPixel.mapUnitsPerPixel() * mGeoTransform[5] ) + 1; int numParts = totalPixelWidth * totalPixelHeight / 5000000 + 1.0; int numRowsPerPart = totalPixelHeight / numParts + 1.0; @@ -1962,7 +1962,7 @@ #endif QString v; - if ( mValidNoDataValue && ( fabs( value - mNoDataValue ) <= TINY_VALUE || value != value ) ) + if ( mValidNoDataValue && ( qAbs( value - mNoDataValue ) <= TINY_VALUE || value != value ) ) { v = tr( "null (no data)" ); } @@ -3063,7 +3063,7 @@ // We can only use one of the mGeoTransform[], so go with the // horisontal one. - return fabs( mGeoTransform[1] ); + return qAbs( mGeoTransform[1] ); } /** @@ -4516,9 +4516,9 @@ if ( mValidNoDataValue && ( - ( fabs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) || - ( fabs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) || - ( fabs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue ) + ( qAbs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) || + ( qAbs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) || + ( qAbs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue ) ) ) { @@ -4618,7 +4618,7 @@ myBlueValue = 0; myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i ); - if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) + if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) { imageScanLine[ i ] = myDefaultColor; continue; @@ -4698,7 +4698,7 @@ myBlueValue = 0; myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i ); - if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) + if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) { imageScanLine[ i ] = myDefaultColor; continue; @@ -4795,7 +4795,7 @@ myBlueValue = 0; myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i ); - if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) + if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) { imageScanLine[ i ] = myDefaultColor; continue; @@ -4891,7 +4891,7 @@ { myGrayValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i ); - if ( mValidNoDataValue && ( fabs( myGrayValue - mNoDataValue ) <= TINY_VALUE || myGrayValue != myGrayValue ) ) + if ( mValidNoDataValue && ( qAbs( myGrayValue - mNoDataValue ) <= TINY_VALUE || myGrayValue != myGrayValue ) ) { imageScanLine[ i ] = myDefaultColor; continue; @@ -4981,7 +4981,7 @@ { myPixelValue = readValue( rasterScanLine, myDataType, i ); - if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) + if ( mValidNoDataValue && ( qAbs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) ) { imageScanLine[ i ] = myDefaultColor; continue; @@ -5081,14 +5081,14 @@ ( theRasterViewPort->rectXOffsetFloat - theRasterViewPort->rectXOffset ) / theQgsMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[1] ) + * qAbs( mGeoTransform[1] ) ); paintYoffset = static_cast( ( theRasterViewPort->rectYOffsetFloat - theRasterViewPort->rectYOffset ) / theQgsMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[5] ) + * qAbs( mGeoTransform[5] ) ); } @@ -5121,8 +5121,8 @@ int myPixelBoundaryY = 0; if ( theQgsMapToPixel ) { - myPixelBoundaryX = static_cast( theRasterViewPort->topLeftPoint.x() + 0.5 ) + static_cast( fabs( mGeoTransform[1] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset; - myPixelBoundaryY = static_cast( theRasterViewPort->topLeftPoint.y() + 0.5 ) + static_cast( fabs( mGeoTransform[5] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset; + myPixelBoundaryX = static_cast( theRasterViewPort->topLeftPoint.x() + 0.5 ) + static_cast( qAbs( mGeoTransform[1] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset; + myPixelBoundaryY = static_cast( theRasterViewPort->topLeftPoint.y() + 0.5 ) + static_cast( qAbs( mGeoTransform[5] / theQgsMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset; } //INSTANCE: 1x2 @@ -5762,18 +5762,18 @@ ( mViewPort->rectXOffsetFloat - mViewPort->rectXOffset ) / mMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[1] ) + * qAbs( mGeoTransform[1] ) ); paintYoffset = static_cast( ( mViewPort->rectYOffsetFloat - mViewPort->rectYOffset ) / mMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[5] ) + * qAbs( mGeoTransform[5] ) ); imageX = static_cast( mViewPort->topLeftPoint.x() + 0.5 ); - imageY = static_cast( mViewPort->topLeftPoint.y() + 0.5 + fabs( mGeoTransform[5] ) * mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel() ); + imageY = static_cast( mViewPort->topLeftPoint.y() + 0.5 + qAbs( mGeoTransform[5] ) * mCurrentPartRasterMin / mMapToPixel->mapUnitsPerPixel() ); } mPainter->drawImage( imageX, @@ -5812,7 +5812,7 @@ int overlapRows = 0; if ( mMapToPixel ) { - overlapRows = mMapToPixel->mapUnitsPerPixel() / fabs( mGeoTransform[5] ) + 2; + overlapRows = mMapToPixel->mapUnitsPerPixel() / qAbs( mGeoTransform[5] ) + 2; } if ( mCurrentPartRasterMax + overlapRows >= mViewPort->clippedHeight ) { @@ -5829,7 +5829,7 @@ { if ( mMapToPixel ) { - ySize = fabs((( rasterYSize ) / mMapToPixel->mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5; + ySize = qAbs((( rasterYSize ) / mMapToPixel->mapUnitsPerPixel() * mGeoTransform[5] ) ) + 0.5; } } if ( ySize < 1 || xSize < 1 ) @@ -5875,14 +5875,14 @@ ( mViewPort->rectXOffsetFloat - mViewPort->rectXOffset ) / mMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[1] ) + * qAbs( mGeoTransform[1] ) ); paintYoffset = static_cast( ( mViewPort->rectYOffsetFloat - mViewPort->rectYOffset ) / mMapToPixel->mapUnitsPerPixel() - * fabs( mGeoTransform[5] ) + * qAbs( mGeoTransform[5] ) ); } @@ -5906,8 +5906,8 @@ int myPixelBoundaryY = 0; if ( mMapToPixel ) { - myPixelBoundaryX = static_cast( mViewPort->topLeftPoint.x() + 0.5 ) + static_cast( fabs( mGeoTransform[1] / mMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset; - myPixelBoundaryY = static_cast( mViewPort->topLeftPoint.y() + 0.5 ) + static_cast( fabs( mGeoTransform[5] / mMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset; + myPixelBoundaryX = static_cast( mViewPort->topLeftPoint.x() + 0.5 ) + static_cast( qAbs( mGeoTransform[1] / mMapToPixel->mapUnitsPerPixel() ) ) - paintXoffset; + myPixelBoundaryY = static_cast( mViewPort->topLeftPoint.y() + 0.5 ) + static_cast( qAbs( mGeoTransform[5] / mMapToPixel->mapUnitsPerPixel() ) ) - paintYoffset; } //INSTANCE: 1x2 Index: src/core/qgsrectangle.cpp =================================================================== --- src/core/qgsrectangle.cpp (revision 14711) +++ src/core/qgsrectangle.cpp (working copy) @@ -213,7 +213,7 @@ int precision = 0; if (( width() < 1 || height() < 1 ) && ( width() > 0 && height() > 0 ) ) { - precision = static_cast( ceil( -1.0 * log10( std::min( width(), height() ) ) ) ) + 1; + precision = static_cast( ceil( -1.0 * log10( qMin( width(), height() ) ) ) ) + 1; // sanity check if ( precision > 20 ) precision = 20; Index: src/core/renderer/qgsuniquevaluerenderer.cpp =================================================================== --- src/core/renderer/qgsuniquevaluerenderer.cpp (revision 14711) +++ src/core/renderer/qgsuniquevaluerenderer.cpp (working copy) @@ -24,7 +24,7 @@ #include "qgssymbol.h" #include "qgssymbologyutils.h" #include "qgslogger.h" -#include +#include #include #include #include @@ -123,7 +123,7 @@ { //first find out the value for the scale classification attribute const QgsAttributeMap& attrs = f.attributeMap(); - fieldScale = sqrt( fabs( attrs[symbol->scaleClassificationField()].toDouble() ) ); + fieldScale = sqrt( qAbs( attrs[symbol->scaleClassificationField()].toDouble() ) ); } if ( symbol->rotationClassificationField() >= 0 ) { Index: src/core/renderer/qgsgraduatedsymbolrenderer.cpp =================================================================== --- src/core/renderer/qgsgraduatedsymbolrenderer.cpp (revision 14711) +++ src/core/renderer/qgsgraduatedsymbolrenderer.cpp (working copy) @@ -25,7 +25,7 @@ #include "qgsvectordataprovider.h" #include "qgsvectorlayer.h" #include "qgsrendercontext.h" -#include +#include #include #include #include @@ -145,7 +145,7 @@ { //first find out the value for the scale classification attribute const QgsAttributeMap& attrs = f.attributeMap(); - fieldScale = sqrt( fabs( attrs[theSymbol->scaleClassificationField()].toDouble() ) ); + fieldScale = sqrt( qAbs( attrs[theSymbol->scaleClassificationField()].toDouble() ) ); QgsDebugMsgLevel( QString( "Feature has field scale factor %1" ).arg( fieldScale ), 3 ); } if ( theSymbol->rotationClassificationField() >= 0 ) Index: src/core/renderer/qgssinglesymbolrenderer.cpp =================================================================== --- src/core/renderer/qgssinglesymbolrenderer.cpp (revision 14711) +++ src/core/renderer/qgssinglesymbolrenderer.cpp (working copy) @@ -30,7 +30,7 @@ #include #include #include -#include +#include QgsSingleSymbolRenderer::QgsSingleSymbolRenderer( QGis::GeometryType type ) { @@ -141,7 +141,7 @@ { //first find out the value for the scale classification attribute const QgsAttributeMap& attrs = f.attributeMap(); - fieldScale = sqrt( fabs( attrs[ mSymbol0->scaleClassificationField()].toDouble() ) ); + fieldScale = sqrt( qAbs( attrs[ mSymbol0->scaleClassificationField()].toDouble() ) ); QgsDebugMsgLevel( QString( "Feature has field scale factor %1" ).arg( fieldScale ), 3 ); } if ( mSymbol0->rotationClassificationField() >= 0 ) Index: src/core/qgspallabeling.cpp =================================================================== --- src/core/qgspallabeling.cpp (revision 14711) +++ src/core/qgspallabeling.cpp (working copy) @@ -402,8 +402,8 @@ } QgsPoint ptSize = xform->toMapCoordinates( w, h ); - labelX = fabs( ptSize.x() - ptZero.x() ); - labelY = fabs( ptSize.y() - ptZero.y() ); + labelX = qAbs( ptSize.x() - ptZero.x() ); + labelY = qAbs( ptSize.y() - ptZero.y() ); } @@ -570,7 +570,7 @@ if ( distance != 0 ) { - feat->setDistLabel( fabs( ptOne.x() - ptZero.x() )* distance * vectorScaleFactor ); + feat->setDistLabel( qAbs( ptOne.x() - ptZero.x() )* distance * vectorScaleFactor ); } //add parameters for data defined labeling to QgsPalGeometry Index: src/core/qgsdistancearea.cpp =================================================================== --- src/core/qgsdistancearea.cpp (revision 14711) +++ src/core/qgsdistancearea.cpp (working copy) @@ -494,7 +494,7 @@ double tu2 = 0; int iterLimit = 20; - while ( fabs( lambda - lambdaP ) > 1e-12 && --iterLimit > 0 ) + while ( qAbs( lambda - lambdaP ) > 1e-12 && --iterLimit > 0 ) { sinLambda = sin( lambda ); cosLambda = cos( lambda ); @@ -665,7 +665,7 @@ } // QgsDebugMsg("Area from point: " + (points[i % size]).toString(2)); area = area / 2.0; - return fabs( area ); // All areas are positive! + return qAbs( area ); // All areas are positive! } QString QgsDistanceArea::textUnit( double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit ) @@ -682,12 +682,12 @@ { unitLabel = QObject::tr( " m2" ); } - else if ( fabs( value ) > 1000000.0 ) + else if ( qAbs( value ) > 1000000.0 ) { unitLabel = QObject::tr( " km2" ); value = value / 1000000.0; } - else if ( fabs( value ) > 10000.0 ) + else if ( qAbs( value ) > 10000.0 ) { unitLabel = QObject::tr( " ha" ); value = value / 10000.0; @@ -699,21 +699,21 @@ } else { - if ( keepBaseUnit || fabs( value ) == 0.0 ) + if ( keepBaseUnit || qAbs( value ) == 0.0 ) { unitLabel = QObject::tr( " m" ); } - else if ( fabs( value ) > 1000.0 ) + else if ( qAbs( value ) > 1000.0 ) { unitLabel = QObject::tr( " km" ); value = value / 1000; } - else if ( fabs( value ) < 0.01 ) + else if ( qAbs( value ) < 0.01 ) { unitLabel = QObject::tr( " mm" ); value = value * 1000; } - else if ( fabs( value ) < 0.1 ) + else if ( qAbs( value ) < 0.1 ) { unitLabel = QObject::tr( " cm" ); value = value * 100; @@ -727,7 +727,7 @@ case QGis::Feet: if ( isArea ) { - if ( keepBaseUnit || fabs( value ) <= ( 528.0*528.0 ) ) + if ( keepBaseUnit || qAbs( value ) <= ( 528.0*528.0 ) ) { unitLabel = QObject::tr( " sq ft" ); } @@ -739,9 +739,9 @@ } else { - if ( fabs( value ) <= 528.0 || keepBaseUnit ) + if ( qAbs( value ) <= 528.0 || keepBaseUnit ) { - if ( fabs( value ) == 1.0 ) + if ( qAbs( value ) == 1.0 ) { unitLabel = QObject::tr( " foot" ); } @@ -764,7 +764,7 @@ } else { - if ( fabs( value ) == 1.0 ) + if ( qAbs( value ) == 1.0 ) unitLabel = QObject::tr( " degree" ); else unitLabel = QObject::tr( " degrees" ); Index: src/core/qgssearchtreenode.cpp =================================================================== --- src/core/qgssearchtreenode.cpp (revision 14711) +++ src/core/qgssearchtreenode.cpp (working copy) @@ -28,14 +28,8 @@ #include #include -#ifndef Q_OS_MACX #include -#else -#include -#endif - - #define EVAL_STR(x) (x.length() ? x : "(empty)") QgsSearchTreeNode::QgsSearchTreeNode( QgsSearchTreeNode::Type t ) Index: src/core/qgsmaprenderer.cpp =================================================================== --- src/core/qgsmaprenderer.cpp (revision 14711) +++ src/core/qgsmaprenderer.cpp (working copy) @@ -104,8 +104,8 @@ { // Use abs() on the extent to avoid the case where the extent is // symmetrical about 0. - double xMean = ( fabs( extent.xMinimum() ) + fabs( extent.xMaximum() ) ) * 0.5; - double yMean = ( fabs( extent.yMinimum() ) + fabs( extent.yMaximum() ) ) * 0.5; + double xMean = ( qAbs( extent.xMinimum() ) + qAbs( extent.xMaximum() ) ) * 0.5; + double yMean = ( qAbs( extent.yMinimum() ) + qAbs( extent.yMaximum() ) ) * 0.5; double xRange = extent.width() / xMean; double yRange = extent.height() / yMean; @@ -388,7 +388,7 @@ QgsMapToPixel rasterMapToPixel; QgsMapToPixel bk_mapToPixel; - if ( ml->type() == QgsMapLayer::RasterLayer && fabs( rasterScaleFactor - 1.0 ) > 0.000001 ) + if ( ml->type() == QgsMapLayer::RasterLayer && qAbs( rasterScaleFactor - 1.0 ) > 0.000001 ) { scaleRaster = true; } Index: src/core/spatialindex/tools/Tools.cc =================================================================== --- src/core/spatialindex/tools/Tools.cc (revision 14711) +++ src/core/spatialindex/tools/Tools.cc (working copy) @@ -640,7 +640,7 @@ rl * blockSize ) { - unsigned long l = std::max( bufferLength, rl * blockSize ); + unsigned long l = qMax( bufferLength, rl * blockSize ); byte* tmp; try @@ -717,10 +717,10 @@ ); // maximum resident set size - m_peakMemory = std::max( m_peakMemory, m_tmpRU.ru_maxrss ); + m_peakMemory = qMax( m_peakMemory, m_tmpRU.ru_maxrss ); // total memory - m_totalMemory = std::max( m_totalMemory, m_tmpRU.ru_ixrss + m_tmpRU.ru_idrss + m_tmpRU.ru_isrss + m_tmpRU.ru_maxrss ); + m_totalMemory = qMax( m_totalMemory, m_tmpRU.ru_ixrss + m_tmpRU.ru_idrss + m_tmpRU.ru_isrss + m_tmpRU.ru_maxrss ); } void Tools::ResourceUsage::stop() @@ -757,10 +757,10 @@ m_writeIO += ru.ru_oublock - m_tmpRU.ru_oublock; // maximum resident set size - m_peakMemory = std::max( m_peakMemory, ru.ru_maxrss ); + m_peakMemory = qMax( m_peakMemory, ru.ru_maxrss ); // total memory - m_totalMemory = std::max( m_totalMemory, ru.ru_ixrss + ru.ru_idrss + ru.ru_isrss + ru.ru_maxrss ); + m_totalMemory = qMax( m_totalMemory, ru.ru_ixrss + ru.ru_idrss + ru.ru_isrss + ru.ru_maxrss ); // page faults m_pageFaults += ru.ru_majflt - m_tmpRU.ru_majflt; Index: src/core/spatialindex/tools/ExternalSort.cc =================================================================== --- src/core/spatialindex/tools/ExternalSort.cc (revision 14711) +++ src/core/spatialindex/tools/ExternalSort.cc (working copy) @@ -212,7 +212,7 @@ // if there are no more records in the file, do nothing. } - cMaxRun = std::max( cRun, cMaxRun ); + cMaxRun = qMax( cRun, cMaxRun ); cRun++; if ( cRun == runs.size() ) cRun = 0; } Index: src/core/spatialindex/rtree/RTree.cc =================================================================== --- src/core/spatialindex/rtree/RTree.cc (revision 14711) +++ src/core/spatialindex/rtree/RTree.cc (working copy) @@ -639,8 +639,8 @@ for ( unsigned long cChild = 0; cChild < e.m_pNode->m_children; cChild++ ) { - tmpRegion.m_pLow[cDim] = std::min( tmpRegion.m_pLow[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pLow[cDim] ); - tmpRegion.m_pHigh[cDim] = std::max( tmpRegion.m_pHigh[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pHigh[cDim] ); + tmpRegion.m_pLow[cDim] = qMin( tmpRegion.m_pLow[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pLow[cDim] ); + tmpRegion.m_pHigh[cDim] = qMax( tmpRegion.m_pHigh[cDim], e.m_pNode->m_ptrMBR[cChild]->m_pHigh[cDim] ); } } Index: src/core/spatialindex/rtree/Node.cc =================================================================== --- src/core/spatialindex/rtree/Node.cc (revision 14711) +++ src/core/spatialindex/rtree/Node.cc (working copy) @@ -326,8 +326,8 @@ for ( unsigned long cChild = 0; cChild < m_children; cChild++ ) { - m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); - m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); + m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); + m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); } } } @@ -439,8 +439,8 @@ for ( unsigned long cChild = 0; cChild < m_children; cChild++ ) { - m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); - m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); + m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); + m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); } } @@ -673,7 +673,7 @@ d1 = a->getArea() - a1; mbr2->getCombinedRegion( *b, *( m_ptrMBR[cChild] ) ); d2 = b->getArea() - a2; - d = std::abs( d1 - d2 ); + d = qAbs( d1 - d2 ); if ( d > m ) { @@ -826,7 +826,7 @@ marginh += bbh1.getMargin() + bbh2.getMargin(); } // for (cChild) - double margin = std::min( marginl, marginh ); + double margin = qMin( marginl, marginh ); // keep minimum margin as split axis. if ( margin < minimumMargin ) @@ -935,8 +935,8 @@ if ( m_ptrMBR[cChild]->m_pLow[cDim] > m_ptrMBR[greatestLower]->m_pLow[cDim] ) greatestLower = cChild; if ( m_ptrMBR[cChild]->m_pHigh[cDim] < m_ptrMBR[leastUpper]->m_pHigh[cDim] ) leastUpper = cChild; - leastLower = std::min( m_ptrMBR[cChild]->m_pLow[cDim], leastLower ); - greatestUpper = std::max( m_ptrMBR[cChild]->m_pHigh[cDim], greatestUpper ); + leastLower = qMin( m_ptrMBR[cChild]->m_pLow[cDim], leastLower ); + greatestUpper = qMax( m_ptrMBR[cChild]->m_pHigh[cDim], greatestUpper ); } width = greatestUpper - leastLower; @@ -1047,8 +1047,8 @@ for ( unsigned long cChild = 0; cChild < p->m_children; cChild++ ) { - p->m_nodeMBR.m_pLow[cDim] = std::min( p->m_nodeMBR.m_pLow[cDim], p->m_ptrMBR[cChild]->m_pLow[cDim] ); - p->m_nodeMBR.m_pHigh[cDim] = std::max( p->m_nodeMBR.m_pHigh[cDim], p->m_ptrMBR[cChild]->m_pHigh[cDim] ); + p->m_nodeMBR.m_pLow[cDim] = qMin( p->m_nodeMBR.m_pLow[cDim], p->m_ptrMBR[cChild]->m_pLow[cDim] ); + p->m_nodeMBR.m_pHigh[cDim] = qMax( p->m_nodeMBR.m_pHigh[cDim], p->m_ptrMBR[cChild]->m_pHigh[cDim] ); } } } Index: src/core/spatialindex/rtree/Index.cc =================================================================== --- src/core/spatialindex/rtree/Index.cc (revision 14711) +++ src/core/spatialindex/rtree/Index.cc (working copy) @@ -309,8 +309,8 @@ for ( unsigned long cChild = 0; cChild < m_children; cChild++ ) { - m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); - m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); + m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); + m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); } } } @@ -355,8 +355,8 @@ for ( unsigned long cChild = 0; cChild < m_children; cChild++ ) { - m_nodeMBR.m_pLow[cDim] = std::min( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); - m_nodeMBR.m_pHigh[cDim] = std::max( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); + m_nodeMBR.m_pLow[cDim] = qMin( m_nodeMBR.m_pLow[cDim], m_ptrMBR[cChild]->m_pLow[cDim] ); + m_nodeMBR.m_pHigh[cDim] = qMax( m_nodeMBR.m_pHigh[cDim], m_ptrMBR[cChild]->m_pHigh[cDim] ); } } } Index: src/core/spatialindex/geometry/Region.cc =================================================================== --- src/core/spatialindex/geometry/Region.cc (revision 14711) +++ src/core/spatialindex/geometry/Region.cc (working copy) @@ -395,8 +395,8 @@ for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ ) { - ret.m_pLow[cDim] = std::max( m_pLow[cDim], r.m_pLow[cDim] ); - ret.m_pHigh[cDim] = std::min( m_pHigh[cDim], r.m_pHigh[cDim] ); + ret.m_pLow[cDim] = qMax( m_pLow[cDim], r.m_pLow[cDim] ); + ret.m_pHigh[cDim] = qMin( m_pHigh[cDim], r.m_pHigh[cDim] ); } return ret; @@ -416,8 +416,8 @@ { if ( m_pLow[cDim] > r.m_pHigh[cDim] || m_pHigh[cDim] < r.m_pLow[cDim] ) return 0.0; - f1 = std::max( m_pLow[cDim], r.m_pLow[cDim] ); - f2 = std::min( m_pHigh[cDim], r.m_pHigh[cDim] ); + f1 = qMax( m_pLow[cDim], r.m_pLow[cDim] ); + f2 = qMin( m_pHigh[cDim], r.m_pHigh[cDim] ); ret *= f2 - f1; } @@ -450,8 +450,8 @@ for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ ) { - m_pLow[cDim] = std::min( m_pLow[cDim], r.m_pLow[cDim] ); - m_pHigh[cDim] = std::max( m_pHigh[cDim], r.m_pHigh[cDim] ); + m_pLow[cDim] = qMin( m_pLow[cDim], r.m_pLow[cDim] ); + m_pHigh[cDim] = qMax( m_pHigh[cDim], r.m_pHigh[cDim] ); } } @@ -464,8 +464,8 @@ for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ ) { - m_pLow[cDim] = std::min( m_pLow[cDim], p.m_pCoords[cDim] ); - m_pHigh[cDim] = std::max( m_pHigh[cDim], p.m_pCoords[cDim] ); + m_pLow[cDim] = qMin( m_pLow[cDim], p.m_pCoords[cDim] ); + m_pHigh[cDim] = qMax( m_pHigh[cDim], p.m_pCoords[cDim] ); } } Index: src/core/spatialindex/geometry/LineSegment.cc =================================================================== --- src/core/spatialindex/geometry/LineSegment.cc (revision 14711) +++ src/core/spatialindex/geometry/LineSegment.cc (working copy) @@ -177,8 +177,8 @@ for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ ) { coords[cDim] = - ( std::abs( m_pStartPoint[cDim] - m_pEndPoint[cDim] ) / 2.0 ) + - std::min( m_pStartPoint[cDim], m_pEndPoint[cDim] ); + ( qAbs( m_pStartPoint[cDim] - m_pEndPoint[cDim] ) / 2.0 ) + + qMin( m_pStartPoint[cDim], m_pEndPoint[cDim] ); } out = Point( coords, m_dimension ); @@ -198,8 +198,8 @@ for ( unsigned long cDim = 0; cDim < m_dimension; cDim++ ) { - low[cDim] = std::min( m_pStartPoint[cDim], m_pEndPoint[cDim] ); - high[cDim] = std::max( m_pStartPoint[cDim], m_pEndPoint[cDim] ); + low[cDim] = qMin( m_pStartPoint[cDim], m_pEndPoint[cDim] ); + high[cDim] = qMax( m_pStartPoint[cDim], m_pEndPoint[cDim] ); } out = Region( low, high, m_dimension ); @@ -247,10 +247,10 @@ ); if ( m_pEndPoint[0] >= m_pStartPoint[0] - std::numeric_limits::epsilon() && - m_pEndPoint[0] <= m_pStartPoint[0] + std::numeric_limits::epsilon() ) return std::abs( p.m_pCoords[0] - m_pStartPoint[0] ); + m_pEndPoint[0] <= m_pStartPoint[0] + std::numeric_limits::epsilon() ) return qAbs( p.m_pCoords[0] - m_pStartPoint[0] ); if ( m_pEndPoint[1] >= m_pStartPoint[1] - std::numeric_limits::epsilon() && - m_pEndPoint[1] <= m_pStartPoint[1] + std::numeric_limits::epsilon() ) return std::abs( p.m_pCoords[1] - m_pStartPoint[1] ); + m_pEndPoint[1] <= m_pStartPoint[1] + std::numeric_limits::epsilon() ) return qAbs( p.m_pCoords[1] - m_pStartPoint[1] ); double x1 = m_pStartPoint[0]; double x2 = m_pEndPoint[0]; @@ -259,7 +259,7 @@ double y2 = m_pEndPoint[1]; double y0 = p.m_pCoords[1]; - return std::abs(( x2 - x1 ) *( y1 - y0 ) - ( x1 - x0 ) *( y2 - y1 ) ) / ( std::sqrt(( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 ) ) ); + return qAbs(( x2 - x1 ) *( y1 - y0 ) - ( x1 - x0 ) *( y2 - y1 ) ) / ( std::sqrt(( x2 - x1 ) *( x2 - x1 ) + ( y2 - y1 ) *( y2 - y1 ) ) ); } // assuming moving from start to end, positive distance is from right hand side. @@ -325,7 +325,7 @@ coords[1] = r.m_pLow[1]; double d4 = getRelativeMinimumDistance( Point( coords, 2 ) ); - return std::max( d1, std::max( d2, std::max( d3, d4 ) ) ); + return qMax( d1, qMax( d2, qMax( d3, d4 ) ) ); } double Tools::Geometry::LineSegment::getAngleOfPerpendicularRay() Index: src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp =================================================================== --- src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp (revision 14711) +++ src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp (working copy) @@ -25,7 +25,7 @@ #include #include // for legend #include // for jenks classification -#include "math.h" // for pretty classification +#include // for pretty classification QgsRendererRangeV2::QgsRendererRangeV2( double lowerValue, double upperValue, QgsSymbolV2* symbol, QString label ) : mLowerValue( lowerValue ), mUpperValue( upperValue ), mSymbol( symbol ), mLabel( label ) Index: src/core/symbology-ng/qgssymbollayerv2utils.cpp =================================================================== --- src/core/symbology-ng/qgssymbollayerv2utils.cpp (revision 14711) +++ src/core/symbology-ng/qgssymbollayerv2utils.cpp (working copy) @@ -313,7 +313,7 @@ static QPointF linesIntersection( QPointF p1, double t1, QPointF p2, double t2 ) { // parallel lines? (or the difference between angles is less than cca 0.1 degree) - if (( t1 == DBL_MAX && t2 == DBL_MAX ) || fabs( t1 - t2 ) < 0.001 ) + if (( t1 == DBL_MAX && t2 == DBL_MAX ) || qAbs( t1 - t2 ) < 0.001 ) return QPointF(); double x, y; Index: src/core/qgscoordinatereferencesystem.cpp =================================================================== --- src/core/qgscoordinatereferencesystem.cpp (revision 14711) +++ src/core/qgscoordinatereferencesystem.cpp (working copy) @@ -747,7 +747,7 @@ static const double feetToMeter = 0.3048; static const double smallNum = 1e-3; - if ( std::abs( toMeter - feetToMeter ) < smallNum ) + if ( qAbs( toMeter - feetToMeter ) < smallNum ) unit = "Foot"; QgsDebugMsg( "Projection has linear units of " + unit ); Index: src/core/composer/qgscomposerpicture.cpp =================================================================== --- src/core/composer/qgscomposerpicture.cpp (revision 14711) +++ src/core/composer/qgscomposerpicture.cpp (working copy) @@ -86,8 +86,8 @@ //make nicer preview if ( mComposition && mComposition->plotStyle() == QgsComposition::Preview ) { - boundImageWidth *= std::min( viewScaleFactor, 10.0 ); - boundImageHeight *= std::min( viewScaleFactor, 10.0 ); + boundImageWidth *= qMin( viewScaleFactor, 10.0 ); + boundImageHeight *= qMin( viewScaleFactor, 10.0 ); } mImage = QImage( boundImageWidth, boundImageHeight, QImage::Format_ARGB32 ); updateImageFromSvg(); Index: src/core/composer/qgscomposermap.cpp =================================================================== --- src/core/composer/qgscomposermap.cpp (revision 14711) +++ src/core/composer/qgscomposermap.cpp (working copy) @@ -1292,16 +1292,16 @@ for ( ; it != xLines.constEnd(); ++it ) { currentAnnotationString = QString::number( it->first, 'f', mGridAnnotationPrecision ); - currentExtension = std::max( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) ); - maxExtension = std::max( maxExtension, currentExtension ); + currentExtension = qMax( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) ); + maxExtension = qMax( maxExtension, currentExtension ); } it = yLines.constBegin(); for ( ; it != yLines.constEnd(); ++it ) { currentAnnotationString = QString::number( it->first, 'f', mGridAnnotationPrecision ); - currentExtension = std::max( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) ); - maxExtension = std::max( maxExtension, currentExtension ); + currentExtension = qMax( textWidthMillimeters( mGridAnnotationFont, currentAnnotationString ), fontAscentMillimeters( mGridAnnotationFont ) ); + maxExtension = qMax( maxExtension, currentExtension ); } return maxExtension + mAnnotationFrameDistance; Index: src/core/composer/qgscomposerlegend.cpp =================================================================== --- src/core/composer/qgscomposerlegend.cpp (revision 14711) +++ src/core/composer/qgscomposerlegend.cpp (working copy) @@ -163,7 +163,7 @@ p->setPen( QColor( 0, 0, 0 ) ); drawText( p, mBoxSpace, currentYCoord, groupItem->text(), mGroupFont ); - maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mGroupFont, groupItem->text() ) ); + maxXCoord = qMax( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mGroupFont, groupItem->text() ) ); //children can be other group items or layer items int numChildItems = groupItem->rowCount(); @@ -212,7 +212,7 @@ drawText( p, mBoxSpace, currentYCoord, layerItem->text(), mLayerFont ); } - maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, layerItem->text() ) ); + maxXCoord = qMax( maxXCoord, 2 * mBoxSpace + textWidthMillimeters( mLayerFont, layerItem->text() ) ); } //and child items drawLayerChildItems( p, layerItem, currentYCoord, maxXCoord, opacity ); @@ -235,7 +235,7 @@ } //standerd item height - double itemHeight = std::max( mSymbolHeight, fontAscentMillimeters( mItemFont ) ); + double itemHeight = qMax( mSymbolHeight, fontAscentMillimeters( mItemFont ) ); QStandardItem* currentItem; @@ -275,13 +275,13 @@ { //draw symbol drawSymbol( p, symbol, currentYCoord + ( itemHeight - mSymbolHeight ) / 2, currentXCoord, realSymbolHeight, layerOpacity ); - realItemHeight = std::max( realSymbolHeight, itemHeight ); + realItemHeight = qMax( realSymbolHeight, itemHeight ); currentXCoord += mIconLabelSpace; } else if ( symbolNg ) //item with symbol NG? { drawSymbolV2( p, symbolNg, currentYCoord + ( itemHeight - mSymbolHeight ) / 2, currentXCoord, realSymbolHeight, layerOpacity ); - realItemHeight = std::max( realSymbolHeight, itemHeight ); + realItemHeight = qMax( realSymbolHeight, itemHeight ); currentXCoord += mIconLabelSpace; } else //item with icon? @@ -304,7 +304,7 @@ } currentXCoord += mBoxSpace; - maxXCoord = std::max( maxXCoord, currentXCoord ); + maxXCoord = qMax( maxXCoord, currentXCoord ); currentYCoord += realItemHeight; } Index: src/core/composer/qgscomposerarrow.cpp =================================================================== --- src/core/composer/qgscomposerarrow.cpp (revision 14711) +++ src/core/composer/qgscomposerarrow.cpp (working copy) @@ -19,19 +19,24 @@ #include #include -#ifndef Q_OS_MACX #include -#else -#include -#endif -QgsComposerArrow::QgsComposerArrow( QgsComposition* c ): QgsComposerItem( c ), mStartPoint( 0, 0 ), mStopPoint( 0, 0 ), mMarkerMode( DefaultMarker ), mArrowColor( QColor( 0, 0, 0 ) ) +QgsComposerArrow::QgsComposerArrow( QgsComposition* c ) + : QgsComposerItem( c ) + , mStartPoint( 0, 0 ) + , mStopPoint( 0, 0 ) + , mMarkerMode( DefaultMarker ) + , mArrowColor( QColor( 0, 0, 0 ) ) { initGraphicsSettings(); } -QgsComposerArrow::QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c ): QgsComposerItem( c ), mStartPoint( startPoint ), \ - mStopPoint( stopPoint ), mMarkerMode( DefaultMarker ), mArrowColor( QColor( 0, 0, 0 ) ) +QgsComposerArrow::QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c ) + : QgsComposerItem( c ) + , mStartPoint( startPoint ) + , mStopPoint( stopPoint ) + , mMarkerMode( DefaultMarker ) + , mArrowColor( QColor( 0, 0, 0 ) ) { initGraphicsSettings(); adaptItemSceneRect(); @@ -134,8 +139,8 @@ //make nicer preview if ( mComposition && mComposition->plotStyle() == QgsComposition::Preview ) { - imageWidth *= std::min( viewScaleFactor, 10.0 ); - imageHeight *= std::min( viewScaleFactor, 10.0 ); + imageWidth *= qMin( viewScaleFactor, 10.0 ); + imageHeight *= qMin( viewScaleFactor, 10.0 ); } QImage markerImage( imageWidth, imageHeight, QImage::Format_ARGB32 ); QColor markerBG( 255, 255, 255, 0 ); //transparent white background @@ -251,8 +256,8 @@ void QgsComposerArrow::adaptItemSceneRect() { //rectangle containing start and end point - QRectF rect = QRectF( std::min( mStartPoint.x(), mStopPoint.x() ), std::min( mStartPoint.y(), mStopPoint.y() ), \ - fabs( mStopPoint.x() - mStartPoint.x() ), fabs( mStopPoint.y() - mStartPoint.y() ) ); + QRectF rect = QRectF( qMin( mStartPoint.x(), mStopPoint.x() ), qMin( mStartPoint.y(), mStopPoint.y() ), \ + qAbs( mStopPoint.x() - mStartPoint.x() ), qAbs( mStopPoint.y() - mStartPoint.y() ) ); double enlarge = 0; if ( mMarkerMode == DefaultMarker ) { @@ -264,8 +269,8 @@ } else if ( mMarkerMode == SVGMarker ) { - double maxArrowHeight = std::max( mStartArrowHeadHeight, mStopArrowHeadHeight ); - enlarge = mPen.widthF() / 2 + std::max( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 ); + double maxArrowHeight = qMax( mStartArrowHeadHeight, mStopArrowHeadHeight ); + enlarge = mPen.widthF() / 2 + qMax( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 ); } rect.adjust( -enlarge, -enlarge, enlarge, enlarge ); Index: src/core/composer/qgscomposeritem.cpp =================================================================== --- src/core/composer/qgscomposeritem.cpp (revision 14711) +++ src/core/composer/qgscomposeritem.cpp (working copy) @@ -31,11 +31,7 @@ #include "qgsrectangle.h" //just for debugging #include "qgslogger.h" -#ifndef Q_OS_MACX #include -#else -#include -#endif #define FONT_WORKAROUND_SCALE 10 //scale factor for upscaling fontsize and downscaling painter @@ -346,7 +342,7 @@ double diffY = mouseMoveStopPoint.y() - mMouseMoveStartPos.y(); //it was only a click - if ( abs( diffX ) < std::numeric_limits::min() && abs( diffY ) < std::numeric_limits::min() ) + if ( qAbs( diffX ) < std::numeric_limits::min() && qAbs( diffY ) < std::numeric_limits::min() ) { return; } @@ -892,7 +888,7 @@ bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height ) const { - if ( abs( mRotation ) <= 0 ) //width and height stays the same if there is no rotation + if ( qAbs( mRotation ) <= 0.0 ) //width and height stays the same if there is no rotation { return true; } Index: src/core/qgstolerance.cpp =================================================================== --- src/core/qgstolerance.cpp (revision 14711) +++ src/core/qgstolerance.cpp (working copy) @@ -16,10 +16,8 @@ #include "qgstolerance.h" #include #include -#include +#include - - double QgsTolerance::toleranceInMapUnits( double tolerance, QgsMapLayer* layer, QgsMapRenderer* renderer, UnitType units ) { if ( units == MapUnits ) Index: src/mapserver/qgswmsserver.cpp =================================================================== --- src/mapserver/qgswmsserver.cpp (revision 14711) +++ src/mapserver/qgswmsserver.cpp (working copy) @@ -1146,7 +1146,7 @@ } //finally draw text - double symbolItemHeight = std::max( itemFontMetrics.ascent() / fontOversamplingFactor, currentSymbolHeight ); + double symbolItemHeight = qMax( itemFontMetrics.ascent() / fontOversamplingFactor, currentSymbolHeight ); if ( p ) { Index: src/mapserver/qgssldrule.cpp =================================================================== --- src/mapserver/qgssldrule.cpp (revision 14711) +++ src/mapserver/qgssldrule.cpp (working copy) @@ -26,7 +26,7 @@ #include #include #include -#include +#include QgsSLDRule::QgsSLDRule( double minDenom, double maxDenom, const QgsSymbol& s, const QgsFilter* f ): mSymbol( s ), mMinScaleDenominator( minDenom ), mMaxScaleDenominator( maxDenom ) { @@ -54,7 +54,7 @@ { //first find out the value for the scale classification attribute const QgsAttributeMap& attrs = f.attributeMap(); - fieldScale = sqrt( fabs( attrs[mSymbol.scaleClassificationField()].toDouble() ) ); + fieldScale = sqrt( qAbs( attrs[mSymbol.scaleClassificationField()].toDouble() ) ); } *pic = mSymbol.getPointSymbolAsImage( widthScale, selected, selectionColor, fieldScale, rotation, rasterScaleFactor ); Index: src/providers/grass/qgsgrassrasterprovider.cpp =================================================================== --- src/providers/grass/qgsgrassrasterprovider.cpp (revision 14711) +++ src/providers/grass/qgsgrassrasterprovider.cpp (working copy) @@ -23,7 +23,7 @@ #include "qgsgrassrasterprovider.h" #include "qgsconfig.h" -#include +#include #include "qgsapplication.h" #include "qgscoordinatetransform.h" Index: src/providers/wms/qgswmsprovider.cpp =================================================================== --- src/providers/wms/qgswmsprovider.cpp (revision 14711) +++ src/providers/wms/qgswmsprovider.cpp (working copy) @@ -26,7 +26,7 @@ #include "qgslogger.h" #include "qgswmsprovider.h" -#include +#include #include "qgscoordinatetransform.h" #include "qgsrectangle.h" @@ -552,10 +552,10 @@ double tres = mResolutions[i]; // clip view extent to layer extent - double xmin = std::max( viewExtent.xMinimum(), layerExtent.xMinimum() ); - double ymin = std::max( viewExtent.yMinimum(), layerExtent.yMinimum() ); - double xmax = std::min( viewExtent.xMaximum(), layerExtent.xMaximum() ); - double ymax = std::min( viewExtent.yMaximum(), layerExtent.yMaximum() ); + double xmin = qMax( viewExtent.xMinimum(), layerExtent.xMinimum() ); + double ymin = qMax( viewExtent.yMinimum(), layerExtent.yMinimum() ); + double xmax = qMin( viewExtent.xMaximum(), layerExtent.xMaximum() ); + double ymax = qMin( viewExtent.yMaximum(), layerExtent.yMaximum() ); // snap to tile coordinates double x0 = floor(( xmin - layerExtent.xMinimum() ) / mTileWidth / tres ) * mTileWidth * tres + layerExtent.xMinimum() + mTileWidth * tres * 0.001; @@ -2251,7 +2251,7 @@ myMetadataQString += ""; // Layer Coordinate Reference Systems - for ( int j = 0; j < std::min( layer.crs.size(), 10 ); j++ ) + for ( int j = 0; j < qMin( layer.crs.size(), 10 ); j++ ) { myMetadataQString += ""; myMetadataQString += tr( "Available in CRS" );