Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix warnings from clang
  • Loading branch information
jef-n committed Feb 11, 2012
1 parent 2708f17 commit 7689076
Show file tree
Hide file tree
Showing 38 changed files with 65 additions and 60 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsmaplayer.sip
Expand Up @@ -168,7 +168,7 @@ public:

@returns true if successful
*/
bool writeXML(QDomNode & layer_node, QDomDocument & document) const;
bool writeXML(QDomNode & layer_node, QDomDocument & document);

/** Set a custom property for layer. Properties are stored in a map and saved in project file.
* @note Added in v1.4 */
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/interpolation/TriDecorator.h
Expand Up @@ -36,8 +36,8 @@ class TriDecorator: public Triangulation
virtual bool calcPoint( double x, double y, Point3D* result );
virtual Point3D* getPoint( unsigned int i ) const;
virtual int getNumberOfPoints() const;
virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 );
virtual bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 );
bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 );
bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 );
virtual int getOppositePoint( int p1, int p2 );
virtual QList<int>* getSurroundingTriangles( int pointno );
virtual double getXMax() const;
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -210,7 +210,7 @@ void QgsLegend::removeAll()
mDropTarget = 0;
}

void QgsLegend::selectAll( bool select )
void QgsLegend::setLayersVisible( bool visible )
{
if ( !mMapCanvas || mMapCanvas->isDrawing() )
{
Expand All @@ -227,7 +227,7 @@ void QgsLegend::selectAll( bool select )
QgsLegendItem* litem = dynamic_cast<QgsLegendItem *>( theItem );
if ( litem && litem->type() == QgsLegendItem::LEGEND_LAYER )
{
theItem->setCheckState( 0, select ? Qt::Checked : Qt::Unchecked );
theItem->setCheckState( 0, visible ? Qt::Checked : Qt::Unchecked );
handleItemChange( theItem, 0 );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegend.h
Expand Up @@ -227,7 +227,7 @@ class QgsLegend : public QTreeWidget
* the legend, and in the map.
* @return void
*/
void selectAll( bool select );
void setLayersVisible( bool visible );

/*!
* Slot called when user wishes to add a new empty layer group to the legend.
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -3219,7 +3219,7 @@ void QgisApp::hideAllLayers()
{
QgsDebugMsg( "hiding all layers!" );

legend()->selectAll( false );
legend()->setLayersVisible( false );
}


Expand All @@ -3228,7 +3228,7 @@ void QgisApp::showAllLayers()
{
QgsDebugMsg( "Showing all layers!" );

legend()->selectAll( true );
legend()->setLayersVisible( true );
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/hashtable.hpp
Expand Up @@ -230,7 +230,7 @@ namespace pal


template <typename Data>
bool HashTable<Data>::removeElement( const char * key )
bool HashTable<Data>::removeElement( const char * )
{
// TODO: Remove the element that has this key from the hash table.
// Return true if the entry is found or false otherwise.
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsdataprovider.h
Expand Up @@ -191,7 +191,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
* (in order from bottom to top)
* \note layers must have been previously added.
*/
virtual void setLayerOrder( QStringList layers )
virtual void setLayerOrder( const QStringList &layers )
{
//prevent unused var warnings
if ( layers.count() < 1 )
Expand All @@ -205,7 +205,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
/**
* Set the visibility of the given sublayer name
*/
virtual void setSubLayerVisibility( QString name, bool vis )
virtual void setSubLayerVisibility( const QString &name, bool vis )
{
//prevent unused var warnings
if ( name.isEmpty() || !vis )
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsdiagram.h
Expand Up @@ -15,6 +15,7 @@ class QgsRenderContext;
class CORE_EXPORT QgsDiagram
{
public:
virtual ~QgsDiagram() {}
/**Draws the diagram at the given position (in pixel coordinates)*/
virtual void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0;
virtual QString diagramName() const = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsexpression.h
Expand Up @@ -235,7 +235,7 @@ class CORE_EXPORT QgsExpression
{
public:
NodeList() {}
~NodeList() { foreach( Node* n, mList ) delete n; }
virtual ~NodeList() { foreach( Node* n, mList ) delete n; }
void append( Node* node ) { mList.append( node ); }
int count() { return mList.count(); }
QList<Node*> list() { return mList; }
Expand Down Expand Up @@ -297,7 +297,7 @@ class CORE_EXPORT QgsExpression
{
public:
NodeInOperator( Node* node, NodeList* list, bool notin = false ) : mNode( node ), mList( list ), mNotIn( notin ) {}
~NodeInOperator() { delete mNode; delete mList; }
virtual ~NodeInOperator() { delete mNode; delete mList; }

Node* node() { return mNode; }
bool isNotIn() { return mNotIn; }
Expand All @@ -321,7 +321,7 @@ class CORE_EXPORT QgsExpression
public:
NodeFunction( int fnIndex, NodeList* args ): mFnIndex( fnIndex ), mArgs( args ) {}
//NodeFunction( QString name, NodeList* args ) : mName(name), mArgs(args) {}
~NodeFunction() { delete mArgs; }
virtual ~NodeFunction() { delete mArgs; }

int fnIndex() { return mFnIndex; }
NodeList* args() { return mArgs; }
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -480,12 +480,12 @@ float QgsMapLayer::maximumScale()
}


QStringList QgsMapLayer::subLayers()
QStringList QgsMapLayer::subLayers() const
{
return QStringList(); // Empty
}

void QgsMapLayer::setLayerOrder( QStringList layers )
void QgsMapLayer::setLayerOrder( const QStringList &layers )
{
Q_UNUSED( layers );
// NOOP
Expand Down
5 changes: 2 additions & 3 deletions src/core/qgsmaplayer.h
Expand Up @@ -132,18 +132,17 @@ class CORE_EXPORT QgsMapLayer : public QObject
* Returns the sublayers of this layer
* (Useful for providers that manage their own layers, such as WMS)
*/
virtual QStringList subLayers();
virtual QStringList subLayers() const;

/**
* Reorders the *previously selected* sublayers of this layer from bottom to top
* (Useful for providers that manage their own layers, such as WMS)
*/
virtual void setLayerOrder( QStringList layers );
virtual void setLayerOrder( const QStringList &layers );

/** Set the visibility of the given sublayer name */
virtual void setSubLayerVisibility( QString name, bool vis );


/** True if the layer can be edited */
virtual bool isEditable() const;

Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -2837,7 +2837,7 @@ void QgsRasterLayer::setRedBandName( QString const & theBandName )
mRedBandName = validateBandName( theBandName );
}

void QgsRasterLayer::setSubLayerVisibility( QString const & name, bool vis )
void QgsRasterLayer::setSubLayerVisibility( QString name, bool vis )
{

if ( mDataProvider )
Expand Down
8 changes: 4 additions & 4 deletions src/core/raster/qgsrasterlayer.h
Expand Up @@ -634,7 +634,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
void showProgress( int theValue );

/** \brief Returns the sublayers of this layer - Useful for providers that manage their own layers, such as WMS */
QStringList subLayers() const;
virtual QStringList subLayers() const;

/** \brief Draws a thumbnail of the rasterlayer into the supplied pixmap pointer */
void thumbnailAsPixmap( QPixmap * theQPixmap );
Expand All @@ -647,20 +647,20 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
void triggerRepaint();

//
// Virtural methods
// Virtual methods
//
/**
* Reorders the *previously selected* sublayers of this layer from bottom to top
*
* (Useful for providers that manage their own layers, such as WMS)
*
*/
virtual void setLayerOrder( const QStringList & layers );
virtual void setLayerOrder( const QStringList &layers );

/**
* Set the visibility of the given sublayer name
*/
virtual void setSubLayerVisibility( const QString & name, bool vis );
virtual void setSubLayerVisibility( QString name, bool vis );

/** Time stamp of data source in the moment when data/metadata were loaded by provider */
virtual QDateTime timestamp() const { return mDataProvider->timestamp() ; }
Expand Down
2 changes: 1 addition & 1 deletion src/core/renderer/qgsgraduatedsymbolrenderer.cpp
Expand Up @@ -346,7 +346,7 @@ bool QgsGraduatedSymbolRenderer::writeXML( QDomNode & layer_node, QDomDocument &
QString modeValue = "";
if ( mMode == QgsGraduatedSymbolRenderer::Empty )
{
modeValue == "Empty";
modeValue = "Empty";
}
else if ( QgsGraduatedSymbolRenderer::Quantile )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/spatialite/spatialite.c
Expand Up @@ -57581,7 +57581,7 @@ Parse (void *yyp, /* The parser */
#define __STDC_LIMIT_MACROS 1
#endif

/* #include <inttypes.h> */
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgsrendererv2registry.h
Expand Up @@ -22,6 +22,7 @@ class CORE_EXPORT QgsRendererV2AbstractMetadata
public:
QgsRendererV2AbstractMetadata( QString name, QString visibleName, QIcon icon = QIcon() )
: mName( name ), mVisibleName( visibleName ), mIcon( icon ) {}
virtual ~QgsRendererV2AbstractMetadata() {}

QString name() const { return mName; }
QString visibleName() const { return mVisibleName; }
Expand Down
4 changes: 4 additions & 0 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -332,9 +332,13 @@ QgsRuleBasedRendererV2::Rule* QgsRuleBasedRendererV2::Rule::create( QDomElement&
{
Rule* childRule = create( childRuleElem, symbolMap );
if ( childRule )
{
rule->appendChild( childRule );
}
else
{
QgsDebugMsg( "failed to init a child rule!" );
}
childRuleElem = childRuleElem.nextSiblingElement( "rule" );
}

Expand Down
3 changes: 2 additions & 1 deletion src/gui/attributetable/qgsattributetablememorymodel.cpp
Expand Up @@ -115,10 +115,11 @@ void QgsAttributeTableMemoryModel::featureDeleted( QgsFeatureId fid )
QgsAttributeTableModel::featureDeleted( fid );
}

void QgsAttributeTableMemoryModel::featureAdded( QgsFeatureId fid )
void QgsAttributeTableMemoryModel::featureAdded( QgsFeatureId fid, bool inOperation )
{
QgsDebugMsg( "entered." );
Q_UNUSED( fid );
Q_UNUSED( inOperation );
loadLayer();
}

Expand Down
3 changes: 2 additions & 1 deletion src/gui/attributetable/qgsattributetablememorymodel.h
Expand Up @@ -59,8 +59,9 @@ class QgsAttributeTableMemoryModel : public QgsAttributeTableModel
/**
* Launched when a feature has been deleted
* @param fid feature id
* @param inOperation guard insertion with beginInsertRows() / endInsertRows()
*/
virtual void featureAdded( QgsFeatureId fid );
virtual void featureAdded( QgsFeatureId fid, bool inOperation = true );
/**
* Launched when layer has been deleted
*/
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Expand Up @@ -754,7 +754,9 @@ bool QgsRuleBasedRendererV2Model::removeRows( int row, int count, const QModelIn
//parentRule->takeChildAt( row );
}
else
{
QgsDebugMsg( "trying to remove invalid index - this should not happen!" );
}
}

endRemoveRows();
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgswmsserver.cpp
Expand Up @@ -281,7 +281,7 @@ QImage* QgsWMSServer::getLegendGraphics()
{
if ( !mConfigParser || !mMapRenderer )
{
return false;
return 0;
}

QStringList layersList, stylesList;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/globe/globe_plugin.h
Expand Up @@ -196,6 +196,7 @@ namespace osgEarth
public:
virtual void onMouseDown( class Control* control, int mouseButtonMask ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); }
virtual void onClick( class Control* control, int mouseButtonMask, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); Q_UNUSED( ea ); Q_UNUSED( aa ); }
virtual void onClick( class Control* control, int mouseButtonMask ) { Q_UNUSED( control ); Q_UNUSED( mouseButtonMask ); }
};

class NavigationControl : public ImageControl
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/globe/qgsosgearthtilesource.cpp
Expand Up @@ -83,7 +83,7 @@ osg::Image* QgsOsgEarthTileSource::createImage( const TileKey& key, ProgressCall
return 0;
}

QImage* qImage = createImage( target_width, target_height );
QImage* qImage = createQImage( target_width, target_height );
if ( !qImage )
{
return 0;
Expand Down Expand Up @@ -121,7 +121,7 @@ osg::Image* QgsOsgEarthTileSource::createImage( const TileKey& key, ProgressCall
return image.release();
}

QImage* QgsOsgEarthTileSource::createImage( int width, int height ) const
QImage* QgsOsgEarthTileSource::createQImage( int width, int height ) const
{
if ( width < 0 || height < 0 )
{
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/globe/qgsosgearthtilesource.h
Expand Up @@ -25,8 +25,7 @@ namespace osgEarth

osg::Image* createImage( const TileKey& key, ProgressCallback* progress );

osg::HeightField* createHeightField( const TileKey* key,
ProgressCallback* progress )
virtual osg::HeightField* createHeightField( const TileKey &key, ProgressCallback* progress )
{
Q_UNUSED( key );
Q_UNUSED( progress );
Expand All @@ -48,7 +47,7 @@ namespace osgEarth

private:

QImage* createImage( int width, int height ) const;
QImage* createQImage( int width, int height ) const;
bool intersects( const TileKey* key );

//! Pointer to the QGIS interface object
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -1437,7 +1437,7 @@ void QgsGrassEdit::checkOrphan( int field, int cat )
return;

// Delete record
error = mProvider->deleteAttributes( field, cat );
error = mProvider->deleteAttribute( field, cat );
if ( !error->isEmpty() )
{
QMessageBox::warning( 0, tr( "Warning" ), tr( "Cannot delete orphan record: " )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmapcalc.cpp
Expand Up @@ -1542,7 +1542,7 @@ QgsGrassMapcalcObject::~QgsGrassMapcalcObject()
QgsDebugMsg( "exited." );
}

int QgsGrassMapcalcObject::type()
int QgsGrassMapcalcObject::type() const
{
return mType;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassmapcalc.h
Expand Up @@ -363,7 +363,7 @@ class QgsGrassMapcalcObject: public QGraphicsRectItem, public QgsGrassMapcalcIte
QgsGrassMapcalcConnector *connector = 0, int end = 0 );

// Object type
int type();
virtual int type() const;

// Value
QString value() { return mValue; }
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qtermwidget/ShellCommand.cpp
Expand Up @@ -65,7 +65,7 @@ ShellCommand::ShellCommand( const QString& command , const QStringList& argument
_arguments = arguments;

if ( !_arguments.isEmpty() )
_arguments[0] == command;
_arguments[0] = command;
}
QString ShellCommand::fullCommand() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -2279,7 +2279,7 @@ QString *QgsGrassProvider::insertAttributes( int field, int cat )
return executeSql( field, query );
}

QString *QgsGrassProvider::deleteAttributes( int field, int cat )
QString *QgsGrassProvider::deleteAttribute( int field, int cat )
{
QgsDebugMsg( QString( "field = %1 cat = %2" ).arg( field ).arg( cat ) );

Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassprovider.h
Expand Up @@ -429,7 +429,7 @@ class GRASS_EXPORT QgsGrassProvider : public QgsVectorDataProvider
* @param cat
* @return empty string or error message
*/
QString *deleteAttributes( int field, int cat );
QString *deleteAttribute( int field, int cat );

/** Check if a database row exists and it is orphan (no more lines with
* that category)
Expand Down

0 comments on commit 7689076

Please sign in to comment.