Skip to content

Commit 5ee5e37

Browse files
committedNov 5, 2019
fix windows build including some warnings
1 parent 375b390 commit 5ee5e37

File tree

12 files changed

+302
-290
lines changed

12 files changed

+302
-290
lines changed
 

‎python/core/auto_generated/qgis.sip.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,16 @@ QString geoWkt();
293293
Wkt string that represents a geographic coord sys
294294
\since QGIS GEOWkt
295295
%End
296+
296297
//! PROJ4 string that represents a geographic coord sys
297298
QString geoProj4();
299+
298300
//! Geographic coord sys from EPSG authority
299301
QString geoEpsgCrsAuthId();
302+
300303
//! Constant that holds the string representation for "No ellips/No CRS"
301304
QString geoNone();
305+
302306
/************************************************************************
303307
* This file has been generated automatically from *
304308
* *

‎src/analysis/raster/qgsninecellfilter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ int QgsNineCellFilter::processRaster( QgsFeedback *feedback )
7676
{
7777
return processRasterCPU( feedback );
7878
}
79+
#ifndef _MSC_VER
7980
return 1;
81+
#endif
8082
#else
8183
return processRasterCPU( feedback );
8284
#endif

‎src/core/qgis.h

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,17 @@ void CORE_EXPORT qgsFree( void *ptr ) SIP_SKIP;
597597

598598
#ifndef SIP_RUN
599599

600-
/**
601-
* Wkt string that represents a geographic coord sys
602-
* \since QGIS GEOWkt
603-
*/
604600
#ifdef _MSC_VER
605-
QString CORE_EXPORT geoWkt()
601+
#define CONSTLATIN1STRING inline const QLatin1String
606602
#else
607-
constexpr QLatin1String CORE_EXPORT geoWkt()
603+
#define CONSTLATIN1STRING constexpr QLatin1String
608604
#endif
605+
606+
/**
607+
* Wkt string that represents a geographic coord sys
608+
* \since QGIS GEOWkt
609+
*/
610+
CONSTLATIN1STRING geoWkt()
609611
{
610612
return QLatin1String(
611613
"GEOGCS[\"WGS 84\", "
@@ -623,34 +625,23 @@ constexpr QLatin1String CORE_EXPORT geoWkt()
623625
}
624626

625627
//! PROJ4 string that represents a geographic coord sys
626-
#ifdef _MSC_VER
627-
QString CORE_EXPORT geoProj4()
628-
#else
629-
constexpr QLatin1String CORE_EXPORT geoProj4()
630-
#endif
628+
CONSTLATIN1STRING geoProj4()
631629
{
632630
return QLatin1String( "+proj=longlat +datum=WGS84 +no_defs" );
633631
}
634632

635633
//! Geographic coord sys from EPSG authority
636-
#ifdef _MSC_VER
637-
QString CORE_EXPORT geoEpsgCrsAuthId()
638-
#else
639-
constexpr QLatin1String CORE_EXPORT geoEpsgCrsAuthId()
640-
#endif
634+
CONSTLATIN1STRING geoEpsgCrsAuthId()
641635
{
642636
return QLatin1String( "EPSG:4326" );
643637
}
644638

645639
//! Constant that holds the string representation for "No ellips/No CRS"
646-
#ifdef _MSC_VER
647-
QString CORE_EXPORT geoNone()
648-
#else
649-
constexpr QLatin1String CORE_EXPORT geoNone()
650-
#endif
640+
CONSTLATIN1STRING geoNone()
651641
{
652642
return QLatin1String( "NONE" );
653643
}
644+
654645
///@cond PRIVATE
655646

656647
//! Delay between the scheduling of 2 preview jobs
@@ -805,15 +796,15 @@ typedef unsigned long long qgssize;
805796
* Wkt string that represents a geographic coord sys
806797
* \since QGIS GEOWkt
807798
*/
808-
QString CORE_EXPORT geoWkt()
799+
QString CORE_EXPORT geoWkt();
809800

810801
//! PROJ4 string that represents a geographic coord sys
811-
QString CORE_EXPORT geoProj4()
802+
QString CORE_EXPORT geoProj4();
812803

813804
//! Geographic coord sys from EPSG authority
814-
QString CORE_EXPORT geoEpsgCrsAuthId()
805+
QString CORE_EXPORT geoEpsgCrsAuthId();
815806

816807
//! Constant that holds the string representation for "No ellips/No CRS"
817-
QString CORE_EXPORT geoNone()
808+
QString CORE_EXPORT geoNone();
818809

819810
#endif

‎src/core/qgsapplication.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ QgsApplication::ApplicationMembers *QgsApplication::sApplicationMembers = nullpt
114114
QgsAuthManager *QgsApplication::sAuthManager = nullptr;
115115
int ABISYM( QgsApplication::sMaxThreads ) = -1;
116116

117-
118117
Q_GLOBAL_STATIC( QStringList, sFileOpenEventList )
119118
Q_GLOBAL_STATIC( QString, sPrefixPath )
120119
Q_GLOBAL_STATIC( QString, sPluginPath )
@@ -232,14 +231,14 @@ void QgsApplication::init( QString profileFolder )
232231
// we run from source directory - not installed to destination (specified prefix)
233232
*sPrefixPath() = QString(); // set invalid path
234233
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
235-
setPluginPath( *sBuildOutputPath() + '/' + QString( QGIS_PLUGIN_SUBDIR ) + '/' + ABISYM( mCfgIntDir ) );
234+
setPluginPath( *sBuildOutputPath() + '/' + QString( QGIS_PLUGIN_SUBDIR ) + '/' + *sCfgIntDir() );
236235
#else
237236
setPluginPath( *sBuildOutputPath() + '/' + QStringLiteral( QGIS_PLUGIN_SUBDIR ) );
238237
#endif
239238
setPkgDataPath( *sBuildOutputPath() + QStringLiteral( "/data" ) ); // in buildDir/data - used for: doc, resources, svg
240239
*sLibraryPath() = *sBuildOutputPath() + '/' + QGIS_LIB_SUBDIR + '/';
241240
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
242-
*sLibexecPath() = *sBuildOutputPath() + '/' + QGIS_LIBEXEC_SUBDIR + '/' + ABISYM( mCfgIntDir ) + '/';
241+
*sLibexecPath() = *sBuildOutputPath() + '/' + QGIS_LIBEXEC_SUBDIR + '/' + *sCfgIntDir() + '/';
243242
#else
244243
*sLibexecPath() = *sBuildOutputPath() + '/' + QGIS_LIBEXEC_SUBDIR + '/';
245244
#endif
@@ -464,9 +463,9 @@ void QgsApplication::setPrefixPath( const QString &prefixPath, bool useDefaultPa
464463
{
465464
*sPrefixPath() = prefixPath;
466465
#if defined(Q_OS_WIN)
467-
if ( *sPrefixPath().endsWith( "/bin" ) )
466+
if ( sPrefixPath()->endsWith( "/bin" ) )
468467
{
469-
*sPrefixPath().chop( 4 );
468+
sPrefixPath()->chop( 4 );
470469
}
471470
#endif
472471
if ( useDefaultPaths && !ABISYM( mRunningFromBuildDir ) )
@@ -736,8 +735,8 @@ QString QgsApplication::resolvePkgPath()
736735
QgsDebugMsgLevel( QStringLiteral( "- source directory: %1" ).arg( sBuildSourcePath()->toUtf8().constData() ), 4 );
737736
QgsDebugMsgLevel( QStringLiteral( "- output directory of the build: %1" ).arg( sBuildOutputPath()->toUtf8().constData() ), 4 );
738737
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
739-
ABISYM( mCfgIntDir ) = appPath.split( '/', QString::SkipEmptyParts ).last();
740-
qDebug( "- cfg: %s", ABISYM( mCfgIntDir ).toUtf8().constData() );
738+
*sCfgIntDir() = appPath.split( '/', QString::SkipEmptyParts ).last();
739+
qDebug( "- cfg: %s", sCfgIntDir()->toUtf8().constData() );
741740
#endif
742741
}
743742
}
@@ -1101,12 +1100,12 @@ QString QgsApplication::userFullName()
11011100
//note - this only works for accounts connected to domain
11021101
if ( GetUserNameEx( NameDisplay, ( TCHAR * )name, &size ) )
11031102
{
1104-
sUserFullName = QString::fromLocal8Bit( name );
1103+
*sUserFullName() = QString::fromLocal8Bit( name );
11051104
}
11061105

11071106
//fall back to login name
11081107
if ( sUserFullName()->isEmpty() )
1109-
sUserFullName = userLoginName();
1108+
*sUserFullName() = userLoginName();
11101109
#elif defined(Q_OS_ANDROID) || defined(__MINGW32__)
11111110
*sUserFullName() = QStringLiteral( "Not available" );
11121111
#else
@@ -1604,6 +1603,13 @@ QString QgsApplication::buildOutputPath()
16041603
return *sBuildOutputPath();
16051604
}
16061605

