Skip to content
Permalink
Browse files
fix warnings from clang
  • Loading branch information
jef-n committed Feb 11, 2012
1 parent 2708f17 commit 76890768def3dc3354345955165f0ed37470ae4d
Showing with 65 additions and 60 deletions.
  1. +1 −1 python/core/qgsmaplayer.sip
  2. +2 −2 src/analysis/interpolation/TriDecorator.h
  3. +2 −2 src/app/legend/qgslegend.cpp
  4. +1 −1 src/app/legend/qgslegend.h
  5. +2 −2 src/app/qgisapp.cpp
  6. +1 −1 src/core/pal/hashtable.hpp
  7. +2 −2 src/core/qgsdataprovider.h
  8. +1 −0 src/core/qgsdiagram.h
  9. +3 −3 src/core/qgsexpression.h
  10. +2 −2 src/core/qgsmaplayer.cpp
  11. +2 −3 src/core/qgsmaplayer.h
  12. +1 −1 src/core/raster/qgsrasterlayer.cpp
  13. +4 −4 src/core/raster/qgsrasterlayer.h
  14. +1 −1 src/core/renderer/qgsgraduatedsymbolrenderer.cpp
  15. +1 −1 src/core/spatialite/spatialite.c
  16. +1 −0 src/core/symbology-ng/qgsrendererv2registry.h
  17. +4 −0 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
  18. +2 −1 src/gui/attributetable/qgsattributetablememorymodel.cpp
  19. +2 −1 src/gui/attributetable/qgsattributetablememorymodel.h
  20. +2 −0 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  21. +1 −1 src/mapserver/qgswmsserver.cpp
  22. +1 −0 src/plugins/globe/globe_plugin.h
  23. +2 −2 src/plugins/globe/qgsosgearthtilesource.cpp
  24. +2 −3 src/plugins/globe/qgsosgearthtilesource.h
  25. +1 −1 src/plugins/grass/qgsgrassedit.cpp
  26. +1 −1 src/plugins/grass/qgsgrassmapcalc.cpp
  27. +1 −1 src/plugins/grass/qgsgrassmapcalc.h
  28. +1 −1 src/plugins/grass/qtermwidget/ShellCommand.cpp
  29. +1 −1 src/providers/grass/qgsgrassprovider.cpp
  30. +1 −1 src/providers/grass/qgsgrassprovider.h
  31. +1 −4 src/providers/osm/osmhandler.cpp
  32. +1 −1 src/providers/osm/osmhandler.h
  33. +1 −3 src/providers/postgres/qgspostgresprovider.cpp
  34. +1 −1 src/providers/sqlanywhere/qgssqlanywhereprovider.cpp
  35. +1 −1 src/providers/sqlanywhere/qgssqlanywhereprovider.h
  36. +6 −5 src/providers/wfs/qgswfsprovider.cpp
  37. +3 −3 src/providers/wfs/qgswfsprovider.h
  38. +2 −2 src/providers/wms/qgswmsprovider.h
@@ -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 */
@@ -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;
@@ -210,7 +210,7 @@ void QgsLegend::removeAll()
mDropTarget = 0;
}

void QgsLegend::selectAll( bool select )
void QgsLegend::setLayersVisible( bool visible )
{
if ( !mMapCanvas || mMapCanvas->isDrawing() )
{
@@ -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 );
}
}
@@ -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.
@@ -3219,7 +3219,7 @@ void QgisApp::hideAllLayers()
{
QgsDebugMsg( "hiding all layers!" );

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


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

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


@@ -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.
@@ -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 )
@@ -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 )
@@ -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;
@@ -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; }
@@ -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; }
@@ -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; }
@@ -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
@@ -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;

@@ -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 )
@@ -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 );
@@ -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() ; }
@@ -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 )
{
@@ -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;
@@ -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; }
@@ -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" );
}

@@ -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();
}

@@ -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
*/
@@ -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();
@@ -281,7 +281,7 @@ QImage* QgsWMSServer::getLegendGraphics()
{
if ( !mConfigParser || !mMapRenderer )
{
return false;
return 0;
}

QStringList layersList, stylesList;
@@ -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
@@ -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;
@@ -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 )
{
@@ -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 );
@@ -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
@@ -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: " )
@@ -1542,7 +1542,7 @@ QgsGrassMapcalcObject::~QgsGrassMapcalcObject()
QgsDebugMsg( "exited." );
}

int QgsGrassMapcalcObject::type()
int QgsGrassMapcalcObject::type() const
{
return mType;
}
@@ -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; }
@@ -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
{
@@ -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 ) );

@@ -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)

0 comments on commit 7689076

Please sign in to comment.