<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Luis,<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>This looks like an absolutely massive effort you are attempting here. I have grepped through the iterator classes are there alot of incorrect usages of long:</div><div>&nbsp;</div><div>itkImageRegionReverseConstIterator.h: &nbsp; &nbsp;m_SpanEndOffset = this-&gt;m_BeginOffset - static_cast&lt;long&gt;(this-&gt;m_Region.GetSize()[0]);</div><div><br></div><div>And then there are complex relations like this:</div><div><br></div><div><div>itkSize.h: &nbsp;typedef &nbsp; unsigned long &nbsp; &nbsp; SizeValueType;</div><div><div>itkImageRegion.h: &nbsp;typedef Size&lt; itkGetStaticConstMacro( ImageDimension ) &gt; &nbsp;SizeType;</div><div>itkImageRegion.h: &nbsp;typedef typename SizeType::SizeValueType &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SizeValueType;</div><div>itkImageRegion.h: &nbsp;SizeValueType GetNumberOfPixels() const;</div><div><br></div><div><br></div><div>I am not really sure how all these issues can be tracked down. From the user list:</div><div><br></div><div><br></div><div><div>On Jul 10, 2009, at 12:46 PM, Michael Jackson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br>IMNSHO, ITK (and VTK by extension) should absolutely BAN the use of<br>"long" in their projects. Period. Too many avoidable bugs come up from<br>its use. If you want a 32 bit integer use int or the standard ansi int<br>type, if you want a 64 bit integer then use "long long int" or the<br>standard ansi 64 bit integer type.<br>&nbsp;&nbsp;"long int" is just a mess waiting to happen. Maybe a rule should be<br>put into the KWStyle project to look for and flag the use of 'long'?</span></blockquote><div><br></div><div><br></div><div>Do we need to go as far as banning the use of long and unsigned long?&nbsp;</div><div><br></div><div><br></div><div>Good Luck Luis,</div><div>Brad</div></div><div><br></div></div><div><br></div></div><div><br></div><div><div><div>On Jul 10, 2009, at 6:33 PM, Luis Ibanez wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On recent realization: &nbsp; <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "size_t"&nbsp; &nbsp; is unsigned&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :-/<br><br>and we need the OffsetValueType to be signed,<br>since we use it to compute differences...<br><br>It seems that what we need is the type<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ptrdiff_t"<br><br>which is supposed to represent the differences<br>between two pointers, and therefore should be<br>capable of measuring distances between any<br>two locations in memory.<br> <br>I'm now rerunning the Experimental with <br>"ptrdiff_t" instead of "size_t".<br><font color="#888888"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<br></font><br>------------------------------------------------------------------------------------------------------<br> <div class="gmail_quote">On Fri, Jul 10, 2009 at 12:30 PM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi Kana,<br><br>Thanks a lot for looking into this and sharing your findings.<br><br>I just confirmed that in Windows 64bits, the "long" type is<br>only 4 bytes.<br><br>Here is the program I used:<br><br>#include &lt;iostream&gt;<br> #include "itkOffset.h"<br>#include "itkNumericTraits.h"<div class="im"><br><br>int main()<br>{<br>&nbsp; unsigned long tt;<br>&nbsp; std::cout &lt;&lt; "size = " &lt;&lt; sizeof(tt) &lt;&lt; std::endl;<br> &nbsp; tt&nbsp; =&nbsp; -1;<br> &nbsp; std::cout &lt;&lt; "tt = " &lt;&lt; tt &lt;&lt; std::endl;<br><br></div>&nbsp; typedef itk::Offset&lt;3&gt;&nbsp;&nbsp; OffsetType;<br>&nbsp; typedef OffsetType::OffsetValueType&nbsp;&nbsp; OffsetValueType;<br><br>&nbsp; OffsetValueType&nbsp; offsetValue;<br> <br>&nbsp; std::cout &lt;&lt; "sizeof(offsetValue) = " &lt;&lt; sizeof( offsetValue ) &lt;&lt; std::endl;<br><br>&nbsp; offsetValue = itk::NumericTraits&lt; OffsetValueType &gt;::max();<br><br>&nbsp; std::cout &lt;&lt; "OffsetValueType max() = " &lt;&lt; offsetValue &lt;&lt; std::endl;<br> <br>&nbsp; return EXIT_SUCCESS;<br>}<br><br><br>with this CMakeLists.txt file<br><br><br>CMAKE_MINIMUM_REQUIRED(VERSION 2.4)<br>IF(COMMAND CMAKE_POLICY)<br>&nbsp; CMAKE_POLICY(SET CMP0003 NEW)<br>ENDIF(COMMAND CMAKE_POLICY)<br><br> <br>PROJECT(64bitsTest)<br><br>FIND_PACKAGE(ITK REQUIRED)<br>INCLUDE(${ITK_USE_FILE})<br><br>ADD_EXECUTABLE(typesTest typesTest.cxx )<br><br>TARGET_LINK_LIBRARIES(typesTest ITKCommon)<br><br></blockquote></div><br> <span>&lt;ATT00001.txt&gt;</span></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin&nbsp;</span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span> </div><br></div></body></html>