1606+
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
1607+
QString QgsApplication::cfgIntDir()
1608+
{
1609+
return *sCfgIntDir();
1610+
}
1611+
#endif
1612+
16071613
void QgsApplication::skipGdalDriver( const QString &driver )
16081614
{
16091615
if ( sGdalSkipList()->contains( driver ) || driver.isEmpty() )

‎src/core/qgsapplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class CORE_EXPORT QgsApplication : public QApplication
514514
//! Indicates whether running from build directory (not installed)
515515
static bool isRunningFromBuildDir() { return ABISYM( mRunningFromBuildDir ); }
516516
#if defined(_MSC_VER) && !defined(USING_NMAKE) && !defined(USING_NINJA)
517-
static QString cfgIntDir() { return ABISYM( mCfgIntDir ); } SIP_SKIP
517+
static QString cfgIntDir() SIP_SKIP;
518518
#endif
519519
//! Returns path to the source directory. Valid only when running from build directory
520520
static QString buildSourcePath();

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ QString QgsCoordinateReferenceSystem::toWkt( WktVariant variant, bool multiline,
17551755
#if PROJ_VERSION_MAJOR>=6
17561756
if ( d->mPj )
17571757
{
1758-
PJ_WKT_TYPE type;
1758+
PJ_WKT_TYPE type = PJ_WKT1_GDAL;
17591759
switch ( variant )
17601760
{
17611761
case WKT1_GDAL:

‎src/core/qgsprojutils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ QgsProjUtils::proj_pj_unique_ptr QgsProjUtils::crsToSingleCrs( const PJ *crs )
181181
return QgsProjUtils::proj_pj_unique_ptr( proj_clone( context, crs ) );
182182
}
183183

184+
#ifndef _MSC_VER // unreachable
184185
return nullptr;
186+
#endif
185187
}
186188

187189
bool QgsProjUtils::coordinateOperationIsAvailable( const QString &projDef )

‎src/gui/editorwidgets/qgsdoublespinbox.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
// This is required because private implementation of
3030
// QAbstractSpinBoxPrivate checks for specialText emptiness
3131
// and skips specialText handling if it's empty
32+
#ifdef _MSC_VER
33+
static QChar SPECIAL_TEXT_WHEN_EMPTY = QChar( 0x2063 );
34+
#else
3235
static constexpr QChar SPECIAL_TEXT_WHEN_EMPTY = QChar( 0x2063 );
36+
#endif
37+
3338

3439
QgsDoubleSpinBox::QgsDoubleSpinBox( QWidget *parent )
3540
: QDoubleSpinBox( parent )

‎src/gui/editorwidgets/qgsspinbox.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
// This is required because private implementation of
3030
// QAbstractSpinBoxPrivate checks for specialText emptiness
3131
// and skips specialText handling if it's empty
32+
#ifdef _MSC_VER
33+
static QChar SPECIAL_TEXT_WHEN_EMPTY = QChar( 0x2063 );
34+
#else
3235
static constexpr QChar SPECIAL_TEXT_WHEN_EMPTY = QChar( 0x2063 );
36+
#endif
3337

3438
QgsSpinBox::QgsSpinBox( QWidget *parent )
3539
: QSpinBox( parent )

‎src/gui/layertree/qgslayertreeviewitemdelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class QgsLayerTreeViewProxyStyle : public QgsProxyStyle
4848

4949
QRect subElementRect( SubElement element, const QStyleOption *option, const QWidget *widget ) const override;
5050

51-
static const unsigned long SE_LayerTreeItemIndicator = SE_CustomBase + 1;
51+
static const auto SE_LayerTreeItemIndicator = SE_CustomBase + 1;
5252

5353
private:
5454
QgsLayerTreeView *mLayerTreeView;

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 249 additions & 251 deletions
Large diffs are not rendered by default.

‎tests/src/3d/testqgstessellator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ void TestQgsTessellator::testBoundsScaling()
357357
polygon.fromWkt( "POLYGON((1 1, 1.00000001 1, 1.00000001 1.00000001, 1 1.0000000001, 1 1))" );
358358

359359
QList<TriangleCoords> tc;
360-
tc << TriangleCoords( QVector3D( 0, 1e-10, 0 ), QVector3D( 1e-08, 0, 0 ), QVector3D( 1e-08, 1e-08, 0 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ) );
361-
tc << TriangleCoords( QVector3D( 0, 1e-10, 0 ), QVector3D( 0, 0, 0 ), QVector3D( 1e-08, 0, 0 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ) );
360+
tc << TriangleCoords( QVector3D( 0, 1e-10f, 0 ), QVector3D( 1e-08f, 0, 0 ), QVector3D( 1e-08f, 1e-08f, 0 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ) );
361+
tc << TriangleCoords( QVector3D( 0, 1e-10f, 0 ), QVector3D( 0, 0, 0 ), QVector3D( 1e-08f, 0, 0 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ), QVector3D( 0, 0, 1 ) );
362362

363363
// without using bounds -- numerically unstable, expect no result
364364
QgsTessellator t( 0, 0, true );

0 commit comments

Comments
 (0)
Please sign in to comment.