Skip to content
Permalink
Browse files

fix some warnings and suppression warnings on windows

  • Loading branch information
jef-n committed Jul 6, 2015
1 parent 8e488ca commit 688f27528b2daa5ee0f80866a9bb832ead521def
@@ -382,23 +382,26 @@ ENDIF()
IF (PEDANTIC)
MESSAGE (STATUS "Pedantic compiler settings enabled")
IF(MSVC)
SET(_warnings "")
IF (NOT USING_NMAKE)
ADD_DEFINITIONS( /W4 )
SET(_warnings "${_warnings} /W4" )
ENDIF (NOT USING_NMAKE)

# disable warnings
ADD_DEFINITIONS( /wd4100 ) # unused formal parameters
ADD_DEFINITIONS( /wd4127 ) # constant conditional expressions (used in Qt template classes)
ADD_DEFINITIONS( /wd4231 ) # nonstandard extension used : 'identifier' before template explicit instantiation (used in Qt template classes)
ADD_DEFINITIONS( /wd4244 ) # conversion from '...' to '...' possible loss of data
ADD_DEFINITIONS( /wd4251 ) # needs to have dll-interface to be used by clients of class (occurs in Qt template classes)
ADD_DEFINITIONS( /wd4275 ) # non dll-interface class '...' used as base for dll-interface class '...'
ADD_DEFINITIONS( /wd4505 ) # unreferenced local function has been removed (QgsRasterDataProvider::extent)
ADD_DEFINITIONS( /wd4510 ) # default constructor could not be generated (sqlite3_index_info, QMap)
ADD_DEFINITIONS( /wd4512 ) # assignment operator could not be generated (sqlite3_index_info)
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal)
ADD_DEFINITIONS( /wd4800 ) # 'int' : forcing value to bool 'true' or 'false' (performance warning)
SET(_warnings "${_warnings} /wd4100 ") # unused formal parameters
SET(_warnings "${_warnings} /wd4127 ") # constant conditional expressions (used in Qt template classes)
SET(_warnings "${_warnings} /wd4231 ") # nonstandard extension used : 'identifier' before template explicit instantiation (used in Qt template classes)
SET(_warnings "${_warnings} /wd4244 ") # conversion from '...' to '...' possible loss of data
SET(_warnings "${_warnings} /wd4251 ") # needs to have dll-interface to be used by clients of class (occurs in Qt template classes)
SET(_warnings "${_warnings} /wd4275 ") # non dll-interface class '...' used as base for dll-interface class '...'
SET(_warnings "${_warnings} /wd4505 ") # unreferenced local function has been removed (QgsRasterDataProvider::extent)
SET(_warnings "${_warnings} /wd4510 ") # default constructor could not be generated (sqlite3_index_info, QMap)
SET(_warnings "${_warnings} /wd4512 ") # assignment operator could not be generated (sqlite3_index_info)
SET(_warnings "${_warnings} /wd4610 ") # user defined constructor required (sqlite3_index_info)
SET(_warnings "${_warnings} /wd4706 ") # assignment within conditional expression (pal)
SET(_warnings "${_warnings} /wd4800 ") # 'int' : forcing value to bool 'true' or 'false' (performance warning)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_warnings}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_warnings}")
ELSE (MSVC)
# add warnings via flags (not as definitions as on Mac -Wall can not be overridden per language )
SET(_warnings "-Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing")
@@ -256,7 +256,7 @@ static int cell_draw( char *name,
if ( data_type == CELL_TYPE )
{
//int nul = -2000000000;
int nul = -2147483648;
int nul = INT_MIN;
fwrite( &nul, 4, 1, fo );
}
else if ( data_type == DCELL_TYPE )
@@ -155,7 +155,7 @@ int main( int argc, char **argv )
void *buf = G_allocate_raster_buf( grass_type );

int expectedSize = cols * QgsRasterBlock::typeSize( qgis_type );
bool isCanceled;
bool isCanceled = false;
QByteArray byteArray;
for ( int row = 0; row < rows; row++ )
{
@@ -108,7 +108,7 @@ QgsGrassRasterProvider::QgsGrassRasterProvider( QString const & uri )
double myInternalNoDataValue;
if ( mGrassDataType == CELL_TYPE )
{
myInternalNoDataValue = -2147483648;
myInternalNoDataValue = INT_MIN;
}
else if ( mGrassDataType == DCELL_TYPE )
{
@@ -1897,7 +1897,6 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const
{
QgsDebugMsg( "Error, could not create output CRS from EPSG" );
throw QgsMapServiceException( "InvalidCRS", "Could not create output CRS" );
return 5;
}
mMapRenderer->setDestinationCrs( outputCRS );
mMapRenderer->setProjectionsEnabled( true );

0 comments on commit 688f275

Please sign in to comment.
You can’t perform that action at this time.