Skip to content

Commit 5769f3b

Browse files
committedMar 20, 2016
fix warnings
1 parent bd3fd74 commit 5769f3b

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed
 

‎src/analysis/raster/qgsninecellfilter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
140140
scanLine1[a] = mInputNodataValue;
141141
}
142142
if ( GDALRasterIO( rasterBand, GF_Read, 0, 0, xSize, 1, scanLine2, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
143+
{
143144
QgsDebugMsg( "Raster IO Error" );
145+
}
144146
}
145147
else
146148
{
@@ -161,7 +163,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
161163
else
162164
{
163165
if ( GDALRasterIO( rasterBand, GF_Read, 0, i + 1, xSize, 1, scanLine3, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
166+
{
164167
QgsDebugMsg( "Raster IO Error" );
168+
}
165169
}
166170

167171
for ( int j = 0; j < xSize; ++j )
@@ -184,7 +188,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
184188
}
185189

186190
if ( GDALRasterIO( outputRasterBand, GF_Write, 0, i, xSize, 1, resultLine, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
191+
{
187192
QgsDebugMsg( "Raster IO Error" );
193+
}
188194
}
189195

190196
if ( p )

‎src/analysis/raster/qgsrelief.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ int QgsRelief::processRaster( QProgressDialog* p )
204204
scanLine1[a] = mInputNodataValue;
205205
}
206206
if ( GDALRasterIO( rasterBand, GF_Read, 0, 0, xSize, 1, scanLine2, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
207+
{
207208
QgsDebugMsg( "Raster IO Error" );
209+
}
208210
}
209211
else
210212
{
@@ -225,7 +227,9 @@ int QgsRelief::processRaster( QProgressDialog* p )
225227
else
226228
{
227229
if ( GDALRasterIO( rasterBand, GF_Read, 0, i + 1, xSize, 1, scanLine3, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
230+
{
228231
QgsDebugMsg( "Raster IO Error" );
232+
}
229233
}
230234

231235
for ( int j = 0; j < xSize; ++j )
@@ -258,11 +262,17 @@ int QgsRelief::processRaster( QProgressDialog* p )
258262
}
259263

260264
if ( GDALRasterIO( outputRedBand, GF_Write, 0, i, xSize, 1, resultRedLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
265+
{
261266
QgsDebugMsg( "Raster IO Error" );
267+
}
262268
if ( GDALRasterIO( outputGreenBand, GF_Write, 0, i, xSize, 1, resultGreenLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
269+
{
263270
QgsDebugMsg( "Raster IO Error" );
271+
}
264272
if ( GDALRasterIO( outputBlueBand, GF_Write, 0, i, xSize, 1, resultBlueLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
273+
{
265274
QgsDebugMsg( "Raster IO Error" );
275+
}
266276
}
267277

268278
if ( p )

‎src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( void* band, const Qg
483483
for ( int col = 0; col < nCellsX; ++col )
484484
{
485485
if ( GDALRasterIO( band, GF_Read, pixelOffsetX + col, pixelOffsetY + row, nCellsX, 1, pixelData, 1, 1, GDT_Float32, 0, 0 ) != CE_None )
486+
{
486487
QgsDebugMsg( "Raster IO Error" );
488+
}
487489

488490
if ( !validPixel( *pixelData ) )
489491
continue;

‎src/plugins/heatmap/heatmap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ void Heatmap::run()
171171
for ( int i = 0; i < rows ; i++ )
172172
{
173173
if ( poBand->RasterIO( GF_Write, 0, i, columns, 1, line, columns, 1, GDT_Float32, 0, 0 ) != CE_None )
174+
{
174175
QgsDebugMsg( "Raster IO Error" );
176+
}
175177
}
176178

177179
CPLFree( line );
@@ -302,7 +304,9 @@ void Heatmap::run()
302304
float *dataBuffer = ( float * ) CPLMalloc( sizeof( float ) * blockSize * blockSize );
303305
if ( poBand->RasterIO( GF_Read, xPosition, yPosition, blockSize, blockSize,
304306
dataBuffer, blockSize, blockSize, GDT_Float32, 0, 0 ) != CE_None )
307+
{
305308
QgsDebugMsg( "Raster IO Error" );
309+
}
306310

307311
for ( int xp = 0; xp <= myBuffer; xp++ )
308312
{
@@ -345,7 +349,9 @@ void Heatmap::run()
345349
}
346350
if ( poBand->RasterIO( GF_Write, xPosition, yPosition, blockSize, blockSize,
347351
dataBuffer, blockSize, blockSize, GDT_Float32, 0, 0 ) != CE_None )
352+
{
348353
QgsDebugMsg( "Raster IO Error" );
354+
}
349355
CPLFree( dataBuffer );
350356
}
351357
}

‎src/providers/wcs/qgswcsprovider.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,13 @@ QgsWcsProvider::QgsWcsProvider( QString const &uri )
341341
#endif
342342
mGdalDataType.append( myGdalDataType );
343343

344+
#if 0
344345
// TODO: what to do if null values from DescribeCoverage differ?
345-
//if ( !mCoverageSummary.nullValues.contains( myNoDataValue ) )
346-
//{
347-
// QgsDebugMsg( QString( "noDataValue %1 is missing in nullValues from CoverageDescription" ).arg( myNoDataValue ) );
348-
//}
346+
if ( !mCoverageSummary.nullValues.contains( myNoDataValue ) )
347+
{
348+
QgsDebugMsg( QString( "noDataValue %1 is missing in nullValues from CoverageDescription" ).arg( myNoDataValue ) );
349+
}
350+
#endif
349351

350352
QgsDebugMsg( QString( "mSrcGdalDataType[%1] = %2" ).arg( i - 1 ).arg( mSrcGdalDataType.at( i - 1 ) ) );
351353
QgsDebugMsg( QString( "mGdalDataType[%1] = %2" ).arg( i - 1 ).arg( mGdalDataType.at( i - 1 ) ) );
@@ -588,7 +590,9 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
588590
return;
589591
}
590592
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, width, height, tmpData, width, height, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
593+
{
591594
QgsDebugMsg( "Raster IO Error" );
595+
}
592596
for ( int i = 0; i < pixelHeight; i++ )
593597
{
594598
for ( int j = 0; j < pixelWidth; j++ )
@@ -603,15 +607,21 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
603607
else if ( width == pixelWidth && height == pixelHeight )
604608
{
605609
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, pixelWidth, pixelHeight, block, pixelWidth, pixelHeight, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
610+
{
606611
QgsDebugMsg( "Raster IO Error" );
612+
}
607613
else
614+
{
608615
QgsDebugMsg( "Block read OK" );
616+
}
609617
}
610618
else
611619
{
612620
// This should not happen, but it is better to give distorted result + warning
613621
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, width, height, block, pixelWidth, pixelHeight, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
622+
{
614623
QgsDebugMsg( "Raster IO Error" );
624+
}
615625
QgsMessageLog::logMessage( tr( "Received coverage has wrong size %1 x %2 (expected %3 x %4)" ).arg( width ).arg( height ).arg( pixelWidth ).arg( pixelHeight ), tr( "WCS" ) );
616626
}
617627
}

0 commit comments

Comments
 (0)
Please sign in to comment.