X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fapitracecall.cpp;h=25b035d2ca90e82b8cfe2733b29fe2098e2a83c4;hb=fc9939fc84a006ccddfad84b137b6915b1a55771;hp=dfaaeef0e478a6a7b7a9fba76b02ec510a67bcba;hpb=f6b0dfe46e320daa8f59b935372223ba0308b2ce;p=apitrace diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp index dfaaeef..25b035d 100644 --- a/gui/apitracecall.cpp +++ b/gui/apitracecall.cpp @@ -336,7 +336,6 @@ void ApiBitmask::init(const trace::Bitmask *bitmask) m_value = bitmask->value; for (const trace::BitmaskFlag *it = bitmask->sig->flags; it != bitmask->sig->flags + bitmask->sig->num_flags; ++it) { - assert(it->value); QPair pair; pair.first = QString::fromStdString(it->name); @@ -351,10 +350,10 @@ QString ApiBitmask::toString() const QString str; unsigned long long value = m_value; bool first = true; - for (Signature::const_iterator it = m_sig.begin(); - value != 0 && it != m_sig.end(); ++it) { - Q_ASSERT(it->second); - if ((value & it->second) == it->second) { + for (Signature::const_iterator it = m_sig.begin(); it != m_sig.end(); ++it) { + Q_ASSERT(it->second || first); + if ((it->second && (value & it->second) == it->second) || + (!it->second && value == 0)) { if (!first) { str += QLatin1String(" | "); } @@ -362,6 +361,9 @@ QString ApiBitmask::toString() const value &= ~it->second; first = false; } + if (value == 0) { + break; + } } if (value || first) { if (!first) {