Skip to content
Permalink
Browse files

Add more missing std:: prefixes

  • Loading branch information
nyalldawson committed Aug 24, 2017
1 parent 891d612 commit c19418c4479b3eb0a637035f6fd79644f7c1fb34
Showing with 141 additions and 141 deletions.
  1. +1 −1 src/analysis/network/qgsvectorlayerdirector.cpp
  2. +1 −1 src/analysis/raster/qgsalignraster.cpp
  3. +1 −1 src/analysis/raster/qgshillshadefilter.cpp
  4. +2 −2 src/analysis/raster/qgskde.cpp
  5. +5 −5 src/analysis/raster/qgsrastermatrix.cpp
  6. +2 −2 src/analysis/raster/qgsrelief.cpp
  7. +1 −1 src/analysis/raster/qgsruggednessfilter.cpp
  8. +1 −1 src/analysis/raster/qgsslopefilter.cpp
  9. +3 −3 src/app/dwg/qgsdwgimporter.cpp
  10. +1 −1 src/app/qgsdecorationgrid.cpp
  11. +1 −1 src/app/qgsdecorationscalebar.cpp
  12. +1 −1 src/app/qgsmeasuredialog.cpp
  13. +1 −1 src/app/qgspointrotationitem.cpp
  14. +1 −1 src/core/composer/qgscomposeritem.cpp
  15. +1 −1 src/core/composer/qgscomposermapgrid.cpp
  16. +1 −1 src/core/composer/qgscomposernodesitem.cpp
  17. +5 −5 src/core/composer/qgscomposerscalebar.cpp
  18. +4 −4 src/core/composer/qgscomposerutils.cpp
  19. +11 −11 src/core/composer/qgscomposition.cpp
  20. +1 −1 src/core/effects/qgsimageoperation.cpp
  21. +11 −11 src/core/expression/qgsexpressionfunction.cpp
  22. +1 −1 src/core/expression/qgsexpressionnodeimpl.cpp
  23. +1 −1 src/core/geometry/qgscircularstring.cpp
  24. +1 −1 src/core/geometry/qgsellipse.cpp
  25. +1 −1 src/core/geometry/qgsgeometry.cpp
  26. +2 −2 src/core/geometry/qgsgeometryutils.cpp
  27. +2 −2 src/core/geometry/qgsgeos.cpp
  28. +6 −6 src/core/geometry/qgspoint.cpp
  29. +1 −1 src/core/geometry/qgsrectangle.cpp
  30. +3 −3 src/core/geometry/qgstriangle.cpp
  31. +1 −1 src/core/layout/qgslayoututils.cpp
  32. +1 −1 src/core/pal/feature.cpp
  33. +1 −1 src/core/pal/geomfunction.h
  34. +1 −1 src/core/pal/labelposition.cpp
  35. +2 −2 src/core/qgis.h
  36. +1 −1 src/core/qgscolorramp.cpp
  37. +1 −1 src/core/qgscoordinateutils.cpp
  38. +1 −1 src/core/qgsdiagramrenderer.cpp
  39. +7 −7 src/core/qgsdistancearea.cpp
  40. +1 −1 src/core/qgshistogram.cpp
  41. +1 −1 src/core/qgsmapsettingsutils.cpp
  42. +2 −2 src/core/qgspallabeling.cpp
  43. +5 −5 src/core/qgspointxy.cpp
  44. +1 −1 src/core/qgsscalecalculator.cpp
  45. +2 −2 src/core/qgstolerance.cpp
  46. +1 −1 src/core/qgsvector.cpp
  47. +2 −2 src/core/raster/qgscolorrampshader.cpp
  48. +1 −1 src/core/raster/qgshillshaderenderer.cpp
  49. +1 −1 src/core/raster/qgsrasterchecker.cpp
  50. +1 −1 src/core/raster/qgsrasterinterface.h
  51. +1 −1 src/core/simplify/effectivearea.cpp
  52. +2 −2 src/core/symbology/qgsarrowsymbollayer.cpp
  53. +2 −2 src/core/symbology/qgsheatmaprenderer.cpp
  54. +2 −2 src/core/symbology/qgslinesymbollayer.cpp
  55. +1 −1 src/core/symbology/qgssymbollayerutils.cpp
  56. +1 −1 src/gui/qgsadvanceddigitizingdockwidget.cpp
  57. +13 −13 src/gui/qgscolorwidgets.cpp
  58. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrycheck.cpp
  59. +1 −1 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  60. +3 −3 src/plugins/georeferencer/qgsresidualplotitem.cpp
  61. +1 −1 src/providers/gdal/qgsgdalprovider.cpp
  62. +4 −4 src/providers/wms/qgswmsprovider.cpp
