From: kawi Date: Tue, 13 Jan 2015 07:50:30 +0000 (+0100) Subject: windows corrections X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=b069aa658ab5460cff51b26d4969f9854afd7151;p=crepublib windows corrections --- diff --git a/base/ReHashList.cpp b/base/ReHashList.cpp index a98229b..abcfd02 100644 --- a/base/ReHashList.cpp +++ b/base/ReHashList.cpp @@ -85,7 +85,7 @@ bool ReHashList::get(const Byte* key, size_t keyLength, 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; } diff --git a/base/ReSeqList.cpp b/base/ReSeqList.cpp index db30a6a..bc9457a 100644 --- a/base/ReSeqList.cpp +++ b/base/ReSeqList.cpp @@ -395,7 +395,7 @@ void ReSeqList::remove(Index index){ // 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); @@ -467,7 +467,7 @@ void ReSeqList::setSequence(Sequence* seq, Index index, size_t length, Tag tag){ 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); diff --git a/base/ReTestUnit.cpp b/base/ReTestUnit.cpp index 7d23938..366de0f 100644 --- a/base/ReTestUnit.cpp +++ b/base/ReTestUnit.cpp @@ -91,9 +91,9 @@ void ReTestUnit::assertEqual(int expected, int current, int lineNo){ * @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); } } @@ -103,9 +103,9 @@ void ReTestUnit::assertEqual(unsigned int expected, unsigned int current, int li * @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); } } diff --git a/cunit/cuReSeqList.cpp b/cunit/cuReSeqList.cpp index 5406402..8217068 100644 --- a/cunit/cuReSeqList.cpp +++ b/cunit/cuReSeqList.cpp @@ -68,7 +68,7 @@ private: 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()); @@ -79,7 +79,7 @@ private: } 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()); @@ -111,7 +111,7 @@ private: 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(){ @@ -119,7 +119,7 @@ private: 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());