Skip to content
Permalink
Browse files

[mssql] Fix more clazy/clang warnings

  • Loading branch information
nyalldawson committed Oct 4, 2018
1 parent c5ecc64 commit 072965385e1115d289d0a48aef182b90de9d9902
@@ -136,8 +136,6 @@ QVector<QgsDataItem *> QgsMssqlConnectionItem::createChildren()
return children;
}

QString connectionName = db.connectionName();

// build sql statement
QString query( QStringLiteral( "select " ) );
if ( mUseGeometryColumns )
@@ -229,7 +229,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest &request )
{
QString part;
part = compiler.result();
part += clause.ascending() ? " ASC" : " DESC";
part += clause.ascending() ? QStringLiteral( " ASC" ) : QStringLiteral( " DESC" );
orderByParts << part;
}
else
@@ -292,7 +292,7 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature )

if ( !mDatabase.open() )
{
QgsDebugMsg( "Failed to open database" );
QgsDebugMsg( QStringLiteral( "Failed to open database" ) );
QgsDebugMsg( mDatabase.lastError().text() );
return false;
}
@@ -310,7 +310,7 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature )

if ( !mQuery->isActive() )
{
QgsDebugMsg( "Read attempt on inactive query" );
QgsDebugMsg( QStringLiteral( "Read attempt on inactive query" ) );
return false;
}

@@ -336,7 +336,7 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature )
QByteArray ar = mQuery->record().value( mSource->mGeometryColName ).toByteArray();
if ( !ar.isEmpty() )
{
if ( unsigned char *wkb = mParser.ParseSqlGeometry( ( unsigned char * )ar.data(), ar.size() ) )
if ( unsigned char *wkb = mParser.ParseSqlGeometry( reinterpret_cast< unsigned char * >( ar.data() ), ar.size() ) )
{
QgsGeometry g;
g.fromWkb( wkb, mParser.GetWkbLen() );
@@ -374,7 +374,7 @@ bool QgsMssqlFeatureIterator::rewind()

if ( mStatement.isEmpty() )
{
QgsDebugMsg( "QgsMssqlFeatureIterator::rewind on empty statement" );
QgsDebugMsg( QStringLiteral( "QgsMssqlFeatureIterator::rewind on empty statement" ) );
return false;
}

@@ -106,7 +106,7 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsM
QString mFallbackStatement;

// Field index of FID column
long mFidCol = -1;
int mFidCol = -1;

// List of attribute indices to fetch with nextFeature calls
QgsAttributeList mAttributesToFetch;

0 comments on commit 0729653

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