[vtkusers] Question about 64-bit ids and long

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Sep 23 03:13:11 EDT 2008


On Mon, Sep 22, 2008 at 9:00 PM, Nick Gnedin <gnedin at fnal.gov> wrote:
>
> I may be mistaken, but I think long is always guaranteed to have the same size
> as a pointer. Thus, on a 32-bit platform (or a 64-bit platform but compiled
> in a 32-bit mode, like in g++ -m32) it is 32-bit, and on a 64-bit platform it
> is 64-bit. Thus, if vtkIdType is always set to long, then one can address the
> full address space of the platform.

maybe, but that not the definition of vtkIdType. On 32bits, I want to
be able to have vtkIdType of 64bits.

> At the moment, one has to set VTK_USE_64BIT_IDS option to use 64-bit ids, even
> on a 64-bit platform.

Are u sure about that ?

<quote>
IF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
 SET(VTK_USE_64BIT_IDS_DEFAULT ON)
ELSE("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
 SET(VTK_USE_64BIT_IDS_DEFAULT OFF)
ENDIF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
OPTION(VTK_USE_64BIT_IDS "Build VTK with 64 bit ids"
      ${VTK_USE_64BIT_IDS_DEFAULT})
</quote>

> Many users may overlook this advanced option. If I may,
> I would like to make a suggestion that vtkIdType be always set to long by
> default, and then it can be forced to int on a 64-bit platform with a special
> option. On a 32-bit platform there is no difference between int and long. I
> am not sure what happens on a 16-bit platform, but I doubt anyone uses a
> 16-bit platforms nowdays.

I do not understand your initial question anymore, why do you prefer
long over long long ? long long seems to be working out of the box,
while long at least at some point caused some issues (according to CVS
log).

2cts
-- 
Mathieu



More information about the vtkusers mailing list