# HG changeset patch # User mas01mc # Date 1235156925 0 # Node ID d3c96cbb91e39930e292fbba81c5124467d5a606 # Parent 600b87550b8313b08d03f8c8d6345bdd90b96f8c INDEXING: fixed reverse-lookup roundoff error when data gets very large. Computation of offset was lacking an essential cast to off_t. diff -r 600b87550b83 -r d3c96cbb91e3 audioDB-internals.h --- a/audioDB-internals.h Fri Feb 13 11:23:13 2009 +0000 +++ b/audioDB-internals.h Fri Feb 20 19:08:45 2009 +0000 @@ -271,8 +271,8 @@ return (*adb->keys)[index].c_str(); } -static inline uint32_t audiodb_index_to_track_id(adb_t *adb, uint32_t lshid) { - off_t offset = lshid * adb->header->dim * sizeof(double); +static inline uint32_t audiodb_index_to_track_id(adb_t *adb, uint32_t lshid){ + off_t offset = (off_t)lshid*adb->header->dim*sizeof(double); std::vector::iterator b = (*adb->track_offsets).begin(); std::vector::iterator e = (*adb->track_offsets).end(); std::vector::iterator p = std::upper_bound(b, e, offset);