From e124d1a4d18dca7717126aef25f5e52214f605fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 21 Aug 2021 12:59:39 +0200 Subject: [PATCH] Replace DEBUG_ASSERT(false) with an inverted string literal --- src/control/control.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/control/control.cpp b/src/control/control.cpp index 5d03c3c6123..d7d4db46d60 100644 --- a/src/control/control.cpp +++ b/src/control/control.cpp @@ -153,7 +153,7 @@ QSharedPointer ControlDoublePrivate::getControl( << "ControlObject" << key.group << key.item << "already created"; - DEBUG_ASSERT(false); + DEBUG_ASSERT(!"pCreatorCO != nullptr, ControlObject already created"); return nullptr; } return pControl; @@ -313,8 +313,8 @@ double ControlDoublePrivate::getParameterForValue(double value) const { double ControlDoublePrivate::getParameterForMidi(double midiParam) const { QSharedPointer pBehavior = m_pBehavior; if (!pBehavior) { - qWarning() << "Cannot set" << m_key << "by Midi"; - DEBUG_ASSERT(false); + qWarning() << "Cannot get" << m_key << "for Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, getParameterForMidi is returning 0"); return 0; } return pBehavior->midiToParameter(midiParam); @@ -323,8 +323,8 @@ double ControlDoublePrivate::getParameterForMidi(double midiParam) const { void ControlDoublePrivate::setValueFromMidi(MidiOpCode opcode, double midiParam) { QSharedPointer pBehavior = m_pBehavior; if (!pBehavior) { - qWarning() << "Cannot set" << m_key << "by Midi"; - DEBUG_ASSERT(false); + qWarning() << "Cannot set" << m_key << "from Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, abort setValueFromMidi()"); return; } pBehavior->setValueFromMidi(opcode, midiParam, this); @@ -333,8 +333,8 @@ void ControlDoublePrivate::setValueFromMidi(MidiOpCode opcode, double midiParam) double ControlDoublePrivate::getMidiParameter() const { QSharedPointer pBehavior = m_pBehavior; if (!pBehavior) { - qWarning() << "Cannot get" << m_key << "by Midi"; - DEBUG_ASSERT(false); + qWarning() << "Cannot get" << m_key << "as Midi"; + DEBUG_ASSERT(!"pBehavior == nullptr, getMidiParameter() is returning 0"); return 0; } return pBehavior->valueToMidiParameter(get());