Skip to content
Permalink
Browse files

fix clazy and fallthrough warnings

  • Loading branch information
troopa81 authored and nyalldawson committed Nov 5, 2019
1 parent 0caea59 commit 8713d9692c266aac6e6b1b5dd1ef63196f0edaa4
@@ -48,7 +48,7 @@
#if __cplusplus >= 201500
#define FALLTHROUGH [[fallthrough]];
#elif defined(__clang__)
#define FALLTHROUGH //[[clang::fallthrough]]
#define FALLTHROUGH [[clang::fallthrough]];
#elif defined(__GNUC__) && __GNUC__ >= 7
#define FALLTHROUGH [[gnu::fallthrough]];
#else
@@ -719,9 +719,8 @@ int QOCISpatialResultPrivate::bindValue( OCIStmt *sql, OCIBind **hbnd, OCIError
setCharset( *hbnd, OCI_HTYPE_BIND );
break;
}

FALLTHROUGH
}
FALLTHROUGH

default:
{
@@ -2743,7 +2742,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
line[ partNum ].second.append( line.at( partNum + 1 ).second.first() );
}

for ( const CurvePart &part : line )
for ( const CurvePart &part : qAsConst( line ) )
{
const PointSequence &pts = part.second;
if ( part.first == WKBCompoundCurve )
@@ -2758,7 +2757,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
}
}

for ( const CurvePart &part : line )
for ( const CurvePart &part : qAsConst( line ) )
{
const PointSequence &pts = part.second;
if ( part.first == WKBCompoundCurve )
@@ -2818,7 +2817,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
if ( lines.size() > 1 )
*ptr.iPtr++ = lines.size();

for ( const auto &line : lines )
for ( const auto &line : qAsConst( lines ) )
{
if ( lines.size() > 1 )
{
@@ -2874,7 +2873,6 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
SurfaceRings currentPart;
WKBType currentPartWkbType = WKBUnknown;

QVector<int> nPolygonRings;
bool isCurved = false;
bool isCompoundCurve = false;

@@ -3026,7 +3024,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
}
}

for ( const CurvePart &curvePart : ring )
for ( const CurvePart &curvePart : qAsConst( ring ) )
{
if ( isCurved )
wkbSize += 1 + sizeof( int );
@@ -3057,7 +3055,7 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
*ptr.iPtr++ = nPolygons;
}

for ( const QPair< WKBType, SurfaceRings > &rings : parts )
for ( const QPair< WKBType, SurfaceRings > &rings : qAsConst( parts ) )
{
if ( nPolygons > 1 )
{
@@ -3322,7 +3320,9 @@ void QOCISpatialCols::getValues( QVector<QVariant> &v, int index )
break;
}
}
// else fall through

FALLTHROUGH

case QVariant::String:
qDebug() << "String";
v[index + i] = QString( reinterpret_cast<const QChar *>( fld.data ) );
@@ -3460,7 +3460,8 @@ bool QOCISpatialResult::gotoNext( QSqlCachedResult::ValueCache &values, int inde
r = OCI_SUCCESS; /* ignore it */
break;
}
// fall through
FALLTHROUGH

default:
qOraWarning( "QOCISpatialResult::gotoNext: ", d->err );
setLastError( qMakeError( QCoreApplication::translate( "QOCISpatialResult",
@@ -423,13 +423,13 @@ bool QgsOracleConn::exec( const QString &query, bool logError, QString *errorMes
if ( logError )
{
QgsMessageLog::logMessage( tr( "Connection error: %1 returned %2" )
.arg( query ).arg( error ),
.arg( query, error ),
tr( "Oracle" ) );
}
else
{
QgsDebugMsg( QStringLiteral( "Connection error: %1 returned %2" )
.arg( query ).arg( error ) );
.arg( query, error ) );
}
if ( errorMessage )
*errorMessage = error;
@@ -99,14 +99,14 @@ struct QgsOracleLayerProperty
}

return QString( "%1.%2.%3 type=%4 srid=%5 view=%6%7 sql=%8" )
.arg( ownerName )
.arg( tableName )
.arg( geometryColName )
.arg( typeString )
.arg( sridString )
.arg( isView ? "yes" : "no" )
.arg( isView ? QString( " pk=%1" ).arg( pkCols.join( "|" ) ) : "" )
.arg( sql );
.arg( ownerName,
tableName,
geometryColName,
typeString,
sridString,
isView ? "yes" : "no",
isView ? QString( " pk=%1" ).arg( pkCols.join( "|" ) ) : "",
sql );
}
#endif
};
@@ -116,7 +116,7 @@ class QgsOracleLayerItem : public QgsLayerItem
QList<QAction *> actions( QWidget *parent ) override;

public slots:
bool deleteLayer();
bool deleteLayer() override;

private:
QgsOracleLayerProperty mLayerProperty;
@@ -382,7 +382,7 @@ class QgsOracleProviderMetadata: public QgsProviderMetadata
QString loadStyle( const QString &uri, QString &errCause ) override;
bool saveStyle( const QString &uri, const QString &qmlStyle, const QString &sldStyle, const QString &styleName,
const QString &styleDescription, const QString &uiFileContent, bool useAsDefault, QString &errCause ) override;
void cleanupProvider();
void cleanupProvider() override;
QgsVectorLayerExporter::ExportError createEmptyLayer( const QString &uri,
const QgsFields &fields, QgsWkbTypes::Type wkbType,
const QgsCoordinateReferenceSystem &srs, bool overwrite,

0 comments on commit 8713d96

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