Skip to content

Commit 0729653

Browse files
committed
[mssql] Fix more clazy/clang warnings
1 parent c5ecc64 commit 0729653

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/providers/mssql/qgsmssqldataitems.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ QVector<QgsDataItem *> QgsMssqlConnectionItem::createChildren()
136136
return children;
137137
}
138138

139-
QString connectionName = db.connectionName();
140-
141139
// build sql statement
142140
QString query( QStringLiteral( "select " ) );
143141
if ( mUseGeometryColumns )

src/providers/mssql/qgsmssqlfeatureiterator.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest &request )
229229
{
230230
QString part;
231231
part = compiler.result();
232-
part += clause.ascending() ? " ASC" : " DESC";
232+
part += clause.ascending() ? QStringLiteral( " ASC" ) : QStringLiteral( " DESC" );
233233
orderByParts << part;
234234
}
235235
else
@@ -292,7 +292,7 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature )
292292

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

311311
if ( !mQuery->isActive() )
312312
{
313-
QgsDebugMsg( "Read attempt on inactive query" );
313+
QgsDebugMsg( QStringLiteral( "Read attempt on inactive query" ) );
314314
return false;
315315
}
316316

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

375375
if ( mStatement.isEmpty() )
376376
{
377-
QgsDebugMsg( "QgsMssqlFeatureIterator::rewind on empty statement" );
377+
QgsDebugMsg( QStringLiteral( "QgsMssqlFeatureIterator::rewind on empty statement" ) );
378378
return false;
379379
}
380380

src/providers/mssql/qgsmssqlfeatureiterator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsM
106106
QString mFallbackStatement;
107107

108108
// Field index of FID column
109-
long mFidCol = -1;
109+
int mFidCol = -1;
110110

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

0 commit comments

Comments
 (0)