Commit 1932e6c2 authored by Ben Boeckel's avatar Ben Boeckel

vtkWin32OpenGLRenderWindow: use size_t for integer storage of pointers

Also explicitly reinterpret_cast them.

Change-Id: I5ec4ae799e205e743c868cecffcf9ee400ded60f
parent fd5e0ef1
......@@ -21,6 +21,7 @@
#include "vtkOpenGLRenderWindow.h"
#include "vtkOpenGLError.h"
#include "vtkRendererCollection.h"
#include "vtkTypeTraits.h"
#include "vtkWin32RenderWindowInteractor.h"
#include <math.h>
......@@ -1348,19 +1349,19 @@ void vtkWin32OpenGLRenderWindow::SetWindowId(HWND arg)
// Set this RenderWindow's X window id to a pre-existing window.
void vtkWin32OpenGLRenderWindow::SetWindowInfo(char *info)
{
int tmp;
sscanf(info, "%i", &tmp);
size_t tmp;
sscanf(info, vtkTypeTraits<size_t>::ParseFormat(), &tmp);
this->WindowId = (HWND)tmp;
this->WindowId = reinterpret_cast<HWND>(tmp);
vtkDebugMacro(<< "Setting WindowId to " << this->WindowId << "\n");
}
void vtkWin32OpenGLRenderWindow::SetNextWindowInfo(char *info)
{
int tmp;
sscanf(info, "%i", &tmp);
size_t tmp;
sscanf(info, vtkTypeTraits<size_t>::ParseFormat(), &tmp);
this->SetNextWindowId((HWND)tmp);
this->SetNextWindowId(reinterpret_cast<HWND>(tmp));
}
void vtkWin32OpenGLRenderWindow::SetDisplayId(void * arg)
......@@ -1382,10 +1383,10 @@ void vtkWin32OpenGLRenderWindow::SetDeviceContext(HDC arg)
// Sets the HWND id of the window that WILL BE created.
void vtkWin32OpenGLRenderWindow::SetParentInfo(char *info)
{
int tmp;
sscanf(info, "%i", &tmp);
size_t tmp;
sscanf(info, vtkTypeTraits<size_t>::ParseFormat(), &tmp);
this->ParentId = (HWND)tmp;
this->ParentId = reinterpret_cast<HWND>(tmp);
vtkDebugMacro(<< "Setting ParentId to " << this->ParentId << "\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment