Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some build warnings, clazy warnings
  • Loading branch information
nyalldawson committed Dec 5, 2019
1 parent 35eea1c commit 61903a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions python/core/auto_generated/mesh/qgsmeshdataprovider.sip.in
Expand Up @@ -45,8 +45,8 @@ Returns a dataset index within group()
%Docstring
Returns whether index is valid, ie at least groups is set
%End
bool operator == ( const QgsMeshDatasetIndex &other ) const;
bool operator != ( const QgsMeshDatasetIndex &other ) const;
bool operator == ( QgsMeshDatasetIndex other ) const;
bool operator != ( QgsMeshDatasetIndex other ) const;
};

typedef QgsPoint QgsMeshVertex;
Expand Down Expand Up @@ -142,7 +142,7 @@ Returns x value
Returns y value
%End

bool operator==( const QgsMeshDatasetValue &other ) const;
bool operator==( QgsMeshDatasetValue other ) const;

};

Expand Down
8 changes: 5 additions & 3 deletions src/core/mesh/qgsmeshdataprovider.cpp
Expand Up @@ -40,15 +40,15 @@ bool QgsMeshDatasetIndex::isValid() const
return ( group() > -1 ) && ( dataset() > -1 );
}

bool QgsMeshDatasetIndex::operator ==( const QgsMeshDatasetIndex &other ) const
bool QgsMeshDatasetIndex::operator ==( QgsMeshDatasetIndex other ) const
{
if ( isValid() && other.isValid() )
return other.group() == group() && other.dataset() == dataset();
else
return isValid() == other.isValid();
}

bool QgsMeshDatasetIndex::operator !=( const QgsMeshDatasetIndex &other ) const
bool QgsMeshDatasetIndex::operator !=( QgsMeshDatasetIndex other ) const
{
return !( operator==( other ) );
}
Expand Down Expand Up @@ -107,7 +107,7 @@ double QgsMeshDatasetValue::y() const
return mY;
}

bool QgsMeshDatasetValue::operator==( const QgsMeshDatasetValue &other ) const
bool QgsMeshDatasetValue::operator==( const QgsMeshDatasetValue other ) const
{
bool equal = std::isnan( mX ) == std::isnan( other.x() );
equal &= std::isnan( mY ) == std::isnan( other.y() );
Expand Down Expand Up @@ -415,6 +415,7 @@ void *QgsMesh3dDataBlock::buffer( QgsMesh3dDataBlock::DataType type )
case FaceToVolumeIndex:
return mFaceToVolumeIndex.data();
}
return nullptr;
}

const void *QgsMesh3dDataBlock::constBuffer( QgsMesh3dDataBlock::DataType type ) const
Expand All @@ -434,6 +435,7 @@ const void *QgsMesh3dDataBlock::constBuffer( QgsMesh3dDataBlock::DataType type )
case FaceToVolumeIndex:
return mFaceToVolumeIndex.constData();
}
return nullptr;
}

void QgsMesh3dDataBlock::setValid( bool valid )
Expand Down
10 changes: 5 additions & 5 deletions src/core/mesh/qgsmeshdataprovider.h
Expand Up @@ -51,9 +51,9 @@ class CORE_EXPORT QgsMeshDatasetIndex
//! Returns whether index is valid, ie at least groups is set
bool isValid() const;
//! Equality operator
bool operator == ( const QgsMeshDatasetIndex &other ) const;
bool operator == ( QgsMeshDatasetIndex other ) const;
//! Inequality operator
bool operator != ( const QgsMeshDatasetIndex &other ) const;
bool operator != ( QgsMeshDatasetIndex other ) const;
private:
int mGroupIndex = -1;
int mDatasetIndex = -1;
Expand Down Expand Up @@ -135,11 +135,11 @@ class CORE_EXPORT QgsMeshDatasetValue
//! Returns y value
double y() const;

bool operator==( const QgsMeshDatasetValue &other ) const;
bool operator==( QgsMeshDatasetValue other ) const;

private:
double mX = std::numeric_limits<double>::quiet_NaN();
double mY = std::numeric_limits<double>::quiet_NaN();
double mX = std::numeric_limits<double>::quiet_NaN();
double mY = std::numeric_limits<double>::quiet_NaN();
};

/**
Expand Down

0 comments on commit 61903a7

Please sign in to comment.