<div dir="ltr">That did not work either.  My bad.<div><br></div><div style>Should it not be</div><div style><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">const unsigned char  buffer[3] = { 255, 255, 254};</span><br>
</div><div style><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">or</span></div><div style><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px">const char  buffer[3] = { -1, -1, -2};</span><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 18, 2013 at 3:11 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Try int&#39;s. See:<br><a href="http://www.stroustrup.com/C++11FAQ.html#narrowing" target="_blank">http://www.stroustrup.com/C++11FAQ.html#narrowing</a><br>
<br>const char  buffer[3] = { 255, 255, 254};<br><br></div><div class="gmail_extra"><div><div class="h5">
<br><br><div class="gmail_quote">On Sat, May 18, 2013 at 1:09 PM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br>
<br>
I pushed some code yesterday and it&#39;s causing a couple problem. It seems simple enough. Whats the best way to express this?<br>
<br>
   // MAGIC_NUMBER = 16777214 ( little endian )<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
<br>
<br>
ERROR:<br>
/Users/builder/external/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:31: error: constant expression evaluates to 255 which cannot be narrowed to type &#39;char&#39; [-Wc++11-narrowing]<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
                             ^~~~<br>
/Users/builder/external/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:31: note: override this message by inserting an explicit cast<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
                             ^~~~<br>
                             static_cast&lt;char&gt;( )<br>
<br>
<br>
WARNING:<br>
<br>
var/lib/jenkins/jobs/ITK-v4-Testing-32-chroot/workspace/MyTests/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx: In member function &#39;virtual void itk::FreeSurferBinaryMeshIO::WriteMeshInformation()&#39;:<br>
/var/lib/jenkins/jobs/ITK-v4-Testing-32-chroot/workspace/MyTests/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:47: warning: narrowing conversion of &#39;255&#39; from &#39;int&#39; to &#39;const char&#39; inside { } is ill-formed in C++11 [-Wnarrowing]<br>


<br>
<br>
Thanks for your suggestion.<br>
<br>
Brad<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>