various vtkRenderWindow subclass implementations of SetWindowInfo are likely not 64 bit clean
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
vtkRenderWindow has a strange API named SetWindowInfo(). It takes an ASCII string of a decimal number and converts it to a pointer.
The X11 and Win32 implementations don't appear 64bit clean as they use an 'int' which is not guaranteed by the C++ standard to be big enough to hold a pointer. Using 'int' is also weird because it is signed, but addresses are never signed.
Using ptrdiff_t would be safer.
The following have the error: vtkOSOpenGLRenderWindow, vtkWin32OpenGLRenderWindow, vtkWinCEOpenGLRenderWindow, vtkXOpenGLRenderWindow.
For example:
void vtkWin32OpenGLRenderWindow::SetWindowInfo(char *info) { int tmp;
sscanf(info,"%i",&tmp);
this->WindowId = (HWND)tmp; vtkDebugMacro(<< "Setting WindowId to " << this->WindowId << "\n"); }
This is how I did it in Cocoa:
ptrdiff_t tmp = 0; if (info) { (void)sscanf(info, "%tu", &tmp); }
I don't have access to these platforms and so daren't fix it myself.