@@ -50,7 +50,7 @@ class QgsPointCompare
double tx1 = std::ceil( p1.x() / mTolerance );
double tx2 = std::ceil( p2.x() / mTolerance );
if ( tx1 == tx2 )
return ceil( p1.y() / mTolerance ) < std::ceil( p2.y() / mTolerance );
return std::ceil( p1.y() / mTolerance ) < std::ceil( p2.y() / mTolerance );
return tx1 < tx2;
}

@@ -40,7 +40,7 @@ static double floor_with_tolerance( double value )
if ( std::fabs( value - std::round( value ) ) < 1e-6 )
return std::round( value );
else
return floor( value );
return std::floor( value );
}

static double fmod_with_tolerance( double num, double denom )
@@ -38,7 +38,7 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
}

float zenith_rad = mLightAngle * M_PI / 180.0;
float slope_rad = atan( std::sqrt( derX * derX + derY * derY ) );
float slope_rad = std::atan( std::sqrt( derX * derX + derY * derY ) );
float azimuth_rad = mLightAzimuth * M_PI / 180.0;
float aspect_rad = 0;
if ( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions?
@@ -330,7 +330,7 @@ double QgsKernelDensityEstimation::quarticKernel( const double distance, const d
return k * ( 15. / 16. ) * std::pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
}
case OutputRaw:
return pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
return std::pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
}
return 0.0; //no, seriously, I told you NO WARNINGS!
}
@@ -348,7 +348,7 @@ double QgsKernelDensityEstimation::triweightKernel( const double distance, const
return k * ( 35. / 32. ) * std::pow( 1. - std::pow( distance / bandwidth, 2 ), 3 );
}
case OutputRaw:
return pow( 1. - std::pow( distance / bandwidth, 2 ), 3 );
return std::pow( 1. - std::pow( distance / bandwidth, 2 ), 3 );
}
return 0.0; // this is getting ridiculous... don't you ever listen to a word I say?
}
@@ -226,16 +226,16 @@ bool QgsRasterMatrix::oneArgumentOperation( OneArgOperator op )
mData[i] = std::cos( value );
break;
case opTAN:
mData[i] = tan( value );
mData[i] = std::tan( value );
break;
case opASIN:
mData[i] = asin( value );
mData[i] = std::asin( value );
break;
case opACOS:
mData[i] = acos( value );
mData[i] = std::acos( value );
break;
case opATAN:
mData[i] = atan( value );
mData[i] = std::atan( value );
break;
case opSIGN:
mData[i] = -value;
@@ -292,7 +292,7 @@ double QgsRasterMatrix::calculateTwoArgumentOp( TwoArgOperator op, double arg1,
}
else
{
return pow( arg1, arg2 );
return std::pow( arg1, arg2 );
}
case opEQ:
return ( arg1 == arg2 ? 1.0 : 0.0 );
@@ -560,7 +560,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString &file )
//log10 transformation for all frequency values
for ( int i = 0; i < 252; ++i )
{
frequency[i] = log10( frequency[i] );
frequency[i] = std::log10( frequency[i] );
}

//write out frequency values to csv file for debugging
@@ -651,7 +651,7 @@ QList< QgsRelief::ReliefColor > QgsRelief::calculateOptimizedReliefClasses()
//log10 transformation for all frequency values
for ( int i = 0; i < 252; ++i )
{
frequency[i] = log10( frequency[i] );
frequency[i] = std::log10( frequency[i] );
}

//start with 9 uniformly distributed classes
@@ -83,6 +83,6 @@ float QgsRuggednessFilter::processNineCellWindow( float *x11, float *x21, float
sum += ( *x33 - *x22 ) * ( *x33 - *x22 );
}

