Skip to content

Commit

Permalink
Avoid some warnings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 13, 2016
1 parent f0d8efb commit 4181ef8
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp
Expand Up @@ -349,7 +349,7 @@ void QwtPolarLayout::activate( const QwtPolarPlot *plot,

QRectF rect( boundingRect ); // undistributed rest of the plot rect
rect.adjust( d_data->margin, d_data->margin,
-d_data->margin, -d_data->margin );
-1.0 * d_data->margin, -1.0 * d_data->margin );

// We extract all layout relevant data from the widgets
// and save them to d_data->layoutData.
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Expand Up @@ -37,6 +37,9 @@

extern "C"
{
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>
}

Expand Down
2 changes: 2 additions & 0 deletions src/providers/gdal/qgsgdaldataitems.cpp
Expand Up @@ -53,10 +53,12 @@ QgsGdalLayerItem::~QgsGdalLayerItem()
{
}

Q_NOWARN_DEPRECATED_PUSH
QgsLayerItem::Capability QgsGdalLayerItem::capabilities()
{
return mCapabilities & SetCrs ? SetCrs : NoCapabilities;
}
Q_NOWARN_DEPRECATED_POP

bool QgsGdalLayerItem::setCrs( QgsCoordinateReferenceSystem crs )
{
Expand Down
3 changes: 3 additions & 0 deletions src/providers/gdal/qgsgdaldataitems.h
Expand Up @@ -17,6 +17,7 @@

#include "qgsdataitem.h"

Q_NOWARN_DEPRECATED_PUSH
class QgsGdalLayerItem : public QgsLayerItem
{
Q_OBJECT
Expand All @@ -32,11 +33,13 @@ class QgsGdalLayerItem : public QgsLayerItem
~QgsGdalLayerItem();

bool setCrs( QgsCoordinateReferenceSystem crs ) override;

Q_DECL_DEPRECATED Capability capabilities() override;

QVector<QgsDataItem*> createChildren() override;

QString layerName() const override;
};
Q_NOWARN_DEPRECATED_POP

#endif // QGSGDALDATAITEMS_H
14 changes: 13 additions & 1 deletion src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -105,8 +105,13 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, QgsError error )
, mYBlockSize( 0 )
, mGdalBaseDataset( nullptr )
, mGdalDataset( nullptr )
, mGeoTransform()
{
mGeoTransform[0] = 0;
mGeoTransform[1] = 1;
mGeoTransform[2] = 0;
mGeoTransform[3] = 0;
mGeoTransform[4] = 0;
mGeoTransform[5] = -1;
setError( error );
}

Expand All @@ -123,6 +128,13 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, bool update )
, mGdalBaseDataset( nullptr )
, mGdalDataset( nullptr )
{
mGeoTransform[0] = 0;
mGeoTransform[1] = 1;
mGeoTransform[2] = 0;
mGeoTransform[3] = 0;
mGeoTransform[4] = 0;
mGeoTransform[5] = -1;

QgsDebugMsg( "constructing with uri '" + uri + "'." );

QgsGdalProviderBase::registerGdalDrivers();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgis.d.rast.c
Expand Up @@ -175,7 +175,7 @@ static int cell_draw( char *name,
size_t raster_size;
#ifdef NAN
double dnul = NAN;
float fnul = NAN;
float fnul = ( float )( NAN );
#else
double dnul = strtod( "NAN", 0 );
float fnul = strtof( "NAN", 0 );
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgis.g.info.c
Expand Up @@ -32,6 +32,9 @@
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>

#if GRASS_VERSION_MAJOR >= 7
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -58,6 +58,9 @@ extern "C"
#include <sys/types.h>
#endif
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>

#if GRASS_VERSION_MAJOR < 7
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -57,6 +57,9 @@
extern "C"
{
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
10 changes: 5 additions & 5 deletions src/providers/grass/qgsgrassrasterprovider.h
Expand Up @@ -20,6 +20,11 @@
#ifndef QGSGRASSRASTERPROVIDER_H
#define QGSGRASSRASTERPROVIDER_H

#include "qgscoordinatereferencesystem.h"
#include "qgsrasterdataprovider.h"
#include "qgsrectangle.h"
#include "qgscolorrampshader.h"

extern "C"
{
#include <grass/version.h>
Expand All @@ -29,11 +34,6 @@ extern "C"
#endif
}

#include "qgscoordinatereferencesystem.h"
#include "qgsrasterdataprovider.h"
#include "qgsrectangle.h"
#include "qgscolorrampshader.h"

#include <QString>
#include <QStringList>
#include <QDomElement>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvector.cpp
Expand Up @@ -28,6 +28,9 @@ extern "C"
#include <unistd.h>
#endif
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>

#if GRASS_VERSION_MAJOR < 7
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormap.cpp
Expand Up @@ -32,6 +32,9 @@
extern "C"
{
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormaplayer.cpp
Expand Up @@ -27,6 +27,9 @@
extern "C"
{
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormaplayer.h
Expand Up @@ -28,6 +28,9 @@
extern "C"
{
#include <grass/version.h>
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
2 changes: 2 additions & 0 deletions src/providers/ogr/qgsogrdataitems.cpp
Expand Up @@ -59,10 +59,12 @@ QgsOgrLayerItem::~QgsOgrLayerItem()
{
}

Q_NOWARN_DEPRECATED_PUSH
QgsLayerItem::Capability QgsOgrLayerItem::capabilities()
{
return mCapabilities & SetCrs ? SetCrs : NoCapabilities;
}
Q_NOWARN_DEPRECATED_POP

bool QgsOgrLayerItem::setCrs( QgsCoordinateReferenceSystem crs )
{
Expand Down
3 changes: 3 additions & 0 deletions src/providers/ogr/qgsogrdataitems.h
Expand Up @@ -19,6 +19,7 @@
#include "qgsdataitem.h"
#include "qgsogrprovider.h"

Q_NOWARN_DEPRECATED_PUSH
class QgsOgrLayerItem : public QgsLayerItem
{
Q_OBJECT
Expand All @@ -27,9 +28,11 @@ class QgsOgrLayerItem : public QgsLayerItem
~QgsOgrLayerItem();

bool setCrs( QgsCoordinateReferenceSystem crs ) override;

Q_DECL_DEPRECATED Capability capabilities() override;
QString layerName() const override;
};
Q_NOWARN_DEPRECATED_POP

class QgsOgrDataCollectionItem : public QgsDataCollectionItem
{
Expand Down

0 comments on commit 4181ef8

Please sign in to comment.