From a6747403103a61ad08456d159505f8d97a416a45 Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Tue, 30 Nov 2010 17:56:54 +0100
Subject: [PATCH] WRG

---
 Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx      | 6 +++---
 ...evelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx b/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx
index 2f8bcbc965..b61998fdc6 100644
--- a/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx
+++ b/Testing/Code/Visualization/otbAmplitudeFunctorTest.cxx
@@ -54,7 +54,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[])
       funct.SetChannelList(channels);
       output = funct.operator ()(vectorPixel);
       result = vcl_sqrt(vectorPixel[i] * vectorPixel[i] + vectorPixel[j] * vectorPixel[j]);
-      if( abs(result-output[0]) > 0.0000001)
+      if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001)
         {
           std::cout << "vectorPixelType Test VectorPixelType failed for channels " << i<< " and "
               << j << " !" << std::endl;
@@ -78,7 +78,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[])
       funct.SetChannelList(channels);
       output = funct.operator ()(rgbPixel);
       result = vcl_sqrt(rgbPixel[i] * rgbPixel[i] + rgbPixel[j] * rgbPixel[j]);
-      if( abs(result-output[0]) > 0.0000001)
+      if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001)
         {
           std::cout << "vectorPixelType Test RGBPixelType failed for channels " << i<< " and "
               << j << " !" << std::endl;
@@ -107,7 +107,7 @@ int otbAmplitudeFunctorTest(int argc, char * argv[])
       funct.SetChannelList(channels);
       output = funct.operator ()(rgbaPixel);
       result = vcl_sqrt(rgbaPixel[i] * rgbaPixel[i] + rgbaPixel[j] * rgbaPixel[j]);
-      if( abs(result-output[0]) > 0.0000001)
+      if( abs(static_cast<double>(result)-static_cast<double>(output[0])) > 0.0000001)
         {
           std::cout << "vectorPixelType Test RGBAPixelType failed for channels " << i<< " and "
               << j << " !" << std::endl;
diff --git a/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx b/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx
index 57cbba8bf4..5626436f60 100644
--- a/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx
+++ b/Testing/Utilities/ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest.cxx
@@ -54,7 +54,7 @@ int ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest( int argc, char*
     numberOfPixelsInMask *= imageReader->GetOutput()->GetLargestPossibleRegion().GetSize()[i];
     numberOfDirections *= 3;
     } 
-  numberOfDirections = vcl_floor( 0.5 * numberOfDirections );
+  numberOfDirections = static_cast<unsigned int>( vcl_floor( 0.5 * static_cast<double>(numberOfDirections) ) );
   unsigned int numberOfBins = 100;
 
   try
-- 
GitLab