return sqrt( sum );
return std::sqrt( sum );
}

@@ -34,6 +34,6 @@ float QgsSlopeFilter::processNineCellWindow( float *x11, float *x21, float *x31,
return mOutputNodataValue;
}

return atan( std::sqrt( derX * derX + derY * derY ) ) * 180.0 / M_PI;
return std::atan( std::sqrt( derX * derX + derY * derY ) ) * 180.0 / M_PI;
}

@@ -1441,7 +1441,7 @@ bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoun
{
size_t i1 = ( i + 1 ) % vertexnum;

double a = 2.0 * atan( data.vertlist[i]->bulge );
double a = 2.0 * std::atan( data.vertlist[i]->bulge );
double dx = data.vertlist[i1]->x - data.vertlist[i0]->x;
double dy = data.vertlist[i1]->y - data.vertlist[i0]->y;
double c = std::sqrt( dx * dx + dy * dy );
@@ -1552,7 +1552,7 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )

if ( hasBulge )
{
double a = 2.0 * atan( data.vertlist[i]->bulge );
double a = 2.0 * std::atan( data.vertlist[i]->bulge );
double dx = p1.x() - p0.x();
double dy = p1.y() - p0.y();
double c = std::sqrt( dx * dx + dy * dy );
@@ -1753,7 +1753,7 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )

