embedserv/source/embed/tracker.cxx | 2 +- sfx2/source/appl/shutdowniconw32.cxx | 8 ++++++-- vcl/win/dtrans/MtaOleClipb.cxx | 10 +++++++--- vcl/win/dtrans/target.cxx | 8 ++++++-- 4 files changed, 20 insertions(+), 8 deletions(-)
New commits: commit 8f22ce5ea3e62a4837773f6958b8ce7ac96f811a Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Feb 9 16:27:41 2021 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Feb 9 19:41:51 2021 +0100 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 <sberg...@redhat.com> 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())); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits