Skip to content

Commit 2e52cb5

Browse files
committed
fix windows build and a couple of warnings
1 parent 2d9115f commit 2e52cb5

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

src/analysis/vector/qgsgeometryanalyzer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ bool QgsGeometryAnalyzer::eventLayer( QgsVectorLayer* lineLayer, QgsVectorLayer*
958958
eventLayer->select( eventLayer->pendingAllAttributesList(), QgsRectangle(), false, false );
959959
QgsGeometry* lrsGeom = 0;
960960
QgsFeature lineFeature;
961-
double measure1, measure2;
961+
double measure1, measure2 = 0.0;
962962

963963
int nEventFeatures = eventLayer->pendingFeatureCount();
964964
int featureCounter = 0;
@@ -1271,7 +1271,7 @@ unsigned char* QgsGeometryAnalyzer::locateBetweenWkbString( unsigned char* ptr,
12711271
{
12721272
int* nPoints = ( int* ) ptr;
12731273
ptr += sizeof( int );
1274-
double prevx, prevy, prevz;
1274+
double prevx = 0.0, prevy = 0.0, prevz = 0.0;
12751275
double *x, *y, *z;
12761276
QgsPolyline currentLine;
12771277

@@ -1323,7 +1323,7 @@ unsigned char* QgsGeometryAnalyzer::locateAlongWkbString( unsigned char* ptr, Qg
13231323
{
13241324
int* nPoints = ( int* ) ptr;
13251325
ptr += sizeof( int );
1326-
double prevx, prevy, prevz;
1326+
double prevx = 0.0, prevy = 0.0, prevz = 0.0;
13271327
double *x, *y, *z;
13281328

13291329
QgsPoint pt1, pt2;

src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void QgsLegend::mouseMoveEvent( QMouseEvent * e )
433433
showItem( "layer/group" , item );
434434

435435
int line_x = visualItemRect( item ).left();
436-
int line_y;
436+
int line_y = 0;
437437
if ( layer )
438438
{
439439
QTreeWidgetItem *lastItem = item->childCount() > 0 && item->isExpanded() ? item->child( item->childCount() - 1 ) : item;

src/core/gps/qgsgpsdetector.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
#include <QList>
2323
#include <QPair>
2424

25+
#ifdef _MSC_VER
26+
// qextserialport.h includes windows.h,
27+
// which defines min()/max() macros w/o NOMINMAX,
28+
// which in turn breaks limits std::numeric_limits<T>::min()/max()
29+
#define NOMINMAX
30+
#endif
31+
2532
#include "qextserialport.h"
2633

2734
class QgsGPSConnection;

src/gui/raster/qgsrasterhistogramwidget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ void QgsRasterHistogramWidget::histoAction( const QString actionName, bool actio
676676
else if ( actionName.left( 5 ) == "Load " && mRendererWidget )
677677
{
678678
QVector<int> myBands;
679+
#if 0
679680
double minMaxValues[2];
681+
#endif
680682
bool ok = false;
681683

682684
// find which band(s) need updating (all or current)

src/providers/grass/qgsgrassrasterprovider.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ double QgsGrassRasterProvider::noDataValue() const
270270
// limit: 1.7976931348623157e+308
271271
nul = -1e+300;
272272
}
273-
else if ( mGrassDataType == FCELL_TYPE )
273+
else
274274
{
275+
if ( mGrassDataType != FCELL_TYPE )
276+
QgsDebugMsg( "unexpected data type" );
277+
275278
// limit: 3.40282347e+38
276279
nul = -1e+30;
277280
}
@@ -303,7 +306,7 @@ QList<QgsColorRampShader::ColorRampItem> QgsGrassRasterProvider::colorTable( int
303306
QList<QgsGrass::Color> colors = QgsGrass::colors( mGisdbase, mLocation, mMapset, mMapName );
304307
QList<QgsGrass::Color>::iterator i;
305308

306-
double v, r, g, b;
309+
double v = 0.0, r = 0.0, g = 0.0, b = 0.0;
307310
for ( i = colors.begin(); i != colors.end(); ++i )
308311
{
309312
if ( ct.count() == 0 || i->value1 != v || i->red1 != r || i->green1 != g || i->blue1 != b )

0 commit comments

Comments
 (0)