diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-02-09 16:27:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-02-09 19:41:51 +0100 |
commit | 8f22ce5ea3e62a4837773f6958b8ce7ac96f811a (patch) | |
tree | 255d12a2d154c40cc9b58e25c29f228d73cedacd | |
parent | 2d154d55db925dfa20358faa0302d4d942496aee (diff) |
loplugin:fakebool (clang-cl)
But GetMessageW encodes more than true vs. false in its BOOL return value, so
silence the unhelpful loplugin with auto.
Change-Id: I77d053b760e93f918367532c63a6dfe963faa12d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110645
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | embedserv/source/embed/tracker.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 8 | ||||
-rw-r--r-- | vcl/win/dtrans/MtaOleClipb.cxx | 10 | ||||
-rw-r--r-- | vcl/win/dtrans/target.cxx | 8 |
4 files changed, 20 insertions, 8 deletions
diff --git a/embedserv/source/embed/tracker.cxx b/embedserv/source/embed/tracker.cxx index dbe114660f61..2a736c39b05f 100644 --- a/embedserv/source/embed/tracker.cxx +++ b/embedserv/source/embed/tracker.cxx @@ -405,7 +405,7 @@ BOOL Tracker::TrackHandle(int nHandle,HWND hWnd,POINT point,HWND hWndClipTo) for (;;) { MSG msg; - BOOL bRet = GetMessageW(&msg, nullptr, 0, 0); + auto const bRet = GetMessageW(&msg, nullptr, 0, 0); SAL_WARN_IF(-1 == bRet, "embedserv", "GetMessageW failed: " << WindowsErrorString(GetLastError())); if (-1 == bRet || 0 == bRet) break; diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 298d84bf7d89..f86476995f1a 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -459,10 +459,14 @@ static DWORD WINAPI SystrayThread( LPVOID /*lpParam*/ ) ); MSG msg; - BOOL bRet; - while ((bRet = GetMessageW(&msg, nullptr, 0, 0)) != 0) + for (;;) { + auto const bRet = GetMessageW(&msg, nullptr, 0, 0); + if (bRet == 0) + { + break; + } if (-1 == bRet) { SAL_WARN("sfx.appl", "GetMessageW failed: " << WindowsErrorString(GetLastError())); diff --git a/vcl/win/dtrans/MtaOleClipb.cxx b/vcl/win/dtrans/MtaOleClipb.cxx index f6e471925516..3898bdc30dfb 100644 --- a/vcl/win/dtrans/MtaOleClipb.cxx +++ b/vcl/win/dtrans/MtaOleClipb.cxx @@ -654,10 +654,14 @@ unsigned int CMtaOleClipboard::run( ) nRet = 0; // pumping messages - MSG msg; - BOOL bRet; - while ((bRet = GetMessageW(&msg, nullptr, 0, 0)) != 0) + for (;;) { + MSG msg; + auto const bRet = GetMessageW(&msg, nullptr, 0, 0); + if (bRet == 0) + { + break; + } if (-1 == bRet) { SAL_WARN("vcl.win.dtrans", "GetMessageW failed: " << WindowsErrorString(GetLastError())); diff --git a/vcl/win/dtrans/target.cxx b/vcl/win/dtrans/target.cxx index 45a8515bd414..2492c8a3cc94 100644 --- a/vcl/win/dtrans/target.cxx +++ b/vcl/win/dtrans/target.cxx @@ -208,9 +208,13 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams) DWORD threadId= GetCurrentThreadId(); // We force the creation of a thread message queue. This is necessary // for a later call to AttachThreadInput - BOOL bRet; - while ((bRet = GetMessageW(&msg, nullptr, 0, 0)) != 0) + for (;;) { + auto const bRet = GetMessageW(&msg, nullptr, 0, 0); + if (bRet == 0) + { + break; + } if (-1 == bRet) { SAL_WARN("vcl.win.dtrans", "GetMessageW failed: " << WindowsErrorString(GetLastError())); |