diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-19 15:15:50 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-19 21:34:30 +0100 |
commit | 5a11fe87a6f1507149a0965aa740dcdf4ccef3c3 (patch) | |
tree | 3f3e788a0e54c94e980bd61e4466d4d6e2c34415 /vcl/win | |
parent | 77d301f5e40e4f0fb4a127b8b6361a0fb1b1dbd9 (diff) |
loplugin:fakebool (clang-cl)
...plus follow-up loplugin:implicitboolconversion and loplugin:redundantcast
Change-Id: I9fc9c5cb46fbb50da87ff80af64cb0dfda3e5f90
Reviewed-on: https://gerrit.libreoffice.org/83207
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/app/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/win/app/saltimer.cxx | 12 | ||||
-rw-r--r-- | vcl/win/gdi/salprn.cxx | 4 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 36 | ||||
-rw-r--r-- | vcl/win/window/salobj.cxx | 24 |
5 files changed, 39 insertions, 39 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 1994a274f8b4..2cf9a4f57d9c 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -549,7 +549,7 @@ bool WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, bool& rDef ) { - const BOOL bIsOtherThreadMessage = InSendMessage(); + const bool bIsOtherThreadMessage = InSendMessage(); LRESULT nRet = 0; WinSalInstance *pInst = GetSalData()->mpInstance; WinSalTimer *const pTimer = static_cast<WinSalTimer*>( ImplGetSVData()->maSchedCtx.mpSalTimer ); diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx index 3aa919ec41b5..5a4760ad5e11 100644 --- a/vcl/win/app/saltimer.cxx +++ b/vcl/win/app/saltimer.cxx @@ -110,9 +110,9 @@ void WinSalTimer::Start( sal_uInt64 nMS ) WinSalInstance *pInst = GetSalData()->mpInstance; if ( pInst && !pInst->IsMainThread() ) { - BOOL const ret = PostMessageW(pInst->mhComWnd, + bool const ret = PostMessageW(pInst->mhComWnd, SAL_MSG_STARTTIMER, 0, static_cast<LPARAM>(tools::Time::GetSystemTicks()) + nMS); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } else ImplStart( nMS ); @@ -123,9 +123,9 @@ void WinSalTimer::Stop() WinSalInstance *pInst = GetSalData()->mpInstance; if ( pInst && !pInst->IsMainThread() ) { - BOOL const ret = PostMessageW(pInst->mhComWnd, + bool const ret = PostMessageW(pInst->mhComWnd, SAL_MSG_STOPTIMER, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } else ImplStop(); @@ -140,11 +140,11 @@ void CALLBACK SalTimerProc(PVOID data, BOOLEAN) __try { WinSalTimer *pTimer = static_cast<WinSalTimer*>( data ); - BOOL const ret = PostMessageW( + bool const ret = PostMessageW( GetSalData()->mpInstance->mhComWnd, SAL_MSG_TIMER_CALLBACK, static_cast<WPARAM>(pTimer->GetNextEventVersion()), 0 ); #if OSL_DEBUG_LEVEL > 0 - if (0 == ret) // SEH prevents using SAL_WARN here? + if (!ret) // SEH prevents using SAL_WARN here? fputs("ERROR: PostMessage() failed!\n", stderr); #endif } diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 83d5aa749e14..211f84a8609d 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1464,8 +1464,8 @@ bool WinSalPrinter::StartJob( const OUString* pFileName, // As the Telecom Balloon Fax driver tends to send messages repeatedly // we try to process first all, and then insert a dummy message for (int i = 0; Application::Reschedule( true ) && i <= 15; ++i); - BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); // bring up a file chooser if printing to file port but no file name given OUString aOutFileName; diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index a57e67ce8896..afecae44beaf 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -1053,9 +1053,9 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) bool WinSalFrame::PostEvent(std::unique_ptr<ImplSVEvent> pData) { - BOOL const ret = PostMessageW(mhWnd, SAL_MSG_USEREVENT, 0, reinterpret_cast<LPARAM>(pData.release())); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); - return static_cast<bool>(ret); + bool const ret = PostMessageW(mhWnd, SAL_MSG_USEREVENT, 0, reinterpret_cast<LPARAM>(pData.release())); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); + return ret; } void WinSalFrame::SetTitle( const OUString& rTitle ) @@ -1202,8 +1202,8 @@ void WinSalFrame::Show( bool bVisible, bool bNoActivate ) // We post this message to avoid deadlocks if ( GetSalData()->mnAppThreadId != GetCurrentThreadId() ) { - BOOL const ret = PostMessageW(mhWnd, SAL_MSG_SHOW, WPARAM(bVisible), LPARAM(bNoActivate)); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(mhWnd, SAL_MSG_SHOW, WPARAM(bVisible), LPARAM(bNoActivate)); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } else ImplSalShow( mhWnd, bVisible, bNoActivate ); @@ -1987,8 +1987,8 @@ void WinSalFrame::ToTop( SalFrameToTop nFlags ) // We post this message to avoid deadlocks if ( GetSalData()->mnAppThreadId != GetCurrentThreadId() ) { - BOOL const ret = PostMessageW( mhWnd, SAL_MSG_TOTOP, static_cast<WPARAM>(nFlags), 0 ); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW( mhWnd, SAL_MSG_TOTOP, static_cast<WPARAM>(nFlags), 0 ); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } else ImplSalToTop( mhWnd, nFlags ); @@ -2959,8 +2959,8 @@ static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg, vcl::Window *pWin = pFrame->GetWindow(); if( pWin && pWin->ImplGetWindowImpl()->mpFrameData->mnFocusId ) { - BOOL const ret = PostMessageW( hWnd, nMsg, wParam, lParam ); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW( hWnd, nMsg, wParam, lParam ); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); return true; } } @@ -3472,7 +3472,7 @@ static bool ImplHandleKeyMsg( HWND hWnd, UINT nMsg, SalKeyEvent aKeyEvt; SalEvent nEvent; MSG aCharMsg; - BOOL bCharPeek = FALSE; + bool bCharPeek = FALSE; UINT nCharMsg = WM_CHAR; bool bKeyUp = (nMsg == WM_KEYUP) || (nMsg == WM_SYSKEYUP); @@ -3696,8 +3696,8 @@ static WinSalFrame* ProcessOrDeferMessage( HWND hWnd, INT nMsg, WPARAM pWParam = ImplSalYieldMutexRelease(); if ( DeferPolicy::Allowed == eCanDefer ) { - BOOL const ret = PostMessageW(hWnd, nMsg, pWParam, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(hWnd, nMsg, pWParam, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } } @@ -4128,13 +4128,13 @@ static LRESULT ImplHandlePalette( bool bFrame, HWND hWnd, UINT nMsg, bReleaseMutex = true; else if ( nMsg == WM_QUERYNEWPALETTE ) { - BOOL const ret = PostMessageW(hWnd, SAL_MSG_POSTQUERYNEWPAL, wParam, lParam); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(hWnd, SAL_MSG_POSTQUERYNEWPAL, wParam, lParam); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } else /* ( nMsg == WM_PALETTECHANGED ) */ { - BOOL const ret = PostMessageW(hWnd, SAL_MSG_POSTPALCHANGED, wParam, lParam); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(hWnd, SAL_MSG_POSTPALCHANGED, wParam, lParam); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } } @@ -4751,8 +4751,8 @@ static bool ImplHandleSysCommand( HWND hWnd, WPARAM wParam, LPARAM lParam ) if ( pFrame->mbFullScreen ) { - BOOL bMaximize = IsZoomed( pFrame->mhWnd ); - BOOL bMinimize = IsIconic( pFrame->mhWnd ); + bool bMaximize = IsZoomed( pFrame->mhWnd ); + bool bMinimize = IsIconic( pFrame->mhWnd ); if ( (nCommand == SC_SIZE) || (!bMinimize && (nCommand == SC_MOVE)) || (!bMaximize && (nCommand == SC_MAXIMIZE)) || diff --git a/vcl/win/window/salobj.cxx b/vcl/win/window/salobj.cxx index 9840994bc9fa..e01dc072bfa3 100644 --- a/vcl/win/window/salobj.cxx +++ b/vcl/win/window/salobj.cxx @@ -115,8 +115,8 @@ static LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) } else { - BOOL const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } } } @@ -135,8 +135,8 @@ static LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) } else { - BOOL const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } } else @@ -162,8 +162,8 @@ bool ImplSalPreDispatchMsg( const MSG* pMsg ) pObject = ImplFindSalObject( pMsg->hwnd ); if ( pObject && !pObject->IsMouseTransparent() ) { - BOOL const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_TOTOP, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(pObject->mhWnd, SALOBJ_MSG_TOTOP, 0, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } ImplSalYieldMutexRelease(); } @@ -300,8 +300,8 @@ static LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, L pSysObj = GetSalObjWindowPtr( hWnd ); if ( pSysObj && !pSysObj->IsMouseTransparent() ) { - BOOL const ret = PostMessageW( hWnd, SALOBJ_MSG_TOTOP, 0, 0 ); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW( hWnd, SALOBJ_MSG_TOTOP, 0, 0 ); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } ImplSalYieldMutexRelease(); } @@ -317,8 +317,8 @@ static LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, L } else { - BOOL const ret = PostMessageW( hWnd, SALOBJ_MSG_TOTOP, 0, 0 ); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW( hWnd, SALOBJ_MSG_TOTOP, 0, 0 ); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } break; @@ -337,8 +337,8 @@ static LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, L } else { - BOOL const ret = PostMessageW(hWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); - SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); + bool const ret = PostMessageW(hWnd, SALOBJ_MSG_POSTFOCUS, 0, 0); + SAL_WARN_IF(!ret, "vcl", "ERROR: PostMessage() failed!"); } rDef = FALSE; break; |