Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix some warnings and suppression warnings on windows
  • Loading branch information
jef-n committed Jul 6, 2015
1 parent 8e488ca commit 688f275
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
29 changes: 16 additions & 13 deletions CMakeLists.txt
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgis.d.rast.c
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgis.r.in.cpp
Expand Up @@ -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++ )
{
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassrasterprovider.cpp
Expand Up @@ -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 )
{
Expand Down
1 change: 0 additions & 1 deletion src/server/qgswmsserver.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 688f275

Please sign in to comment.