From fa496c5beabd85b434e93f1fdac89bf83c101484 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Thu, 12 Nov 2015 10:33:52 +0100
Subject: [PATCH] WRG: fix cast-align warning

---
 Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx b/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx
index 9f4322eecd..7ac218c33b 100644
--- a/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx
+++ b/Modules/IO/IOMSTAR/src/otbMSTARImageIO.cxx
@@ -705,12 +705,13 @@ float MSTARImageIO::byteswap_SR_IR(unsigned char *pointer)
 {
   float *       temp;
   unsigned char iarray[4];
-
+  void *vptr;
   iarray[0] = *(pointer + 3);
   iarray[1] = *(pointer + 2);
   iarray[2] = *(pointer + 1);
   iarray[3] = *(pointer);
-  temp    = (float *) iarray ;
+  vptr = static_cast<void*>(iarray);
+  temp = static_cast<float*>(vptr);
   return *(temp);
 }
 
@@ -718,10 +719,11 @@ unsigned short MSTARImageIO::byteswap_SUS_IUS(unsigned char *pointer)
 {
   unsigned short *temp;
   unsigned char   iarray[2];
-
+  void *vptr;
   iarray[0] = *(pointer + 1);
   iarray[1] = *(pointer);
-  temp    = (unsigned short *) iarray;
+  vptr = static_cast<void*>(iarray);
+  temp = static_cast<unsigned short*>(vptr);
   return *(temp);
 }
 
-- 
GitLab