From 1e836fff18ceaea8331711708bdc3d8ea0cc051e Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 5 Mar 2024 15:35:59 +0300 Subject: QFutureInterface: Rename "interface" variables to "iface" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows the "interface" is defined as "struct". Do not #undef it to fix a unity build. Task-number: QTBUG-122980 Pick-to: 6.7 Change-Id: I9379c996d8b67b16a8b825af0ff3469111533291 Reviewed-by: Mårten Nordheim --- src/corelib/thread/qfutureinterface.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/corelib/thread/qfutureinterface.cpp') diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index d3d44a169d..5fc186b1e4 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -12,10 +12,6 @@ #include #include -#ifdef interface -# undef interface -#endif - // GCC 12 gets confused about QFutureInterfaceBase::state, for some non-obvious // 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=] @@ -796,9 +792,9 @@ void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOu return; for (int i = 0; i < outputConnections.size(); ++i) { - QFutureCallOutInterface *interface = outputConnections.at(i); - interface->postCallOutEvent(callOutEvent1); - interface->postCallOutEvent(callOutEvent2); + QFutureCallOutInterface *iface = outputConnections.at(i); + iface->postCallOutEvent(callOutEvent1); + 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 // 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. -void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *interface) +void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *iface) { QMutexLocker locker(&m_mutex); @@ -855,22 +851,22 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface if (currentState & QFutureInterfaceBase::Finished) events.emplace_back(new QFutureCallOutEvent(QFutureCallOutEvent::Finished)); - outputConnections.append(interface); + outputConnections.append(iface); locker.unlock(); for (auto &&event : events) - interface->postCallOutEvent(*event); + iface->postCallOutEvent(*event); } -void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface) +void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *iface) { QMutexLocker lock(&m_mutex); - const qsizetype index = outputConnections.indexOf(interface); + const qsizetype index = outputConnections.indexOf(iface); if (index == -1) return; outputConnections.removeAt(index); - interface->callOutInterfaceDisconnected(); + iface->callOutInterfaceDisconnected(); } void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState) -- cgit v1.2.3