From b6ac18954b3c8697333ea5dc7f86bb018ea7c753 Mon Sep 17 00:00:00 2001
From: Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Date: Fri, 11 Nov 2011 00:52:07 +0100
Subject: [PATCH] WRG: correct windows warning (unreferenced and non
 initialized variables)

---
 .../otbWrapperComplexInputImageParameter.cxx         |  4 ++--
 .../otbWrapperInputImageListParameter.cxx            |  8 ++++----
 .../otbWrapperInputImageParameter.cxx                |  2 +-
 .../otbWrapperInputVectorDataListParameter.cxx       |  8 ++++----
 .../otbWrapperInputVectorDataParameter.cxx           |  2 +-
 Code/IO/otbGDALImageIO.cxx                           | 12 ++++--------
 6 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/Code/ApplicationEngine/otbWrapperComplexInputImageParameter.cxx b/Code/ApplicationEngine/otbWrapperComplexInputImageParameter.cxx
index f194a511a3..5c6f36471a 100644
--- a/Code/ApplicationEngine/otbWrapperComplexInputImageParameter.cxx
+++ b/Code/ApplicationEngine/otbWrapperComplexInputImageParameter.cxx
@@ -56,7 +56,7 @@ ComplexInputImageParameter::SetFromFileName(const std::string& filename)
       {
       reader->UpdateOutputInformation();
       }
-    catch(itk::ExceptionObject & err)
+    catch(itk::ExceptionObject &)
       {
       }
 
@@ -102,7 +102,7 @@ ComplexInputImageParameter::GetImage()
       {
       reader->UpdateOutputInformation();
       }
-    catch(itk::ExceptionObject & err)
+    catch(itk::ExceptionObject &)
       {
       this->ClearValue();
       }
diff --git a/Code/ApplicationEngine/otbWrapperInputImageListParameter.cxx b/Code/ApplicationEngine/otbWrapperInputImageListParameter.cxx
index 723278985f..7019290320 100644
--- a/Code/ApplicationEngine/otbWrapperInputImageListParameter.cxx
+++ b/Code/ApplicationEngine/otbWrapperInputImageListParameter.cxx
@@ -103,7 +103,7 @@ InputImageListParameter::AddFromFileName(const std::string & filename)
       {
       reader->UpdateOutputInformation();
       }
