Mercurial > hg > audiodb
diff lshlib.cpp @ 343:fdeb8db97678
added portable C++ reinterpret_cast<Uns32T> instead of C-style cast to fix 64-bit compile error in query.cpp. This is in advance of re-writing bucket class to include a union{} of pointer and counter fields.
author | mas01mc |
---|---|
date | Tue, 07 Oct 2008 20:08:22 +0000 |
parents | a6edbe97fddf |
children | 223a5994a962 |
line wrap: on
line diff
--- a/lshlib.cpp Tue Oct 07 18:41:38 2008 +0000 +++ b/lshlib.cpp Tue Oct 07 20:08:22 2008 +0000 @@ -444,10 +444,10 @@ // Find the linked-list pointer at the end of the CORE_ARRAY bucket** H::get_pointer_to_bucket_linked_list(bucket* rowPtr){ - Uns32T numBuckets = (Uns32T) rowPtr->snext; // Cast pointer to unsigned int - Uns32T numPoints = rowPtr->t2 & 0x7FFFFFFF; // Value is stored in low 31 bits of t2 field - bucket** listPtr = reinterpret_cast<bucket**> (reinterpret_cast<unsigned int*>(rowPtr->next)+numPoints+numBuckets+1); - return listPtr; + Uns32T numBuckets = reinterpret_cast<Uns32T> (rowPtr->snext); // Cast pointer to unsigned int + Uns32T numPoints = rowPtr->t2 & 0x7FFFFFFF; // Value is stored in low 31 bits of t2 field + bucket** listPtr = reinterpret_cast<bucket**> (reinterpret_cast<unsigned int*>(rowPtr->next)+numPoints+numBuckets+1); + return listPtr; } // Interface to Locality Sensitive Hashing G