diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-27 14:59:37 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-06-13 15:05:33 +0200 |
commit | cffc667ad9dae10adf415357a606e7253a0c3206 (patch) | |
tree | 2c4b1366ab7f2c34ad6863d97fa87103883a0199 /src | |
parent | b548c321d75e217e736da3a031412f708825baf1 (diff) |
QThread: avoid mixed enum arithmetic
It's deprecated.
Task-number: QTBUG-94059
Change-Id: If4fb81b650edb7cdb96980986dc4710a1a5040af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 8d2c83d519..4cbe072727 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -296,8 +296,8 @@ void *QThreadPrivate::start(void *arg) QMutexLocker locker(&thr->d_func()->mutex); // do we need to reset the thread priority? - if (int(thr->d_func()->priority) & ThreadPriorityResetFlag) { - thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag)); + if (qToUnderlying(thr->d_func()->priority) & ThreadPriorityResetFlag) { + thr->d_func()->setPriority(QThread::Priority(qToUnderlying(thr->d_func()->priority) & ~ThreadPriorityResetFlag)); } data->threadId.storeRelaxed(to_HANDLE(pthread_self())); @@ -679,7 +679,7 @@ void QThread::start(Priority priority) // could not set scheduling hints, fallback to inheriting them // we'll try again from inside the thread pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); - d->priority = Priority(priority | ThreadPriorityResetFlag); + d->priority = Priority(qToUnderlying(priority) | ThreadPriorityResetFlag); } break; } |