MantisBT - ITK |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0009426 | ITK | | public | 2009-08-15 04:10 | 2010-10-21 12:31 |
|
Reporter | Gaetan Lehmann | |
Assigned To | Bradley Lowekamp | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | ITK-3-18 | |
Resolution Date | |
Sprint | |
Sprint Status | |
|
Summary | 0009426: ITK_UINT64 and vxl_uint_64 are not a 64bit integer on windows |
Description | in itkIntType.h we have:
#ifdef _WIN32
typedef long ITK_INT64;
#endif
#ifdef _WIN32
typedef unsigned long ITK_UINT64;
#endif
and vxl_uint_64 is defined as void on vc60.
As a consequence, there is no portable 64bit integer type usable in ITK. |
Steps To Reproduce | |
Additional Information | |
Tags | No tags attached. |
Relationships | parent of | 0010093 | closed | Mathieu Malaterre | Changes in "itkIntTypes.h" conflict with "gdcmCommon.h" | related to | 0001538 | closed | Luis Ibanez | itkIntTypes.h and 64 bits integer type |
|
Attached Files | itkIntTypes.h (4,640) 2009-12-14 12:13 https://public.kitware.com/Bug/file/2720/itkIntTypes.h |
|
Issue History |
Date Modified | Username | Field | Change |
2009-08-15 04:10 | Gaetan Lehmann | New Issue | |
2009-08-15 12:20 | Luis Ibanez | Note Added: 0017136 | |
2009-08-19 09:45 | Tom Vercauteren | Note Added: 0017160 | |
2009-10-22 12:04 | Bradley Lowekamp | Note Added: 0018191 | |
2009-10-22 12:04 | Bradley Lowekamp | Status | new => assigned |
2009-10-22 12:04 | Bradley Lowekamp | Assigned To | => Bradley Lowekamp |
2009-12-04 11:24 | Bradley Lowekamp | Relationship added | related to 0001538 |
2009-12-11 11:47 | Bradley Lowekamp | File Added: itkIntTypes.h | |
2009-12-11 11:50 | Bradley Lowekamp | File Deleted: itkIntTypes.h | |
2009-12-11 11:50 | Bradley Lowekamp | File Added: itkIntTypes.h | |
2009-12-14 10:18 | Brad King | Note Added: 0018846 | |
2009-12-14 12:13 | Bradley Lowekamp | File Deleted: itkIntTypes.h | |
2009-12-14 12:13 | Bradley Lowekamp | File Added: itkIntTypes.h | |
2009-12-15 09:25 | Bradley Lowekamp | Note Added: 0018895 | |
2009-12-15 09:30 | Brad King | Note Added: 0018896 | |
2009-12-16 08:31 | Bradley Lowekamp | Note Added: 0018914 | |
2009-12-16 08:32 | Bradley Lowekamp | Note Edited: 0018914 | |
2009-12-16 08:32 | Bradley Lowekamp | Note Edited: 0018914 | |
2009-12-16 08:49 | Brad King | Note Added: 0018915 | |
2010-01-15 09:38 | Bradley Lowekamp | Relationship added | parent of 0010093 |
2010-06-22 15:19 | Bradley Lowekamp | Note Added: 0021130 | |
2010-06-22 15:19 | Bradley Lowekamp | Status | assigned => resolved |
2010-06-22 15:19 | Bradley Lowekamp | Fixed in Version | => ITK-3-18 |
2010-06-22 15:19 | Bradley Lowekamp | Resolution | open => fixed |
2010-10-21 12:31 | Gabe Hart | Status | resolved => closed |
Notes |
|
(0017136)
|
Luis Ibanez
|
2009-08-15 12:20
|
|
Instead of the 64 bits types we should use size_t and ptrdiff_t, which will have the largest integer type that can be represented in that architecture.
(unsigned and signed respectively). |
|
|
(0017160)
|
Tom Vercauteren
|
2009-08-19 09:45
|
|
|
|
(0018191)
|
Bradley Lowekamp
|
2009-10-22 12:04
|
|
I agree that in many cases size_t and ptrdiff_t should be used when initially one thinks they need an explicitly 64bit integer.
However, many times:
sizeof(long long) > sizeof( long )
and 32-bit build have 64 bit integers.
Also vxl_uint_64 is defined as void on vc60 because the 64-bit integer is incomplete on this system as it does not behave as expected in term of conversion etc... |
|
|
(0018846)
|
Brad King
|
2009-12-14 10:18
|
|
The attached "itkIntTypes.h" looks pretty good. I have a couple comments:
- KWSYS_CAN_CONVERT_UI64_TO_DOUBLE should be itksys_CAN_CONVERT_UI64_TO_DOUBLE
- The line "typedef uintptr_t uintptr_t;" should be "typedef ::uintptr_t uintptr_t;"
Also, please create a test that verifies type size and signed-ness at runtime.
We should consider looking for <cstdint> and pulling types out of std:: if it is available. This could wait for later though. |
|
|
(0018895)
|
Bradley Lowekamp
|
2009-12-15 09:25
|
|
|
|
(0018896)
|
Brad King
|
2009-12-15 09:30
|
|
|
|
(0018914)
|
Bradley Lowekamp
|
2009-12-16 08:31
(edited on: 2009-12-16 08:32) |
|
|
|
(0018915)
|
Brad King
|
2009-12-16 08:49
|
|
It's because of code like this in the test:
-------------------------------------
template <typename T>
bool CheckSize( size_t size )
{
return ( sizeof( T ) == size );
}
-------------------------------------
VS6 only includes argument types in mangling and does not account for the template argument. Therefore the linker chooses one symbol for all the instantiations no matter the type. Change it to this:
-------------------------------------
template <typename T>
bool CheckSize( size_t size, T* = 0 )
{
return ( sizeof( T ) == size );
}
-------------------------------------
Do the same for all the check functions. |
|
|
(0021130)
|
Bradley Lowekamp
|
2010-06-22 15:19
|
|
update itkIntType includes new types which are tested to be of the correct size. |
|