From 2bd890e190b66a6027594f657a6f05b1b5a803bb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 25 Nov 2015 23:14:04 +0100 Subject: -Werror,-Wint-to-pointer-cast Change-Id: Iec98a5a3df5dcfcd3fcf658bf27e9b5fe57ffc44 (cherry picked from commit 6cd09d31f48539d2ba8ae89f0725e6fbef37b920) --- avmedia/source/win/player.cxx | 10 +++++----- avmedia/source/win/player.hxx | 8 ++++++-- avmedia/source/win/window.cxx | 20 ++++++++++---------- avmedia/source/win/window.hxx | 8 ++++++-- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index 61b073d0dee2..4f6cd78902e9 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -113,7 +113,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : Player::~Player() { if( mnFrameWnd ) - ::DestroyWindow( (HWND) mnFrameWnd ); + ::DestroyWindow( mnFrameWnd ); ::CoUninitialize(); } @@ -207,7 +207,7 @@ const IVideoWindow* Player::getVideoWindow() const return mpVW; } -void Player::setNotifyWnd( int nNotifyWnd ) +void Player::setNotifyWnd( HWND nNotifyWnd ) { mbAddWindow = false; if( mpME ) @@ -266,14 +266,14 @@ void SAL_CALL Player::start( ) } if ( !mnFrameWnd ) { - mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL, 0, 0, 0, 0, 0, (HWND) NULL, NULL, mpWndClass->hInstance, 0 ); if ( mnFrameWnd ) { - ::ShowWindow((HWND) mnFrameWnd, SW_HIDE); - ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); + ::ShowWindow(mnFrameWnd, SW_HIDE); + ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); // mpVW->put_Owner( (OAHWND) mnFrameWnd ); setNotifyWnd( mnFrameWnd ); } diff --git a/avmedia/source/win/player.hxx b/avmedia/source/win/player.hxx index 79287bbb59d8..e7c84012c09b 100644 --- a/avmedia/source/win/player.hxx +++ b/avmedia/source/win/player.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_AVMEDIA_SOURCE_WIN_PLAYER_HXX #define INCLUDED_AVMEDIA_SOURCE_WIN_PLAYER_HXX +#include + +#include + #include "wincommon.hxx" #include "com/sun/star/media/XPlayer.hpp" @@ -59,7 +63,7 @@ public: bool create( const OUString& rURL ); - void setNotifyWnd( int nNotifyWnd ); + void setNotifyWnd( HWND nNotifyWnd ); long processEvent(); const IVideoWindow* getVideoWindow() const; @@ -105,7 +109,7 @@ private: IVideoWindow* mpVW; IDDrawExclModeVideo* mpEV; long mnUnmutedVolume; - int mnFrameWnd; + HWND mnFrameWnd; bool mbMuted; bool mbLooping; bool mbAddWindow; diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index 341ea6a52ce9..56ec9690bd67 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -195,7 +195,7 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& rxMgr, Playe Window::~Window() { if( mnFrameWnd ) - ::DestroyWindow( (HWND) mnFrameWnd ); + ::DestroyWindow( mnFrameWnd ); } void Window::ImplLayoutVideoWindow() @@ -296,16 +296,16 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments ) rArguments[ 0 ] >>= nWnd; rArguments[ 1 ] >>= aRect; - mnParentWnd = static_cast(nWnd); + mnParentWnd = reinterpret_cast(nWnd); - mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + mnFrameWnd = ::CreateWindow( mpWndClass->lpszClassName, NULL, WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, aRect.X, aRect.Y, aRect.Width, aRect.Height, - (HWND) mnParentWnd, NULL, mpWndClass->hInstance, 0 ); + mnParentWnd, NULL, mpWndClass->hInstance, 0 ); if( mnFrameWnd ) { - ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); + ::SetWindowLong( mnFrameWnd, 0, (DWORD) this ); pVideoWindow->put_Owner( (OAHWND) mnFrameWnd ); pVideoWindow->put_MessageDrain( (OAHWND) mnFrameWnd ); @@ -387,7 +387,7 @@ void SAL_CALL Window::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal { if( mnFrameWnd ) { - ::SetWindowPos( (HWND) mnFrameWnd, HWND_TOP, X, Y, Width, Height, 0 ); + ::SetWindowPos( mnFrameWnd, HWND_TOP, X, Y, Width, Height, 0 ); ImplLayoutVideoWindow(); } } @@ -401,7 +401,7 @@ awt::Rectangle SAL_CALL Window::getPosSize() { ::RECT aWndRect; - if( ::GetClientRect( (HWND) mnFrameWnd, &aWndRect ) ) + if( ::GetClientRect( mnFrameWnd, &aWndRect ) ) { aRet.X = aWndRect.left; aRet.Y = aWndRect.top; @@ -423,7 +423,7 @@ void SAL_CALL Window::setVisible( sal_Bool bVisible ) if( pVideoWindow ) pVideoWindow->put_Visible( bVisible ? OATRUE : OAFALSE ); - ::ShowWindow( (HWND) mnFrameWnd, bVisible ? SW_SHOW : SW_HIDE ); + ::ShowWindow( mnFrameWnd, bVisible ? SW_SHOW : SW_HIDE ); } } @@ -431,14 +431,14 @@ void SAL_CALL Window::setEnable( sal_Bool bEnable ) throw (uno::RuntimeException) { if( mnFrameWnd ) - ::EnableWindow( (HWND) mnFrameWnd, bEnable ); + ::EnableWindow( mnFrameWnd, bEnable ); } void SAL_CALL Window::setFocus( ) throw (uno::RuntimeException) { if( mnFrameWnd ) - ::SetFocus( (HWND) mnFrameWnd ); + ::SetFocus( mnFrameWnd ); } void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) diff --git a/avmedia/source/win/window.hxx b/avmedia/source/win/window.hxx index 79f183283610..fa01b19c1ed7 100644 --- a/avmedia/source/win/window.hxx +++ b/avmedia/source/win/window.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_AVMEDIA_SOURCE_WIN_WINDOW_HXX #define INCLUDED_AVMEDIA_SOURCE_WIN_WINDOW_HXX +#include + +#include + #include "wincommon.hxx" #include #include @@ -101,8 +105,8 @@ private: ::cppu::OMultiTypeInterfaceContainerHelper maListeners; css::media::ZoomLevel meZoomLevel; Player& mrPlayer; - int mnFrameWnd; - int mnParentWnd; + HWND mnFrameWnd; + HWND mnParentWnd; int mnPointerType; void ImplLayoutVideoWindow(); -- cgit