Skip to content
Permalink
Browse files

remove useless cast

(int) x + y => static_cast<int>(x) + y
precedence is higher for casting
see https://en.cppreference.com/w/cpp/language/operator_precedence
  • Loading branch information
3nids committed Sep 19, 2018
1 parent fde813c commit 269bf02da8521a9a399ced6d0404ad9d9ddb9000
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/app/qgsstatusbarmagnifierwidget.cpp
  2. +2 −2 src/gui/qgsadvanceddigitizingcanvasitem.cpp
@@ -68,7 +68,7 @@ QgsStatusBarMagnifierWidget::QgsStatusBarMagnifierWidget( QWidget *parent )

void QgsStatusBarMagnifierWidget::setDefaultFactor( double factor )
{
mSpinBox->setClearValue( ( int )100 * factor );
mSpinBox->setClearValue( 100 * factor );
}

void QgsStatusBarMagnifierWidget::setFont( const QFont &myFont )
@@ -142,8 +142,8 @@ void QgsAdvancedDigitizingCanvasItem::paint( QPainter *painter )
painter->drawArc( prevPointPix.x() - 20,
prevPointPix.y() - 20,
40, 40,
( int )16 * -a0 * 180 / M_PI,
( int )16 * ( a0 - a ) * 180 / M_PI );
16 * -a0 * 180 / M_PI,
16 * ( a0 - a ) * 180 / M_PI );
painter->drawLine( prevPointPix.x(),
prevPointPix.y(),
prevPointPix.x() + 60 * std::cos( a0 ),

0 comments on commit 269bf02

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