mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
msvc warning fixes:
* use AUTORCC to avoid locked qrc_images.cpp during build of gui tests * bump minimum version of cmake to 3.0.0 for AUTORCC * suppress some warnings in sip bindings * suppress unreachable warnings and some more * split sip files in more parts to suppress warning BK4504 * also remove old WITH_INTERNAL_YAML from travis
This commit is contained in:
parent
d9a2492fc2
commit
03e0298f49
@ -52,7 +52,6 @@ CMAKE_FLAGS="
|
||||
-DWITH_QWTPOLAR=OFF
|
||||
-DWITH_APIDOC=OFF
|
||||
-DWITH_ASTYLE=OFF
|
||||
-DWITH_INTERNAL_YAML=OFF
|
||||
-DDISABLE_DEPRECATED=ON
|
||||
-DCXX_EXTRA_FLAGS=${CLANG_WARNINGS}
|
||||
"
|
||||
|
@ -21,7 +21,7 @@ MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSIO
|
||||
#############################################################
|
||||
# CMake settings
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
|
||||
|
||||
SET(CMAKE_COLOR_MAKEFILE ON)
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
SET(SIP_INCLUDES)
|
||||
SET(SIP_TAGS)
|
||||
SET(SIP_CONCAT_PARTS 8)
|
||||
SET(SIP_CONCAT_PARTS 10)
|
||||
SET(SIP_DISABLE_FEATURES)
|
||||
SET(SIP_EXTRA_OPTIONS)
|
||||
SET(SIP_EXTRA_OBJECTS)
|
||||
@ -79,10 +79,13 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP CPP_FILES)
|
||||
# Suppress warnings
|
||||
IF(PEDANTIC)
|
||||
IF(MSVC)
|
||||
# 4996 deprecation warnings (bindings re-export deprecated methods)
|
||||
# 4701 potentially uninitialized variable used (sip generated code)
|
||||
# 4702 unreachable code (sip generated code)
|
||||
ADD_DEFINITIONS( /wd4996 /wd4701 /wd4702 )
|
||||
ADD_DEFINITIONS(
|
||||
/wd4189 # local variable is initialized but not referenced
|
||||
/wd4996 # deprecation warnings (bindings re-export deprecated methods)
|
||||
/wd4701 # potentially uninitialized variable used (sip generated code)
|
||||
/wd4702 # unreachable code (sip generated code)
|
||||
/wd4703 # potentially uninitialized local pointer variable 'sipType' used
|
||||
)
|
||||
ELSE(MSVC)
|
||||
# disable all warnings
|
||||
ADD_DEFINITIONS( -w -Wno-deprecated-declarations )
|
||||
|
@ -8,7 +8,7 @@ Following a summary of the required dependencies for building:
|
||||
|
||||
Required build tools:
|
||||
|
||||
- CMake >= 2.8.6
|
||||
- CMake >= 3.0.0
|
||||
- Flex >= 2.5.6
|
||||
- Bison >= 2.4
|
||||
-
|
||||
|
@ -577,7 +577,6 @@ Unregister a previously registered action. (e.g. when plugin is going to be unlo
|
||||
%End
|
||||
|
||||
|
||||
|
||||
virtual QMenu *projectMenu() = 0;
|
||||
%Docstring
|
||||
:rtype: QMenu
|
||||
|
@ -463,8 +463,8 @@ while ($LINE_IDX < $LINE_COUNT){
|
||||
if ( $LINE =~ m/^\s*friend class \w+/ ){
|
||||
next;
|
||||
}
|
||||
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET
|
||||
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED).*?$/){
|
||||
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET etc.
|
||||
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED|NOWARN_DEPRECATED_(PUSH|POP)).*?$/){
|
||||
next;
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ declare -A GLOBREP_IGNORE=()
|
||||
ERRORFOUND=NO
|
||||
|
||||
for I in $(seq -f '%02g' 0 $(($SPLIT-1)) ) ; do
|
||||
( [[ "$INTERACTIVE" =~ YES ]] || [[ "$TRAVIS" =~ true ]] ) && printf "Progress: %d/%d\n" $I $SPLIT
|
||||
( [[ "$INTERACTIVE" =~ YES ]] || [[ "$TRAVIS" =~ true ]] ) && printf "Progress: %d/%d\n" $(( I + 1 )) $SPLIT
|
||||
SPELLFILE=spelling$I~
|
||||
|
||||
# if correction contains an uppercase letter and is the same as the error character wise, this means that the error is searched as a full word and case sensitive (not incorporated in a bigger one)
|
||||
|
@ -16,6 +16,16 @@
|
||||
#include "rscodec.h"
|
||||
#include "../libdwgr.h"
|
||||
|
||||
#if __cplusplus >= 201500
|
||||
#define FALLTHROUGH [[fallthrough]];
|
||||
#elif defined(__clang__)
|
||||
#define FALLTHROUGH //[[clang::fallthrough]]
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 7
|
||||
#define FALLTHROUGH [[gnu::fallthrough]];
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#include "qgslogger.h"
|
||||
|
||||
/** Utility function
|
||||
@ -486,6 +496,9 @@ void dwgCompressor::copyCompBytes21( duint8 *cbuf, duint8 *dbuf, duint32 l, duin
|
||||
for ( int i = 1; i < 5; i++ )
|
||||
dbuf[dix++] = cbuf[six + i];
|
||||
dbuf[dix] = cbuf[six];
|
||||
|
||||
FALLTHROUGH
|
||||
|
||||
case 8: //OK
|
||||
for ( int i = 0; i < 8; i++ ) //RLZ 4[0],4[4] or 4[4],4[0]
|
||||
dbuf[dix++] = cbuf[six++];
|
||||
|
@ -24,6 +24,16 @@
|
||||
|
||||
#include "qgslogger.h"
|
||||
|
||||
#if __cplusplus >= 201500
|
||||
#define FALLTHROUGH [[fallthrough]];
|
||||
#elif defined(__clang__)
|
||||
#define FALLTHROUGH //[[clang::fallthrough]]
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 7
|
||||
#define FALLTHROUGH [[gnu::fallthrough]];
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#define FIRSTHANDLE 48
|
||||
|
||||
#if 0
|
||||
@ -3047,6 +3057,8 @@ bool dxfRW::processPolyline()
|
||||
{
|
||||
processVertex( &pl );
|
||||
}
|
||||
|
||||
FALLTHROUGH
|
||||
}
|
||||
default:
|
||||
pl.parseCode( code, reader );
|
||||
@ -3079,6 +3091,8 @@ bool dxfRW::processVertex( DRW_Polyline *pl )
|
||||
{
|
||||
v = new DRW_Vertex(); //another vertex
|
||||
}
|
||||
|
||||
FALLTHROUGH
|
||||
}
|
||||
default:
|
||||
v->parseCode( code, reader );
|
||||
|
@ -1395,7 +1395,7 @@ void QgsDwgImporter::addEllipse( const DRW_Ellipse &data )
|
||||
|
||||
bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoundCurve &cc )
|
||||
{
|
||||
int vertexnum = data.vertlist.size();
|
||||
size_t vertexnum = data.vertlist.size();
|
||||
if ( vertexnum == 0 )
|
||||
{
|
||||
QgsDebugMsg( "polyline without points" );
|
||||
@ -1407,7 +1407,7 @@ bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoun
|
||||
std::vector<DRW_Vertex2D *>::size_type n = data.flags & 1 ? vertexnum + 1 : vertexnum;
|
||||
for ( std::vector<DRW_Vertex2D *>::size_type i = 0; i < n; i++ )
|
||||
{
|
||||
int i0 = i % vertexnum;
|
||||
size_t i0 = i % vertexnum;
|
||||
|
||||
Q_ASSERT( data.vertlist[i0] != nullptr );
|
||||
QgsDebugMsgLevel( QString( "%1: %2,%3 bulge:%4" ).arg( i ).arg( data.vertlist[i0]->x ).arg( data.vertlist[i0]->y ).arg( data.vertlist[i0]->bulge ), 5 );
|
||||
@ -1439,7 +1439,7 @@ bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoun
|
||||
|
||||
if ( hasBulge && i < n - 1 )
|
||||
{
|
||||
int i1 = ( i + 1 ) % vertexnum;
|
||||
size_t i1 = ( i + 1 ) % vertexnum;
|
||||
|
||||
double a = 2.0 * atan( data.vertlist[i]->bulge );
|
||||
double dx = data.vertlist[i1]->x - data.vertlist[i0]->x;
|
||||
@ -1461,7 +1461,7 @@ bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoun
|
||||
|
||||
void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
|
||||
{
|
||||
int vertexnum = data.vertlist.size();
|
||||
size_t vertexnum = data.vertlist.size();
|
||||
if ( vertexnum == 0 )
|
||||
{
|
||||
QgsDebugMsg( "LWPolyline without vertices" );
|
||||
@ -1476,8 +1476,8 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
|
||||
std::vector<DRW_Vertex2D *>::size_type n = data.flags & 1 ? vertexnum : vertexnum - 1;
|
||||
for ( std::vector<DRW_Vertex2D *>::size_type i = 0; i < n; i++ )
|
||||
{
|
||||
int i0 = i % vertexnum;
|
||||
int i1 = ( i + 1 ) % vertexnum;
|
||||
size_t i0 = i % vertexnum;
|
||||
size_t i1 = ( i + 1 ) % vertexnum;
|
||||
|
||||
QgsPoint p0( QgsWkbTypes::PointZ, data.vertlist[i0]->x, data.vertlist[i0]->y, data.elevation );
|
||||
QgsPoint p1( QgsWkbTypes::PointZ, data.vertlist[i1]->x, data.vertlist[i1]->y, data.elevation );
|
||||
@ -1660,7 +1660,7 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
|
||||
|
||||
void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
|
||||
{
|
||||
int vertexnum = data.vertlist.size();
|
||||
size_t vertexnum = data.vertlist.size();
|
||||
if ( vertexnum == 0 )
|
||||
{
|
||||
QgsDebugMsg( "Polyline without vertices" );
|
||||
@ -1675,8 +1675,8 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
|
||||
std::vector<DRW_Vertex *>::size_type n = data.flags & 1 ? vertexnum : vertexnum - 1;
|
||||
for ( std::vector<DRW_Vertex *>::size_type i = 0; i < n; i++ )
|
||||
{
|
||||
int i0 = i % vertexnum;
|
||||
int i1 = ( i + 1 ) % vertexnum;
|
||||
size_t i0 = i % vertexnum;
|
||||
size_t i1 = ( i + 1 ) % vertexnum;
|
||||
|
||||
QgsPoint p0( QgsWkbTypes::PointZ, data.vertlist[i0]->basePoint.x, data.vertlist[i0]->basePoint.y, data.vertlist[i0]->basePoint.z );
|
||||
QgsPoint p1( QgsWkbTypes::PointZ, data.vertlist[i1]->basePoint.x, data.vertlist[i1]->basePoint.y, data.vertlist[i1]->basePoint.z );
|
||||
@ -1906,24 +1906,24 @@ static std::vector<double> knotu( const DRW_Spline &data, size_t num, size_t ord
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<double> rbasis( int c, double t, int npts,
|
||||
static std::vector<double> rbasis( size_t c, double t, size_t npts,
|
||||
const std::vector<double> &x,
|
||||
const std::vector<double> &h )
|
||||
{
|
||||
int nplusc = npts + c;
|
||||
size_t nplusc = npts + c;
|
||||
std::vector<double> temp( nplusc, 0. );
|
||||
|
||||
// calculate the first order nonrational basis functions n[i]
|
||||
for ( int i = 0; i < nplusc - 1; ++i )
|
||||
for ( size_t i = 0; i < nplusc - 1; ++i )
|
||||
{
|
||||
if ( t >= x[i] && t < x[i + 1] )
|
||||
temp[i] = 1;
|
||||
}
|
||||
|
||||
// calculate the higher order nonrational base functions
|
||||
for ( int k = 2; k <= c; ++k )
|
||||
for ( size_t k = 2; k <= c; ++k )
|
||||
{
|
||||
for ( int i = 0; i < nplusc - k; ++i )
|
||||
for ( size_t i = 0; i < nplusc - k; ++i )
|
||||
{
|
||||
// if the lower order basis function is zero skip the calculation
|
||||
if ( temp[i] != 0 )
|
||||
@ -1941,7 +1941,7 @@ static std::vector<double> rbasis( int c, double t, int npts,
|
||||
|
||||
// calculate sum for denominator of rational basis functions
|
||||
double sum = 0.;
|
||||
for ( int i = 0; i < npts; ++i )
|
||||
for ( size_t i = 0; i < npts; ++i )
|
||||
{
|
||||
sum += temp[i] * h[i];
|
||||
}
|
||||
@ -1951,7 +1951,7 @@ static std::vector<double> rbasis( int c, double t, int npts,
|
||||
// form rational basis functions and put in r vector
|
||||
if ( sum != 0.0 )
|
||||
{
|
||||
for ( int i = 0; i < npts; i++ )
|
||||
for ( size_t i = 0; i < npts; i++ )
|
||||
{
|
||||
r[i] = ( temp[i] * h[i] ) / sum;
|
||||
}
|
||||
@ -1969,7 +1969,7 @@ static void rbspline( const DRW_Spline &data,
|
||||
const std::vector<double> &h,
|
||||
std::vector<QgsPointXY> &p )
|
||||
{
|
||||
int nplusc = npts + k;
|
||||
size_t nplusc = npts + k;
|
||||
|
||||
// generate the open knot vector
|
||||
std::vector<double> x( knot( data, npts, k ) );
|
||||
|
@ -33,6 +33,7 @@ class QgisApp;
|
||||
* plugin.
|
||||
*/
|
||||
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
class APP_EXPORT QgisAppInterface : public QgisInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -519,5 +520,6 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
|
||||
//! Pointer to the PluginManagerInterface object
|
||||
QgsAppPluginManagerInterface pluginManagerIface;
|
||||
};
|
||||
Q_NOWARN_DEPRECATED_POP
|
||||
|
||||
#endif //#define QGISAPPINTERFACE_H
|
||||
|
@ -159,8 +159,10 @@ static GEOSGeometry *LWGEOM_GEOS_buildArea( const GEOSGeometry *geom_in, QString
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
errorMessage = QString( "GEOSPolygonize(): %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
// We should now have a collection
|
||||
@ -505,9 +507,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
GEOSGeom_destroy_r( handle, geos_bound );
|
||||
errorMessage = QString( "GEOSGeom_extractUniquePoints(): %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
try
|
||||
@ -516,10 +520,12 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
GEOSGeom_destroy_r( handle, geos_bound );
|
||||
GEOSGeom_destroy_r( handle, pi );
|
||||
errorMessage = QString( "GEOSGeom_extractUniquePoints(): %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
try
|
||||
@ -528,11 +534,13 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
GEOSGeom_destroy_r( handle, geos_bound );
|
||||
GEOSGeom_destroy_r( handle, pi );
|
||||
GEOSGeom_destroy_r( handle, po );
|
||||
errorMessage = QString( "GEOSDifference(): %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
GEOSGeom_destroy_r( handle, pi );
|
||||
@ -547,9 +555,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
errorMessage = QString( "GEOSGeom_createEmptyPolygon(): %1" ).arg( e.what() );
|
||||
GEOSGeom_destroy_r( handle, geos_cut_edges );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
// See if an area can be build with the remaining edges
|
||||
@ -594,12 +604,14 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
// We did check for empty area already so
|
||||
// this must be some other error
|
||||
errorMessage = QString( "GEOSBoundary() threw an error: %1" ).arg( e.what() );
|
||||
GEOSGeom_destroy_r( handle, new_area );
|
||||
GEOSGeom_destroy_r( handle, geos_area );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
// Now symdif new and old area
|
||||
@ -609,12 +621,14 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
GEOSGeom_destroy_r( handle, geos_cut_edges );
|
||||
GEOSGeom_destroy_r( handle, new_area );
|
||||
GEOSGeom_destroy_r( handle, new_area_bound );
|
||||
GEOSGeom_destroy_r( handle, geos_area );
|
||||
errorMessage = QString( "GEOSSymDifference() threw an error: %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
GEOSGeom_destroy_r( handle, geos_area );
|
||||
@ -636,11 +650,13 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
GEOSGeom_destroy_r( handle, geos_cut_edges );
|
||||
GEOSGeom_destroy_r( handle, new_area_bound );
|
||||
GEOSGeom_destroy_r( handle, geos_area );
|
||||
errorMessage = QString( "GEOSDifference() threw an error: %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
GEOSGeom_destroy_r( handle, geos_cut_edges );
|
||||
GEOSGeom_destroy_r( handle, new_area_bound );
|
||||
@ -688,9 +704,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValidPolygon( const GEOSGeometry *gin, QStr
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
errorMessage = QString( "GEOSGeom_createCollection() threw an error: %1" ).arg( e.what() );
|
||||
// TODO: cleanup!
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
}
|
||||
|
||||
@ -856,9 +874,11 @@ static GEOSGeometry *LWGEOM_GEOS_makeValid( const GEOSGeometry *gin, QString &er
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
// I don't think should ever happen
|
||||
errorMessage = QString( "GEOSisValid(): %1" ).arg( e.what() );
|
||||
return nullptr;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
|
||||
// make what we got valid
|
||||
|
@ -26,6 +26,14 @@
|
||||
|
||||
//! \file tok.h
|
||||
|
||||
#if defined(__clang__)
|
||||
#define FALLTHROUGH //[[clang::fallthrough]]
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 7
|
||||
#define FALLTHROUGH __attribute__((fallthrough));
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#include "tok.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
@ -165,15 +173,21 @@ int nmea_scanf( const char *buff, int buff_sz, const char *format, ... )
|
||||
width = 0;
|
||||
beg_fmt = format;
|
||||
tok_type = NMEA_TOKS_WIDTH;
|
||||
//intentional fall-through
|
||||
|
||||
FALLTHROUGH
|
||||
|
||||
case NMEA_TOKS_WIDTH:
|
||||
{
|
||||
if ( isdigit( *format ) )
|
||||
break;
|
||||
{
|
||||
|
||||
tok_type = NMEA_TOKS_TYPE;
|
||||
if ( format > beg_fmt )
|
||||
width = nmea_atoi( beg_fmt, ( int )( format - beg_fmt ), 10 );
|
||||
|
||||
FALLTHROUGH
|
||||
}
|
||||
|
||||
case NMEA_TOKS_TYPE:
|
||||
beg_tok = buff;
|
||||
|
||||
|
@ -363,8 +363,10 @@ bool GeomFunction::containsCandidate( const GEOSPreparedGeometry *geom, double x
|
||||
}
|
||||
catch ( GEOSException &e )
|
||||
{
|
||||
Q_NOWARN_UNREACHABLE_PUSH
|
||||
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
|
||||
return false;
|
||||
Q_NOWARN_UNREACHABLE_POP
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,9 @@ QString memoryLayerFieldType( QVariant::Type type )
|
||||
return QStringLiteral( "datetime" );
|
||||
|
||||
default:
|
||||
return QStringLiteral( "string" );
|
||||
break;
|
||||
}
|
||||
return QStringLiteral( "string" ); // no warnings
|
||||
return QStringLiteral( "string" );
|
||||
}
|
||||
|
||||
QgsVectorLayer *QgsMemoryProviderUtils::createMemoryLayer( const QString &name, const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs )
|
||||
|
@ -232,7 +232,7 @@ QString qgsVsiPrefix( const QString &path )
|
||||
uint qHash( const QVariant &variant )
|
||||
{
|
||||
if ( !variant.isValid() || variant.isNull() )
|
||||
return -1;
|
||||
return std::numeric_limits<uint>::max();
|
||||
|
||||
switch ( variant.type() )
|
||||
{
|
||||
@ -290,8 +290,8 @@ uint qHash( const QVariant &variant )
|
||||
case QVariant::RegExp:
|
||||
return qHash( variant.toString() );
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return std::numeric_limits<uint>::max();
|
||||
}
|
||||
|
@ -356,20 +356,35 @@ typedef unsigned long long qgssize;
|
||||
|
||||
#ifndef SIP_RUN
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
||||
|
||||
#define Q_NOWARN_DEPRECATED_PUSH \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
|
||||
#define Q_NOWARN_DEPRECATED_POP \
|
||||
_Pragma("GCC diagnostic pop");
|
||||
#define Q_NOWARN_UNREACHABLE_PUSH
|
||||
#define Q_NOWARN_UNREACHABLE_POP
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
#define Q_NOWARN_DEPRECATED_PUSH \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4996))
|
||||
#define Q_NOWARN_DEPRECATED_POP \
|
||||
__pragma(warning(pop))
|
||||
#define Q_NOWARN_UNREACHABLE_PUSH \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4702))
|
||||
#define Q_NOWARN_UNREACHABLE_POP \
|
||||
__pragma(warning(pop))
|
||||
|
||||
#else
|
||||
|
||||
#define Q_NOWARN_DEPRECATED_PUSH
|
||||
#define Q_NOWARN_DEPRECATED_POP
|
||||
#define Q_NOWARN_UNREACHABLE_PUSH
|
||||
#define Q_NOWARN_UNREACHABLE_POP
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -49,7 +49,7 @@ QVector<QgsStackTrace::StackLine> QgsStackTrace::trace( _EXCEPTION_POINTERS *Exc
|
||||
paths = QgsStackTrace::mSymbolPaths.toStdString().c_str();
|
||||
}
|
||||
|
||||
BOOL success = SymInitialize( process, paths, TRUE );
|
||||
SymInitialize( process, paths, TRUE );
|
||||
|
||||
// StackWalk64() may modify context record passed to it, so we will
|
||||
// use a copy.
|
||||
|
@ -1485,6 +1485,8 @@ QgsUnitTypes::DistanceValue QgsUnitTypes::scaledDistance( double distance, QgsUn
|
||||
QgsUnitTypes::AreaValue QgsUnitTypes::scaledArea( double area, QgsUnitTypes::AreaUnit unit, int decimals, bool keepBaseUnit )
|
||||
{
|
||||
AreaValue result;
|
||||
result.value = -1.0;
|
||||
result.unit = AreaUnknownUnit;
|
||||
|
||||
// If we are not forced to keep the base units, switch to meter calculation
|
||||
if ( unit == AreaSquareMillimeters )
|
||||
|
@ -127,7 +127,7 @@ QVariant QgsVectorLayerUtils::createUniqueValue( const QgsVectorLayer *layer, in
|
||||
|
||||
default:
|
||||
// todo other types - dates? times?
|
||||
return QVariant();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,8 +139,8 @@ bool QgsZipUtils::zip( const QString &zipFilename, const QStringList &files )
|
||||
{
|
||||
QString err = QObject::tr( "Error input file does not exist: '%1'" ).arg( file );
|
||||
QgsMessageLog::logMessage( err, QStringLiteral( "QgsZipUtils" ) );
|
||||
return false;
|
||||
zip_close( z );
|
||||
return false;
|
||||
}
|
||||
|
||||
zip_source *src = zip_source_file( z, file.toStdString().c_str(), 0, 0 );
|
||||
|
@ -419,7 +419,7 @@ void QgsLayoutRuler::drawSmallDivisions( QPainter *painter, double startPos, int
|
||||
double smallMarkerPos = startPos;
|
||||
double smallDivisionSpacing = rulerScale / numDivisions;
|
||||
|
||||
double pixelCoord;
|
||||
double pixelCoord = 0.0;
|
||||
|
||||
//draw numDivisions small divisions
|
||||
for ( int i = 0; i < numDivisions; ++i )
|
||||
|
@ -69,6 +69,7 @@ class QgsStatusBar;
|
||||
* could provide their own implementation to be able to use plugins.
|
||||
*/
|
||||
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
class GUI_EXPORT QgisInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -459,7 +460,6 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
#endif
|
||||
virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0 SIP_DEPRECATED;
|
||||
|
||||
|
||||
/** Accessors for inserting items into menus and toolbars.
|
||||
* An item can be inserted before any existing action.
|
||||
*/
|
||||
@ -797,5 +797,6 @@ class GUI_EXPORT QgisInterface : public QObject
|
||||
*/
|
||||
void layerSavedAs( QgsMapLayer *l, const QString &path );
|
||||
};
|
||||
Q_NOWARN_DEPRECATED_POP
|
||||
|
||||
#endif //#ifndef QGISINTERFACE_H
|
||||
|
@ -173,7 +173,7 @@ bool QgsFontButton::event( QEvent *e )
|
||||
{
|
||||
QHelpEvent *helpEvent = static_cast< QHelpEvent *>( e );
|
||||
QString toolTip;
|
||||
double fontSize;
|
||||
double fontSize = 0.0;
|
||||
switch ( mMode )
|
||||
{
|
||||
case ModeTextRenderer:
|
||||
|
@ -583,7 +583,7 @@ QVariant QgsPalettedRendererModel::data( const QModelIndex &index, int role ) co
|
||||
}
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
break;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
@ -361,7 +361,7 @@ GDALResampleAlg QgsImageWarper::toGDALResampleAlg( const QgsImageWarper::Resampl
|
||||
case Lanczos:
|
||||
return GRA_Lanczos;
|
||||
default:
|
||||
return GRA_NearestNeighbour;
|
||||
break;
|
||||
};
|
||||
|
||||
//avoid warning
|
||||
|
@ -43,23 +43,23 @@ extern "C"
|
||||
#include "qgsgrass.h"
|
||||
#include "qgsgrassdatafile.h"
|
||||
|
||||
static struct line_pnts *line = Vect_new_line_struct();
|
||||
static struct line_pnts *gLine = Vect_new_line_struct();
|
||||
|
||||
void writePoint( struct Map_info *map, int type, const QgsPointXY &point, struct line_cats *cats )
|
||||
{
|
||||
Vect_reset_line( line );
|
||||
Vect_append_point( line, point.x(), point.y(), 0 );
|
||||
Vect_write_line( map, type, line, cats );
|
||||
Vect_reset_line( gLine );
|
||||
Vect_append_point( gLine, point.x(), point.y(), 0 );
|
||||
Vect_write_line( map, type, gLine, cats );
|
||||
}
|
||||
|
||||
void writePolyline( struct Map_info *map, int type, const QgsPolyline &polyline, struct line_cats *cats )
|
||||
{
|
||||
Vect_reset_line( line );
|
||||
Vect_reset_line( gLine );
|
||||
Q_FOREACH ( const QgsPointXY &point, polyline )
|
||||
{
|
||||
Vect_append_point( line, point.x(), point.y(), 0 );
|
||||
Vect_append_point( gLine, point.x(), point.y(), 0 );
|
||||
}
|
||||
Vect_write_line( map, type, line, cats );
|
||||
Vect_write_line( map, type, gLine, cats );
|
||||
}
|
||||
|
||||
static struct Map_info *finalMap = 0;
|
||||
|
@ -45,6 +45,16 @@
|
||||
#define QT_NO_DEBUG_OUTPUT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201500
|
||||
#define FALLTHROUGH [[fallthrough]];
|
||||
#elif defined(__clang__)
|
||||
#define FALLTHROUGH //[[clang::fallthrough]]
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 7
|
||||
#define FALLTHROUGH [[gnu::fallthrough]];
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#include "qsql_ocispatial.h"
|
||||
#include "wkbptr.h"
|
||||
|
||||
@ -699,7 +709,10 @@ int QOCISpatialResultPrivate::bindValue( OCIStmt *sql, OCIBind **hbnd, OCIError
|
||||
setCharset( *hbnd, OCI_HTYPE_BIND );
|
||||
break;
|
||||
}
|
||||
} // fall through for OUT values
|
||||
|
||||
FALLTHROUGH
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
const QString s = val.toString();
|
||||
@ -2006,6 +2019,9 @@ bool QOCISpatialCols::execBatch( QOCISpatialResultPrivate *d, QVector<QVariant>
|
||||
columns[i].lengths[row] = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
FALLTHROUGH
|
||||
|
||||
case QVariant::ByteArray:
|
||||
default:
|
||||
{
|
||||
|
@ -195,8 +195,8 @@ QgsSqlExpressionCompiler::Result QgsPostgresExpressionCompiler::compileNode( con
|
||||
}
|
||||
|
||||
default:
|
||||
return QgsSqlExpressionCompiler::compileNode( node, result );
|
||||
break;
|
||||
}
|
||||
|
||||
return Fail;
|
||||
return QgsSqlExpressionCompiler::compileNode( node, result );
|
||||
}
|
||||
|
@ -29,10 +29,10 @@
|
||||
#include "qgis_server.h"
|
||||
#include "qgis_sip.h"
|
||||
#include "qgswmsconfigparser.h"
|
||||
#include "qgsproject.h"
|
||||
|
||||
class QgsServerProjectParser;
|
||||
class QgsAccessControl;
|
||||
class QgsProject;
|
||||
|
||||
class SERVER_EXPORT QgsConfigCache : public QObject
|
||||
{
|
||||
|
@ -75,13 +75,13 @@ INCLUDE_DIRECTORIES(SYSTEM
|
||||
#ENDIF (APPLE)
|
||||
|
||||
SET(IMAGE_RCCS ../../../images/images.qrc)
|
||||
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})
|
||||
|
||||
MACRO (ADD_QGIS_TEST testname testsrc)
|
||||
SET(qgis_${testname}_SRCS ${testsrc} ${util_SRCS})
|
||||
SET(qgis_${testname}_MOC_CPPS ${testsrc})
|
||||
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS} ${IMAGE_RCC_SRCS})
|
||||
ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname}_SRCS} ${IMAGE_RCCS})
|
||||
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTOMOC TRUE)
|
||||
SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES AUTORCC TRUE)
|
||||
TARGET_LINK_LIBRARIES(qgis_${testname}
|
||||
${QT_QTXML_LIBRARY}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
|
Loading…
x
Reference in New Issue
Block a user