<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> </div><div>itkImageRegionReverseConstIterator.h: m_SpanEndOffset = this->m_BeginOffset - static_cast<long>(this->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: typedef unsigned long SizeValueType;</div><div><div>itkImageRegion.h: typedef Size< itkGetStaticConstMacro( ImageDimension ) > SizeType;</div><div>itkImageRegion.h: typedef typename SizeType::SizeValueType SizeValueType;</div><div>itkImageRegion.h: 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> "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? </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: <br><br> "size_t" is unsigned :-/<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> "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> Luis<br></font><br>------------------------------------------------------------------------------------------------------<br> <div class="gmail_quote">On Fri, Jul 10, 2009 at 12:30 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></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 <iostream><br> #include "itkOffset.h"<br>#include "itkNumericTraits.h"<div class="im"><br><br>int main()<br>{<br> unsigned long tt;<br> std::cout << "size = " << sizeof(tt) << std::endl;<br> tt = -1;<br> std::cout << "tt = " << tt << std::endl;<br><br></div> typedef itk::Offset<3> OffsetType;<br> typedef OffsetType::OffsetValueType OffsetValueType;<br><br> OffsetValueType offsetValue;<br> <br> std::cout << "sizeof(offsetValue) = " << sizeof( offsetValue ) << std::endl;<br><br> offsetValue = itk::NumericTraits< OffsetValueType >::max();<br><br> std::cout << "OffsetValueType max() = " << offsetValue << std::endl;<br> <br> 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> 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><ATT00001.txt></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"> </span><span class="Apple-converted-space"> </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 </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"> </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>