]> Creatis software - clitk.git/commitdiff
COMP: C++11 identified type missmatches
authorHans Johnson <hans-johnson@uiowa.edu>
Sat, 31 May 2014 12:59:26 +0000 (07:59 -0500)
committerHans Johnson <hans-johnson@uiowa.edu>
Thu, 5 Jun 2014 15:48:07 +0000 (10:48 -0500)
rtkHisImageIO.cxx:149:53: error: constant
expression evaluates to 134 which cannot be narrowed to type 'char'
[-Wc++11-narrowing]

common/rtkHisImageIO.cxx

index 6f9aa227c96b4c406c1adad2f236ba91a7b1f22c..04a6e46144d6829b01ca317714b759cfe7886357 100644 (file)
@@ -143,7 +143,7 @@ void rtk::HisImageIO::Write(const void* buffer)
     itkGenericExceptionMacro(<< "Could not open file (for writing): " << m_FileName);
 
   m_HeaderSize = HEADER_INFO_SIZE + 32;
-  char szHeader[HEADER_INFO_SIZE + 32] = {
+  unsigned char szHeader[HEADER_INFO_SIZE + 32] = {
     0x00, 0x70, 0x44, 0x00, 0x64, 0x00, 0x64, 0x00, 0x20, 0x00, 0x20, 0x00, 0x01, 0x00, 0x01, 0x00,
     0x00, 0x04, 0x00, 0x04, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6A, 0x18, 0x41,
     0x04, 0x00, 0x40, 0x5F, 0x48, 0x01, 0x40, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -187,7 +187,7 @@ void rtk::HisImageIO::Write(const void* buffer)
       break;
     }
 
-  file.write(szHeader, m_HeaderSize);
+  file.write((const char *)szHeader, m_HeaderSize);
   file.write( (const char *)buffer, GetImageSizeInBytes() );
   file.close();
 } ////