diff --git a/Modules/Applications/AppFiltering/app/otbDespeckle.cxx b/Modules/Applications/AppFiltering/app/otbDespeckle.cxx index 63b4a10765bdba1a27bf1f00e8f07282b5df6a28..a580f1243bf5fb3309a2e529c1d0e524eaf2382b 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 d12482eb5e89eaca3ed82746b4061aab491fc87a..4d5b55f8f501eaac3da239478c5edcd24bd662cf 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 500873fdb834b5b7bf8208b1e0864eb55ced733a..449aebf44a880a0aa5089e9bcc6b19be6f712540 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 7afb602e6d7de0b8dbe2a4354d83ef10c03594d1..793cadc98ed87bce117e279f23c62929fe749a63 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 10e1cc2d83fd5ed4cd9719a1f96e8626d5c5a311..5e15182a9e3af66eb0b2f9a57c5e9c567bb04007 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 c214d733c4b0ecbf7ef808897888fa914ace9d22..9625cd73896b2e6199895d760985773ba4451702 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 ec0fff3759945a59bcf0c8e4af3e902b42ede380..55ced3296175abd68419f7c209ff0148a357ebb0 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 aab2bb9592d00d09eaac57807a61dbf713892157..ac51cb86ba9f512073c3ce377569ec388da35d1e 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 c61e77fd9a38eef888b8018879820a7a018fccfe..07b749c19f857aad1fba86a0ddc4734ca7b9ea03 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 65397990bfa58d29b99c982696632727799a7f0d..4ed5faa9061fc532eb095112887c6d7c53b3854f 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 2d7ffd7c7ec8f7ffa466e51c4048a2ce0a2acf7f..ad036fb3b24fb0f92744e1f1d79baadd72cba6a0 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); }