[vtkusers] Mac OS X x86_64 with Qt-4.5.x,vtk-5.3.x

Sean McBride sean at rogue-research.com
Thu Nov 20 21:50:24 EST 2008


On 11/18/08 1:01 PM, Clinton Stimpson said:

>You could try implementing vtkCocoaRenderWindow::SetWindowInfo to 
>something like this:
>
>  int tmp;
>  sscanf(info "%i", &tmp);
>    NSMutableDictionary* manager =
>      reinterpret_cast<NSMutableDictionary *>(this->GetCocoaManager());
>    [manager setObject:reinterpret_cast<id>(tmp)
>                forKey:@"DisplayId"];
>
>I don't know if that sscanf thing is the right syntax for Obj-C.

'int' is no good, because in the 64 bit ABI, an 'int' is still 32 bit,
but a pointer (like 'id') is 64 bit.  I suggest using NSUInteger because
it is always the same size as a pointer (32 in 32bit and 64 in 64bit). 
Likewise, %i should be %lu.

Do I understand correctly that this API takes an ASCII string (of a
base-10 number) that represents a pointer address?!?  That's strange,
no?  This is likely to wreak havoc with Obj-C garbage collection....

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list