Commit bb85cdd9 authored by Andy Cedilnik's avatar Andy Cedilnik

Remove lots of warnings on visual studio .net

parent 9522a14a
......@@ -61,9 +61,14 @@
// Finally, when Execute() is reading from the FrameBuffer it must do
// so from within a mutex lock. Otherwise tearing artifacts might result.
vtkCxxRevisionMacro(vtkVideoSource, "1.26");
vtkCxxRevisionMacro(vtkVideoSource, "1.27");
vtkStandardNewMacro(vtkVideoSource);
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
#endif
//----------------------------------------------------------------------------
// keep a list of all the existing vtkVideoSource objects, to ensure
// that proper deallocation occurs then the program exits.
......@@ -492,6 +497,7 @@ void vtkVideoSource::InternalGrab()
// copy 'noise' into the frame buffer
ptr = reinterpret_cast<vtkUnsignedCharArray *>(this->FrameBuffer[index])->GetPointer(0);
// Somebody should check this:
lptr = (int *)(((((long)ptr) + 3)/4)*4);
i = totalSize/4;
......
......@@ -25,9 +25,19 @@
// VFW compressed formats are listed at http://www.webartz.com/fourcc/
#define VTK_BI_UYVY 0x59565955
vtkCxxRevisionMacro(vtkWin32VideoSource, "1.17");
vtkCxxRevisionMacro(vtkWin32VideoSource, "1.18");
vtkStandardNewMacro(vtkWin32VideoSource);
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
# define vtkSetWindowLong SetWindowLongPtr
#else // regular Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
#endif //
//----------------------------------------------------------------------------
vtkWin32VideoSource::vtkWin32VideoSource()
{
......@@ -77,7 +87,7 @@ vtkWin32VideoSourceWinProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
vtkWin32VideoSource *self = (vtkWin32VideoSource *)\
(GetWindowLong(hwnd,GWL_USERDATA));
(vtkGetWindowLong(hwnd,GWL_USERDATA));
switch(message) {
......@@ -249,7 +259,7 @@ void vtkWin32VideoSource::Initialize()
}
// set the user data to 'this'
SetWindowLong(this->ParentWnd,GWL_USERDATA,(LONG)this);
vtkSetWindowLong(this->ParentWnd,GWL_USERDATA,(LONG)this);
// Create the capture window
this->CapWnd = capCreateCaptureWindow("Capture",
......
......@@ -22,7 +22,7 @@ extern "C" {
#include <jpeglib.h>
}
vtkCxxRevisionMacro(vtkJPEGWriter, "1.9");
vtkCxxRevisionMacro(vtkJPEGWriter, "1.10");
vtkStandardNewMacro(vtkJPEGWriter);
vtkJPEGWriter::vtkJPEGWriter()
......@@ -152,8 +152,8 @@ void vtkJPEGWriteToMemoryTerm(j_compress_ptr cinfo)
{
vtkUnsignedCharArray *uc = self->GetResult();
// we must close the array
int oldSize = uc->GetSize();
uc->SetNumberOfTuples(oldSize - cinfo->dest->free_in_buffer);
vtkIdType oldSize = uc->GetSize();
uc->SetNumberOfTuples(oldSize - static_cast<vtkIdType>(cinfo->dest->free_in_buffer));
}
}
......
......@@ -37,6 +37,16 @@
#define VTK_MAX(a,b) (((a)>(b))?(a):(b))
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
# define vtkSetWindowLong SetWindowLongPtr
#else // regular Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
#endif //
// These are the options that can be set when the widget is created
// or with the command configure. The only new one is "-rw" which allows
// the uses to set their own ImageViewer window.
......@@ -371,7 +381,7 @@ LRESULT APIENTRY vtkTkImageViewerWidgetProc(HWND hWnd, UINT message,
{
LRESULT rval;
struct vtkTkImageViewerWidget *self =
(struct vtkTkImageViewerWidget *)GetWindowLong(hWnd,GWL_USERDATA);
(struct vtkTkImageViewerWidget *)vtkGetWindowLong(hWnd,GWL_USERDATA);
if (!self)
{
......@@ -379,10 +389,10 @@ LRESULT APIENTRY vtkTkImageViewerWidgetProc(HWND hWnd, UINT message,
}
// forward message to Tk handler
SetWindowLong(hWnd,GWL_USERDATA,(LONG)((TkWindow *)self->TkWin)->window);
vtkSetWindowLong(hWnd,GWL_USERDATA,(LONG)((TkWindow *)self->TkWin)->window);
if (((TkWindow *)self->TkWin)->parentPtr)
{
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
rval = TkWinChildProc(hWnd,message,wParam,lParam);
}
else
......@@ -392,7 +402,7 @@ LRESULT APIENTRY vtkTkImageViewerWidgetProc(HWND hWnd, UINT message,
// well this will actually work in 8.0.
//
#if (TK_MAJOR_VERSION < 8)
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinTopLevelProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinTopLevelProc);
rval = TkWinTopLevelProc(hWnd,message,wParam,lParam);
#else
if (message == WM_WINDOWPOSCHANGED)
......@@ -439,7 +449,7 @@ LRESULT APIENTRY vtkTkImageViewerWidgetProc(HWND hWnd, UINT message,
Tcl_ServiceAll();
return 0;
}
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
rval = TkWinChildProc(hWnd,message,wParam,lParam);
#endif
}
......@@ -448,15 +458,16 @@ LRESULT APIENTRY vtkTkImageViewerWidgetProc(HWND hWnd, UINT message,
{
if (self->ImageViewer)
{
SetWindowLong(hWnd,GWL_USERDATA,(LONG)self->ImageViewer->GetRenderWindow());
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)self->OldProc);
vtkSetWindowLong(hWnd,GWL_USERDATA,
(LONG)self->ImageViewer->GetRenderWindow());
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)self->OldProc);
CallWindowProc(self->OldProc,hWnd,message,wParam,lParam);
}
}
// now reset to the original config
SetWindowLong(hWnd,GWL_USERDATA,(LONG)self);
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)vtkTkImageViewerWidgetProc);
vtkSetWindowLong(hWnd,GWL_USERDATA,(LONG)self);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)vtkTkImageViewerWidgetProc);
return rval;
}
......@@ -567,9 +578,10 @@ static int vtkTkImageViewerWidget_MakeImageViewer(struct vtkTkImageViewerWidget
twdPtr->window.handle = (HWND)ImageWindow->GetGenericWindowId();
#endif
self->OldProc = (WNDPROC)GetWindowLong(twdPtr->window.handle,GWL_WNDPROC);
SetWindowLong(twdPtr->window.handle,GWL_USERDATA,(LONG)self);
SetWindowLong(twdPtr->window.handle,GWL_WNDPROC,(LONG)vtkTkImageViewerWidgetProc);
self->OldProc = (WNDPROC)vtkGetWindowLong(twdPtr->window.handle,GWL_WNDPROC);
vtkSetWindowLong(twdPtr->window.handle,GWL_USERDATA,(LONG)self);
vtkSetWindowLong(twdPtr->window.handle,GWL_WNDPROC,
(LONG)vtkTkImageViewerWidgetProc);
winPtr->window = (Window)twdPtr;
......
......@@ -39,6 +39,16 @@
#define VTK_MAX(a,b) (((a)>(b))?(a):(b))
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
# define vtkSetWindowLong SetWindowLongPtr
#else // regular Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
#endif //
// These are the options that can be set when the widget is created
// or with the command configure. The only new one is "-rw" which allows
// the uses to set their own render window.
......@@ -377,7 +387,7 @@ LRESULT APIENTRY vtkTkRenderWidgetProc(HWND hWnd, UINT message,
{
LRESULT rval;
struct vtkTkRenderWidget *self =
(struct vtkTkRenderWidget *)GetWindowLong(hWnd,4);
(struct vtkTkRenderWidget *)vtkGetWindowLong(hWnd,4);
if (!self)
{
......@@ -391,9 +401,9 @@ LRESULT APIENTRY vtkTkRenderWidgetProc(HWND hWnd, UINT message,
{
WNDPROC tmp = (WNDPROC)lParam;
// we need to tell it what the original vtk event handler was
SetWindowLong(hWnd,4,(LONG)self->RenderWindow);
vtkSetWindowLong(hWnd,4,(LONG)self->RenderWindow);
tmp(hWnd, WM_USER+13,26,(LONG)self->OldProc);
SetWindowLong(hWnd,4,(LONG)self);
vtkSetWindowLong(hWnd,4,(LONG)self);
self->OldProc = tmp;
return 1;
}
......@@ -405,16 +415,16 @@ LRESULT APIENTRY vtkTkRenderWidgetProc(HWND hWnd, UINT message,
}
// forward message to Tk handler
SetWindowLong(hWnd,4,(LONG)((TkWindow *)self->TkWin)->window);
vtkSetWindowLong(hWnd,4,(LONG)((TkWindow *)self->TkWin)->window);
if (((TkWindow *)self->TkWin)->parentPtr)
{
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
rval = TkWinChildProc(hWnd,message,wParam,lParam);
}
else
{
#if(TK_MAJOR_VERSION < 8)
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinTopLevelProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinTopLevelProc);
rval = TkWinTopLevelProc(hWnd,message,wParam,lParam);
#else
if (message == WM_WINDOWPOSCHANGED)
......@@ -461,7 +471,7 @@ LRESULT APIENTRY vtkTkRenderWidgetProc(HWND hWnd, UINT message,
Tcl_ServiceAll();
return 0;
}
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)TkWinChildProc);
rval = TkWinChildProc(hWnd,message,wParam,lParam);
#endif
}
......@@ -470,15 +480,15 @@ LRESULT APIENTRY vtkTkRenderWidgetProc(HWND hWnd, UINT message,
{
if (self->RenderWindow)
{
SetWindowLong(hWnd,4,(LONG)self->RenderWindow);
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)self->OldProc);
vtkSetWindowLong(hWnd,4,(LONG)self->RenderWindow);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)self->OldProc);
CallWindowProc(self->OldProc,hWnd,message,wParam,lParam);
}
}
// now reset to the original config
SetWindowLong(hWnd,4,(LONG)self);
SetWindowLong(hWnd,GWL_WNDPROC,(LONG)vtkTkRenderWidgetProc);
vtkSetWindowLong(hWnd,4,(LONG)self);
vtkSetWindowLong(hWnd,GWL_WNDPROC,(LONG)vtkTkRenderWidgetProc);
return rval;
}
......@@ -583,9 +593,10 @@ static int vtkTkRenderWidget_MakeRenderWindow(struct vtkTkRenderWidget *self)
twdPtr->window.handle = renderWindow->GetWindowId();
#endif
self->OldProc = (WNDPROC)GetWindowLong(twdPtr->window.handle,GWL_WNDPROC);
SetWindowLong(twdPtr->window.handle,4,(LONG)self);
SetWindowLong(twdPtr->window.handle,GWL_WNDPROC,(LONG)vtkTkRenderWidgetProc);
self->OldProc = (WNDPROC)vtkGetWindowLong(twdPtr->window.handle,GWL_WNDPROC);
vtkSetWindowLong(twdPtr->window.handle,4,(LONG)self);
vtkSetWindowLong(twdPtr->window.handle,GWL_WNDPROC,
(LONG)vtkTkRenderWidgetProc);
winPtr->window = (Window)twdPtr;
......
......@@ -35,12 +35,22 @@
#include "vtkOpenGLLight.h"
#include "vtkOpenGLPolyDataMapper.h"
#include "vtkObjectFactory.h"
#include "vtkString.h"
vtkCxxRevisionMacro(vtkWin32OpenGLRenderWindow, "1.83");
vtkCxxRevisionMacro(vtkWin32OpenGLRenderWindow, "1.84");
vtkStandardNewMacro(vtkWin32OpenGLRenderWindow);
#define VTK_MAX_LIGHTS 8
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
# define vtkSetWindowLong SetWindowLongPtr
#else // regular Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
#endif //
vtkWin32OpenGLRenderWindow::vtkWin32OpenGLRenderWindow()
{
......@@ -77,7 +87,7 @@ vtkWin32OpenGLRenderWindow::~vtkWin32OpenGLRenderWindow()
this->DeviceContext = NULL;
// clear the extra data before calling destroy
SetWindowLong(this->WindowId,4,(LONG)0);
vtkSetWindowLong(this->WindowId,4,(LONG)0);
DestroyWindow(this->WindowId);
}
}
......@@ -138,7 +148,7 @@ LRESULT APIENTRY vtkWin32OpenGLRenderWindow::WndProc(HWND hWnd, UINT message,
LPARAM lParam)
{
vtkWin32OpenGLRenderWindow *me =
(vtkWin32OpenGLRenderWindow *)GetWindowLong(hWnd,4);
(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,4);
// forward to actual object
if (me)
......@@ -466,7 +476,7 @@ void vtkWin32OpenGLRenderWindow::InitializeApplication()
// if we have a parent window get the app instance from it
if (this->ParentId)
{
this->ApplicationInstance = (HINSTANCE)GetWindowLong(this->ParentId,GWL_HINSTANCE);
this->ApplicationInstance = (HINSTANCE)vtkGetWindowLong(this->ParentId,GWL_HINSTANCE);
}
else
{
......@@ -485,7 +495,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow(int x, int y, int width,
{
WNDCLASS wndClass;
int len = strlen( "Visualization Toolkit - Win32OpenGL #")
int len = vtkString::Length( "Visualization Toolkit - Win32OpenGL #")
+ (int)ceil( (double) log10( (double)(count+1) ) )
+ 1;
windowName = new char [ len ];
......@@ -549,7 +559,7 @@ void vtkWin32OpenGLRenderWindow::CreateAWindow(int x, int y, int width,
ShowWindow(this->WindowId, SW_SHOW);
//UpdateWindow(this->WindowId);
this->OwnWindow = 1;
SetWindowLong(this->WindowId,4,(LONG)this);
vtkSetWindowLong(this->WindowId,4,(LONG)this);
}
this->DeviceContext = GetDC(this->WindowId);
if (this->StereoCapableWindow)
......
......@@ -19,8 +19,9 @@
#include <GL/gl.h>
#include "vtkObjectFactory.h"
#include "vtkgluPickMatrix.h"
#include "vtkString.h"
vtkCxxRevisionMacro(vtkWin32OpenGLTextMapper, "1.40");
vtkCxxRevisionMacro(vtkWin32OpenGLTextMapper, "1.41");
vtkStandardNewMacro(vtkWin32OpenGLTextMapper);
struct vtkFontStruct
......@@ -363,7 +364,8 @@ void vtkWin32OpenGLTextMapper::RenderOverlay(vtkViewport* viewport,
glBitmap(0, 0, 0, 0, xoff + 1, yoff - 1, NULL);
// Draw the shadow text
glCallLists (strlen(this->Input), GL_UNSIGNED_BYTE, this->Input);
glCallLists (vtkString::Length(this->Input), GL_UNSIGNED_BYTE,
this->Input);
}
// set the colors for the foreground
......@@ -374,7 +376,8 @@ void vtkWin32OpenGLTextMapper::RenderOverlay(vtkViewport* viewport,
glBitmap(0, 0, 0, 0, xoff, yoff, NULL);
// display a string: // indicate start of glyph display lists
glCallLists (strlen(this->Input), GL_UNSIGNED_BYTE, this->Input);
glCallLists (vtkString::Length(this->Input), GL_UNSIGNED_BYTE,
this->Input);
glFlush();
#ifndef _WIN32_WCE
......
......@@ -37,9 +37,19 @@ VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND,UINT,WPARAM,LPARAM,
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
# define vtkSetWindowLong SetWindowLongPtr
#else // regular Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
#endif //
#ifndef VTK_IMPLEMENT_MESA_CXX
vtkCxxRevisionMacro(vtkWin32RenderWindowInteractor, "1.80");
vtkCxxRevisionMacro(vtkWin32RenderWindowInteractor, "1.81");
vtkStandardNewMacro(vtkWin32RenderWindowInteractor);
#endif
......@@ -67,8 +77,8 @@ vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
if (this->WindowId && this->Enabled && this->InstallMessageProc)
{
vtkWin32OpenGLRenderWindow *ren;
ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
tmp = (vtkWin32OpenGLRenderWindow *)GetWindowLong(this->WindowId,4);
ren = static_cast<vtkWin32OpenGLRenderWindow *>(this->RenderWindow);
tmp = (vtkWin32OpenGLRenderWindow *)(GetWindowLongPtr(this->WindowId,4));
// watch for odd conditions
if ((tmp != ren) && (ren != NULL))
{
......@@ -81,7 +91,7 @@ vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
}
else
{
SetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)this->OldProc);
vtkSetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)this->OldProc);
}
this->Enabled = 0;
}
......@@ -149,8 +159,8 @@ void vtkWin32RenderWindowInteractor::Enable()
{
// add our callback
ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
this->OldProc = (WNDPROC)GetWindowLong(this->WindowId,GWL_WNDPROC);
tmp=(vtkWin32OpenGLRenderWindow *)GetWindowLong(this->WindowId,4);
this->OldProc = (WNDPROC)vtkGetWindowLong(this->WindowId,GWL_WNDPROC);
tmp=(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,4);
// watch for odd conditions
if (tmp != ren)
{
......@@ -163,7 +173,7 @@ void vtkWin32RenderWindowInteractor::Enable()
}
else
{
SetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)vtkHandleMessage);
vtkSetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)vtkHandleMessage);
}
// in case the size of the window has changed while we were away
int *size;
......@@ -189,7 +199,7 @@ void vtkWin32RenderWindowInteractor::Disable()
// we need to release any hold we have on a windows event loop
vtkWin32OpenGLRenderWindow *ren;
ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
tmp = (vtkWin32OpenGLRenderWindow *)GetWindowLong(this->WindowId,4);
tmp = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,4);
// watch for odd conditions
if ((tmp != ren) && (ren != NULL))
{
......@@ -202,7 +212,7 @@ void vtkWin32RenderWindowInteractor::Disable()
}
else
{
SetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)this->OldProc);
vtkSetWindowLong(this->WindowId,GWL_WNDPROC,(LONG)this->OldProc);
}
}
this->Enabled = 0;
......@@ -515,7 +525,7 @@ LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
vtkWin32OpenGLRenderWindow *ren;
vtkWin32RenderWindowInteractor *me;
ren = (vtkWin32OpenGLRenderWindow *)GetWindowLong(hWnd,4);
ren = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,4);
if (ren == NULL)
{
return 0;
......
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