Skip to content

Commit

Permalink
Fix some warnings in release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 31, 2023
1 parent 30700f1 commit 73fea28
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/3d/qgsvectorlayerchunkloader_p.cpp
Expand Up @@ -14,24 +14,18 @@
***************************************************************************/

#include "qgsvectorlayerchunkloader_p.h"

#include "qgs3dutils.h"
#include "qgsraycastingutils_p.h"
#include "qgsabstractvectorlayer3drenderer.h"
#include "qgstessellatedpolygongeometry.h"
#include "qgschunknode_p.h"
#include "qgspolygon3dsymbol_p.h"
#include "qgseventtracing.h"
#include "qgslogger.h"
#include "qgsvectorlayer.h"
#include "qgsvectorlayerfeatureiterator.h"

#include "qgsline3dsymbol.h"
#include "qgspoint3dsymbol.h"
#include "qgspolygon3dsymbol.h"

#include "qgsapplication.h"
#include "qgs3dsymbolregistry.h"
#include "qgsabstract3dsymbol.h"

#include <QtConcurrent>
#include <Qt3DCore/QTransform>
Expand Down Expand Up @@ -222,8 +216,7 @@ QVector<QgsRayCastingUtils::RayHit> QgsVectorLayerChunkedEntity::rayIntersection

float minDist = -1;
QVector3D intersectionPoint;
QgsFeatureId fid;
QgsFeatureId nearestFid;
QgsFeatureId nearestFid = FID_NULL;

for ( QgsChunkNode *node : activeNodes )
{
Expand All @@ -245,6 +238,7 @@ QVector<QgsRayCastingUtils::RayHit> QgsVectorLayerChunkedEntity::rayIntersection
}

QVector3D nodeIntPoint;
QgsFeatureId fid = FID_NULL;
if ( polygonGeom->rayIntersection( ray, transformMatrix, nodeIntPoint, fid ) )
{
hits++;
Expand All @@ -259,7 +253,7 @@ QVector<QgsRayCastingUtils::RayHit> QgsVectorLayerChunkedEntity::rayIntersection
}
}
}
if ( !intersectionPoint.isNull() )
if ( !FID_IS_NULL( nearestFid ) )
{
QgsRayCastingUtils::RayHit hit( minDist, intersectionPoint, nearestFid );
result.append( hit );
Expand Down
8 changes: 7 additions & 1 deletion src/core/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -3273,7 +3273,7 @@ bool QgsGdalProvider::readNativeAttributeTable( QString *errorMessage )
for ( int columnNumber = 0; columnNumber < GDALRATGetColumnCount( hRat ); ++columnNumber )
{
const Qgis::RasterAttributeTableFieldUsage usage { static_cast<Qgis::RasterAttributeTableFieldUsage>( GDALRATGetUsageOfCol( hRat, columnNumber ) ) };
QVariant::Type type;
QVariant::Type type = QVariant::Int;
switch ( GDALRATGetTypeOfCol( hRat, columnNumber ) )
{
case GFT_Integer:
Expand All @@ -3291,6 +3291,12 @@ bool QgsGdalProvider::readNativeAttributeTable( QString *errorMessage )
type = QVariant::String;
break;
}

default:
{
QgsDebugMsg( QStringLiteral( "Unhandled RAT type %1" ).arg( GDALRATGetTypeOfCol( hRat, columnNumber ) ) );
continue;
}
}
const QString name { GDALRATGetNameOfCol( hRat, columnNumber ) };
lowerNames.append( name.toLower() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterblock.cpp
Expand Up @@ -190,7 +190,7 @@ bool QgsRasterBlock::typeIsColor( Qgis::DataType dataType )

Qgis::DataType QgsRasterBlock::typeWithNoDataValue( Qgis::DataType dataType, double *noDataValue )
{
Qgis::DataType newDataType;
Qgis::DataType newDataType = Qgis::DataType::UnknownDataType;

switch ( dataType )
{
Expand Down

0 comments on commit 73fea28

Please sign in to comment.