Skip to content

Commit

Permalink
fix warnings from clang/gcc 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 1, 2012
1 parent d9e9943 commit 8ae7651
Show file tree
Hide file tree
Showing 50 changed files with 90 additions and 67 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
1 change: 1 addition & 0 deletions src/analysis/raster/qgsrastercalcparser.yy
Expand Up @@ -110,6 +110,7 @@ void addToTmpNodes(QgsRasterCalcNode* node)
void joinTmpNodes(QgsRasterCalcNode* parent, QgsRasterCalcNode* left, QgsRasterCalcNode* right)
{
bool res;
Q_UNUSED( res );

if (left)
{
Expand Down
1 change: 1 addition & 0 deletions src/analysis/vector/qgsgeometryanalyzer.cpp
Expand Up @@ -1175,6 +1175,7 @@ QgsPoint QgsGeometryAnalyzer::createPointOffset( double x, double y, double dist
normalY *= ( dist / normalLength );

double debugLength = sqrt( normalX * normalX + normalY * normalY ); //control
Q_UNUSED( debugLength );

return QgsPoint( x - normalX, y - normalY ); //negative values -> left side, positive values -> right side
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/qgsgeometryanalyzer.h
Expand Up @@ -148,7 +148,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
bool forceSingleType = false );
/**Create geometry offset relative to line geometry.
@param geom the geometry to modify
@param the line geometry to wich the feature is referenced
@param lineGeom the line geometry to wich the feature is referenced
@param offset the offset value in layer unit. Negativ value means offset towards left, positive value is offset to the right side*/
void createOffsetGeometry( QgsGeometry* geom, QgsGeometry* lineGeom, double offset );
QgsPoint createPointOffset( double x, double y, double dist, QgsGeometry* lineGeom ) const;
Expand Down
4 changes: 2 additions & 2 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -244,7 +244,7 @@ void QgsLegend::removeAll()
mDropTarget = 0;
}

void QgsLegend::selectAll( bool select )
void QgsLegend::selectAll( bool visible )
{
if ( !mMapCanvas || mMapCanvas->isDrawing() )
{
Expand All @@ -259,7 +259,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 selectAll( bool visible );

/*!
* Slot called when user wishes to add a new empty layer group to the legend.
Expand Down
1 change: 1 addition & 0 deletions src/app/main.cpp
Expand Up @@ -75,6 +75,7 @@ typedef SInt32 SRefCon;
#include "qgslogger.h"

#if defined(linux) && ! defined(ANDROID)
#include <unistd.h>
#include <execinfo.h>
#endif

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
1 change: 1 addition & 0 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -299,6 +299,7 @@ bool QgsCoordinateReferenceSystem::axisInverted() const
{
OGRAxisOrientation orientation;
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
Q_UNUSED( axis0 );
mAxisInverted = mGeoFlag
? ( orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: ( orientation == OAO_North || orientation == OAO_South );
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 @@ -242,7 +242,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 @@ -314,7 +314,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 @@ -341,7 +341,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
1 change: 1 addition & 0 deletions src/core/qgssearchstringparser.yy
Expand Up @@ -215,6 +215,7 @@ void addToTmpNodes(QgsSearchTreeNode* node)
void joinTmpNodes(QgsSearchTreeNode* parent, QgsSearchTreeNode* left, QgsSearchTreeNode* right)
{
bool res;
Q_UNUSED( res );

if (left)
{
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 @@ -24,6 +24,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 @@ -446,9 +446,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
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgssymbollayerv2registry.h
Expand Up @@ -19,6 +19,8 @@ class CORE_EXPORT QgsSymbolLayerV2AbstractMetadata
QgsSymbolLayerV2AbstractMetadata( QString name, QString visibleName, QgsSymbolV2::SymbolType type )
: mName( name ), mVisibleName( visibleName ), mType( type ) {}

virtual ~QgsSymbolLayerV2AbstractMetadata() {}

QString name() const { return mName; }
QString visibleName() const { return mVisibleName; }
QgsSymbolV2::SymbolType type() const { return mType; }
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
12 changes: 6 additions & 6 deletions src/plugins/georeferencer/qgsleastsquares.cpp
Expand Up @@ -94,10 +94,10 @@ void QgsLeastSquares::helmert( std::vector<QgsPoint> mapCoords,
that this is correct but I derived it myself late at night. Look at
helmert.jpg if you suspect bugs. */

double MData[] = { A, -B, n, 0,
B, A, 0, n,
G + H, 0, A, B,
0, G + H, -B, A
double MData[] = { A, -B, ( double ) n, 0.,
B, A, 0., ( double ) n,
G + H, 0., A, B,
0., G + H, -B, A
};

double bData[] = { C, D, E + F, J - I };
Expand Down Expand Up @@ -151,8 +151,8 @@ void QgsLeastSquares::affine( std::vector<QgsPoint> mapCoords,
I *think* that this is correct but I derived it myself late at night.
Look at affine.jpg if you suspect bugs. */

double MData[] = { A, B, 0, 0, n, 0,
0, 0, A, B, 0, n,
double MData[] = { A, B, 0, 0, ( double ) n, 0,
0, 0, A, B, 0, ( double ) n,
E, G, 0, 0, A, 0,
G, F, 0, 0, B, 0,
0, 0, E, G, 0, A,
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

0 comments on commit 8ae7651

Please sign in to comment.