When the zero valued flag appears before the non zero valued flags.
const Bitmask::Signature *sig = bitmask->sig;
bool first = true;
for (Bitmask::Signature::const_iterator it = sig->begin(); value != 0 && it != sig->end(); ++it) {
- assert(it->second);
- if ((value & it->second) == it->second) {
+ if ((it->second && (value & it->second) == it->second) ||
+ (!it->second && value == 0)) {
if (!first) {
os << " | ";
}
for (Bitmask::Signature::iterator it = sig->begin(); it != sig->end(); ++it) {
it->first = read_string();
it->second = read_uint();
- assert(it->second);
+ if (it->second == 0 && it != sig->begin()) {
+ std::cerr << "warning: bitmask " << it->first << " is zero but is not first flag\n";
+ }
}
bitmasks[id] = sig;
}
if (!lookup(bitmasks, bitmask.id)) {
WriteUInt(bitmask.count);
for (unsigned i = 0; i < bitmask.count; ++i) {
+ if (i != 0 && bitmask.values[i].value == 0) {
+ OS::DebugMessage("apitrace: bitmask %s is zero but is not first flag\n", bitmask.values[i].name);
+ }
WriteString(bitmask.values[i].name);
WriteUInt(bitmask.values[i].value);
}