From b1331544c8489b781d9a2ee59412110afb297042 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@orfeo-toolbox.org> Date: Wed, 25 Feb 2015 17:16:33 +0100 Subject: [PATCH] WRG: Fixing a bunch of warnings --- .../Applications/AppFiltering/app/otbDespeckle.cxx | 4 ++-- .../AppFusion/app/otbPansharpening.cxx | 8 ++++---- .../AppImageUtils/app/otbDownloadSRTMTiles.cxx | 8 ++++---- .../otbImageToLineSpatialObjectListFilter.h | 1 + .../MathParser/include/otbBandMathImageFilter.h | 1 + .../include/otbSparseUnmixingImageFilter.h | 1 + Modules/IO/TestKernel/src/otbTestHelper.cxx | 3 +++ .../test/otbAtmosphericCorrectionSequencement.cxx | 12 ++++++------ ...tanceToRomaniaSurfaceReflectanceImageFilter.cxx | 14 +++++++------- ...urfaceAdjacencyEffectCorrectionSchemeFilter.cxx | 14 +++++++------- .../include/otbVectorDataToLabelImageFilter.txx | 10 +++++----- 11 files changed, 41 insertions(+), 35 deletions(-) diff --git a/Modules/Applications/AppFiltering/app/otbDespeckle.cxx b/Modules/Applications/AppFiltering/app/otbDespeckle.cxx index 63b4a10765..a580f1243b 100644 --- a/Modules/Applications/AppFiltering/app/otbDespeckle.cxx +++ b/Modules/Applications/AppFiltering/app/otbDespeckle.cxx @@ -111,7 +111,7 @@ private: FloatVectorImageType* inVImage = GetParameterImage("in"); // Transform to otb::Image - typedef otb::Image<FloatVectorImageType::InternalPixelType> FloatImageType; + typedef otb::Image<FloatVectorImageType::InternalPixelType> InternalFloatImageType; typedef otb::MultiToMonoChannelExtractROI<float,float> ExtractFilterType; ExtractFilterType::Pointer channelSelect = ExtractFilterType::New(); @@ -119,7 +119,7 @@ private: channelSelect->SetChannel(1); channelSelect->SetInput(inVImage); channelSelect->UpdateOutputInformation(); - FloatImageType::Pointer inImage = channelSelect->GetOutput(); + InternalFloatImageType::Pointer inImage = channelSelect->GetOutput(); inImage->UpdateOutputInformation(); switch (GetParameterInt("filter")) diff --git a/Modules/Applications/AppFusion/app/otbPansharpening.cxx b/Modules/Applications/AppFusion/app/otbPansharpening.cxx index d12482eb5e..4d5b55f8f5 100644 --- a/Modules/Applications/AppFusion/app/otbPansharpening.cxx +++ b/Modules/Applications/AppFusion/app/otbPansharpening.cxx @@ -147,8 +147,8 @@ private: } // Transform the PAN image to otb::Image - typedef otb::Image<FloatVectorImageType::InternalPixelType> FloatImageType; - typedef itk::VectorIndexSelectionCastImageFilter<FloatVectorImageType, FloatImageType> VectorIndexSelectionCastImageFilterType; + typedef otb::Image<FloatVectorImageType::InternalPixelType> InternalFloatImageType; + typedef itk::VectorIndexSelectionCastImageFilter<FloatVectorImageType, InternalFloatImageType> VectorIndexSelectionCastImageFilterType; VectorIndexSelectionCastImageFilterType::Pointer channelSelect = VectorIndexSelectionCastImageFilterType::New(); m_Ref.push_back(channelSelect.GetPointer()); @@ -156,7 +156,7 @@ private: channelSelect->SetInput(panchroV); channelSelect->UpdateOutputInformation(); - FloatImageType::Pointer panchro = channelSelect->GetOutput(); + InternalFloatImageType::Pointer panchro = channelSelect->GetOutput(); FloatVectorImageType* xs = GetParameterImage("inxs"); switch (GetParameterInt("method")) @@ -184,7 +184,7 @@ private: double radiusx = static_cast<unsigned int> (GetParameterInt("method.lmvm.radiusx")); double radiusy = static_cast<unsigned int> (GetParameterInt("method.lmvm.radiusy")); - FloatImageType::SizeType radius; + InternalFloatImageType::SizeType radius; radius[0] = radiusx; radius[1] = radiusy; diff --git a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx index 500873fdb8..449aebf44a 100644 --- a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx @@ -264,12 +264,12 @@ private: } //Construct SRTM tile filename based on min/max lat/long - for (int i = floorMinLat; i <= floorMaxLat; ++i) + for (int k = floorMinLat; k <= floorMaxLat; ++k) { for (int j = floorMinLong; j <= floorMaxLong; ++j) { std::ostringstream ossOutput; - if (i < 0) + if (k < 0) { ossOutput << "S"; } @@ -278,11 +278,11 @@ private: ossOutput << "N"; } - if (vcl_abs(i) <= 9) + if (vcl_abs(k) <= 9) { ossOutput << "0"; } - ossOutput << vcl_abs(i); + ossOutput << vcl_abs(k); if (j < 0) { diff --git a/Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.h b/Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.h index 7afb602e6d..793cadc98e 100644 --- a/Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.h +++ b/Modules/Core/SpatialObjects/include/otbImageToLineSpatialObjectListFilter.h @@ -76,6 +76,7 @@ public: const InputImageType * GetInput(void); /** Set/Get the list of LineSpatialObject of this process object. */ + using Superclass::SetOutput; void SetOutput(const LinesListType *list); LinesListType * GetOutput(void); diff --git a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.h b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.h index 10e1cc2d83..5e15182a9e 100644 --- a/Modules/Filtering/MathParser/include/otbBandMathImageFilter.h +++ b/Modules/Filtering/MathParser/include/otbBandMathImageFilter.h @@ -106,6 +106,7 @@ public: typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; /** Set the nth filter input with or without a specified associated variable name */ + using Superclass::SetNthInput; void SetNthInput( DataObjectPointerArraySizeType idx, const ImageType * image); void SetNthInput( DataObjectPointerArraySizeType idx, const ImageType * image, const std::string& varName); diff --git a/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.h b/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.h index c214d733c4..9625cd7389 100644 --- a/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.h +++ b/Modules/Hyperspectral/Unmixing/include/otbSparseUnmixingImageFilter.h @@ -110,6 +110,7 @@ public: typedef typename TransformFilterType::OutputImageListPointerType OutputImageListPointerType; typedef typename TransformFilterType::OutputImageIterator OutputImageIterator; + using Superclass::SetInput; void SetInput ( unsigned int i, const InputImageType * ); const InputImageType * GetInput( unsigned int i ) const; diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index ec0fff3759..55ced32961 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -45,7 +45,10 @@ #include "cpl_string.h" #include "cpl_multiproc.h" #include "ogr_api.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include "ogrsf_frmts.h" +#pragma GCC diagnostic pop #define otbPrintDiff(comment, refStr, testStr) \ std::cout << " ---- '" << comment << "' checking ---------------------------" << std::endl; \ diff --git a/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx b/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx index aab2bb9592..ac51cb86ba 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbAtmosphericCorrectionSequencement.cxx @@ -175,12 +175,12 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) fin >> value; valuesVector.push_back(value); } - FilterFunctionValuesType::Pointer functionValues = FilterFunctionValuesType::New(); - functionValues->SetFilterFunctionValues(valuesVector); - functionValues->SetMinSpectralValue(minSpectralValue); - functionValues->SetMaxSpectralValue(maxSpectralValue); - functionValues->SetUserStep(userStep); - paramAcqui->SetWavelengthSpectralBandWithIndex(i, functionValues); + FilterFunctionValuesType::Pointer functionValues2 = FilterFunctionValuesType::New(); + functionValues2->SetFilterFunctionValues(valuesVector); + functionValues2->SetMinSpectralValue(minSpectralValue); + functionValues2->SetMaxSpectralValue(maxSpectralValue); + functionValues2->SetUserStep(userStep); + paramAcqui->SetWavelengthSpectralBandWithIndex(i, functionValues2); } fin.close(); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx index c61e77fd9a..07b749c19f 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx @@ -142,16 +142,16 @@ int otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter(int itkNotUsed(a float maxSpectralValue(0.); float value(0.); - std::ifstream fin; + std::ifstream fin2; //Read input file parameters - fin.open(wavelenghFiles[j]); - fin >> minSpectralValue; //wlinf; - fin >> maxSpectralValue; //wlsup; + fin2.open(wavelenghFiles[j]); + fin2 >> minSpectralValue; //wlinf; + fin2 >> maxSpectralValue; //wlsup; - while (fin.good()) + while (fin2.good()) { std::string line; - std::getline(fin, line); + std::getline(fin2, line); if (!line.empty()) { value = atof(line.c_str()); @@ -159,7 +159,7 @@ int otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter(int itkNotUsed(a } } - fin.close(); + fin2.close(); functionValues->SetFilterFunctionValues(vect); functionValues->SetMinSpectralValue(minSpectralValue); diff --git a/Modules/Radiometry/OpticalCalibration/test/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.cxx b/Modules/Radiometry/OpticalCalibration/test/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.cxx index 65397990bf..4ed5faa906 100644 --- a/Modules/Radiometry/OpticalCalibration/test/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.cxx +++ b/Modules/Radiometry/OpticalCalibration/test/otbSurfaceAdjacencyEffectCorrectionSchemeFilter.cxx @@ -135,22 +135,22 @@ int otbSurfaceAdjacencyEffectCorrectionSchemeFilter(int itkNotUsed(argc), char * float maxSpectralValue(0.); float value(0.); - std::ifstream fin; + std::ifstream fin2; //Read input file parameters - fin.open(wavelenghFiles[j]); - fin >> minSpectralValue; //wlinf; - fin >> maxSpectralValue; //wlsup; + fin2.open(wavelenghFiles[j]); + fin2 >> minSpectralValue; //wlinf; + fin2 >> maxSpectralValue; //wlsup; std::string line; - std::getline(fin, line); - while (std::getline(fin, line) ) + std::getline(fin2, line); + while (std::getline(fin2, line) ) { value = atof(line.c_str()); vect.push_back(value); std::cout << "value " << value << std::endl; } std::cout << "vec size " << vect.size()<< std::endl; - fin.close(); + fin2.close(); functionValues->SetFilterFunctionValues(vect); functionValues->SetMinSpectralValue(minSpectralValue); functionValues->SetMaxSpectralValue(maxSpectralValue); diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx index 2d7ffd7c7e..ad036fb3b2 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.txx @@ -197,20 +197,20 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> oSRS); // From OGRLayer* to OGRGeometryH vector - for (unsigned int idx = 0; idx < ogrLayerVector.size(); ++idx) + for (unsigned int idx2 = 0; idx2 < ogrLayerVector.size(); ++idx2) { // test if the layers contain a field m_BurnField; int burnField = -1; if( !m_BurnAttribute.empty() ) { - burnField = OGR_FD_GetFieldIndex( OGR_L_GetLayerDefn( (OGRLayerH)(ogrLayerVector[idx]) ), + burnField = OGR_FD_GetFieldIndex( OGR_L_GetLayerDefn( (OGRLayerH)(ogrLayerVector[idx2]) ), m_BurnAttribute.c_str() ); // Get the geometries of the layer OGRFeatureH hFeat; - OGR_L_ResetReading( (OGRLayerH)(ogrLayerVector[idx]) ); - while( ( hFeat = OGR_L_GetNextFeature( (OGRLayerH)(ogrLayerVector[idx]) )) != NULL ) + OGR_L_ResetReading( (OGRLayerH)(ogrLayerVector[idx2]) ); + while( ( hFeat = OGR_L_GetNextFeature( (OGRLayerH)(ogrLayerVector[idx2]) )) != NULL ) { OGRGeometryH hGeom; if( OGR_F_GetGeometryRef( hFeat ) == NULL ) @@ -227,7 +227,7 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage> // TODO : if no burnAttribute available, warning or raise an exception?? m_FullBurnValues.push_back(m_DefaultBurnValue++); itkWarningMacro(<<"Failed to find attribute "<<m_BurnAttribute << " in layer " - << OGR_FD_GetName( OGR_L_GetLayerDefn( (OGRLayerH)(ogrLayerVector[idx]) )) + << OGR_FD_GetName( OGR_L_GetLayerDefn( (OGRLayerH)(ogrLayerVector[idx2]) )) <<" .Setting burn value to default = " << m_DefaultBurnValue); } -- GitLab