Skip to content

Commit

Permalink
Fix some warnings, incorrect use of abs for double values
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 10, 2015
1 parent 76927bb commit db17513
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermousehandles.cpp
Expand Up @@ -824,7 +824,7 @@ void QgsComposerMouseHandles::dragMouseMove( const QPointF& currentPosition, boo
{
//constrained (shift) moving should lock to horizontal/vertical movement
//reset the smaller of the x/y movements
if ( abs( moveRectX ) <= abs( moveRectY ) )
if ( qAbs( moveRectX ) <= qAbs( moveRectY ) )
{
moveRectX = 0;
}
Expand Down
3 changes: 1 addition & 2 deletions src/core/symbology-ng/qgscptcityarchive.cpp
Expand Up @@ -967,8 +967,7 @@ QMap< QString, QStringList > QgsCptCityDirectoryItem::rampsMap()
QString curName, prevName, prevPath, curVariant, curSep, schemeName;
QStringList listVariant;
QStringList schemeNamesAll, schemeNames;
int num;
bool ok, prevAdd, curAdd;
bool prevAdd, curAdd;

QDir dir( QgsCptCityArchive::defaultBaseDir() + "/" + mPath );
schemeNamesAll = dir.entryList( QStringList( "*.svg" ), QDir::Files, QDir::Name );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/raster/qgsrasterhistogramwidget.cpp
Expand Up @@ -1068,7 +1068,7 @@ QString findClosestTickVal( double target, const QwtScaleDiv * scale, int div =
current += diff;
if ( current > target )
{
closest = ( abs( target - current + diff ) < abs( target - current ) ) ? current - diff : current;
closest = ( qAbs( target - current + diff ) < qAbs( target - current ) ) ? current - diff : current;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/qt_modeltest/modeltest.cpp
Expand Up @@ -497,7 +497,7 @@ void ModelTest::data()
*/
void ModelTest::rowsAboutToBeInserted( const QModelIndex &parent, int start, int end )
{
// Q_UNUSED(end);
Q_UNUSED( end );
// qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString()
// << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) );
// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) );
Expand Down

0 comments on commit db17513

Please sign in to comment.