-    catch(itk::ExceptionObject & err)
+    catch(itk::ExceptionObject &)
       {
       this->ClearValue();
       return false;
@@ -139,7 +139,7 @@ InputImageListParameter::SetNthFileName( const unsigned int id, const std::strin
       {
       reader->UpdateOutputInformation();
       }
-    catch(itk::ExceptionObject & err)
+    catch(itk::ExceptionObject &)
       {
       this->ClearValue();
       return false;
@@ -219,7 +219,7 @@ InputImageListParameter::SetImageList(FloatVectorImageListType* imList)
       imList->GetNthElement( i )->UpdateOutputInformation();
       }
     }
-  catch(itk::ExceptionObject & err)
+  catch(itk::ExceptionObject &)
     {
     return;
     }
@@ -245,7 +245,7 @@ InputImageListParameter::AddImage(FloatVectorImageType* image)
     {
     image->UpdateOutputInformation();
     }
-  catch(itk::ExceptionObject & err)
+  catch(itk::ExceptionObject &)
     {
     return;
     }
diff --git a/Code/ApplicationEngine/otbWrapperInputImageParameter.cxx b/Code/ApplicationEngine/otbWrapperInputImageParameter.cxx
index 13286b214f..f276205f02 100644
--- a/Code/ApplicationEngine/otbWrapperInputImageParameter.cxx
+++ b/Code/ApplicationEngine/otbWrapperInputImageParameter.cxx
@@ -127,7 +127,7 @@ InputImageParameter::GetImage()
       {
       reader->UpdateOutputInformation();
       }
-    catch (itk::ExceptionObject & err)
+    catch (itk::ExceptionObject &)
       {
       this->ClearValue();
       }
diff --git a/Code/ApplicationEngine/otbWrapperInputVectorDataListParameter.cxx b/Code/ApplicationEngine/otbWrapperInputVectorDataListParameter.cxx
index 42a35381fb..e1eeb1e636 100644
--- a/Code/ApplicationEngine/otbWrapperInputVectorDataListParameter.cxx
+++ b/Code/ApplicationEngine/otbWrapperInputVectorDataListParameter.cxx
@@ -58,7 +58,7 @@ InputVectorDataListParameter::SetListFromFileName(const std::vector<std::string>
         {
         reader->UpdateOutputInformation();
         }
-      catch(itk::ExceptionObject & err)
+      catch(itk::ExceptionObject &)
         {
         this->ClearValue();
         isOk = false;
@@ -142,7 +142,7 @@ InputVectorDataListParameter::SetNthFileName( const unsigned int id, const std::
       {
       reader->UpdateOutputInformation();
       }
-    catch(itk::ExceptionObject & err)
+    catch(itk::ExceptionObject &)
       {
       this->ClearValue();
       return false;
@@ -223,7 +223,7 @@ InputVectorDataListParameter::SetVectorDataList(VectorDataListType* vdList)
       vdList->GetNthElement( i )->UpdateOutputInformation();
       }
     }
-  catch(itk::ExceptionObject & err)
+  catch(itk::ExceptionObject &)
     {
     return;
     }
@@ -249,7 +249,7 @@ InputVectorDataListParameter::AddVectorData(VectorDataType* vectorData)
     {
     vectorData->UpdateOutputInformation();
     }
-  catch(itk::ExceptionObject & err)
+  catch(itk::ExceptionObject &)
     {
     return;
     }
diff --git a/Code/ApplicationEngine/otbWrapperInputVectorDataParameter.cxx b/Code/ApplicationEngine/otbWrapperInputVectorDataParameter.cxx
index 499311950f..21fc4a2ed8 100644
--- a/Code/ApplicationEngine/otbWrapperInputVectorDataParameter.cxx
+++ b/Code/ApplicationEngine/otbWrapperInputVectorDataParameter.cxx
@@ -81,7 +81,7 @@ InputVectorDataParameter::GetVectorData()
       // Update the viewer here to load the file => no streaming for VectorData
       m_Reader->Update();
       }
-    catch (itk::ExceptionObject & err)
+    catch (itk::ExceptionObject &)
       {
       this->ClearValue();
       }
diff --git a/Code/IO/otbGDALImageIO.cxx b/Code/IO/otbGDALImageIO.cxx
index 7f3affd8c5..edd70d6af5 100644
--- a/Code/IO/otbGDALImageIO.cxx
+++ b/Code/IO/otbGDALImageIO.cxx
@@ -716,13 +716,11 @@ void GDALImageIO::InternalReadImageInformation()
     }
   else if (this->GetComponentType() == LONG)
     {
-    long tmp;
-    m_BytePerPixel = sizeof(tmp);
+    m_BytePerPixel = sizeof(long);
     }
   else if (this->GetComponentType() == ULONG)
     {
-    long tmp;
-    m_BytePerPixel = sizeof(tmp);
+    m_BytePerPixel = sizeof(unsigned long);
     }
   else if (this->GetComponentType() == FLOAT)
     {
@@ -1325,8 +1323,7 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
       }
     else if (this->GetComponentType() == LONG)
       {
-        long tmp;
-        m_BytePerPixel = sizeof(tmp);
+		m_BytePerPixel = sizeof(long);
         if( m_BytePerPixel == 8 )
           {
             itkWarningMacro(<< "Cast a long (64 bits) image into an int (32 bits) one.")
@@ -1335,8 +1332,7 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
       }
     else if (this->GetComponentType() == ULONG)
       {
-        unsigned long tmp;
-        m_BytePerPixel = sizeof(tmp);
+        m_BytePerPixel = sizeof(unsigned long);
         if( m_BytePerPixel == 8 )
           {
             itkWarningMacro(<< "Cast an unsigned long (64 bits) image into an unsigned int (32 bits) one.")
-- 
GitLab