diff --git a/src/blackcore/afv/audio/input.cpp b/src/blackcore/afv/audio/input.cpp index 07a1c5e96..b2c22f57b 100644 --- a/src/blackcore/afv/audio/input.cpp +++ b/src/blackcore/afv/audio/input.cpp @@ -95,7 +95,7 @@ namespace BlackCore::Afv::Audio { if (m_started) { return; } - BLACK_VERIFY_X(inputDevice.isValid() && inputDevice.isInputDevice(), Q_FUNC_INFO, "Wrong input device"); + SWIFT_VERIFY_X(inputDevice.isValid() && inputDevice.isInputDevice(), Q_FUNC_INFO, "Wrong input device"); m_device = inputDevice; QAudioFormat inputFormat; diff --git a/src/blackcore/afv/audio/output.cpp b/src/blackcore/afv/audio/output.cpp index 8854bfb31..6801889ef 100644 --- a/src/blackcore/afv/audio/output.cpp +++ b/src/blackcore/afv/audio/output.cpp @@ -94,7 +94,7 @@ namespace BlackCore::Afv::Audio { if (m_started) { return; } - BLACK_VERIFY_X(outputDevice.isValid() && outputDevice.isOutputDevice(), Q_FUNC_INFO, "Wrong output device"); + SWIFT_VERIFY_X(outputDevice.isValid() && outputDevice.isOutputDevice(), Q_FUNC_INFO, "Wrong output device"); if (m_audioOutputBuffer) { m_audioOutputBuffer->deleteLater(); } m_audioOutputBuffer = new CAudioOutputBuffer(sampleProvider, this); diff --git a/src/blackcore/afv/clients/afvclient.cpp b/src/blackcore/afv/clients/afvclient.cpp index 6e6593ae6..97cc6630c 100644 --- a/src/blackcore/afv/clients/afvclient.cpp +++ b/src/blackcore/afv/clients/afvclient.cpp @@ -292,8 +292,8 @@ namespace BlackCore::Afv::Clients const CAudioDeviceInfo useInputDevice = inputDevice.isValid() ? inputDevice : CAudioDeviceInfo::getDefaultInputDevice(); const CAudioDeviceInfo useOutputDevice = outputDevice.isValid() ? outputDevice : CAudioDeviceInfo::getDefaultOutputDevice(); - BLACK_VERIFY_X(useInputDevice.isValid() && useInputDevice.isInputDevice(), Q_FUNC_INFO, "Wrong input device"); - BLACK_VERIFY_X(useOutputDevice.isValid() && useOutputDevice.isOutputDevice(), Q_FUNC_INFO, "Wrong output device"); + SWIFT_VERIFY_X(useInputDevice.isValid() && useInputDevice.isInputDevice(), Q_FUNC_INFO, "Wrong input device"); + SWIFT_VERIFY_X(useOutputDevice.isValid() && useOutputDevice.isOutputDevice(), Q_FUNC_INFO, "Wrong output device"); if (m_isStarted) { diff --git a/src/blackcore/afv/connection/clientconnection.cpp b/src/blackcore/afv/connection/clientconnection.cpp index 9c161c915..5cd24057a 100644 --- a/src/blackcore/afv/connection/clientconnection.cpp +++ b/src/blackcore/afv/connection/clientconnection.cpp @@ -149,7 +149,7 @@ namespace BlackCore::Afv::Connection { if (!m_connection.m_voiceCryptoChannel) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "processMessage used without crypto channel"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "processMessage used without crypto channel"); return; } @@ -185,7 +185,7 @@ namespace BlackCore::Afv::Connection { if (!m_connection.m_voiceCryptoChannel || !m_udpSocket) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "voiceServerHeartbeat used without crypto channel or socket"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "voiceServerHeartbeat used without crypto channel or socket"); return; } diff --git a/src/blackcore/afv/connection/clientconnection.h b/src/blackcore/afv/connection/clientconnection.h index 856d8cba0..e6eeae0b4 100644 --- a/src/blackcore/afv/connection/clientconnection.h +++ b/src/blackcore/afv/connection/clientconnection.h @@ -66,7 +66,7 @@ namespace BlackCore::Afv::Connection { if (!m_connection.m_voiceCryptoChannel || !m_udpSocket) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "sendVoice used without crypto channel or socket"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "sendVoice used without crypto channel or socket"); return; } const QUrl voiceServerUrl("udp://" + m_connection.getTokens().VoiceServer.addressIpV4); diff --git a/src/blackcore/afv/crypto/cryptodtochannel.cpp b/src/blackcore/afv/crypto/cryptodtochannel.cpp index 6baf4132f..2871db0cb 100644 --- a/src/blackcore/afv/crypto/cryptodtochannel.cpp +++ b/src/blackcore/afv/crypto/cryptodtochannel.cpp @@ -13,13 +13,13 @@ namespace BlackCore::Afv::Crypto { if (m_aeadTransmitKey.size() != crypto_aead_chacha20poly1305_IETF_KEYBYTES) { - BLACK_AUDIT_X(false, Q_FUNC_INFO, "wrong transmit key size"); + SWIFT_AUDIT_X(false, Q_FUNC_INFO, "wrong transmit key size"); throw std::invalid_argument("wrong transmit key size"); } if (m_aeadReceiveKey.size() != crypto_aead_chacha20poly1305_IETF_KEYBYTES) { - BLACK_AUDIT_X(false, Q_FUNC_INFO, "wrong receive key size"); + SWIFT_AUDIT_X(false, Q_FUNC_INFO, "wrong receive key size"); throw std::invalid_argument("wrong receive key size"); } @@ -35,7 +35,7 @@ namespace BlackCore::Afv::Crypto case CryptoDtoMode::AEAD_ChaCha20Poly1305: return m_aeadTransmitKey; case CryptoDtoMode::Undefined: case CryptoDtoMode::None: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "GetTransmitKey called with wrong argument."); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "GetTransmitKey called with wrong argument."); break; } @@ -53,7 +53,7 @@ namespace BlackCore::Afv::Crypto case CryptoDtoMode::AEAD_ChaCha20Poly1305: return m_aeadTransmitKey; case CryptoDtoMode::Undefined: case CryptoDtoMode::None: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "GetTransmitKey called with wrong argument."); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "GetTransmitKey called with wrong argument."); break; } @@ -72,7 +72,7 @@ namespace BlackCore::Afv::Crypto case CryptoDtoMode::AEAD_ChaCha20Poly1305: return m_aeadReceiveKey; case CryptoDtoMode::Undefined: case CryptoDtoMode::None: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "GetReceiveKey called with wrong argument."); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "GetReceiveKey called with wrong argument."); break; } diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index a80ccc12a..09c14febe 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -829,7 +829,7 @@ namespace BlackCore { Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "not in main thread"); if (!this->isConnectedAndNotShuttingDown()) { return; } - if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(callsign.isValid(), Q_FUNC_INFO, "invalid callsign"); } + if (CBuildConfig::isLocalDeveloperDebugBuild()) { SWIFT_VERIFY_X(callsign.isValid(), Q_FUNC_INFO, "invalid callsign"); } if (!callsign.isValid()) { return; } if (!this->isAircraftInRange(callsign)) { return; } // FSD overload issue, do not do anything if unknown @@ -1363,7 +1363,7 @@ namespace BlackCore { Q_ASSERT(CThreadUtils::isInThisThread(this)); - BLACK_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } unsigned long pp = 0; @@ -1422,7 +1422,7 @@ namespace BlackCore void CAirspaceMonitor::onAircraftConfigReceived(const CCallsign &callsign, const QJsonObject &jsonObject, qint64 currentOffsetMs) { Q_ASSERT(CThreadUtils::isInThisThread(this)); - BLACK_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } // store parts @@ -1439,7 +1439,7 @@ namespace BlackCore CAircraftSituation CAirspaceMonitor::storeAircraftSituation(const CAircraftSituation &situation, bool allowTestOffset) { const CCallsign callsign(situation.getCallsign()); - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign"); if (callsign.isEmpty()) { return situation; } CAircraftSituation correctedSituation(allowTestOffset ? this->addTestAltitudeOffsetToSituation(situation) : situation); @@ -1564,7 +1564,7 @@ namespace BlackCore if (CBuildConfig::isLocalDeveloperDebugBuild()) { // experimental, could become ASSERT - BLACK_VERIFY_X(needToRequestElevation, Q_FUNC_INFO, "Request should already be set"); + SWIFT_VERIFY_X(needToRequestElevation, Q_FUNC_INFO, "Request should already be set"); } needToRequestElevation = true; // should be "true" already @@ -1576,7 +1576,7 @@ namespace BlackCore // sanity check on the situation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(!correctedSituation.getGroundElevation().isZeroEpsilonConsidered(), Q_FUNC_INFO, "Suspicious elevation"); + SWIFT_VERIFY_X(!correctedSituation.getGroundElevation().isZeroEpsilonConsidered(), Q_FUNC_INFO, "Suspicious elevation"); } } } // gnd. elevation diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 4a983e380..bd33017dd 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -758,7 +758,7 @@ namespace BlackCore CStatusMessageList CApplication::initAndStartWebDataServices(CWebReaderFlags::WebReader webReader, const Db::CDatabaseReaderConfigList &dbReaderConfig) { Q_ASSERT_X(m_webDataServices.isNull(), Q_FUNC_INFO, "Services already started"); - BLACK_VERIFY_X(QSslSocket::supportsSsl(), Q_FUNC_INFO, "No SSL"); + SWIFT_VERIFY_X(QSslSocket::supportsSsl(), Q_FUNC_INFO, "No SSL"); if (!QSslSocket::supportsSsl()) { return CStatusMessage(this).error(u"No SSL supported, can`t be used"); diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index cd16b2096..067dbf521 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -68,7 +68,7 @@ namespace BlackCore::Context case CCoreFacadeConfig::Remote: return new CContextAudioProxy(CDBusServer::coreServiceName(connection), connection, mode, runtime); case CCoreFacadeConfig::NotUsed: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Empty context not supported for audio (since AFV)"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Empty context not supported for audio (since AFV)"); return nullptr; } } @@ -599,7 +599,7 @@ namespace BlackCore::Context if (!m_voiceClient) { return; } Q_UNUSED(from) - BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context"); + SWIFT_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context"); // we only change network connection of AFV client here if (to.isConnected() && this->getIContextNetwork()) diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 1726602f0..2ff2edfed 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -478,7 +478,7 @@ namespace BlackCore::Context CSimulatorInfo simInfo = simulator->getSimulatorInfo(); if (!simInfo.isSingleSimulator()) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Invalid simulator from plugin"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Invalid simulator from plugin"); simInfo = CSimulatorInfo::p3d(); if (simulator->isEmulatedDriver()) { @@ -659,7 +659,7 @@ namespace BlackCore::Context if (!this->isSimulatorPluginAvailable()) { return; } const CCallsign callsign = remoteAircraft.getCallsign(); - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Remote aircraft with empty callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Remote aircraft with empty callsign"); if (callsign.isEmpty()) { return; } // here we find the best simulator model for a resolved model @@ -746,7 +746,7 @@ namespace BlackCore::Context const CSimulatedAircraftList aircraft = networkContext->getAircraftInRange(); for (const CSimulatedAircraft &simulatedAircraft : aircraft) { - BLACK_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!simulatedAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "Need callsign"); this->xCtxAddedRemoteAircraftReadyForModelMatching(simulatedAircraft); } m_initallyAddAircraft = false; @@ -804,7 +804,7 @@ namespace BlackCore::Context void CContextSimulator::xCtxNetworkConnectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to) { Q_UNUSED(from) - BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context"); + SWIFT_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context"); if (to.isConnected() && this->getIContextNetwork()) { m_networkSessionId = this->getIContextNetwork()->getConnectedServer().getServerSessionId(false); diff --git a/src/blackcore/corefacade.cpp b/src/blackcore/corefacade.cpp index 66e027290..09caad692 100644 --- a/src/blackcore/corefacade.cpp +++ b/src/blackcore/corefacade.cpp @@ -90,7 +90,7 @@ namespace BlackCore if (!m_dbusConnection.isConnected()) { const QString e = m_dbusConnection.lastError().message(); - BLACK_VERIFY_X(false, "CRuntime::init DBus problem", e.toUtf8().constData()); + SWIFT_VERIFY_X(false, "CRuntime::init DBus problem", e.toUtf8().constData()); CLogMessage(this).error(u"DBus connection failed: '%1'") << e; return; } diff --git a/src/blackcore/db/infodatareader.cpp b/src/blackcore/db/infodatareader.cpp index 50e409749..23e25108e 100644 --- a/src/blackcore/db/infodatareader.cpp +++ b/src/blackcore/db/infodatareader.cpp @@ -45,21 +45,21 @@ namespace BlackCore::Db void CInfoDataReader::synchronizeCaches(CEntityFlags::Entity entities) { // no caching used here - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); Q_UNUSED(entities); } void CInfoDataReader::admitCaches(CEntityFlags::Entity entities) { // no caching used here - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); Q_UNUSED(entities); } void CInfoDataReader::invalidateCaches(CEntityFlags::Entity entities) { // no caching used here - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); Q_UNUSED(entities); } @@ -72,7 +72,7 @@ namespace BlackCore::Db if (entity == CEntityFlags::DbInfoObjectEntity || entity == CEntityFlags::SharedInfoObjectEntity) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); return QDateTime(); } @@ -90,7 +90,7 @@ namespace BlackCore::Db if (entity == CEntityFlags::DbInfoObjectEntity || entity == CEntityFlags::SharedInfoObjectEntity) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); return 0; } @@ -101,14 +101,14 @@ namespace BlackCore::Db CEntityFlags::Entity CInfoDataReader::getEntitiesWithCacheCount() const { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); return CEntityFlags::NoEntity; } CEntityFlags::Entity CInfoDataReader::getEntitiesWithCacheTimestampNewerThan(const QDateTime &threshold) const { Q_UNUSED(threshold); - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Using this for CInfoDataReader makes no sense"); return CEntityFlags::NoEntity; } diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index 020662cb6..10b636788 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -771,7 +771,7 @@ namespace BlackCore::Fsd } const bool connected = isConnected(); - BLACK_VERIFY_X(connected, Q_FUNC_INFO, "Can't send to server when disconnected"); + SWIFT_VERIFY_X(connected, Q_FUNC_INFO, "Can't send to server when disconnected"); if (!connected) { return; } const CSimulatedAircraft myAircraft(getOwnAircraft()); @@ -1655,7 +1655,7 @@ namespace BlackCore::Fsd CLogMessage(this).info(u"Server requested we switch server to %1") << rehost.m_hostname; - BLACK_AUDIT_X(!m_rehosting, Q_FUNC_INFO, "Rehosting already in progress"); + SWIFT_AUDIT_X(!m_rehosting, Q_FUNC_INFO, "Rehosting already in progress"); m_rehosting = true; auto rehostingSocket = std::make_shared(); @@ -2573,7 +2573,7 @@ namespace BlackCore::Fsd { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Illegal FSD state"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Illegal FSD state"); } CLogMessage(this).warning(message); } diff --git a/src/blackcore/fsd/serializer.cpp b/src/blackcore/fsd/serializer.cpp index e2eabe0f7..0995d85cf 100644 --- a/src/blackcore/fsd/serializer.cpp +++ b/src/blackcore/fsd/serializer.cpp @@ -32,7 +32,7 @@ namespace BlackCore::Fsd { // developers should record these types and EXPLICITLY exclude them const QByteArray msg = message.toLatin1(); - BLACK_VERIFY_X(false, Q_FUNC_INFO, msg); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, msg); } CLogMessage(CLogCategories::fsd()).info(u"%1. Please report this to the DEVELOPERS!") << message; diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index 45c46556b..9460430cb 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -232,7 +232,7 @@ namespace BlackCore void ISimulator::safeKillTimer() { if (m_timerId < 0) { return; } - BLACK_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); + SWIFT_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); this->killTimer(m_timerId); m_timerId = -1; } @@ -566,7 +566,7 @@ namespace BlackCore // normally we should never end up without callsign, but it has happened in real world scenarios // https://discordapp.com/channels/539048679160676382/568904623151382546/575712119513677826 const bool hasCs = sent.hasCallsign(); - BLACK_VERIFY_X(hasCs, Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(hasCs, Q_FUNC_INFO, "Need callsign"); if (!hasCs) { return; } m_lastSentSituations.insert(sent.getCallsign(), sent); } @@ -575,7 +575,7 @@ namespace BlackCore { // normally we should never end up without callsign, but it has happened in real world scenarios // https://discordapp.com/channels/539048679160676382/568904623151382546/575712119513677826 - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } m_lastSentParts.insert(callsign, sent); } @@ -1110,7 +1110,7 @@ namespace BlackCore if (CBuildConfig::isLocalDeveloperDebugBuild()) { const bool invalid = situation.isOnGround() && elevation.isZeroEpsilonConsidered(); - BLACK_AUDIT_X(!invalid, Q_FUNC_INFO, "On ground in water"); + SWIFT_AUDIT_X(!invalid, Q_FUNC_INFO, "On ground in water"); } Q_UNUSED(remembered) // false means it was already in that cache, or something else is wrong } diff --git a/src/blackcore/threadedreader.cpp b/src/blackcore/threadedreader.cpp index 5d7ed1d17..28d67b41f 100644 --- a/src/blackcore/threadedreader.cpp +++ b/src/blackcore/threadedreader.cpp @@ -206,7 +206,7 @@ namespace BlackCore if (funcInfo) { const QByteArray m(logMsg.getMessage().toLatin1()); - BLACK_AUDIT_X(false, funcInfo, m.constData()); + SWIFT_AUDIT_X(false, funcInfo, m.constData()); } CLogMessage::preformatted(logMsg); } diff --git a/src/blackgui/components/datainfoareacomponent.cpp b/src/blackgui/components/datainfoareacomponent.cpp index 0c63b3230..610cb8723 100644 --- a/src/blackgui/components/datainfoareacomponent.cpp +++ b/src/blackgui/components/datainfoareacomponent.cpp @@ -172,7 +172,7 @@ namespace BlackGui::Components } // sanity - BLACK_VERIFY_X(requested, Q_FUNC_INFO, "Entity not supported"); + SWIFT_VERIFY_X(requested, Q_FUNC_INFO, "Entity not supported"); Q_UNUSED(requested); } } // ns diff --git a/src/blackgui/components/datamaininfoareacomponent.cpp b/src/blackgui/components/datamaininfoareacomponent.cpp index 2d1b96dc4..10400e44b 100644 --- a/src/blackgui/components/datamaininfoareacomponent.cpp +++ b/src/blackgui/components/datamaininfoareacomponent.cpp @@ -62,7 +62,7 @@ namespace BlackGui::Components void CDataMainInfoAreaComponent::displayLog() { this->selectArea(InfoAreaLog); - BLACK_VERIFY_X(this->getLogComponent(), Q_FUNC_INFO, "No log component"); + SWIFT_VERIFY_X(this->getLogComponent(), Q_FUNC_INFO, "No log component"); if (!this->getLogComponent()) { return; } this->getLogComponent()->displayLog(); } diff --git a/src/blackgui/components/dblogincomponent.cpp b/src/blackgui/components/dblogincomponent.cpp index 59cd47eb6..dfc5d55da 100644 --- a/src/blackgui/components/dblogincomponent.cpp +++ b/src/blackgui/components/dblogincomponent.cpp @@ -87,7 +87,7 @@ namespace BlackGui::Components { if (msgs.isEmpty()) { return; } COverlayMessagesFrame *mf = CGuiUtility::nextOverlayMessageFrame(this); - BLACK_VERIFY_X(mf, Q_FUNC_INFO, "No overlay widget"); + SWIFT_VERIFY_X(mf, Q_FUNC_INFO, "No overlay widget"); if (!mf) { return; } mf->showOverlayMessages(msgs); } diff --git a/src/blackgui/components/dbstashcomponent.cpp b/src/blackgui/components/dbstashcomponent.cpp index c5a05453a..de279247a 100644 --- a/src/blackgui/components/dbstashcomponent.cpp +++ b/src/blackgui/components/dbstashcomponent.cpp @@ -458,7 +458,7 @@ namespace BlackGui::Components void CDbStashComponent::copyOverValuesToSelectedModels() { const QObject *sender = QObject::sender(); - BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "Missing mapping component"); + SWIFT_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "Missing mapping component"); if (!this->getMappingComponent()) { return; } if (!ui->tvp_StashAircraftModels->hasSelection()) { return; } @@ -523,7 +523,7 @@ namespace BlackGui::Components { if (msgs.isEmpty()) { return false; } if (!msgs.hasErrorMessages() && onlyErrors) { return false; } - BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); + SWIFT_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); if (!this->getMappingComponent()) { return false; } this->getMappingComponent()->showOverlayMessages(msgs, appendOldMessages, timeoutMs); @@ -536,7 +536,7 @@ namespace BlackGui::Components { if (msgs.isEmpty()) { return false; } if (!msgs.hasErrorMessages() && onlyErrors) { return false; } - BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); + SWIFT_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); if (!this->getMappingComponent()) { return false; } this->getMappingComponent()->showOverlayMessagesWithConfirmation(msgs, appendOldMessages, confirmation, okLambda, defaultButton, timeoutMs); return true; @@ -545,7 +545,7 @@ namespace BlackGui::Components bool CDbStashComponent::showOverlayMessage(const CStatusMessage &msg, int timeoutMs) { if (msg.isEmpty()) { return false; } - BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); + SWIFT_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); if (!this->getMappingComponent()) { return false; } this->getMappingComponent()->showOverlayMessage(msg, timeoutMs); return true; @@ -553,7 +553,7 @@ namespace BlackGui::Components void CDbStashComponent::clearOverlayMessages() { - BLACK_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); + SWIFT_VERIFY_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component"); if (!this->getMappingComponent()) { return; } this->getMappingComponent()->clearOverlayMessages(); } diff --git a/src/blackgui/components/firstmodelsetcomponent.cpp b/src/blackgui/components/firstmodelsetcomponent.cpp index df98c6c58..e6b0fbd07 100644 --- a/src/blackgui/components/firstmodelsetcomponent.cpp +++ b/src/blackgui/components/firstmodelsetcomponent.cpp @@ -70,7 +70,7 @@ namespace BlackGui::Components if (!simulator.isSingleSimulator()) { //! \fixme KB 2019-01 reported by RR/crash dump sometimes happening and leading to ASSERT/CTD avoiding the "crash" for better infos - if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(false, Q_FUNC_INFO, "Need single simulator"); } + if (CBuildConfig::isLocalDeveloperDebugBuild()) { SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Need single simulator"); } CLogMessage(this).error(u"Changing to non-single simulator %1 ignored") << simulator.toQString(); return; } diff --git a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp index cc4752608..592431e4d 100644 --- a/src/blackgui/components/infobarwebreadersstatuscomponent.cpp +++ b/src/blackgui/components/infobarwebreadersstatuscomponent.cpp @@ -114,7 +114,7 @@ namespace BlackGui::Components led->setTriState(2 * resetTimeMs); break; default: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "read state not handled"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "read state not handled"); break; } } diff --git a/src/blackgui/components/settingssimulatorcomponent.cpp b/src/blackgui/components/settingssimulatorcomponent.cpp index 37ac9f509..7df6037b6 100644 --- a/src/blackgui/components/settingssimulatorcomponent.cpp +++ b/src/blackgui/components/settingssimulatorcomponent.cpp @@ -402,7 +402,7 @@ namespace BlackGui::Components Q_ASSERT_X(aw, Q_FUNC_INFO, "Missing active window"); CPluginDetailsWindow *w = new CPluginDetailsWindow(aw); - BLACK_VERIFY_X(w, Q_FUNC_INFO, "Missing window"); + SWIFT_VERIFY_X(w, Q_FUNC_INFO, "Missing window"); if (!w) { return; } w->setAttribute(Qt::WA_DeleteOnClose); @@ -420,11 +420,11 @@ namespace BlackGui::Components const QString configId = m_plugins->getPluginConfigId(selected.getIdentifier()); IPluginConfig *config = m_plugins->getPluginById(configId); - BLACK_VERIFY_X(config, Q_FUNC_INFO, "Missing config"); + SWIFT_VERIFY_X(config, Q_FUNC_INFO, "Missing config"); if (!config) { return; } CPluginConfigWindow *window = config->createConfigWindow(qApp->activeWindow()); - BLACK_VERIFY_X(window, Q_FUNC_INFO, "Missing window"); + SWIFT_VERIFY_X(window, Q_FUNC_INFO, "Missing window"); if (!window) { return; } window->setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index ac0df8d59..aa720d46d 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -265,7 +265,7 @@ namespace BlackGui::Components } else { - BLACK_AUDIT_X(false, Q_FUNC_INFO, "Wrong message type"); + SWIFT_AUDIT_X(false, Q_FUNC_INFO, "Wrong message type"); continue; } @@ -574,7 +574,7 @@ namespace BlackGui::Components if (!tab) { tab = this->addNewTextMessageTab(cs); } Q_ASSERT_X(tab, Q_FUNC_INFO, "Missing tab"); CTextMessageTextEdit *textEdit = tab->findChild(); - BLACK_VERIFY_X(textEdit, Q_FUNC_INFO, "Missing text edit"); + SWIFT_VERIFY_X(textEdit, Q_FUNC_INFO, "Missing text edit"); if (!textEdit) { return; } // do not crash, though this situation should not happen textEdit->insertTextMessage(textMessage); diff --git a/src/blackgui/dockwidget.cpp b/src/blackgui/dockwidget.cpp index 18326e3e9..7b1dad7f9 100644 --- a/src/blackgui/dockwidget.cpp +++ b/src/blackgui/dockwidget.cpp @@ -461,7 +461,7 @@ namespace BlackGui this->initStatusBarAndProperties(); // for the first time resize - BLACK_VERIFY(!m_preferredSizeWhenFloating.isNull()); + SWIFT_VERIFY(!m_preferredSizeWhenFloating.isNull()); if (!m_preferredSizeWhenFloating.isNull()) { m_initialDockedMinimumSize = this->minimumSize(); @@ -702,7 +702,7 @@ namespace BlackGui void CDockWidget::saveSettings(const CDockWidgetSettings &settings) { - BLACK_VERIFY_X(!this->objectName().isEmpty(), Q_FUNC_INFO, "Need object name for settings %OwnerName%"); + SWIFT_VERIFY_X(!this->objectName().isEmpty(), Q_FUNC_INFO, "Need object name for settings %OwnerName%"); if (this->objectName().isEmpty()) { CStatusMessage(this).error(u"Settings cannot be saved!"); diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 6ec08fd15..ef46bc767 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -540,7 +540,7 @@ namespace BlackGui bool CGuiApplication::displayInStatusBar(const CStatusMessage &message) { IMainWindowAccess *m = mainWindowAccess(); - BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); + SWIFT_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); if (!m) { return false; } return m->displayInStatusBar(message); } @@ -549,7 +549,7 @@ namespace BlackGui { if (message.isEmpty()) { return false; } IMainWindowAccess *m = mainWindowAccess(); - BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); + SWIFT_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); if (!m) { return IMainWindowAccess::displayInOverlayWindow(message, timeOutMs); } return m->displayInOverlayWindow(message, timeOutMs); } @@ -558,7 +558,7 @@ namespace BlackGui { if (messages.isEmpty()) { return false; } IMainWindowAccess *m = mainWindowAccess(); - BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); + SWIFT_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); if (!m) { return IMainWindowAccess::displayInOverlayWindow(messages, timeOutMs); } return m->displayInOverlayWindow(messages, timeOutMs); } @@ -567,7 +567,7 @@ namespace BlackGui { if (html.isEmpty()) { return false; } IMainWindowAccess *m = mainWindowAccess(); - BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); + SWIFT_VERIFY_X(m, Q_FUNC_INFO, "No access interface"); if (!m) { return IMainWindowAccess::displayInOverlayWindow(html, timeOutMs); } return m->displayInOverlayWindow(html, timeOutMs); } diff --git a/src/blackgui/guiutility.cpp b/src/blackgui/guiutility.cpp index e118a8ff3..a275ff42f 100644 --- a/src/blackgui/guiutility.cpp +++ b/src/blackgui/guiutility.cpp @@ -274,8 +274,8 @@ namespace BlackGui QString c(comparison.trimmed().toLower().simplified()); // we should not have empty titles - BLACK_VERIFY_X(!t.isEmpty(), Q_FUNC_INFO, "missing title"); - BLACK_VERIFY_X(!c.isEmpty(), Q_FUNC_INFO, "missing comparison value"); + SWIFT_VERIFY_X(!t.isEmpty(), Q_FUNC_INFO, "missing title"); + SWIFT_VERIFY_X(!c.isEmpty(), Q_FUNC_INFO, "missing comparison value"); if (t.isEmpty() || c.isEmpty()) { return false; } // same? @@ -443,7 +443,7 @@ namespace BlackGui void CGuiUtility::checkBoxReadOnly(QCheckBox *checkBox, bool readOnly) { static const QCheckBox defaultBox; - BLACK_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox"); + SWIFT_VERIFY_X(checkBox, Q_FUNC_INFO, "no checkbox"); if (!checkBox) { return; } static const QString background("background: rgb(40,40,40)"); //! \fixme hardcoded stylesheet setting, should come from stylesheet diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index 4d10d7c9a..8c415ce9f 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -128,12 +128,12 @@ namespace BlackGui toggleFloatingMenuAction->setChecked(!dw->isFloating()); subMenuToggleFloat->addAction(toggleFloatingMenuAction); c = connect(toggleFloatingMenuAction, &QAction::toggled, signalMapperToggleFloating, qOverload<>(&QSignalMapper::map)); - BLACK_VERIFY_X(c, Q_FUNC_INFO, "Cannot map floating action"); // do not make that shutdown reason in a release build + SWIFT_VERIFY_X(c, Q_FUNC_INFO, "Cannot map floating action"); // do not make that shutdown reason in a release build signalMapperToggleFloating->setMapping(toggleFloatingMenuAction, i); } c = connect(signalMapperToggleFloating, &QSignalMapper::mappedInt, this, &CInfoArea::toggleFloatingByIndex); - BLACK_VERIFY_X(c, Q_FUNC_INFO, "Cannot connect mapper"); // do not make that shutdown reason in a release build + SWIFT_VERIFY_X(c, Q_FUNC_INFO, "Cannot connect mapper"); // do not make that shutdown reason in a release build menu->addMenu(subMenuDisplay); if (c) { menu->addMenu(subMenuToggleFloat); } @@ -385,7 +385,7 @@ namespace BlackGui { if (!this->isValidAreaIndex(areaIndex)) { return; } CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex); - BLACK_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); + SWIFT_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); if (!dw) { return; } dw->toggleFloating(); } @@ -394,7 +394,7 @@ namespace BlackGui { if (!this->isValidAreaIndex(areaIndex)) { return; } CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex); - BLACK_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); + SWIFT_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); if (!dw) { return; } dw->toggleVisibility(); } @@ -402,7 +402,7 @@ namespace BlackGui void CInfoArea::selectArea(int areaIndex) { CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex); - BLACK_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); + SWIFT_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); if (!dw) { return; } Q_ASSERT(m_tabBar); if (m_tabBar->count() < 1) { return; } @@ -420,7 +420,7 @@ namespace BlackGui void CInfoArea::resetPosition(int areaIndex) { CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(areaIndex); - BLACK_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); + SWIFT_VERIFY_X(dw, Q_FUNC_INFO, "Missing info area"); if (!dw) { return; } dw->resetPosition(); } @@ -429,7 +429,7 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - BLACK_VERIFY(action); + SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); this->selectArea(index); @@ -439,7 +439,7 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - BLACK_VERIFY(action); + SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); this->resetPosition(index); @@ -449,7 +449,7 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - BLACK_VERIFY(action); + SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); this->toggleFloatingByIndex(index); @@ -459,7 +459,7 @@ namespace BlackGui { const QObject *sender = QObject::sender(); const QAction *action = qobject_cast(sender); - BLACK_VERIFY(action); + SWIFT_VERIFY(action); if (!action) { return; } const int index = action->data().toInt(); this->restoreDockWidgetInfoAreaByIndex(index); @@ -755,7 +755,7 @@ namespace BlackGui int CInfoArea::getTabBarIndexByTitle(const QString &title) const { - BLACK_VERIFY_X(!title.isEmpty(), Q_FUNC_INFO, "No title"); + SWIFT_VERIFY_X(!title.isEmpty(), Q_FUNC_INFO, "No title"); if (title.isEmpty()) { return -1; } if (m_tabBar->count() < 1) { return -1; } diff --git a/src/blackgui/loadindicator.cpp b/src/blackgui/loadindicator.cpp index f6752c1a6..7818e5e0d 100644 --- a/src/blackgui/loadindicator.cpp +++ b/src/blackgui/loadindicator.cpp @@ -85,7 +85,7 @@ namespace BlackGui m_pendingIds.clear(); if (m_timerId != -1) { - BLACK_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); + SWIFT_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); this->killTimer(m_timerId); } m_timerId = -1; @@ -99,7 +99,7 @@ namespace BlackGui m_delayMs = delay; if (m_timerId != -1) { - BLACK_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); + SWIFT_AUDIT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "Try to kill timer from another thread"); this->killTimer(m_timerId); } m_timerId = this->startTimer(m_delayMs); diff --git a/src/blackgui/models/listmodelbasenontemplate.cpp b/src/blackgui/models/listmodelbasenontemplate.cpp index 4670fb4df..918c48fe4 100644 --- a/src/blackgui/models/listmodelbasenontemplate.cpp +++ b/src/blackgui/models/listmodelbasenontemplate.cpp @@ -158,8 +158,8 @@ namespace BlackGui::Models void CListModelBaseNonTemplate::emitDataChanged(int startRowIndex, int endRowIndex) { - BLACK_VERIFY_X(startRowIndex <= endRowIndex, Q_FUNC_INFO, "check rows"); - BLACK_VERIFY_X(startRowIndex >= 0 && endRowIndex >= 0, Q_FUNC_INFO, "check rows"); + SWIFT_VERIFY_X(startRowIndex <= endRowIndex, Q_FUNC_INFO, "check rows"); + SWIFT_VERIFY_X(startRowIndex >= 0 && endRowIndex >= 0, Q_FUNC_INFO, "check rows"); const int columns = columnCount(); const int rows = rowCount(); diff --git a/src/blackgui/pluginselector.cpp b/src/blackgui/pluginselector.cpp index a34e78423..7f52e4f09 100644 --- a/src/blackgui/pluginselector.cpp +++ b/src/blackgui/pluginselector.cpp @@ -30,7 +30,7 @@ namespace BlackGui void CPluginSelector::addPlugin(const QString &identifier, const QString &name, bool hasConfig, bool enabled) { // skip if identifier is missing, which should normally not happen - BLACK_VERIFY_X(!identifier.isEmpty(), Q_FUNC_INFO, "Missing identifier"); + SWIFT_VERIFY_X(!identifier.isEmpty(), Q_FUNC_INFO, "Missing identifier"); if (identifier.isEmpty()) { return; } QWidget *pw = new QWidget; diff --git a/src/blackmisc/audio/audiodeviceinfo.cpp b/src/blackmisc/audio/audiodeviceinfo.cpp index aec6c952b..f3fee5e8d 100644 --- a/src/blackmisc/audio/audiodeviceinfo.cpp +++ b/src/blackmisc/audio/audiodeviceinfo.cpp @@ -102,7 +102,7 @@ namespace BlackMisc::Audio case IndexIdentifier: return m_identifier.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getIdentifier()); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } diff --git a/src/blackmisc/aviation/aircraftsituation.cpp b/src/blackmisc/aviation/aircraftsituation.cpp index a0810b745..b73e487aa 100644 --- a/src/blackmisc/aviation/aircraftsituation.cpp +++ b/src/blackmisc/aviation/aircraftsituation.cpp @@ -350,7 +350,7 @@ namespace BlackMisc::Aviation default: break; } const QString assertMsg("No comparison for index " + index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(assertMsg)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(assertMsg)); return 0; } @@ -612,12 +612,12 @@ namespace BlackMisc::Aviation // sanity checks if (std::isnan(gh.value())) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "nan ground"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "nan ground"); return CLength::null(); } if (std::isnan(this->getAltitude().value())) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "nan altitude"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "nan altitude"); return CLength::null(); } @@ -653,7 +653,7 @@ namespace BlackMisc::Aviation // above ground if (this->getAltitude().getReferenceDatum() == CAltitude::AboveGround) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Unsupported"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Unsupported"); if (correction) { *correction = AGL; } return this->getAltitude(); } diff --git a/src/blackmisc/aviation/aircraftsituationchange.cpp b/src/blackmisc/aviation/aircraftsituationchange.cpp index 46548cdc5..23defdfa1 100644 --- a/src/blackmisc/aviation/aircraftsituationchange.cpp +++ b/src/blackmisc/aviation/aircraftsituationchange.cpp @@ -118,7 +118,7 @@ namespace BlackMisc::Aviation { // does the value make any sense? const bool validGuessedSpeed = (guessedRotateSpeed.value(CSpeedUnit::km_h()) > 5.0); - BLACK_VERIFY_X(validGuessedSpeed, Q_FUNC_INFO, "Wrong guessed value for lift off"); + SWIFT_VERIFY_X(validGuessedSpeed, Q_FUNC_INFO, "Wrong guessed value for lift off"); if (!validGuessedSpeed) { guessedRotateSpeed = CSpeed(80, CSpeedUnit::kts()); } // fix sureRotateSpeed = guessedRotateSpeed * 1.25; } diff --git a/src/blackmisc/aviation/aircraftvelocity.cpp b/src/blackmisc/aviation/aircraftvelocity.cpp index 90eb7eef9..bfb19801d 100644 --- a/src/blackmisc/aviation/aircraftvelocity.cpp +++ b/src/blackmisc/aviation/aircraftvelocity.cpp @@ -77,19 +77,19 @@ namespace BlackMisc::Aviation QVariant CAircraftVelocity::propertyByIndex(CPropertyIndexRef index) const { - BLACK_VERIFY(index.isMyself()); + SWIFT_VERIFY(index.isMyself()); return QVariant::fromValue(*this); } void CAircraftVelocity::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) { - BLACK_VERIFY(index.isMyself()); + SWIFT_VERIFY(index.isMyself()); *this = variant.value(); } int CAircraftVelocity::comparePropertyByIndex(CPropertyIndexRef index, const CAircraftVelocity &compareValue) const { - BLACK_VERIFY(index.isMyself()); + SWIFT_VERIFY(index.isMyself()); return compare(*this, compareValue); } } diff --git a/src/blackmisc/aviation/airlineicaocode.cpp b/src/blackmisc/aviation/airlineicaocode.cpp index 0d978dbe8..a3c049697 100644 --- a/src/blackmisc/aviation/airlineicaocode.cpp +++ b/src/blackmisc/aviation/airlineicaocode.cpp @@ -510,9 +510,9 @@ namespace BlackMisc::Aviation const QString fn(fileInfo.fileName()); bool ok = fn.size() > 5; if (!ok) { continue; } - BLACK_VERIFY_X(ok, Q_FUNC_INFO, "wrong file name"); + SWIFT_VERIFY_X(ok, Q_FUNC_INFO, "wrong file name"); const int id = QStringView { fn }.left(5).toInt(&ok); - BLACK_VERIFY_X(ok, Q_FUNC_INFO, "wrong id format"); + SWIFT_VERIFY_X(ok, Q_FUNC_INFO, "wrong id format"); if (!ok) { continue; } ids.insert(id); } diff --git a/src/blackmisc/aviation/livery.cpp b/src/blackmisc/aviation/livery.cpp index 67a29b0d6..b874aee15 100644 --- a/src/blackmisc/aviation/livery.cpp +++ b/src/blackmisc/aviation/livery.cpp @@ -245,7 +245,7 @@ namespace BlackMisc::Aviation livery.setKeyVersionTimestampFromDatabaseJson(json, prefix); // color liveries must have default ICAO, but airline liveries must have DB airline - BLACK_VERIFY_X((livery.isColorLivery() && !livery.getAirlineIcaoCode().hasValidDbKey()) || (livery.isAirlineLivery() && livery.getAirlineIcaoCode().hasValidDbKey()), Q_FUNC_INFO, "inconsistent data"); + SWIFT_VERIFY_X((livery.isColorLivery() && !livery.getAirlineIcaoCode().hasValidDbKey()) || (livery.isAirlineLivery() && livery.getAirlineIcaoCode().hasValidDbKey()), Q_FUNC_INFO, "inconsistent data"); return livery; } @@ -293,7 +293,7 @@ namespace BlackMisc::Aviation livery.setKeyVersionTimestampFromDatabaseJson(json, prefix); // color liveries must have default ICAO, but airline liveries must have DB airline - BLACK_VERIFY_X((livery.isColorLivery() && !livery.getAirlineIcaoCode().hasValidDbKey()) || (livery.isAirlineLivery() && livery.getAirlineIcaoCode().hasValidDbKey()), Q_FUNC_INFO, "inconsistent data"); + SWIFT_VERIFY_X((livery.isColorLivery() && !livery.getAirlineIcaoCode().hasValidDbKey()) || (livery.isAirlineLivery() && livery.getAirlineIcaoCode().hasValidDbKey()), Q_FUNC_INFO, "inconsistent data"); return livery; } diff --git a/src/blackmisc/aviation/ongroundinfo.cpp b/src/blackmisc/aviation/ongroundinfo.cpp index 1c3faf6cc..c567c1293 100644 --- a/src/blackmisc/aviation/ongroundinfo.cpp +++ b/src/blackmisc/aviation/ongroundinfo.cpp @@ -109,7 +109,7 @@ namespace BlackMisc::Aviation bool COnGroundInfo::isOnGround() const { - BLACK_VERIFY_X(m_onGroundFactor >= 0.0, Q_FUNC_INFO, "Should only be called with positive groundfactors"); + SWIFT_VERIFY_X(m_onGroundFactor >= 0.0, Q_FUNC_INFO, "Should only be called with positive groundfactors"); if (m_onGroundDetails == OnGroundDetails::OnGroundByInterpolation) { return m_onGroundFactor > m_groundFactorThreshold; diff --git a/src/blackmisc/blackmiscexport.h b/src/blackmisc/blackmiscexport.h index 16c4464ec..d978ded17 100644 --- a/src/blackmisc/blackmiscexport.h +++ b/src/blackmisc/blackmiscexport.h @@ -33,13 +33,13 @@ #endif /*! - * \def BLACK_NO_INLINE + * \def SWIFT_NO_INLINE * Prevent function inlining */ #ifdef Q_CC_MSVC -# define BLACK_NO_INLINE __declspec(noinline) +# define SWIFT_NO_INLINE __declspec(noinline) #else -# define BLACK_NO_INLINE __attribute__((noinline)) +# define SWIFT_NO_INLINE __attribute__((noinline)) #endif #endif // guard diff --git a/src/blackmisc/db/dbflags.cpp b/src/blackmisc/db/dbflags.cpp index 3ea1013b1..345618165 100644 --- a/src/blackmisc/db/dbflags.cpp +++ b/src/blackmisc/db/dbflags.cpp @@ -27,7 +27,7 @@ namespace BlackMisc::Db case SharedInfoOnly: return "Shared info only"; case Cached: return "Cached data"; default: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); return "wrong flags"; } } diff --git a/src/blackmisc/geo/coordinategeodetic.cpp b/src/blackmisc/geo/coordinategeodetic.cpp index 4f1c229d7..0b34a43ce 100644 --- a/src/blackmisc/geo/coordinategeodetic.cpp +++ b/src/blackmisc/geo/coordinategeodetic.cpp @@ -51,7 +51,7 @@ namespace BlackMisc::Geo const float d = earthRadiusMeters * std::atan2(QVector3D::crossProduct(v1, v2).length(), QVector3D::dotProduct(v1, v2)); - BLACK_VERIFY_X(!std::isnan(d), Q_FUNC_INFO, "Distance calculation: NaN in result"); + SWIFT_VERIFY_X(!std::isnan(d), Q_FUNC_INFO, "Distance calculation: NaN in result"); if (std::isnan(d)) { CLogMessage().debug(u"Distance calculation: NaN in result (given arguments %1 %2 %3; %4 %5 %6)") << static_cast(v1.x()) << static_cast(v1.y()) << static_cast(v1.z()) << static_cast(v2.x()) << static_cast(v2.y()) << static_cast(v2.z()); @@ -144,7 +144,7 @@ namespace BlackMisc::Geo } const QString m = QString("no property, index ").append(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return QVariant::fromValue(m); } @@ -166,7 +166,7 @@ namespace BlackMisc::Geo } const QString m = QString("no property, index ").append(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return 0; } @@ -453,7 +453,7 @@ namespace BlackMisc::Geo } } const QString m = QString("no property, index ").append(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return QVariant::fromValue(m); } @@ -469,7 +469,7 @@ namespace BlackMisc::Geo case IndexRelativeDistance: m_relativeDistance.setPropertyByIndex(index.copyFrontRemoved(), variant); break; default: const QString m = QString("no property, index ").append(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); break; } } diff --git a/src/blackmisc/math/mathutils.cpp b/src/blackmisc/math/mathutils.cpp index c6c5388b8..d9e9cdc80 100644 --- a/src/blackmisc/math/mathutils.cpp +++ b/src/blackmisc/math/mathutils.cpp @@ -147,7 +147,7 @@ namespace BlackMisc::Math double CMathUtils::mean(const QList &values) { - BLACK_VERIFY_X(!values.isEmpty(), Q_FUNC_INFO, "Need values"); + SWIFT_VERIFY_X(!values.isEmpty(), Q_FUNC_INFO, "Need values"); return sum(values) / values.size(); } diff --git a/src/blackmisc/network/clientprovider.cpp b/src/blackmisc/network/clientprovider.cpp index f2bb27d48..daa046b7e 100644 --- a/src/blackmisc/network/clientprovider.cpp +++ b/src/blackmisc/network/clientprovider.cpp @@ -51,7 +51,7 @@ namespace BlackMisc::Network bool CClientProvider::setOtherClient(const CClient &client) { const bool hasCallsign = !client.getCallsign().isEmpty(); - BLACK_VERIFY_X(hasCallsign, Q_FUNC_INFO, "Need callsign in client"); + SWIFT_VERIFY_X(hasCallsign, Q_FUNC_INFO, "Need callsign in client"); if (!hasCallsign) { return false; } QWriteLocker l(&m_lockClient); m_clients[client.getCallsign()] = client; @@ -68,7 +68,7 @@ namespace BlackMisc::Network bool CClientProvider::addNewClient(const CClient &client) { const CCallsign callsign = client.getCallsign(); - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); if (callsign.isEmpty()) { return false; } if (this->hasClientInfo(callsign)) { return false; } QWriteLocker l(&m_lockClient); @@ -78,7 +78,7 @@ namespace BlackMisc::Network int CClientProvider::updateOrAddClient(const CCallsign &callsign, const CPropertyIndexVariantMap &vm, bool skipEqualValues) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); if (callsign.isEmpty()) { return 0; } int c = 0; if (this->hasClientInfo(callsign)) @@ -118,7 +118,7 @@ namespace BlackMisc::Network bool CClientProvider::setClientGndCapability(const CCallsign &callsign, bool supportGndFlag) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Missing client callsign"); if (callsign.isEmpty()) { return 0; } CClient client = this->getClientOrDefaultForCallsign(callsign); diff --git a/src/blackmisc/network/ecosystem.cpp b/src/blackmisc/network/ecosystem.cpp index ee91e32fc..7a214d224 100644 --- a/src/blackmisc/network/ecosystem.cpp +++ b/src/blackmisc/network/ecosystem.cpp @@ -103,7 +103,7 @@ namespace BlackMisc::Network case IndexSystem: return Compare::compare(m_system, compareValue.m_system); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } } // namespace diff --git a/src/blackmisc/network/entityflags.cpp b/src/blackmisc/network/entityflags.cpp index 93ad451dd..dd3fe9e73 100644 --- a/src/blackmisc/network/entityflags.cpp +++ b/src/blackmisc/network/entityflags.cpp @@ -32,7 +32,7 @@ namespace BlackMisc::Network case VatsimDataFile: return QStringLiteral("VATSIM data file"); case VatsimStatusFile: return QStringLiteral("VATSIM status file"); default: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); return "wrong flags"; } } @@ -102,7 +102,7 @@ namespace BlackMisc::Network case ReadSkipped: return s; case ReadStarted: return st; default: - BLACK_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "wrong flags"); return x; } } diff --git a/src/blackmisc/network/fsdsetup.cpp b/src/blackmisc/network/fsdsetup.cpp index 128a28c8b..8ba6b1166 100644 --- a/src/blackmisc/network/fsdsetup.cpp +++ b/src/blackmisc/network/fsdsetup.cpp @@ -127,7 +127,7 @@ namespace BlackMisc::Network case IndexSendReceiveDetails: return Compare::compare(m_sendReceive, compareValue.m_sendReceive); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } } // namespace diff --git a/src/blackmisc/network/server.cpp b/src/blackmisc/network/server.cpp index 57777adf4..7a47df649 100644 --- a/src/blackmisc/network/server.cpp +++ b/src/blackmisc/network/server.cpp @@ -239,7 +239,7 @@ namespace BlackMisc::Network return this->getServerTypeAsString().compare(compareValue.getServerTypeAsString(), Qt::CaseInsensitive); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } diff --git a/src/blackmisc/orderable.cpp b/src/blackmisc/orderable.cpp index a63986ba5..a69e1c123 100644 --- a/src/blackmisc/orderable.cpp +++ b/src/blackmisc/orderable.cpp @@ -52,7 +52,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return QVariant::fromValue(m); } @@ -70,7 +70,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); } int IOrderable::comparePropertyByIndex(CPropertyIndexRef index, const IOrderable &compareValue) const diff --git a/src/blackmisc/pq/physicalquantity.cpp b/src/blackmisc/pq/physicalquantity.cpp index c8c92b745..6d35b49fa 100644 --- a/src/blackmisc/pq/physicalquantity.cpp +++ b/src/blackmisc/pq/physicalquantity.cpp @@ -558,7 +558,7 @@ namespace BlackMisc::PhysicalQuantities case IndexValue: return Compare::compare(m_value, pq.m_value); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } diff --git a/src/blackmisc/propertyindex.cpp b/src/blackmisc/propertyindex.cpp index 1316e1d8f..1974bf7f9 100644 --- a/src/blackmisc/propertyindex.cpp +++ b/src/blackmisc/propertyindex.cpp @@ -31,7 +31,7 @@ namespace BlackMisc CPropertyIndex CPropertyIndex::copyFrontRemoved() const { - BLACK_VERIFY_X(!this->isEmpty(), Q_FUNC_INFO, "Empty index"); + SWIFT_VERIFY_X(!this->isEmpty(), Q_FUNC_INFO, "Empty index"); if (this->isEmpty()) { return CPropertyIndex(); } CPropertyIndex copy = *this; copy.m_indexes.pop_front(); diff --git a/src/blackmisc/propertyindexref.cpp b/src/blackmisc/propertyindexref.cpp index 334955b05..3f2464a2d 100644 --- a/src/blackmisc/propertyindexref.cpp +++ b/src/blackmisc/propertyindexref.cpp @@ -19,7 +19,7 @@ namespace BlackMisc CPropertyIndexRef CPropertyIndexRef::copyFrontRemoved() const { - BLACK_VERIFY_X(!this->isEmpty(), Q_FUNC_INFO, "Empty index"); + SWIFT_VERIFY_X(!this->isEmpty(), Q_FUNC_INFO, "Empty index"); if (this->isEmpty() || !m_begin) { return -1; } CPropertyIndexRef copy = *this; ++copy.m_begin; diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index 39b480e0e..d3342771e 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -66,10 +66,10 @@ namespace BlackMisc namespace Private { //! \private Decouple finding from value type. - BLACKMISC_EXPORT BLACK_NO_INLINE QVector findIndices(int size, const std::function &predicate); + BLACKMISC_EXPORT SWIFT_NO_INLINE QVector findIndices(int size, const std::function &predicate); //! \private Decouple sorting from value type. - BLACKMISC_EXPORT BLACK_NO_INLINE QVector sortIndices(int size, const std::function &cmp); + BLACKMISC_EXPORT SWIFT_NO_INLINE QVector sortIndices(int size, const std::function &cmp); } /*! diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index bd7024a8f..893935f74 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -966,7 +966,7 @@ namespace BlackMisc::Simulation { if (mode.isEmpty() || mode.startsWith('I', Qt::CaseInsensitive)) { return Include; } if (mode.startsWith('E', Qt::CaseInsensitive)) { return Exclude; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, "wrong mode"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "wrong mode"); return Include; // default } diff --git a/src/blackmisc/simulation/aircraftmodelutils.cpp b/src/blackmisc/simulation/aircraftmodelutils.cpp index 14c7de897..0069b6bbe 100644 --- a/src/blackmisc/simulation/aircraftmodelutils.cpp +++ b/src/blackmisc/simulation/aircraftmodelutils.cpp @@ -126,7 +126,7 @@ namespace BlackMisc::Simulation if (html.isEmpty()) { return {}; } QDir dir(tempDir); - BLACK_VERIFY_X(dir.exists(), Q_FUNC_INFO, "Directory does not exist"); + SWIFT_VERIFY_X(dir.exists(), Q_FUNC_INFO, "Directory does not exist"); if (!dir.exists()) { return {}; } const QString htmlTemplate = CFileUtils::readFileToString(CSwiftDirectories::htmlTemplateFilePath()); diff --git a/src/blackmisc/simulation/data/modelcaches.cpp b/src/blackmisc/simulation/data/modelcaches.cpp index abf400151..e885d3f1a 100644 --- a/src/blackmisc/simulation/data/modelcaches.cpp +++ b/src/blackmisc/simulation/data/modelcaches.cpp @@ -125,14 +125,14 @@ namespace BlackMisc::Simulation::Data CAircraftModelList IMultiSimulatorModelCaches::getSynchronizedCachedModels(const CSimulatorInfo &simulator) { - BLACK_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator"); + SWIFT_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator"); this->synchronizeCache(simulator); return this->getCachedModels(simulator); } QDateTime IMultiSimulatorModelCaches::getSynchronizedTimestamp(const CSimulatorInfo &simulator) { - BLACK_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator"); + SWIFT_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "need single simulator"); this->synchronizeCache(simulator); return this->getCacheTimestamp(simulator); } diff --git a/src/blackmisc/simulation/interpolation/interpolationrenderingsetup.cpp b/src/blackmisc/simulation/interpolation/interpolationrenderingsetup.cpp index 93c4fa828..6bab49f44 100644 --- a/src/blackmisc/simulation/interpolation/interpolationrenderingsetup.cpp +++ b/src/blackmisc/simulation/interpolation/interpolationrenderingsetup.cpp @@ -108,7 +108,7 @@ namespace BlackMisc::Simulation case IndexPitchOnGround: return QVariant::fromValue(m_pitchOnGround); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Cannot handle index"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Cannot handle index"); return QStringLiteral("Wrong index for %1").arg(i); } @@ -128,7 +128,7 @@ namespace BlackMisc::Simulation case IndexPitchOnGround: m_pitchOnGround.setPropertyByIndex(index.copyFrontRemoved(), variant); return; default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Cannot handle index"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Cannot handle index"); } QString CInterpolationAndRenderingSetupBase::convertToQString(bool i18n) const diff --git a/src/blackmisc/simulation/interpolation/interpolator.cpp b/src/blackmisc/simulation/interpolation/interpolator.cpp index 2eeea1651..6137feff4 100644 --- a/src/blackmisc/simulation/interpolation/interpolator.cpp +++ b/src/blackmisc/simulation/interpolation/interpolator.cpp @@ -228,7 +228,7 @@ namespace BlackMisc::Simulation // if we get here and the vector is invalid it means we haven't handled it correctly in one of the interpolators if (!currentSituation.isValidVectorRange()) { - if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(false, Q_FUNC_INFO, "Invalid interpolation situation"); } + if (CBuildConfig::isLocalDeveloperDebugBuild()) { SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Invalid interpolation situation"); } return CAircraftSituation::null(); } @@ -530,7 +530,7 @@ namespace BlackMisc::Simulation const CLength aboveGnd = situation.getHeightAboveGround(); if (aboveGnd.isNull() || std::isnan(aboveGnd.value())) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "above gnd.is null"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "above gnd.is null"); return parts; } @@ -673,7 +673,7 @@ namespace BlackMisc::Simulation CAircraftSituation currentSituation = m_lastSituation.isNull() ? m_currentSituations.front() : m_lastSituation; if (currentSituation.getCallsign() != m_callsign) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong callsign"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Wrong callsign"); currentSituation.setCallsign(m_callsign); } diff --git a/src/blackmisc/simulation/interpolation/interpolatorlinear.cpp b/src/blackmisc/simulation/interpolation/interpolatorlinear.cpp index f21decbde..21a21b4c5 100644 --- a/src/blackmisc/simulation/interpolation/interpolatorlinear.cpp +++ b/src/blackmisc/simulation/interpolation/interpolatorlinear.cpp @@ -35,7 +35,7 @@ namespace BlackMisc::Simulation { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(isValidTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Time fraction needs to be within [0;1]"); + SWIFT_VERIFY_X(isValidTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Time fraction needs to be within [0;1]"); } m_pbh = CInterpolatorLinearPbh(m_simulationTimeFraction, startSituation, endSituation); } @@ -50,9 +50,9 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(CAircraftSituation::isValidVector(startVec), Q_FUNC_INFO, "Invalid start vector"); - BLACK_VERIFY_X(CAircraftSituation::isValidVector(endVec), Q_FUNC_INFO, "Invalid end vector"); - BLACK_VERIFY_X(isAcceptableTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Invalid fraction"); + SWIFT_VERIFY_X(CAircraftSituation::isValidVector(startVec), Q_FUNC_INFO, "Invalid start vector"); + SWIFT_VERIFY_X(CAircraftSituation::isValidVector(endVec), Q_FUNC_INFO, "Invalid end vector"); + SWIFT_VERIFY_X(isAcceptableTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Invalid fraction"); } // Interpolate position: pos = (posB - posA) * t + posA @@ -64,7 +64,7 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(interpolatedPosition.isValidVectorRange(), Q_FUNC_INFO, "Invalid vector"); + SWIFT_VERIFY_X(interpolatedPosition.isValidVectorRange(), Q_FUNC_INFO, "Invalid vector"); } // Interpolate altitude: Alt = (AltB - AltA) * t + AltA diff --git a/src/blackmisc/simulation/interpolation/interpolatorlinearpbh.cpp b/src/blackmisc/simulation/interpolation/interpolatorlinearpbh.cpp index 5a235620c..f09a5f262 100644 --- a/src/blackmisc/simulation/interpolation/interpolatorlinearpbh.cpp +++ b/src/blackmisc/simulation/interpolation/interpolatorlinearpbh.cpp @@ -18,7 +18,7 @@ namespace BlackMisc::Simulation { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(isValidTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Time fraction needs to be within [0;1]"); + SWIFT_VERIFY_X(isValidTimeFraction(m_simulationTimeFraction), Q_FUNC_INFO, "Time fraction needs to be within [0;1]"); } } @@ -35,7 +35,7 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(isAcceptableTimeFraction(timeFraction0to1), Q_FUNC_INFO, "0..1 fraction needed"); + SWIFT_VERIFY_X(isAcceptableTimeFraction(timeFraction0to1), Q_FUNC_INFO, "0..1 fraction needed"); } //! make sure to not end up we extrapolation @@ -53,7 +53,7 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(headingStart.getReferenceNorth() == headingEnd.getReferenceNorth(), Q_FUNC_INFO, "Need same reference"); + SWIFT_VERIFY_X(headingStart.getReferenceNorth() == headingEnd.getReferenceNorth(), Q_FUNC_INFO, "Need same reference"); } return CHeading(interpolateAngle(headingStart, headingEnd, m_simulationTimeFraction), headingEnd.getReferenceNorth()); } @@ -79,7 +79,7 @@ namespace BlackMisc::Simulation { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(isValidTimeFraction(tf), Q_FUNC_INFO, "Time fraction needs to be 0-1"); + SWIFT_VERIFY_X(isValidTimeFraction(tf), Q_FUNC_INFO, "Time fraction needs to be 0-1"); } m_simulationTimeFraction = clampValidTimeFraction(tf); } diff --git a/src/blackmisc/simulation/interpolation/interpolatorspline.cpp b/src/blackmisc/simulation/interpolation/interpolatorspline.cpp index 578ff7038..73c29313a 100644 --- a/src/blackmisc/simulation/interpolation/interpolatorspline.cpp +++ b/src/blackmisc/simulation/interpolation/interpolatorspline.cpp @@ -90,8 +90,8 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(t >= 0, Q_FUNC_INFO, "Expect t >= 0"); - BLACK_VERIFY_X(t <= 1.0, Q_FUNC_INFO, "Expect t <= 1"); + SWIFT_VERIFY_X(t >= 0, Q_FUNC_INFO, "Expect t >= 0"); + SWIFT_VERIFY_X(t <= 1.0, Q_FUNC_INFO, "Expect t <= 1"); } return y; } @@ -248,9 +248,9 @@ namespace BlackMisc::Simulation if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(dt1 >= 0, Q_FUNC_INFO, "Expect postive dt1"); - BLACK_VERIFY_X(dt2 > 0, Q_FUNC_INFO, "Expect postive dt2"); - BLACK_VERIFY_X(isAcceptableTimeFraction(timeFraction), Q_FUNC_INFO, "Expect fraction 0-1"); + SWIFT_VERIFY_X(dt1 >= 0, Q_FUNC_INFO, "Expect postive dt1"); + SWIFT_VERIFY_X(dt2 > 0, Q_FUNC_INFO, "Expect postive dt2"); + SWIFT_VERIFY_X(isAcceptableTimeFraction(timeFraction), Q_FUNC_INFO, "Expect fraction 0-1"); } timeFraction = clampValidTimeFraction(timeFraction); const qint64 interpolatedTime = m_prevSampleTime + qRound64(timeFraction * dt2); @@ -323,8 +323,8 @@ namespace BlackMisc::Simulation if (!valid && CBuildConfig::isLocalDeveloperDebugBuild()) { Q_ASSERT_X(t1 < t2, Q_FUNC_INFO, "Expect sorted times, latest first"); // that means a bug in our code init the values - BLACK_VERIFY_X(m_currentTimeMsSinceEpoc >= t1, Q_FUNC_INFO, "invalid timestamp t1"); - BLACK_VERIFY_X(m_currentTimeMsSinceEpoc < t2, Q_FUNC_INFO, "invalid timestamp t2"); // t1==t2 results in div/0 + SWIFT_VERIFY_X(m_currentTimeMsSinceEpoc >= t1, Q_FUNC_INFO, "invalid timestamp t1"); + SWIFT_VERIFY_X(m_currentTimeMsSinceEpoc < t2, Q_FUNC_INFO, "invalid timestamp t2"); // t1==t2 results in div/0 } if (!valid) { return { {}, {} }; } @@ -335,9 +335,9 @@ namespace BlackMisc::Simulation valid = CAircraftSituation::isValidVector(m_pa.x) && CAircraftSituation::isValidVector(m_pa.y) && CAircraftSituation::isValidVector(m_pa.z); if (!valid && CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(CAircraftSituation::isValidVector(m_pa.x), Q_FUNC_INFO, "invalid X"); // all x values - BLACK_VERIFY_X(CAircraftSituation::isValidVector(m_pa.y), Q_FUNC_INFO, "invalid Y"); // all y values - BLACK_VERIFY_X(CAircraftSituation::isValidVector(m_pa.z), Q_FUNC_INFO, "invalid Z"); // all z values + SWIFT_VERIFY_X(CAircraftSituation::isValidVector(m_pa.x), Q_FUNC_INFO, "invalid X"); // all x values + SWIFT_VERIFY_X(CAircraftSituation::isValidVector(m_pa.y), Q_FUNC_INFO, "invalid Y"); // all y values + SWIFT_VERIFY_X(CAircraftSituation::isValidVector(m_pa.z), Q_FUNC_INFO, "invalid Z"); // all z values } if (!valid) { return { {}, {} }; } @@ -347,7 +347,7 @@ namespace BlackMisc::Simulation valid = CAircraftSituation::isValidVector(normalVector); if (!valid && CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(valid, Q_FUNC_INFO, "invalid vector"); + SWIFT_VERIFY_X(valid, Q_FUNC_INFO, "invalid vector"); CLogMessage(this).warning(u"Invalid vector v: %2 %3 %4") << normalVector[0] << normalVector[1] << normalVector[2]; } if (!valid) { return { {}, {} }; } @@ -436,19 +436,19 @@ namespace BlackMisc::Simulation { // if a client supports parts, all ground situations are supposed to be parts based details = situations.areAllOnGroundDetailsSame(COnGroundInfo::InFromParts); - BLACK_VERIFY_X(details, Q_FUNC_INFO, "Once gnd.from parts -> always gnd. from parts"); + SWIFT_VERIFY_X(details, Q_FUNC_INFO, "Once gnd.from parts -> always gnd. from parts"); } for (const CAircraftSituation &s : situations) { if (!s.hasGroundElevation()) { continue; } - BLACK_VERIFY_X(!s.getGroundElevation().isZeroEpsilonConsidered(), Q_FUNC_INFO, "Suspicous 0 gnd. value"); + SWIFT_VERIFY_X(!s.getGroundElevation().isZeroEpsilonConsidered(), Q_FUNC_INFO, "Suspicous 0 gnd. value"); } // check if middle situation is missing if (latest.hasGroundElevation() && oldest.hasGroundElevation()) { - BLACK_VERIFY_X(newer.hasGroundElevation(), Q_FUNC_INFO, "Middle ground elevation is missing"); + SWIFT_VERIFY_X(newer.hasGroundElevation(), Q_FUNC_INFO, "Middle ground elevation is missing"); } // result diff --git a/src/blackmisc/simulation/remoteaircraftprovider.cpp b/src/blackmisc/simulation/remoteaircraftprovider.cpp index c2005225d..1fa63b5fd 100644 --- a/src/blackmisc/simulation/remoteaircraftprovider.cpp +++ b/src/blackmisc/simulation/remoteaircraftprovider.cpp @@ -261,8 +261,8 @@ namespace BlackMisc::Simulation // testing if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(situation.getTimeOffsetMs() > 0, Q_FUNC_INFO, "Missing offset"); - BLACK_VERIFY_X(situation.isValidVectorRange(), Q_FUNC_INFO, "Invalid vector"); + SWIFT_VERIFY_X(situation.getTimeOffsetMs() > 0, Q_FUNC_INFO, "Missing offset"); + SWIFT_VERIFY_X(situation.isValidVectorRange(), Q_FUNC_INFO, "Invalid vector"); } // add altitude offset (for testing only) @@ -311,9 +311,9 @@ namespace BlackMisc::Simulation // check sort order if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(newSituationsList.isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "wrong adjusted sort order"); - BLACK_VERIFY_X(newSituationsList.isSortedLatestFirst(), Q_FUNC_INFO, "wrong sort order"); - BLACK_VERIFY_X(newSituationsList.size() <= IRemoteAircraftProvider::MaxSituationsPerCallsign, Q_FUNC_INFO, "Wrong size"); + SWIFT_VERIFY_X(newSituationsList.isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "wrong adjusted sort order"); + SWIFT_VERIFY_X(newSituationsList.isSortedLatestFirst(), Q_FUNC_INFO, "wrong sort order"); + SWIFT_VERIFY_X(newSituationsList.size() <= IRemoteAircraftProvider::MaxSituationsPerCallsign, Q_FUNC_INFO, "Wrong size"); } if (!situation.hasInboundGroundDetails()) @@ -342,7 +342,7 @@ namespace BlackMisc::Simulation void CRemoteAircraftProvider::storeAircraftParts(const CCallsign &callsign, const CAircraftParts &parts, bool removeOutdated) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "empty callsign"); if (callsign.isEmpty()) { return; } // list sorted from new to old @@ -419,7 +419,7 @@ namespace BlackMisc::Simulation // validation in dev.env. const int attributes = jsonObject.size(); const bool correctCount = (attributes == CAircraftParts::attributesCountFullJson); - BLACK_VERIFY_X(correctCount || !CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Wrong full aircraft parts"); + SWIFT_VERIFY_X(correctCount || !CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Wrong full aircraft parts"); if (!correctCount) { CLogMessage(this).warning(u"Wrong full parts attributes, %1 (expected %2)") << attributes << CAircraftParts::attributesCountFullJson; diff --git a/src/blackmisc/simulation/settings/simulatorsettings.cpp b/src/blackmisc/simulation/settings/simulatorsettings.cpp index 41897ee69..ad1b26896 100644 --- a/src/blackmisc/simulation/settings/simulatorsettings.cpp +++ b/src/blackmisc/simulation/settings/simulatorsettings.cpp @@ -198,7 +198,7 @@ namespace BlackMisc::Simulation::Settings if (!simulator.isSingleSimulator()) { // mostly happening with emulated driver, VERIFY for better debugging - BLACK_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); + SWIFT_VERIFY_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator"); return CSimulatorSettings(); } switch (simulator.getSimulator()) diff --git a/src/blackmisc/simulation/simulatedaircraft.cpp b/src/blackmisc/simulation/simulatedaircraft.cpp index 51a836054..76bda5bb3 100644 --- a/src/blackmisc/simulation/simulatedaircraft.cpp +++ b/src/blackmisc/simulation/simulatedaircraft.cpp @@ -202,7 +202,7 @@ namespace BlackMisc::Simulation case CComSystem::Com2: return this->getCom2System(); default: break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); return CComSystem(); // avoid warning } @@ -218,7 +218,7 @@ namespace BlackMisc::Simulation { case CComSystem::Com1: this->setCom1System(com); break; case CComSystem::Com2: this->setCom2System(com); break; - default: BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break; + default: SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break; } } @@ -243,7 +243,7 @@ namespace BlackMisc::Simulation { case CComSystem::Com1: return this->setCom1ActiveFrequency(frequency); case CComSystem::Com2: return this->setCom2ActiveFrequency(frequency); - default: BLACK_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break; + default: SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Wrong unit"); break; } return false; } @@ -445,7 +445,7 @@ namespace BlackMisc::Simulation } break; } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); return 0; } diff --git a/src/blackmisc/simulation/simulationenvironmentprovider.cpp b/src/blackmisc/simulation/simulationenvironmentprovider.cpp index 4b977b2ce..f0879c6c8 100644 --- a/src/blackmisc/simulation/simulationenvironmentprovider.cpp +++ b/src/blackmisc/simulation/simulationenvironmentprovider.cpp @@ -23,7 +23,7 @@ namespace BlackMisc::Simulation { if (!elevationCoordinate.hasMSLGeodeticHeight()) { - BLACK_AUDIT_X(false, Q_FUNC_INFO, "Elevation needs to be MSL NON NULL"); + SWIFT_AUDIT_X(false, Q_FUNC_INFO, "Elevation needs to be MSL NON NULL"); return false; } @@ -52,7 +52,7 @@ namespace BlackMisc::Simulation { // such a huge distance to existing value CLogMessage(this).debug(u"Suspicious GND elevation distance '%1': %2ft at %3") << requestedForCallsign.asString() << distFt << elevationCoordinate.geodeticHeight().valueRoundedAsString(CLengthUnit::ft(), 1); - BLACK_AUDIT_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Suspicious gnd. elevation distance"); + SWIFT_AUDIT_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Suspicious gnd. elevation distance"); } return false; } @@ -67,7 +67,7 @@ namespace BlackMisc::Simulation { // such a huge distance to existing value CLogMessage(this).debug(u"Suspicious NON GND elevation distance for '%1': %2ft at %3") << requestedForCallsign.asString() << distFt << elevationCoordinate.geodeticHeight().valueRoundedAsString(CLengthUnit::ft(), 1); - // BLACK_AUDIT_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Suspicious elevation distance"); + // SWIFT_AUDIT_X(!CBuildConfig::isLocalDeveloperDebugBuild(), Q_FUNC_INFO, "Suspicious elevation distance"); } return false; } @@ -106,7 +106,7 @@ namespace BlackMisc::Simulation { if (!elevationPlane.hasMSLGeodeticHeight()) { - BLACK_AUDIT_X(false, Q_FUNC_INFO, "Elevation plane needs to be MSL NON NULL"); + SWIFT_AUDIT_X(false, Q_FUNC_INFO, "Elevation plane needs to be MSL NON NULL"); return false; } return this->rememberGroundElevation(requestedForCallsign, likelyOnGroundElevation, elevationPlane, elevationPlane.getRadius()); diff --git a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp index 21ddb69fd..58b476ddd 100644 --- a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp +++ b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp @@ -281,7 +281,7 @@ namespace BlackMisc::Simulation::XPlane if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_AUDIT_X(modelFileInfo.exists(), Q_FUNC_INFO, "Model does NOT exist"); + SWIFT_AUDIT_X(modelFileInfo.exists(), Q_FUNC_INFO, "Model does NOT exist"); } CLivery livery; diff --git a/src/blackmisc/statusmessage.cpp b/src/blackmisc/statusmessage.cpp index 999d2df24..95b6b7126 100644 --- a/src/blackmisc/statusmessage.cpp +++ b/src/blackmisc/statusmessage.cpp @@ -51,13 +51,13 @@ namespace BlackMisc if (is09(*it)) { int n = it->unicode() - u'0'; - BLACK_VERIFY(n >= 0 && n <= 9); + SWIFT_VERIFY(n >= 0 && n <= 9); if (++it != format.end() && is09(*it)) { n = n * 10 + it->unicode() - u'0'; ++it; } - BLACK_VERIFY(n > 0 && n <= 99); + SWIFT_VERIFY(n > 0 && n <= 99); if (n > 0 && n <= args.size()) { temp += args[n - 1]; diff --git a/src/blackmisc/timestampbased.cpp b/src/blackmisc/timestampbased.cpp index eb4bcd31b..72f694f84 100644 --- a/src/blackmisc/timestampbased.cpp +++ b/src/blackmisc/timestampbased.cpp @@ -198,7 +198,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return QVariant::fromValue(m); } @@ -225,7 +225,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); } int ITimestampBased::comparePropertyByIndex(CPropertyIndexRef index, const ITimestampBased &compareValue) const @@ -325,7 +325,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return QVariant(); } @@ -352,7 +352,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); } int ITimestampWithOffsetBased::comparePropertyByIndex(CPropertyIndexRef index, const ITimestampWithOffsetBased &compareValue) const @@ -376,7 +376,7 @@ namespace BlackMisc } } const QString m = QStringLiteral("Cannot handle index %1").arg(index.toQString()); - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable(m)); return 0; } } // namespace diff --git a/src/blackmisc/timestampobjectlist.h b/src/blackmisc/timestampobjectlist.h index bc76a5235..a5e2d061f 100644 --- a/src/blackmisc/timestampobjectlist.h +++ b/src/blackmisc/timestampobjectlist.h @@ -565,8 +565,8 @@ namespace BlackMisc if (swift::config::CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(front.isNewerThanAdjusted(second), Q_FUNC_INFO, "Front/second timestamp"); - BLACK_VERIFY_X(this->isSortedAdjustedLatestFirst(), Q_FUNC_INFO, "Wrong sort order"); + SWIFT_VERIFY_X(front.isNewerThanAdjusted(second), Q_FUNC_INFO, "Front/second timestamp"); + SWIFT_VERIFY_X(this->isSortedAdjustedLatestFirst(), Q_FUNC_INFO, "Wrong sort order"); } } @@ -590,7 +590,7 @@ namespace BlackMisc const qint64 os = -1 * qAbs(deltaTimeMs < 0 ? osTime : deltaTimeMs); if (swift::config::CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(os < 0, Q_FUNC_INFO, "Need negative offset time to prefill time"); + SWIFT_VERIFY_X(os < 0, Q_FUNC_INFO, "Need negative offset time to prefill time"); } this->container().push_front(value); for (int i = 1; i < elements; i++) diff --git a/src/blackmisc/verify.h b/src/blackmisc/verify.h index a2e3a1e24..bb52bee1b 100644 --- a/src/blackmisc/verify.h +++ b/src/blackmisc/verify.h @@ -13,8 +13,8 @@ namespace BlackMisc::Private //! \private Do nothing. inline void noop() {} - //! \private Called by BLACK_VERIFY when the condition is false. - BLACKMISC_EXPORT BLACK_NO_INLINE void failedVerify(const char *condition, const char *filename, int line, const char *context, const char *message, bool audit); + //! \private Called by SWIFT_VERIFY when the condition is false. + BLACKMISC_EXPORT SWIFT_NO_INLINE void failedVerify(const char *condition, const char *filename, int line, const char *context, const char *message, bool audit); } //! @{ @@ -22,8 +22,8 @@ namespace BlackMisc::Private * A weaker kind of assert. Still indicates a programmer mistake, but one which is recoverable. * In debug builds, triggers a debugger breakpoint. In release builds, generates a warning. */ -#define BLACK_VERIFY_X(COND, WHERE, WHAT) ((COND) ? BlackMisc::Private::noop() : BlackMisc::Private::failedVerify(#COND, __FILE__, __LINE__, WHERE, WHAT, false)) -#define BLACK_VERIFY(COND) BLACK_VERIFY_X(COND, nullptr, nullptr) +#define SWIFT_VERIFY_X(COND, WHERE, WHAT) ((COND) ? BlackMisc::Private::noop() : BlackMisc::Private::failedVerify(#COND, __FILE__, __LINE__, WHERE, WHAT, false)) +#define SWIFT_VERIFY(COND) SWIFT_VERIFY_X(COND, nullptr, nullptr) //! @} //! @{ @@ -32,8 +32,8 @@ namespace BlackMisc::Private * In debug builds under debugging, triggers a debugger breakpoint. Otherwise generates a warning. * Not a substitute for proper validation. A failed audit in production is suggestive of insufficient validation. */ -#define BLACK_AUDIT_X(COND, WHERE, WHAT) ((COND) ? BlackMisc::Private::noop() : BlackMisc::Private::failedVerify(#COND, __FILE__, __LINE__, WHERE, WHAT, true)) -#define BLACK_AUDIT(COND) BLACK_AUDIT_X(COND, nullptr, nullptr) +#define SWIFT_AUDIT_X(COND, WHERE, WHAT) ((COND) ? BlackMisc::Private::noop() : BlackMisc::Private::failedVerify(#COND, __FILE__, __LINE__, WHERE, WHAT, true)) +#define SWIFT_AUDIT(COND) SWIFT_AUDIT_X(COND, nullptr, nullptr) //! @} #endif diff --git a/src/blackmisc/worker.cpp b/src/blackmisc/worker.cpp index e5c67b6ea..90fbacf7f 100644 --- a/src/blackmisc/worker.cpp +++ b/src/blackmisc/worker.cpp @@ -57,7 +57,7 @@ namespace BlackMisc const bool ok = wait(timeoutMs); //! \todo KB 2017-10 temp workaround: in T145 this will be fixed, sometimes (very rarely) hanging here during shutdown const QString as = QStringLiteral("Wait timeout after %1ms for '%2'").arg(timeoutMs).arg(name); const QByteArray asBA = as.toLatin1(); - BLACK_AUDIT_X(ok, Q_FUNC_INFO, asBA); // MS 2018-09 assert because we want a stack trace of all threads, via breakpad + SWIFT_AUDIT_X(ok, Q_FUNC_INFO, asBA); // MS 2018-09 assert because we want a stack trace of all threads, via breakpad Q_UNUSED(ok) } @@ -104,7 +104,7 @@ namespace BlackMisc const bool ok = workerThread->wait(5000); const QString as = QStringLiteral("Worker thread '%2' refuses to stop after worker finished").arg(workerThread->objectName()); const QByteArray asBA = as.toLatin1(); - BLACK_AUDIT_X(ok, Q_FUNC_INFO, asBA); + SWIFT_AUDIT_X(ok, Q_FUNC_INFO, asBA); workerThread->deleteLater(); }); @@ -160,7 +160,7 @@ namespace BlackMisc void CContinuousWorker::start(QThread::Priority priority) { - BLACK_VERIFY_X(!hasStarted(), Q_FUNC_INFO, "Tried to start a worker that was already started"); + SWIFT_VERIFY_X(!hasStarted(), Q_FUNC_INFO, "Tried to start a worker that was already started"); if (hasStarted()) { return; } // avoid message "QObject: Cannot create children for a parent that is in a different thread" @@ -217,7 +217,7 @@ namespace BlackMisc waitTime = QDateTime::currentMSecsSinceEpoch() - waitTime; const QString msg = QStringLiteral("Waiting for quitAndWait of '%1' for %2ms").arg(name).arg(waitTime); const QByteArray msgBA = msg.toLatin1(); - BLACK_AUDIT_X(ok, Q_FUNC_INFO, msgBA); // MS 2019-05 AUDIT because we want a stack trace of all threads, via breakpad + SWIFT_AUDIT_X(ok, Q_FUNC_INFO, msgBA); // MS 2019-05 AUDIT because we want a stack trace of all threads, via breakpad CLogMessage(this).info(msg); Q_UNUSED(ok) } @@ -289,7 +289,7 @@ namespace BlackMisc const bool ok = workerThread->wait(5000); const QString as = QStringLiteral("Worker thread '%2' refuses to stop after worker finished").arg(workerThread->objectName()); const QByteArray asBA = as.toLatin1(); - BLACK_AUDIT_X(ok, Q_FUNC_INFO, asBA); + SWIFT_AUDIT_X(ok, Q_FUNC_INFO, asBA); workerThread->deleteLater(); }); diff --git a/src/blacksound/dsp/biquadfilter.cpp b/src/blacksound/dsp/biquadfilter.cpp index 74fde9569..6026537a0 100644 --- a/src/blacksound/dsp/biquadfilter.cpp +++ b/src/blacksound/dsp/biquadfilter.cpp @@ -31,7 +31,7 @@ namespace BlackSound::Dsp void BiQuadFilter::setCoefficients(double aa0, double aa1, double aa2, double b0, double b1, double b2) { - if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(qAbs(aa0) > 1E-06, Q_FUNC_INFO, "Div by zero?"); } + if (CBuildConfig::isLocalDeveloperDebugBuild()) { SWIFT_VERIFY_X(qAbs(aa0) > 1E-06, Q_FUNC_INFO, "Div by zero?"); } // precompute the coefficients m_a0 = b0 / aa0; diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index b75202db6..004544952 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -647,7 +647,7 @@ namespace BlackSimPlugin::Flightgear if (!hasCallsign) { // does not make sense to continue here - BLACK_VERIFY_X(false, Q_FUNC_INFO, "missing callsign"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "missing callsign"); continue; } @@ -702,7 +702,7 @@ namespace BlackSimPlugin::Flightgear { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO, "Mismatching sizes"); + SWIFT_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO, "Mismatching sizes"); } m_trafficProxy->setPlanesPositions(planesPositions); } @@ -770,12 +770,12 @@ namespace BlackSimPlugin::Flightgear for (int i = 0; i < size; i++) { const bool emptyCs = callsigns[i].isEmpty(); - BLACK_VERIFY_X(!emptyCs, Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!emptyCs, Q_FUNC_INFO, "Need callsign"); if (emptyCs) { continue; } const CCallsign cs(callsigns[i]); if (!m_flightgearAircraftObjects.contains(cs)) { continue; } const CFlightgearMPAircraft fgAircraft = m_flightgearAircraftObjects[cs]; - BLACK_VERIFY_X(fgAircraft.hasCallsign(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(fgAircraft.hasCallsign(), Q_FUNC_INFO, "Need callsign"); if (!fgAircraft.hasCallsign()) { continue; } CElevationPlane elevation = CElevationPlane::null(); @@ -815,7 +815,7 @@ namespace BlackSimPlugin::Flightgear void CSimulatorFlightgear::onRemoteAircraftAdded(const QString &callsign) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } const CCallsign cs(callsign); CSimulatedAircraft addedRemoteAircraft = this->getAircraftInRangeForCallsign(cs); @@ -891,7 +891,7 @@ namespace BlackSimPlugin::Flightgear void CSimulatorFlightgear::onRemoteAircraftAddingFailed(const QString &callsign) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } const CCallsign cs(callsign); CSimulatedAircraft failedRemoteAircraft = this->getAircraftInRangeForCallsign(cs); diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 3dc87fdff..762db2e3c 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1070,7 +1070,7 @@ namespace BlackSimPlugin::FsxCommon simObjAddAgain.increaseAddingExceptions(); if (!simObject.hasCallsign()) { - BLACK_VERIFY_X(false, Q_FUNC_INFO, "Missing callsign"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "Missing callsign"); return; } @@ -1200,7 +1200,7 @@ namespace BlackSimPlugin::FsxCommon for (const CSimConnectObject &pendingSimObj : std::as_const(m_addPendingAircraft)) { - BLACK_VERIFY_X(pendingSimObj.hasCallsign(), Q_FUNC_INFO, "missing callsign"); + SWIFT_VERIFY_X(pendingSimObj.hasCallsign(), Q_FUNC_INFO, "missing callsign"); if (!pendingSimObj.hasCallsign()) { continue; } if (pendingSimObj.isTerrainProbe() || aircraftCallsignsInRange.contains(pendingSimObj.getCallsign())) { @@ -1568,7 +1568,7 @@ namespace BlackSimPlugin::FsxCommon canAdd = situation.isPositionOrAltitudeNull(); if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(canAdd, Q_FUNC_INFO, "Expect valid situation"); + SWIFT_VERIFY_X(canAdd, Q_FUNC_INFO, "Expect valid situation"); CLogMessage(this).warning(u"Invalid situation for '%1'") << callsign; } } @@ -1942,8 +1942,8 @@ namespace BlackSimPlugin::FsxCommon const CCallsign callsign(simObject.getCallsign()); const bool hasCs = !callsign.isEmpty(); const bool hasValidIds = simObject.hasValidRequestAndObjectId(); - BLACK_VERIFY_X(hasCs, Q_FUNC_INFO, "missing callsign"); - BLACK_AUDIT_X(hasValidIds, Q_FUNC_INFO, "Missing ids"); + SWIFT_VERIFY_X(hasCs, Q_FUNC_INFO, "missing callsign"); + SWIFT_AUDIT_X(hasValidIds, Q_FUNC_INFO, "Missing ids"); if (!hasCs || !hasValidIds) { continue; } // not supposed to happen const DWORD objectId = simObject.getObjectId(); @@ -2260,7 +2260,7 @@ namespace BlackSimPlugin::FsxCommon // crosscheck if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(isValidFsxPosition(position), Q_FUNC_INFO, "Invalid FSX pos."); + SWIFT_VERIFY_X(isValidFsxPosition(position), Q_FUNC_INFO, "Invalid FSX pos."); } return position; diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index 16561fcfd..a6b7d2ab7 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -928,7 +928,7 @@ namespace BlackSimPlugin::XPlane if (!hasCallsign) { // does not make sense to continue here - BLACK_VERIFY_X(false, Q_FUNC_INFO, "missing callsign"); + SWIFT_VERIFY_X(false, Q_FUNC_INFO, "missing callsign"); continue; } @@ -989,7 +989,7 @@ namespace BlackSimPlugin::XPlane { if (CBuildConfig::isLocalDeveloperDebugBuild()) { - BLACK_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO, "Mismatching sizes"); + SWIFT_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO, "Mismatching sizes"); } m_trafficProxy->setPlanesPositions(planesPositions); } @@ -1059,13 +1059,13 @@ namespace BlackSimPlugin::XPlane for (int i = 0; i < size; i++) { const bool emptyCs = callsigns[i].isEmpty(); - BLACK_VERIFY_X(!emptyCs, Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!emptyCs, Q_FUNC_INFO, "Need callsign"); if (emptyCs) { continue; } const CCallsign cs(callsigns[i]); if (!m_xplaneAircraftObjects.contains(cs)) { continue; } const CXPlaneMPAircraft xpAircraft = m_xplaneAircraftObjects[cs]; - BLACK_VERIFY_X(xpAircraft.hasCallsign(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(xpAircraft.hasCallsign(), Q_FUNC_INFO, "Need callsign"); if (!xpAircraft.hasCallsign()) { continue; } CElevationPlane elevation = CElevationPlane::null(); @@ -1177,7 +1177,7 @@ namespace BlackSimPlugin::XPlane void CSimulatorXPlane::onRemoteAircraftAdded(const QString &callsign) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } const CCallsign cs(callsign); CSimulatedAircraft addedRemoteAircraft = this->getAircraftInRangeForCallsign(cs); @@ -1223,7 +1223,7 @@ namespace BlackSimPlugin::XPlane void CSimulatorXPlane::onRemoteAircraftAddingFailed(const QString &callsign) { - BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); + SWIFT_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign"); if (callsign.isEmpty()) { return; } const CCallsign cs(callsign); CSimulatedAircraft failedRemoteAircraft = this->getAircraftInRangeForCallsign(cs);