QFutureInterface: Rename "interface" variables to "iface"
On Windows the "interface" is defined as "struct". Do not #undef it to fix a unity build. Task-number: QTBUG-122980 Change-Id: I9379c996d8b67b16a8b825af0ff3469111533291 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1e836fff18ceaea8331711708bdc3d8ea0cc051e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
157f7b47e4
commit
7c74a2af73
@ -12,10 +12,6 @@
|
|||||||
#include <private/qthreadpool_p.h>
|
#include <private/qthreadpool_p.h>
|
||||||
#include <private/qobject_p.h>
|
#include <private/qobject_p.h>
|
||||||
|
|
||||||
#ifdef interface
|
|
||||||
# undef interface
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// GCC 12 gets confused about QFutureInterfaceBase::state, for some non-obvious
|
// GCC 12 gets confused about QFutureInterfaceBase::state, for some non-obvious
|
||||||
// reason
|
// reason
|
||||||
// warning: ‘unsigned int __atomic_or_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
|
// warning: ‘unsigned int __atomic_or_fetch_4(volatile void*, unsigned int, int)’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
|
||||||
@ -796,9 +792,9 @@ void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOu
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < outputConnections.size(); ++i) {
|
for (int i = 0; i < outputConnections.size(); ++i) {
|
||||||
QFutureCallOutInterface *interface = outputConnections.at(i);
|
QFutureCallOutInterface *iface = outputConnections.at(i);
|
||||||
interface->postCallOutEvent(callOutEvent1);
|
iface->postCallOutEvent(callOutEvent1);
|
||||||
interface->postCallOutEvent(callOutEvent2);
|
iface->postCallOutEvent(callOutEvent2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -806,7 +802,7 @@ void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOu
|
|||||||
// to this future. While holding the lock we check the state and ready results
|
// to this future. While holding the lock we check the state and ready results
|
||||||
// and add the appropriate callouts to the queue. In order to avoid deadlocks,
|
// and add the appropriate callouts to the queue. In order to avoid deadlocks,
|
||||||
// the actual callouts are made at the end while not holding the lock.
|
// the actual callouts are made at the end while not holding the lock.
|
||||||
void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *interface)
|
void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *iface)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
|
|
||||||
@ -855,22 +851,22 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
|
|||||||
if (currentState & QFutureInterfaceBase::Finished)
|
if (currentState & QFutureInterfaceBase::Finished)
|
||||||
events.emplace_back(new QFutureCallOutEvent(QFutureCallOutEvent::Finished));
|
events.emplace_back(new QFutureCallOutEvent(QFutureCallOutEvent::Finished));
|
||||||
|
|
||||||
outputConnections.append(interface);
|
outputConnections.append(iface);
|
||||||
|
|
||||||
locker.unlock();
|
locker.unlock();
|
||||||
for (auto &&event : events)
|
for (auto &&event : events)
|
||||||
interface->postCallOutEvent(*event);
|
iface->postCallOutEvent(*event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface)
|
void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *iface)
|
||||||
{
|
{
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
const qsizetype index = outputConnections.indexOf(interface);
|
const qsizetype index = outputConnections.indexOf(iface);
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return;
|
return;
|
||||||
outputConnections.removeAt(index);
|
outputConnections.removeAt(index);
|
||||||
|
|
||||||
interface->callOutInterfaceDisconnected();
|
iface->callOutInterfaceDisconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)
|
void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user