Commit 544cb182 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

Merge branch 'fix_warnings' into 'develop'

Fix warnings

Closes #2015

See merge request !696
parents 3b6edf74 cc952a40
Pipeline #4090 passed with stages
in 89 minutes and 29 seconds
......@@ -168,8 +168,8 @@ public:
using AcquistionParameterType = TAcquistionParameter;
using SatRSRType = TSatRSR;
using SatRSRPointerType = typename SatRSRType::Pointer;
using ProspectType = typename otb::ProspectModel;
using SailType = typename otb::SailModel;
using ProspectType = otb::ProspectModel;
using SailType = otb::SailModel;
using PrecisionType = double;
using PairType = std::pair<PrecisionType, PrecisionType>;
......
......@@ -21,8 +21,6 @@
#ifndef otbOGRDriversInit_h
#define otbOGRDriversInit_h
#include <boost/noncopyable.hpp>
#include "OTBGdalAdaptersExport.h"
namespace otb
......@@ -45,7 +43,7 @@ namespace ogr
* VC++)
* - Non-copyable
*/
class OTBGdalAdapters_EXPORT Drivers : private boost::noncopyable
class OTBGdalAdapters_EXPORT Drivers
{
/** \name Singleton related functions */
//@{
......@@ -59,6 +57,11 @@ private:
Drivers();
/** Destructor. */
~Drivers() = default;
/** Non copyable class */
Drivers(const Drivers&) = delete;
Drivers& operator=(const Drivers&) = delete;
//@}
};
}
......
......@@ -21,7 +21,6 @@
#define otbSpatialReference_h
#include "OTBGdalAdaptersExport.h"
#include "ogr_spatialref.h"
#include <memory>
#include <string>
......@@ -34,6 +33,10 @@
// to have dll-interface to be used by clients of class 'otb::SpatialReference'
// As long as otb::SpatialReference::m_SR is private no need to export this type.
#endif
// causes warning C4251 on Windows
#include "ogr_spatialref.h"
class OGRSpatialReference;
namespace otb
......
......@@ -20,7 +20,14 @@
#include "otbCoordinateTransformation.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4251)
#include "ogr_spatialref.h"
#pragma warning(pop)
#else
#include "ogr_spatialref.h"
#endif
#include <sstream>
#include <stdexcept>
......
......@@ -23,7 +23,16 @@
/*===============================[ Includes ]================================*/
/*===========================================================================*/
#include "otbOGRGeometryWrapper.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4251)
#include "ogr_geometry.h"
#pragma warning(pop)
#else
#include "ogr_geometry.h"
#endif
#ifdef _MSC_VER
// warning conversion int -> bool
......
......@@ -20,7 +20,7 @@
#include "otbSpatialReference.h"
#include "ogr_spatialref.h"
#include "cpl_conv.h"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wunused-local-typedefs"
......
......@@ -27,6 +27,7 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#include <boost/test/unit_test.hpp>
#pragma GCC diagnostic pop
#else
......
......@@ -145,7 +145,9 @@ private:
template <class Tuple, size_t... Is>
void SetInputsImpl(Tuple& t, std::index_sequence<Is...>)
{
std::initializer_list<int>{(this->template SetInput<Is>(std::get<Is>(t)), 0)...};
// Will be easier to write in c++17 with fold expressions
// (this->template SetInput<Is>(std::get<Is>(t)),...);
(void) std::initializer_list<int>{(this->template SetInput<Is>(std::get<Is>(t)), 0)...};
}
template <size_t... Is>
......
......@@ -39,13 +39,15 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimSensorModelFactory.h"
#pragma GCC diagnostic pop
#else
#include "ossim/projection/ossimProjection.h"
#include "ossim/projection/ossimSensorModelFactory.h"
#endif
#include "ossim/projection/ossimSensorModelFactory.h"
#include "ossim/ossimPluginProjectionFactory.h"
......
......@@ -23,9 +23,20 @@
#include <fstream>
#include <sstream>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4251)
#include "gdal_priv.h"
#include "cpl_string.h"
#include "ogr_spatialref.h"
#pragma warning(pop)
#else
#include "gdal_priv.h"
#include "cpl_string.h"
#include "ogr_spatialref.h"
#endif
#include "itkMacro.h"
// Class to store ProjRef, GEOTransform and GCP info
......
......@@ -19,8 +19,17 @@
*/
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4251)
#include "gdal_priv.h"
#include "ogr_core.h"
#pragma warning(pop)
#else
#include "gdal_priv.h"
#include "ogr_core.h"
#endif
#include <iostream>
#include <complex>
......
......@@ -91,7 +91,8 @@ MultiImageFileWriter::Sink<TImage>::GetRegionToWrite() const
throw e;
}
typename itk::ImageRegion<2>::IndexType start {{boxVector[0], boxVector[1]}};
// indices are signed, sizes are unsigned
typename itk::ImageRegion<2>::IndexType start {{static_cast<int>(boxVector[0]), static_cast<int>(boxVector[1])}};
typename itk::ImageRegion<2>::SizeType size {{boxVector[2], boxVector[3]}};
itk::ImageRegion<2> regionToWrite {start , size};
regionToWrite.Crop(m_InputImage->GetLargestPossibleRegion());
......
......@@ -22,5 +22,5 @@
otb_fetch_module(DiapOTBModule
"OTB module for SAR processing in Diapason."
GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
GIT_TAG 79f48869d2a50d588c35560df5ee9dac646418a8
GIT_TAG f84b85352abb75ff3eefafdf0480fcde7fa06173
)
......@@ -32,5 +32,5 @@ A more detailed description can be found on the project website:
http://tully.ups-tlse.fr/lassallep/grm
"
GIT_REPOSITORY https://github.com/orfeotoolbox/GRM
GIT_TAG d8baf51a70207e5e39adb74be1698a27784df10b
GIT_TAG 459943a6fde517cc0dd601dfaca3400e3f1788de
)
......@@ -25,7 +25,7 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// #pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Wshadow"
#endif
......
......@@ -25,7 +25,7 @@
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// #pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Wshadow"
#endif
......
......@@ -34,6 +34,13 @@
#include <iostream>
#include <stdexcept>
#include <sstream>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4275) // warning C4275: non-DLL-interface std::runtime_error used as base for DLL-interface Error
#endif
namespace otb { namespace gl {
......@@ -44,7 +51,17 @@ struct OTBIce_EXPORT Error : public std::runtime_error
{
/** Construct an OpenGL exception related to the OpenGL error code.
*/
Error( GLenum code );
Error( GLenum code ):
std::runtime_error(
[ code ]()
{
std::ostringstream oss;
oss << "OpenGL error #" << code << ": '" << gluErrorString( code ) << "'";
return oss.str();
}()
) {}
}; // End class GlError
......@@ -93,4 +110,8 @@ CheckError()
} // End namespace otb.
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif // otb_GlError_h
......@@ -21,7 +21,6 @@
set(OTBICE_SRCS
otbGeoInterface.cxx
otbGlActor.cxx
otbGlError.cxx
otbGlImageActor.cxx
otbGlMesh.cxx
otbGlROIActor.cxx
......
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbGlError.h"
#include <sstream>
// This
namespace otb
{
namespace gl
{
Error
::Error( GLenum code ) :
std::runtime_error(
[ code ]()
{
std::ostringstream oss;
oss << "OpenGL error #" << code << ": '" << gluErrorString( code ) << "'";
return oss.str();
}()
)
{
}
} // End namespace 'gl'.
} // End namespace 'otb'.
......@@ -112,10 +112,10 @@ Mesh
glVertexAttribPointer(
id,
components,
static_cast<GLint>(components),
m_VBO.GlType(),
GL_FALSE,
m_VBO.Stride( components ),
static_cast<GLsizei>(m_VBO.Stride(components)),
reinterpret_cast< GLvoid const * >( first * m_VBO.Size() )
);
......
......@@ -701,15 +701,15 @@ void ImageViewWidget::ListGlVersions() const
switch( format().profile() )
{
case QGLFormat::NoProfile:
case QSurfaceFormat::NoProfile:
qWarning() << "QGLFormat::NoProfile";
break;
case QGLFormat::CoreProfile:
case QSurfaceFormat::CoreProfile:
qWarning() << "QGLFormat::CoreProfile";
break;
case QGLFormat::CompatibilityProfile:
case QSurfaceFormat::CompatibilityProfile:
qWarning() << "QGLFormat::CompatibilityProfile";
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment