Skip to content

Commit

Permalink
Grass plugin/provider fixes for Coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent d3c8837 commit 07ea41f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/plugins/grass/qgsgrassmodule.h
Expand Up @@ -343,9 +343,6 @@ class QgsGrassModuleStandardOptions: QWidget, public QgsGrassModuleOptions
//! List of all flags. Necessary for scripts.
QStringList mFlagNames;

//! Use of region defined in qgm
bool mUsesRegion;

// ! Advanced options switch button
QPushButton mAdvancedPushButton;

Expand Down
4 changes: 3 additions & 1 deletion src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -78,6 +78,9 @@ static QString GRASS_DESCRIPTION = "Grass provider"; // XXX verify this

QgsGrassProvider::QgsGrassProvider( QString uri )
: QgsVectorDataProvider( uri )
, mLayerField( -1 )
, mLayerType( POINT )
, mGrassType( 0 )
, mQgisType( QGis::WKBUnknown )
, mLayerId( -1 )
, mMap()
Expand Down Expand Up @@ -119,7 +122,6 @@ QgsGrassProvider::QgsGrassProvider( QString uri )
/* Parse Layer, supported layers <field>_point, <field>_line, <field>_area
* Layer is opened even if it is empty (has no features)
*/
mLayerField = -1;
if ( mLayer.compare( "boundary" ) == 0 ) // currently not used
{
mLayerType = BOUNDARY;
Expand Down
5 changes: 3 additions & 2 deletions src/providers/grass/qgsgrassrasterprovider.cpp
Expand Up @@ -142,10 +142,11 @@ QgsGrassRasterProvider::QgsGrassRasterProvider( QString const & uri )
// We have to decide some reasonable block size, not to big to occupate too much
// memory, not too small to result in too many calls to readBlock -> qgis.d.rast
// for statistics
if ( mCols > 0 )
int typeSize = dataTypeSize( dataType( 1 ) );
if ( mCols > 0 && typeSize > 0 )
{
const int cache_size = 10000000; // ~ 10 MB
mYBlockSize = cache_size / ( dataTypeSize( dataType( 1 ) ) ) / mCols;
mYBlockSize = cache_size / typeSize / mCols;
if ( mYBlockSize > mRows )
{
mYBlockSize = mRows;
Expand Down

0 comments on commit 07ea41f

Please sign in to comment.