diff --git a/plugins/timelib/timelib.cpp b/plugins/timelib/timelib.cpp index f59061b1485..75d3c4568e8 100644 --- a/plugins/timelib/timelib.cpp +++ b/plugins/timelib/timelib.cpp @@ -796,7 +796,6 @@ TIMELIB_API unsigned int TIMELIB_CALL tlAdjustCalendar(unsigned int date, short unsigned int month = (date - (year * 10000)) / 100; unsigned int day = date - (year * 10000) - (month * 100); int expectedMonthVal = month - 1; - time_t seconds [[maybe_unused]]; unsigned int result = 0; // Normalize the expected month value @@ -823,7 +822,7 @@ TIMELIB_API unsigned int TIMELIB_CALL tlAdjustCalendar(unsigned int date, short timeInfo.tm_mon += month_delta; timeInfo.tm_isdst = -1; - seconds = tlMKTime(&timeInfo); + tlMKTime(&timeInfo); if (timeInfo.tm_mon != expectedMonthVal) { diff --git a/roxie/roxiemem/roxiemem.cpp b/roxie/roxiemem/roxiemem.cpp index c8024b61424..ffddbfbd673 100644 --- a/roxie/roxiemem/roxiemem.cpp +++ b/roxie/roxiemem/roxiemem.cpp @@ -8425,6 +8425,7 @@ class RoxieMemTests : public CppUnit::TestFixture for (unsigned pass=0; pass < 8; pass++) { + //numPagesAfterCleanup() also has the side-effect of freeing up any empty pages. [[maybe_unused]] unsigned numPagesFull = rowManager->numPagesAfterCleanup(true); unsigned numRowsLeft = 0; unsigned target=0; diff --git a/system/jhtree/jhinplace.cpp b/system/jhtree/jhinplace.cpp index 620cef8e2b8..dad79e27239 100644 --- a/system/jhtree/jhinplace.cpp +++ b/system/jhtree/jhinplace.cpp @@ -267,83 +267,6 @@ inline void skipPacked(const byte * & cur) } while (next >= 0x80); } -//----- special packed format - code is untested - -#ifdef ALTERNATIVE_PACKING_FORMAT -inline unsigned getLeadingMask(byte extraBytes) { return (0x100U - (1U << (8-extraBytes))); } -inline unsigned getLeadingValueMask(byte extraBytes) { return (~getLeadingMask(extraBytes)) >> 1; } - -static void serializePacked2(MemoryBuffer & out, size32_t value) -{ - //Efficiency of serialization is not the key consideration - byte mask = 0; - unsigned size = sizePacked(value); - constexpr unsigned maxBytes = 9; - byte result[maxBytes]; - - for (unsigned i=1; i < size; i++) - { - result[maxBytes - i] = value; - value >>= 8; - mask = 0x80 | (mask >> 1); - } - unsigned start = maxBytes - size; - result[start] |= mask; - out.append(size, result + start); -} - -inline unsigned numExtraBytesFromFirst1(byte first) -{ - if (first >= 0xF0) - if (first >= 0xFC) - if (first >= 0xFE) - if (first >= 0xFF) - return 8; - else - return 7; - else - return 6; - else - if (first >= 0xF8) - return 5; - else - return 4; - else - if (first >= 0xC0) - if (first >= 0xE0) - return 3; - else - return 2; - else - return (first >> 7); // (first >= 0x80) ? 1 : 0 -} - -inline unsigned numExtraBytesFromFirst2(byte first) -{ - //Surely should be faster, but seems slower on AMD. Retest in its actual context - unsigned value = first; - return countLeadingUnsetBits(~(value << 24)); -} - -inline unsigned numExtraBytesFromFirst(byte first) -{ - return numExtraBytesFromFirst1(first); -} - -inline unsigned readPacked2(const byte * & cur) -{ - byte first = *cur++; - unsigned extraBytes = numExtraBytesFromFirst(first); - unsigned value = first & getLeadingValueMask(extraBytes); - while (extraBytes--) - { - value <<= 8; - value |= *cur++; - } - return value; -} -#endif - //------------------- static unsigned bytesRequired(unsigned __int64 value) @@ -2694,32 +2617,9 @@ static int normalizeCompare(int x) class InplaceIndexTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( InplaceIndexTest ); - //CPPUNIT_TEST(testBytesFromFirstTiming); CPPUNIT_TEST(testSearching); CPPUNIT_TEST_SUITE_END(); -#ifdef ALTERNATIVE_PACKING_FORMAT - void testBytesFromFirstTiming() - { - for (unsigned i=0; i <= 0xff; i++) - assertex(numExtraBytesFromFirst1(i) == numExtraBytesFromFirst2(i)); - unsigned total = 0; - { - CCycleTimer timer; - for (unsigned i=0; i < 0xffffff; i++) - total += numExtraBytesFromFirst1(i); - printf("%llu\n", timer.elapsedNs()); - } - { - CCycleTimer timer; - for (unsigned i2=0; i2 < 0xffffff; i2++) - total += numExtraBytesFromFirst2(i2); - printf("%llu\n", timer.elapsedNs()); - } - printf("%u\n", total); - } -#endif - void testSearching() { const size32_t keyLen = 8; diff --git a/system/jhtree/keybuild.cpp b/system/jhtree/keybuild.cpp index 6d08d881958..23d72c18b9e 100644 --- a/system/jhtree/keybuild.cpp +++ b/system/jhtree/keybuild.cpp @@ -271,16 +271,9 @@ class CKeyBuilder : public CInterfaceOf } protected: - offset_t endLevel(bool close) + void nextLevel() { - return 0; - } - - offset_t nextLevel() - { - endLevel(false); levels++; - return 0; } void writeFileHeader(bool fixHdr, CRC32 *crc) @@ -415,15 +408,8 @@ class CKeyBuilder : public CInterfaceOf if (children.ordinality() != 1) { // Note that we used to always create at least 2 levels as various places used to assume this. - offset_t offset = nextLevel(); - if (offset) - { - ForEachItemIn(idx, children) - { - CNodeInfo &info = children.item(idx); - info.pos += offset; - } - } + nextLevel(); + NodeInfoArray parentInfo; buildLevel(children, parentInfo); buildTree(parentInfo); diff --git a/system/lzma/LzmaEnc.cpp b/system/lzma/LzmaEnc.cpp index 17bf8d4dae6..29461d6f6dc 100644 --- a/system/lzma/LzmaEnc.cpp +++ b/system/lzma/LzmaEnc.cpp @@ -1923,11 +1923,10 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) { UInt32 beforeSize = kNumOpts; - Bool btMode [[maybe_unused]]; if (!RangeEnc_Alloc(&p->rc, alloc)) return SZ_ERROR_MEM; - btMode = (p->matchFinderBase.btMode != 0); #ifdef COMPRESS_MF_MT + Bool btMode = (p->matchFinderBase.btMode != 0); p->mtMode = (p->multiThread && !p->fastMode && btMode); #endif