Skip to content

Commit

Permalink
remove useless cast
Browse files Browse the repository at this point in the history
(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 269bf02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsstatusbarmagnifierwidget.cpp
Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsadvanceddigitizingcanvasitem.cpp
Expand Up @@ -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 ),
Expand Down

0 comments on commit 269bf02

Please sign in to comment.