# HG changeset patch # User mas01cr # Date 1307032300 0 # Node ID 6a5117d68ac4ed0ccf753b16bd9e03b6c2680ae8 # Parent 337e72088f76d22c8fa75114d504892d96931df0 More sample fix Amazingly, it's still the same bit of code that is wrong, and this time I deserve to suffer shame from Chris Cannam, with whom just last month I had a discussion about the relative merits of signed- and unsigned integers by default: the error I made here was Chris' textbook example... diff -r 337e72088f76 -r 6a5117d68ac4 sample.cpp --- a/sample.cpp Thu Jun 02 16:31:35 2011 +0000 +++ b/sample.cpp Thu Jun 02 16:31:40 2011 +0000 @@ -187,11 +187,10 @@ std::set::iterator keys_end = qstate->allowed_keys->end(); for(uint32_t i = 0; i < adb->header->numFiles; i++) { - uint32_t prev = i == 0 ? 0 : props[i-1]; if(qstate->allowed_keys->find((*adb->keys)[i]) == keys_end) { props[i] = 0; } else { - uint32_t add = (*adb->track_lengths)[i] - spec->qid.sequence_length + 1; + int32_t add = (*adb->track_lengths)[i] - spec->qid.sequence_length + 1; props[i] = add > 0 ? add : 0; total += props[i]; }