From 0eff4663bd6322d70b514c4ed4e3bec86214fce5 Mon Sep 17 00:00:00 2001 From: Aurelien Bricier <aurelien.bricier@c-s.fr> Date: Mon, 22 Oct 2012 12:25:20 +0200 Subject: [PATCH] WRG: corrected warnings --- .../FeatureExtraction/otbHaralickTextureExtraction.cxx | 3 ++- Applications/FeatureExtraction/otbSFSTextureExtraction.cxx | 4 +++- Applications/RadiometricIndices/otbRadiometricIndices.cxx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx b/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx index 44f856c3d0..32b3863cd3 100644 --- a/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx +++ b/Applications/FeatureExtraction/otbHaralickTextureExtraction.cxx @@ -162,8 +162,9 @@ void DoExecute() { FloatVectorImageType::Pointer inImage = GetParameterImage("in"); inImage->UpdateOutputInformation(); + int nBComp = inImage->GetNumberOfComponentsPerPixel(); - if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() ) + if( GetParameterInt("channel") > nBComp ) { otbAppLogCRITICAL("Selected band is not available..."); return; diff --git a/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx b/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx index 7f6aec1f5f..b8d800372b 100644 --- a/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx +++ b/Applications/FeatureExtraction/otbSFSTextureExtraction.cxx @@ -125,8 +125,10 @@ void DoExecute() { FloatVectorImageType::Pointer inImage = GetParameterImage("in"); inImage->UpdateOutputInformation(); + int nBComp = inImage->GetNumberOfComponentsPerPixel(); - if( GetParameterInt("channel") > inImage->GetNumberOfComponentsPerPixel() ) + + if( GetParameterInt("channel") > nBComp ) { otbAppLogCRITICAL("Selected band is not available..."); return; diff --git a/Applications/RadiometricIndices/otbRadiometricIndices.cxx b/Applications/RadiometricIndices/otbRadiometricIndices.cxx index c86f021b91..a0b1f209f9 100644 --- a/Applications/RadiometricIndices/otbRadiometricIndices.cxx +++ b/Applications/RadiometricIndices/otbRadiometricIndices.cxx @@ -483,7 +483,7 @@ private: void DoExecute() { - unsigned int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); + int nbChan = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); if ( (this->GetParameterInt("channels.blue") <= nbChan) && (this->GetParameterInt("channels.green") <= nbChan) -- GitLab