Event dispatchers: code tidies

Turn an implicit conversion to bool in

* a call to testAnyFlag in one case;
* a comparison against 0 in another case, for consistency with the
surrounding code.

Change-Id: I1eee42ba82c59a72430bf507ea80408c553be889
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2021-05-02 02:31:32 +02:00
parent 5a1c3c29ac
commit c568257a52
2 changed files with 2 additions and 2 deletions

View File

@ -411,7 +411,7 @@ bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_D(QEventDispatcherGlib);
const bool canWait = (flags & QEventLoop::WaitForMoreEvents);
const bool canWait = flags.testAnyFlag(QEventLoop::WaitForMoreEvents);
if (canWait)
emit aboutToBlock();
else

View File

@ -469,7 +469,7 @@ bool QEventDispatcherUNIX::processEvents(QEventLoop::ProcessEventsFlags flags)
const bool include_timers = (flags & QEventLoop::X11ExcludeTimers) == 0;
const bool include_notifiers = (flags & QEventLoop::ExcludeSocketNotifiers) == 0;
const bool wait_for_events = flags & QEventLoop::WaitForMoreEvents;
const bool wait_for_events = (flags & QEventLoop::WaitForMoreEvents) != 0;
const bool canWait = (threadData->canWaitLocked()
&& !d->interrupt.loadRelaxed()