]> gitweb.hamatoma.de Git - crepublib/commitdiff
windows corrections
authorkawi <winfriedkappeler@atron.de>
Tue, 13 Jan 2015 07:50:30 +0000 (08:50 +0100)
committerkawi <winfriedkappeler@atron.de>
Tue, 13 Jan 2015 07:50:30 +0000 (08:50 +0100)
base/ReHashList.cpp
base/ReSeqList.cpp
base/ReTestUnit.cpp
cunit/cuReSeqList.cpp

index a98229bd082bbd0f134779af9f0b8bb10df4a877..abcfd025a092297e41ff756822f9eab1daeafa68 100644 (file)
@@ -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;
 }
index db30a6acd567adad4c10d1f677da9d5979c771e7..bc9457a52cd6ebfe409672957dd0b7cfbacf4cd2 100644 (file)
@@ -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);
index 7d23938dd9261bc88e2200c189e67711b4502752..366de0f723f30e826fc7d9b09f162724a3546f5c 100644 (file)
@@ -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);
        }
 }
index 54064025394544a0dece1e417db400dc7fb0d2b0..82170685ebdeabda24737c4aa1f7d95c587f6ce5 100644 (file)
@@ -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());