Skip to content
Permalink
Browse files

Fix coverity mixed enum warning, switch 0 -> nullptr

  • Loading branch information
nyalldawson committed May 10, 2016
1 parent f4b63c6 commit ab288c6b1262c2fa28d2c8d85b20341b1eb9aac3
@@ -363,6 +363,6 @@ class QgsVectorDataProvider : QgsDataProvider
void pushError( const QString& msg );

/** Converts the geometry to the provider type if possible / necessary
@return the converted geometry or 0 if no conversion was necessary or possible*/
@return the converted geometry or nullptr if no conversion was necessary or possible*/
QgsGeometry* convertToProviderType( const QgsGeometry* geom ) const /Factory/;
};
@@ -581,24 +581,24 @@ QgsGeometry* QgsVectorDataProvider::convertToProviderType( const QgsGeometry* ge
{
if ( !geom )
{
return 0;
return nullptr;
}

QgsAbstractGeometryV2* geometry = geom->geometry();
if ( !geometry )
{
return 0;
return nullptr;
}

QgsWKBTypes::Type providerGeomType = QgsWKBTypes::Type( geometryType() );
QgsWKBTypes::Type providerGeomType = QGis::fromOldWkbType( geometryType() );

//geom is already in the provider geometry type
if ( geometry->wkbType() == providerGeomType )
{
return 0;
return nullptr;
}

QgsAbstractGeometryV2* outputGeom = 0;
QgsAbstractGeometryV2* outputGeom = nullptr;

//convert compoundcurve to circularstring (possible if compoundcurve consists of one circular string)
if ( QgsWKBTypes::flatType( providerGeomType ) == QgsWKBTypes::CircularString && QgsWKBTypes::flatType( geometry->wkbType() ) == QgsWKBTypes::CompoundCurve )
@@ -642,7 +642,7 @@ QgsGeometry* QgsVectorDataProvider::convertToProviderType( const QgsGeometry* ge
//convert to linear type from curved type
if ( QgsWKBTypes::isCurvedType( geometry->wkbType() ) && !QgsWKBTypes::isCurvedType( providerGeomType ) )
{
QgsAbstractGeometryV2* segmentizedGeom = 0;
QgsAbstractGeometryV2* segmentizedGeom = nullptr;
segmentizedGeom = outputGeom ? outputGeom->segmentize() : geometry->segmentize();
if ( segmentizedGeom )
{
@@ -673,7 +673,7 @@ QgsGeometry* QgsVectorDataProvider::convertToProviderType( const QgsGeometry* ge
{
return new QgsGeometry( outputGeom );
}
return 0;
return nullptr;
}

QStringList QgsVectorDataProvider::smEncodings;
@@ -437,7 +437,7 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
QgsAttrPalIndexNameHash mAttrPalIndexName;

/** Converts the geometry to the provider type if possible / necessary
@return the converted geometry or 0 if no conversion was necessary or possible*/
@return the converted geometry or nullptr if no conversion was necessary or possible*/
QgsGeometry* convertToProviderType( const QgsGeometry* geom ) const;

private:

0 comments on commit ab288c6

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