ReSeqList::Tag tag;
bool rc = m_keys.binarySearch(key, keyLength, index, &tag);
if (rc){
- m_values.get(tag, value);
+ m_values.get(ReSeqList::Index(tag), value);
}
return rc;
}
// We can free the content:
m_content.setLength(seq->m_index);
} else {
- m_lost += seq->m_length;
+ m_lost += currentLength;
}
// Remove the entry from the list:
m_list.remove(index * m_entrySize, m_entrySize);
ptr[1] = (length >> 8) & 0xff;
ptr[2] = (length >> 16) & 0xff;
ptr[3] = (length >> 24) & 0xff;
- ptr[4] = (length >> 32) & 0xff;
+ ptr[4] = (int64_t(length) >> 32) & 0xff;
break;
default:
assert(false);
* @param current the current value
* @param lineNo the line number of the test (for the error message)
*/
-void ReTestUnit::assertEqual(unsigned int expected, unsigned int current, int lineNo){
+void ReTestUnit::assertEqual(int64_t expected, int64_t current, int lineNo){
if (expected != current){
- logF(true, i18n("%s-%d: expected: %ld (%lx) current: %ld (%lx)"),
+ logF(true, i18n("%s-%d: expected: %lld (%llx) current: %lld (%llx)"),
m_sourceFile.str(), lineNo, expected, expected, current, current);
}
}
* @param current the current value
* @param lineNo the line number of the test (for the error message)
*/
-void ReTestUnit::assertEqual(int64_t expected, int64_t current, int lineNo){
+void ReTestUnit::assertEqual(unsigned int expected, unsigned int current, int lineNo){
if (expected != current){
- logF(true, i18n("%s-%d: expected: %lld (%llx) current: %lld (%llx)"),
+ logF(true, i18n("%s-%d: expected: %ld (%lx) current: %ld (%lx)"),
m_sourceFile.str(), lineNo, expected, expected, current, current);
}
}
ReSeqList::Tag expectedTag = 0;
size_t maxIx = 64;
for (size_t ix = 0; ix < maxIx; ix++){
- expectedTag = (1 << ix);
+ expectedTag = (1ll << ix);
expectedValue.append("x", 1);
list.add(-1, expectedValue.str(), -1, expectedTag);
checkEqu(ix + 1, list.count());
}
expectedValue.setLength(0);
for (size_t ix = 0; ix < maxIx; ix++){
- expectedTag = (1 << ix);
+ expectedTag = (1ll << ix);
expectedValue.append("x", 1);
checkT(list.get(ix, value, &tag));
checkEqu(expectedValue.str(), value.str());
if (ix >= 4)
expectedTag = -1;
checkEqu(ix, list.find(expectedValue.str(), expectedValue.length(), &expectedTag));
- checkEqu(10*ix, expectedTag);
+ checkEqu(int(10*ix), (int) expectedTag);
}
}
void testBase(){
ReByteBuffer value;
ReSeqList::Tag tag = 0;
- list.add(-1, "xxx", -1, 1llu << 31);
+ list.add(-1, "xxx", -1, ReSeqList::Tag(1l) << 31);
checkT(list.get(0, value, &tag));
checkEqu(1ll << 31, tag);
checkEqu("xxx", value.str());