if ( hasBulge )
{
double a = 2.0 * atan( data.vertlist[i]->bulge );
double a = 2.0 * std::atan( data.vertlist[i]->bulge );
double dx = p1.x() - p0.x();
double dy = p1.y() - p0.y();
double dz = p1.z() - p0.z();
@@ -787,7 +787,7 @@ bool QgsDecorationGrid::getIntervalFromExtent( double *values, bool useXAxis )
if ( !qgsDoubleNear( interval, 0.0 ) )
{
double interval2 = 0;
int factor = std::pow( 10, std::floor( log10( interval ) ) );
int factor = std::pow( 10, std::floor( std::log10( interval ) ) );
if ( factor != 0 )
{
interval2 = std::round( interval / factor ) * factor;
@@ -158,7 +158,7 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender

// Work out the exponent for the number - e.g, 1234 will give 3,
// and .001234 will give -3
double myPowerOf10 = std::floor( log10( myActualSize ) );
double myPowerOf10 = std::floor( std::log10( myActualSize ) );

// snap to integer < 10 times power of 10
if ( mSnapping )
@@ -280,7 +280,7 @@ QString QgsMeasureDialog::formatDistance( double distance, bool convertUnits ) c
{
// special handling for degrees - because we can't use smaller units (eg m->mm), we need to make sure there's
// enough decimal places to show a usable measurement value
int minPlaces = std::round( log10( 1.0 / distance ) ) + 1;
int minPlaces = std::round( std::log10( 1.0 / distance ) ) + 1;
decimals = qMax( decimals, minPlaces );
}
return QgsDistanceArea::formatDistance( distance, decimals, mDistanceUnits, baseUnit );
@@ -55,7 +55,7 @@ void QgsPointRotationItem::paint( QPainter *painter )
if ( mPixmap.width() > 0 && mPixmap.height() > 0 )
{
h = std::sqrt( ( double ) mPixmap.width() * mPixmap.width() + mPixmap.height() * mPixmap.height() ) / 2; //the half of the item diagonal
dAngel = acos( mPixmap.width() / ( h * 2 ) ) * 180 / M_PI; //the diagonal angel of the original rect
dAngel = std::acos( mPixmap.width() / ( h * 2 ) ) * 180 / M_PI; //the diagonal angel of the original rect
x = h * std::cos( ( painterRotation( mRotation ) - dAngel ) * M_PI / 180 );
y = h * std::sin( ( painterRotation( mRotation ) - dAngel ) * M_PI / 180 );
}
@@ -1012,7 +1012,7 @@ void QgsComposerItem::setItemRotation( const double r, const bool adjustPosition
mItemRotation = r;
if ( mItemRotation >= 360.0 || mItemRotation <= -360.0 )
{
mItemRotation = fmod( mItemRotation, 360.0 );
mItemRotation = std::fmod( mItemRotation, 360.0 );
}

QgsExpressionContext context = createExpressionContext();
@@ -1426,7 +1426,7 @@ QString QgsComposerMapGrid::gridAnnotationString( double value, QgsComposerMapGr
( mGridAnnotationFormat == QgsComposerMapGrid::Decimal || mGridAnnotationFormat == QgsComposerMapGrid::DecimalWithSuffix ) )
{
// wrap around longitudes > 180 or < -180 degrees, so that, e.g., "190E" -> "170W"
double wrappedX = fmod( value, 360.0 );
double wrappedX = std::fmod( value, 360.0 );
if ( wrappedX > 180.0 )
{
value = wrappedX - 360.0;
@@ -50,7 +50,7 @@ QgsComposerNodesItem::QgsComposerNodesItem( const QString &tagName,
double QgsComposerNodesItem::computeDistance( QPointF pt1,
QPointF pt2 ) const
{
return sqrt( std::pow( pt1.x() - pt2.x(), 2 ) + std::pow( pt1.y() - pt2.y(), 2 ) );
return std::sqrt( std::pow( pt1.x() - pt2.x(), 2 ) + std::pow( pt1.y() - pt2.y(), 2 ) );
}

bool QgsComposerNodesItem::addNode( QPointF pt,
@@ -262,15 +262,15 @@ void QgsComposerScaleBar::refreshDataDefinedProperty( const QgsComposerObject::D
// nextNiceNumber(4573.23, d) = 5000 (d=1) -> 4600 (d=10) -> 4580 (d=100) -> 4574 (d=1000) -> etc
inline double nextNiceNumber( double a, double d = 1 )
{
double s = std::pow( 10.0, std::floor( log10( a ) ) ) / d;
return ceil( a / s ) * s;
double s = std::pow( 10.0, std::floor( std::log10( a ) ) ) / d;
return std::ceil( a / s ) * s;
}

// prevNiceNumber(4573.23, d) = 4000 (d=1) -> 4500 (d=10) -> 4570 (d=100) -> 4573 (d=1000) -> etc
inline double prevNiceNumber( double a, double d = 1 )
{
double s = std::pow( 10.0, std::floor( log10( a ) ) ) / d;
return floor( a / s ) * s;
double s = std::pow( 10.0, std::floor( std::log10( a ) ) ) / d;
return std::floor( a / s ) * s;
}

void QgsComposerScaleBar::refreshSegmentMillimeters()
@@ -473,7 +473,7 @@ void QgsComposerScaleBar::applyDefaultSize( QgsUnitTypes::DistanceUnit u )
}

double segmentWidth = initialUnitsPerSegment / upperMagnitudeMultiplier;
int segmentMagnitude = std::floor( log10( segmentWidth ) );
int segmentMagnitude = std::floor( std::log10( segmentWidth ) );
double unitsPerSegment = upperMagnitudeMultiplier * ( std::pow( 10.0, segmentMagnitude ) );
double multiplier = std::floor( ( widthInSelectedUnits / ( unitsPerSegment * 10.0 ) ) / 2.5 ) * 2.5;

@@ -42,9 +42,9 @@ void QgsComposerUtils::drawArrowHead( QPainter *p, const double x, const double
QPointF p2 = QPointF( arrowHeadWidth / 2.0, arrowHeadWidth );

QPointF p1Rotated, p2Rotated;
p1Rotated.setX( p1.x() * std::cos( angleRad ) + p1.y() * -sin( angleRad ) );
p1Rotated.setX( p1.x() * std::cos( angleRad ) + p1.y() * -std::sin( angleRad ) );
p1Rotated.setY( p1.x() * std::sin( angleRad ) + p1.y() * std::cos( angleRad ) );
p2Rotated.setX( p2.x() * std::cos( angleRad ) + p2.y() * -sin( angleRad ) );
p2Rotated.setX( p2.x() * std::cos( angleRad ) + p2.y() * -std::sin( angleRad ) );
p2Rotated.setY( p2.x() * std::sin( angleRad ) + p2.y() * std::cos( angleRad ) );

QPolygonF arrowHeadPoly;
@@ -76,7 +76,7 @@ double QgsComposerUtils::angle( QPointF p1, QPointF p2 )
return 0;
}

double angle = acos( ( -yDiff * length ) / ( length * length ) ) * 180 / M_PI;
double angle = std::acos( ( -yDiff * length ) / ( length * length ) ) * 180 / M_PI;
if ( xDiff < 0 )
{
return ( 360 - angle );
@@ -99,7 +99,7 @@ double QgsComposerUtils::normalizedAngle( const double angle )
double clippedAngle = angle;
if ( clippedAngle >= 360.0 || clippedAngle <= -360.0 )
{
clippedAngle = fmod( clippedAngle, 360.0 );
clippedAngle = std::fmod( clippedAngle, 360.0 );
}
if ( clippedAngle < 0.0 )
{
@@ -565,7 +565,7 @@ QPointF QgsComposition::positionOnPage( QPointF position ) const
else
{
//y coordinate is less then the end of the last page
y = fmod( position.y(), ( paperHeight() + spaceBetweenPages() ) );
y = std::fmod( position.y(), ( paperHeight() + spaceBetweenPages() ) );
}
return QPointF( position.x(), y );
}
@@ -1170,7 +1170,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlacePt )
{
newLabel->setItemPosition( newLabel->pos().x(), fmod( newLabel->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newLabel->setItemPosition( newLabel->pos().x(), std::fmod( newLabel->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newLabel->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1203,7 +1203,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newMap->setItemPosition( newMap->pos().x(), fmod( newMap->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newMap->setItemPosition( newMap->pos().x(), std::fmod( newMap->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newMap->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1247,7 +1247,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newArrow->setItemPosition( newArrow->pos().x(), fmod( newArrow->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newArrow->setItemPosition( newArrow->pos().x(), std::fmod( newArrow->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newArrow->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1275,7 +1275,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newScaleBar->setItemPosition( newScaleBar->pos().x(), fmod( newScaleBar->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newScaleBar->setItemPosition( newScaleBar->pos().x(), std::fmod( newScaleBar->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newScaleBar->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1305,7 +1305,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newShape->setItemPosition( newShape->pos().x(), fmod( newShape->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newShape->setItemPosition( newShape->pos().x(), std::fmod( newShape->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newShape->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1335,7 +1335,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newPolygon->setItemPosition( newPolygon->pos().x(), fmod( newPolygon->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPolygon->setItemPosition( newPolygon->pos().x(), std::fmod( newPolygon->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPolygon->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1366,7 +1366,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newPolyline->setItemPosition( newPolyline->pos().x(), fmod( newPolyline->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPolyline->setItemPosition( newPolyline->pos().x(), std::fmod( newPolyline->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPolyline->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1396,7 +1396,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newPicture->setItemPosition( newPicture->pos().x(), fmod( newPicture->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPicture->setItemPosition( newPicture->pos().x(), std::fmod( newPicture->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newPicture->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -1424,7 +1424,7 @@ void QgsComposition::addItemsFromXml( const QDomElement &elem, const QDomDocumen
{
if ( pasteInPlace )
{
newLegend->setItemPosition( newLegend->pos().x(), fmod( newLegend->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newLegend->setItemPosition( newLegend->pos().x(), std::fmod( newLegend->pos().y(), ( paperHeight() + spaceBetweenPages() ) ) );
newLegend->move( pasteInPlacePt->x(), pasteInPlacePt->y() );
}
else
@@ -3152,7 +3152,7 @@ void QgsComposition::computeWorldFileParameters( const QRectF &exportRegion, dou
// rotation matrix
double r[6];
r[0] = std::cos( alpha );
r[1] = -sin( alpha );
r[1] = -std::sin( alpha );
r[2] = xCenter * ( 1 - std::cos( alpha ) ) + yCenter * std::sin( alpha );
r[3] = std::sin( alpha );
r[4] = std::cos( alpha );
@@ -770,7 +770,7 @@ double *QgsImageOperation::createGaussianKernel( const int radius )
double result;
for ( int i = 0; i <= radius; ++i )
{
result = coefficient * exp( i * i * expCoefficient );
result = coefficient * std::exp( i * i * expCoefficient );
kernel[ radius - i ] = result;
sum += result;
if ( i > 0 )

0 comments on commit c19418c

Please sign in to comment.
You can’t perform that action at this time.