Exemple #1
0
static trace::BitmaskSig *
createBitmaskSig(const ApiBitmask &bt, unsigned id)
{
    ApiBitmask::Signature bsig = bt.signature();
    ApiBitmask::Signature::const_iterator itr;

    trace::BitmaskSig *sig = new trace::BitmaskSig();
    trace::BitmaskFlag *flags = new trace::BitmaskFlag[bsig.count()];

    sig->id = id;
    sig->num_flags = bsig.count();
    sig->flags = flags;

    int i = 0;
    for (itr = bsig.constBegin(); itr != bsig.constEnd(); ++itr, ++i) {
        flags[i].name = qstrdup(itr->first.toLocal8Bit());
        flags[i].value = itr->second;
    }

    return sig;
}
Exemple #2
0
static Trace::BitmaskSig *
createBitmaskSig(const ApiBitmask &bt, unsigned id)
{
    ApiBitmask::Signature bsig = bt.signature();
    ApiBitmask::Signature::const_iterator itr;

    Trace::BitmaskSig *sig = new Trace::BitmaskSig();
    Trace::BitmaskVal *values = new Trace::BitmaskVal[bsig.count()];

    sig->id = id;
    sig->count = bsig.count();
    sig->values = values;

    int i = 0;
    for (itr = bsig.constBegin(); itr != bsig.constEnd(); ++itr, ++i) {
        values[i].name = qstrdup(itr->first.toLocal8Bit());
        values[i].value = itr->second;
    }

    return sig;
}