diff options
author | Geir Storli <geirst@oath.com> | 2017-09-13 12:06:35 +0000 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2017-09-13 12:07:12 +0000 |
commit | 775a0dcbad72b31e088230ce6abe413c0ce77ddd (patch) | |
tree | 026b02b0bfb8f982681616396024dfa256c2cc56 | |
parent | 48593478a699c2618e50c37baabcd8664136b139 (diff) |
Replace tab with spaces.
84 files changed, 1058 insertions, 1058 deletions
diff --git a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp index c2fcba379fd..469c8aeac4e 100644 --- a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp +++ b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp @@ -388,7 +388,7 @@ ShowPostingListSubApp::readWordList(const SchemaUtil::IndexIterator &index) PostingListCounts counts; uint64_t wordNum = noWordNum(); wr.readWord(word, wordNum, counts); - words.push_back(""); // Word number 0 is special here. + words.push_back(""); // Word number 0 is special here. while (wordNum != noWordNumHigh()) { assert(wordNum == words.size()); words.push_back(word); @@ -595,7 +595,7 @@ ShowPostingListSubApp::showPostingList() handle->second._bitOffset = offsetAndCounts._offset; handle->second._bitLength = handle->first._bitLength; const uint32_t first_segment = 0; - const uint32_t num_segments = 0; // means all segments + const uint32_t num_segments = 0; // means all segments handle->second._file = postingfile.get(); handle->second._file->readPostingList(handle->first, first_segment, diff --git a/searchlib/src/tests/btree/btree_test.cpp b/searchlib/src/tests/btree/btree_test.cpp index d29c80afaf1..5795385250f 100644 --- a/searchlib/src/tests/btree/btree_test.cpp +++ b/searchlib/src/tests/btree/btree_test.cpp @@ -91,8 +91,8 @@ typedef MyTree::LeafNodeType MyLeafNode; typedef MyTree::InternalNodeType MyInternalNode; typedef MyTree::NodeAllocatorType MyNodeAllocator; typedef std::pair<MyKey, std::string> LeafPair; -typedef MyTreeStore::KeyDataType MyKeyData; -typedef MyTreeStore::KeyDataTypeRefPair MyKeyDataRefPair; +typedef MyTreeStore::KeyDataType MyKeyData; +typedef MyTreeStore::KeyDataTypeRefPair MyKeyDataRefPair; typedef BTree<int, BTreeNoLeafData, btree::NoAggregated> SetTreeB; diff --git a/searchlib/src/tests/btree/btreeaggregation_test.cpp b/searchlib/src/tests/btree/btreeaggregation_test.cpp index c0b4dad8b95..ef91c2c868a 100644 --- a/searchlib/src/tests/btree/btreeaggregation_test.cpp +++ b/searchlib/src/tests/btree/btreeaggregation_test.cpp @@ -115,8 +115,8 @@ typedef MyTree::NodeAllocatorType MyNodeAllocator; typedef MyTree::Builder::Aggregator MyAggregator; typedef MyTree::AggrCalcType MyAggrCalc; typedef std::pair<MyKey, int32_t> LeafPair; -typedef MyTreeStore::KeyDataType MyKeyData; -typedef MyTreeStore::KeyDataTypeRefPair MyKeyDataRefPair; +typedef MyTreeStore::KeyDataType MyKeyData; +typedef MyTreeStore::KeyDataTypeRefPair MyKeyDataRefPair; typedef BTree<int, BTreeNoLeafData, btree::NoAggregated> SetTreeB; @@ -211,7 +211,7 @@ MyTreeForceApplyStore::insert(EntryRef &ref, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi < olde && !comp(key, oldi->_key)) - retVal = false; // key already present + retVal = false; // key already present } } KeyDataType addition(key, data); @@ -228,7 +228,7 @@ MyTreeForceApplyStore::remove(EntryRef &ref, const KeyType &key, { bool retVal = true; if (!ref.valid()) - retVal = false; // not found + retVal = false; // not found else { RefType iRef(ref); uint32_t clusterSize = getClusterSize(iRef); @@ -243,7 +243,7 @@ MyTreeForceApplyStore::remove(EntryRef &ref, const KeyType &key, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi == olde || comp(key, oldi->_key)) - retVal = false; // not found + retVal = false; // not found } } std::vector<KeyDataType> additions; diff --git a/searchlib/src/tests/common/packets/packets_test.cpp b/searchlib/src/tests/common/packets/packets_test.cpp index cf0e858a014..c4da5ca4873 100644 --- a/searchlib/src/tests/common/packets/packets_test.cpp +++ b/searchlib/src/tests/common/packets/packets_test.cpp @@ -573,9 +573,9 @@ TEST("testGetDocsumsX") { EXPECT_EQUAL(fastos::TimeStamp(2*fastos::TimeStamp::MS), ptr->getTimeout()); if (ptr->_features & GDF_RANKP_QFLAGS) { EXPECT_EQUAL("four", ptr->_ranking); - } else { + } else { EXPECT_EQUAL("", ptr->_ranking); - } + } EXPECT_EQUAL(ptr->_features & GDF_RANKP_QFLAGS ? 5u : 0u, ptr->_qflags); EXPECT_EQUAL(ptr->_features & GDF_QUERYSTACK ? 7u : 0u, ptr->_stackItems); if (ptr->_features & GDF_PROPERTIES) { diff --git a/searchlib/src/tests/diskindex/fieldwriter/fieldwriter_test.cpp b/searchlib/src/tests/diskindex/fieldwriter/fieldwriter_test.cpp index 107636e59ad..72a50d87821 100644 --- a/searchlib/src/tests/diskindex/fieldwriter/fieldwriter_test.cpp +++ b/searchlib/src/tests/diskindex/fieldwriter/fieldwriter_test.cpp @@ -77,7 +77,7 @@ void enableSkip() void enableSkipChunks() { minSkipDocs = 64; - minChunkDocs = 9000; // Unrealistic low for testing + minChunkDocs = 9000; // Unrealistic low for testing } @@ -928,7 +928,7 @@ FieldWriterTest::Main() _wordSet2.setupParams(false, false); _wordSet2.setupWords(_rnd, _numDocs, _commonDocFreq, 3); uint32_t docIdBias = 700000000; - _wordSet2.addDocIdBias(docIdBias); // Large skip numbers + _wordSet2.addDocIdBias(docIdBias); // Large skip numbers testFieldWriterVariantsWithHighLids(_wordSet2, _numDocs + docIdBias, _verbose); return 0; diff --git a/searchlib/src/tests/features/prod_features.cpp b/searchlib/src/tests/features/prod_features.cpp index b8657078b18..b1524cea904 100644 --- a/searchlib/src/tests/features/prod_features.cpp +++ b/searchlib/src/tests/features/prod_features.cpp @@ -1301,7 +1301,7 @@ Test::setupForDotProductTest(FtFeatureTest & ft) WeightedSetStringExtAttribute * ea = static_cast<WeightedSetStringExtAttribute *>(d.get()); EXPECT_TRUE(!ea->hasEnum()); uint32_t docId; - ea->addDoc(docId); // reserved doc + ea->addDoc(docId); // reserved doc ea->addDoc(docId); ea->add("a", 10); ea->add("b", 20); diff --git a/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp b/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp index 763d8105780..6c4c7801038 100644 --- a/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp +++ b/searchlib/src/tests/memoryindex/datastore/wordstore_test.cpp @@ -27,7 +27,7 @@ Test::requireThatWordsCanBeAddedAndRetrieved() EntryRef r1 = ws.addWord(w1); EntryRef r2 = ws.addWord(w2); EntryRef r3 = ws.addWord(w3); - uint32_t invp = WordStore::RefType::align(1); // Reserved as invalid + uint32_t invp = WordStore::RefType::align(1); // Reserved as invalid uint32_t w1s = w1.size() + 1; uint32_t w1p = WordStore::RefType::pad(w1s); uint32_t w2s = w2.size() + 1; diff --git a/searchlib/src/tests/postinglistbm/andstress.cpp b/searchlib/src/tests/postinglistbm/andstress.cpp index bdf90fb7732..d28efb9c0e2 100644 --- a/searchlib/src/tests/postinglistbm/andstress.cpp +++ b/searchlib/src/tests/postinglistbm/andstress.cpp @@ -78,7 +78,7 @@ public: bool validate, bool verbose); void dropPostings(); void dropTasks(); - void resetTasks(); // Prepare for rerun + void resetTasks(); // Prepare for rerun void setupTasks(unsigned int numTasks); Task *getTask(); unsigned int getNumDocs() const { return _numDocs; } diff --git a/searchlib/src/tests/url/testurl.cpp b/searchlib/src/tests/url/testurl.cpp index a193b99f25d..7ac67480a2e 100644 --- a/searchlib/src/tests/url/testurl.cpp +++ b/searchlib/src/tests/url/testurl.cpp @@ -15,8 +15,8 @@ static search::util::URL GlobalURL; static bool CheckString(const char *name, - const unsigned char *test1, - const unsigned char *test2) + const unsigned char *test1, + const unsigned char *test2) { assert(test1 != NULL); assert(test2 != NULL); @@ -32,8 +32,8 @@ CheckString(const char *name, static bool CheckInt(const char *name, - int test1, - int test2) + int test1, + int test2) { if (test1 != test2) { printf("FAILED: %s: %d != %d!\n", name, test1, test2); @@ -68,24 +68,24 @@ GetTokenString(search::util::URL &url) static bool CheckURL(const char *url, - const char *scheme, - const char *host, - const char *domain, - const char *siteowner, + const char *scheme, + const char *host, + const char *domain, + const char *siteowner, const char *tld, const char *maintld, - const char */* tldregion */, - const char *port, - const char *path, - int pathdepth, - const char *filename, - const char *extension, - const char *params, - const char *query, - const char *fragment, - const char *address, - const char *tokens, - int verbose=0) + const char */* tldregion */, + const char *port, + const char *path, + int pathdepth, + const char *filename, + const char *extension, + const char *params, + const char *query, + const char *fragment, + const char *address, + const char *tokens, + int verbose=0) { if (verbose>0) printf("Checking with URL: '%s'\n", url); diff --git a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h index 09db5c334db..febf7d101a9 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributeiterators.h +++ b/searchlib/src/vespa/searchlib/attribute/attributeiterators.h @@ -258,7 +258,7 @@ AttributePostingListIteratorT< btree::BTreeDefaultTraits> >:: getWeight() { - return 1; // default weight 1 for single value attributes + return 1; // default weight 1 for single value attributes } template <> diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 938649880c4..b21f0e0dfff 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -666,7 +666,7 @@ void AttributeVector::addReservedDoc() { uint32_t docId = 42; - addDoc(docId); // Reserved + addDoc(docId); // Reserved assert(docId == 0u); assert(docId < getNumDocs()); clearDoc(docId); diff --git a/searchlib/src/vespa/searchlib/attribute/dociditerator.h b/searchlib/src/vespa/searchlib/attribute/dociditerator.h index a6366172269..c69d6035f49 100644 --- a/searchlib/src/vespa/searchlib/attribute/dociditerator.h +++ b/searchlib/src/vespa/searchlib/attribute/dociditerator.h @@ -62,7 +62,7 @@ template <> inline int32_t DocIdIterator<AttributePosting>::getData() const { - return 1; // default weight 1 for single value attributes + return 1; // default weight 1 for single value attributes } diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp index 1a67e1d8fd0..9da670b2bd5 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.hpp @@ -111,7 +111,7 @@ EnumAttribute<B>::insertNewUniqueValues(EnumStoreBase::IndexVector & newIndexes) fprintf(stderr, "Cannot fallbackResize enumStore\n"); abort(); } - break; // fallback resize performed instead of compaction. + break; // fallback resize performed instead of compaction. } // update underlying structure with new EnumIndex values. diff --git a/searchlib/src/vespa/searchlib/attribute/postingchange.cpp b/searchlib/src/vespa/searchlib/attribute/postingchange.cpp index fad6fb0c8fd..9957d162d9d 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingchange.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postingchange.cpp @@ -28,7 +28,7 @@ removeDupAdditions(PostingChange<AttributePosting>::A &additions) break; } if (i == ie) - return; // no dups found + return; // no dups found for (++i; i != ie; ++i) { if (d->_key != i->_key) { ++d; @@ -56,7 +56,7 @@ removeDupAdditions(PostingChange<AttributeWeightPosting>::A &additions) break; } if (i == ie) - return; // no dups found + return; // no dups found // sum weights together d->setData(d->getData() + i->getData()); for (++i; i != ie; ++i) { @@ -88,7 +88,7 @@ removeDupRemovals(std::vector<uint32_t> &removals) break; } if (i == ie) - return; // no dups found + return; // no dups found for (++i; i != ie; ++i) { if (*d != *i) { ++d; diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp index 27b114c9199..68eda476df7 100644 --- a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp +++ b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp @@ -81,7 +81,7 @@ template <typename DataT> PostingStore<DataT>::~PostingStore() { _builder.clear(); - _store.dropBuffers(); // Drop buffers before type handlers are dropped + _store.dropBuffers(); // Drop buffers before type handlers are dropped } diff --git a/searchlib/src/vespa/searchlib/attribute/readerbase.h b/searchlib/src/vespa/searchlib/attribute/readerbase.h index 358038f9ba2..e1c3b64b8a9 100644 --- a/searchlib/src/vespa/searchlib/attribute/readerbase.h +++ b/searchlib/src/vespa/searchlib/attribute/readerbase.h @@ -57,7 +57,7 @@ private: FileReader<uint32_t> _idxReader; FileReader<uint32_t> _enumReader; uint32_t _currIdx; - uint32_t _datHeaderLen; + uint32_t _datHeaderLen; uint32_t _idxHeaderLen; uint32_t _weightHeaderLen; uint32_t _udatHeaderLen; diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h index 5e8a1d62f70..9320e248160 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h @@ -25,7 +25,7 @@ private: typedef B::generation_t generation_t; protected: - typedef uint32_t Word; // Large enough to contain numDocs. + typedef uint32_t Word; // Large enough to contain numDocs. private: Word _valueMask; // 0x01, 0x03 or 0x0f uint32_t _valueShiftShift; // 0x00, 0x01 or 0x02 diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp index aa39b798b7a..08f1b8a1e9e 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.cpp @@ -178,7 +178,7 @@ readBytes(uint8_t *buf, size_t len) const uint8_t *rbuf = reinterpret_cast<const uint8_t *>(getCompr()) + (getBitOffset() >> 3); const uint8_t *rbufE = reinterpret_cast<const uint8_t *>(_realValE); - size_t rbufSize = rbufE - rbuf; // Size of buffer to read from + size_t rbufSize = rbufE - rbuf; // Size of buffer to read from // How much to copy in this iteration of the loop size_t copySize = std::min(rbufSize, len); // Something must be copied during each iteration diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.h b/searchlib/src/vespa/searchlib/bitcompression/compression.h index 0ca0127074b..a0cba703e65 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/compression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/compression.h @@ -46,7 +46,7 @@ private: * Rice2 (k=1) starts with: 00, 01, 1000, 1001, 1010, 1011, 110000 * Exp golomb (k=0) starts with: 1, 010, 011, 00100, 00101, 00101, 00111 * Exp golomb (k=1) starts with: 10, 11, 0100, 0101, 0110, 0111, 001000 - * unary coding: 0, 10, 110, 1110, 11110, 111110, 1111110 + * unary coding: 0, 10, 110, 1110, 11110, 111110, 1111110 * rice coding (k=0) 0, 10, 110, 1110, 11110, 111110, 1111110 * rice coding (k=1) 00, 01, 100, 101, 1100, 1101, 11100 * @@ -89,618 +89,618 @@ public: CodingTables(); }; -#define UC64_DECODECONTEXT(prefix) \ - const uint64_t * prefix ## Compr; \ - uint64_t prefix ## Val; \ - uint64_t prefix ## CacheInt; \ +#define UC64_DECODECONTEXT(prefix) \ + const uint64_t * prefix ## Compr; \ + uint64_t prefix ## Val; \ + uint64_t prefix ## CacheInt; \ uint32_t prefix ## PreRead; -#define UC64_DECODECONTEXT_CONSTRUCTOR(prefix, ctx) \ - const uint64_t * prefix ## Compr = ctx ## valI; \ - uint64_t prefix ## Val = ctx ## val; \ - uint64_t prefix ## CacheInt = ctx ## cacheInt; \ +#define UC64_DECODECONTEXT_CONSTRUCTOR(prefix, ctx) \ + const uint64_t * prefix ## Compr = ctx ## valI; \ + uint64_t prefix ## Val = ctx ## val; \ + uint64_t prefix ## CacheInt = ctx ## cacheInt; \ uint32_t prefix ## PreRead = ctx ## preRead; -#define UC64_DECODECONTEXT_LOAD(prefix, ctx) \ - prefix ## Compr = ctx ## valI; \ - prefix ## Val = ctx ## val; \ - prefix ## CacheInt = ctx ## cacheInt; \ +#define UC64_DECODECONTEXT_LOAD(prefix, ctx) \ + prefix ## Compr = ctx ## valI; \ + prefix ## Val = ctx ## val; \ + prefix ## CacheInt = ctx ## cacheInt; \ prefix ## PreRead = ctx ## preRead; -#define UC64_DECODECONTEXT_LOAD_PARTIAL(prefix, ctx) \ +#define UC64_DECODECONTEXT_LOAD_PARTIAL(prefix, ctx) \ prefix ## Compr = ctx ## valI; -#define UC64_DECODECONTEXT_STORE(prefix, ctx) \ - ctx ## valI = prefix ## Compr; \ - ctx ## val = prefix ## Val; \ - ctx ## cacheInt = prefix ## CacheInt; \ +#define UC64_DECODECONTEXT_STORE(prefix, ctx) \ + ctx ## valI = prefix ## Compr; \ + ctx ## val = prefix ## Val; \ + ctx ## cacheInt = prefix ## CacheInt; \ ctx ## preRead = prefix ## PreRead; -#define UC64_DECODECONTEXT_STORE_PARTIAL(prefix, ctx) \ +#define UC64_DECODECONTEXT_STORE_PARTIAL(prefix, ctx) \ ctx ## valI = prefix ## Compr; -#define UC64BE_READBITS(val, valI, preRead, cacheInt, EC) \ - do { \ - if (__builtin_expect(length <= preRead, true)) { \ - val |= ((cacheInt >> (preRead - length)) & \ - ::search::bitcompression::CodingTables::_intMask64[length]); \ - preRead -= length; \ - } else { \ - if (__builtin_expect(preRead > 0, true)) { \ - length -= preRead; \ - val |= ((cacheInt & \ - ::search::bitcompression::CodingTables:: \ - _intMask64[preRead]) << length); \ - } \ - cacheInt = EC::bswap(*valI++); \ - preRead = 64 - length; \ - val |= cacheInt >> preRead; \ - } \ +#define UC64BE_READBITS(val, valI, preRead, cacheInt, EC) \ + do { \ + if (__builtin_expect(length <= preRead, true)) { \ + val |= ((cacheInt >> (preRead - length)) & \ + ::search::bitcompression::CodingTables::_intMask64[length]); \ + preRead -= length; \ + } else { \ + if (__builtin_expect(preRead > 0, true)) { \ + length -= preRead; \ + val |= ((cacheInt & \ + ::search::bitcompression::CodingTables:: \ + _intMask64[preRead]) << length); \ + } \ + cacheInt = EC::bswap(*valI++); \ + preRead = 64 - length; \ + val |= cacheInt >> preRead; \ + } \ } while (0) -#define UC64BE_READBITS_NS(prefix, EC) \ - UC64BE_READBITS(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, EC) +#define UC64BE_READBITS_NS(prefix, EC) \ + UC64BE_READBITS(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, EC) -#define UC64BE_READBITS_CTX(ctx, EC) \ - UC64BE_READBITS(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC); +#define UC64BE_READBITS_CTX(ctx, EC) \ + UC64BE_READBITS(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC); -#define UC64BE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ - do { \ - cacheInt = EC::bswap(*valI++); \ - preRead = 64 - bitOffset; \ - val = 0; \ - length = 64; \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ + do { \ + cacheInt = EC::bswap(*valI++); \ + preRead = 64 - bitOffset; \ + val = 0; \ + length = 64; \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ - ns ## Compr = comprData; \ - UC64BE_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ - ns ## PreRead, ns ## CacheInt, EC); - -#define UC64BE_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ - ctx._valI = comprData; \ - UC64BE_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC); - -#define UC64BE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - length = \ - 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ - unsigned int olength = length; \ - val <<= length; \ - if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ - length = 0; \ - } \ - val64 = (val >> (63 - olength - (k))) - (UINT64_C(1) << (k)); \ - val <<= olength + 1 + (k); \ - if (__builtin_expect(olength + 1 + (k) == 64, false)) \ - val = 0; \ - length += olength + 1 + (k); \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ + ns ## Compr = comprData; \ + UC64BE_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ + ns ## PreRead, ns ## CacheInt, EC); + +#define UC64BE_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ + ctx._valI = comprData; \ + UC64BE_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC); + +#define UC64BE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + length = \ + 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ + unsigned int olength = length; \ + val <<= length; \ + if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ + length = 0; \ + } \ + val64 = (val >> (63 - olength - (k))) - (UINT64_C(1) << (k)); \ + val <<= olength + 1 + (k); \ + if (__builtin_expect(olength + 1 + (k) == 64, false)) \ + val = 0; \ + length += olength + 1 + (k); \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64BE_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64BE_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64BE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ - EC) \ - do { \ - length = \ - 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ - val <<= length; \ - val64 = (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \ - val <<= length + 1 + (k); \ - length += length + 1 + (k); \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ + EC) \ + do { \ + length = \ + 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ + val <<= length; \ + val64 = (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \ + val <<= length + 1 + (k); \ + length += length + 1 + (k); \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64BE_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64BE_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64BE_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64BE_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ - do { \ - UC64BE_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, \ - k, EC); \ +#define UC64BE_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ + do { \ + UC64BE_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, \ + k, EC); \ } while (0) -#define UC64BE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt,\ - k, EC, resop) \ - do { \ - length = \ - 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ - val <<= length; \ - resop (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \ - val <<= length + 1 + (k); \ - length += length + 1 + (k); \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ + k, EC, resop) \ + do { \ + length = \ + 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ + val <<= length; \ + resop (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \ + val <<= length + 1 + (k); \ + length += length + 1 + (k); \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - length = \ - 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ - unsigned int olength = length; \ - val <<= length; \ - if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ - length = 0; \ - } \ - val <<= olength + 1 + (k); \ - if (__builtin_expect(olength + 1 + (k) == 64, false)) \ - val = 0; \ - length += olength + 1 + (k); \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + length = \ + 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ + unsigned int olength = length; \ + val <<= length; \ + if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ + length = 0; \ + } \ + val <<= olength + 1 + (k); \ + if (__builtin_expect(olength + 1 + (k) == 64, false)) \ + val = 0; \ + length += olength + 1 + (k); \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_SKIPEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64BE_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64BE_SKIPEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64BE_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64BE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ - EC) \ - do { \ - length = \ - 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ - val <<= length; \ - val <<= length + 1 + (k); \ - length += length + 1 + (k); \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64BE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ + EC) \ + do { \ + length = \ + 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \ + val <<= length; \ + val <<= length + 1 + (k); \ + length += length + 1 + (k); \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64BE_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64BE_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64BE_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64BE_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64BE_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ - do { \ - if (length >= cacheFree) { \ - cacheInt |= ((data >> (length - cacheFree)) & \ - ::search::bitcompression::CodingTables:: \ - _intMask64[cacheFree]); \ - *bufI++ = EC::bswap(cacheInt); \ - length -= cacheFree; \ - cacheInt = 0; \ - cacheFree = 64; \ - } \ - if (length > 0) { \ - uint64_t dataFragment = \ - (data & ::search::bitcompression::CodingTables:: \ - _intMask64[length]); \ - cacheInt |= (dataFragment << (cacheFree - length)); \ - cacheFree -= length; \ - } \ +#define UC64BE_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ + do { \ + if (length >= cacheFree) { \ + cacheInt |= ((data >> (length - cacheFree)) & \ + ::search::bitcompression::CodingTables:: \ + _intMask64[cacheFree]); \ + *bufI++ = EC::bswap(cacheInt); \ + length -= cacheFree; \ + cacheInt = 0; \ + cacheFree = 64; \ + } \ + if (length > 0) { \ + uint64_t dataFragment = \ + (data & ::search::bitcompression::CodingTables:: \ + _intMask64[length]); \ + cacheInt |= (dataFragment << (cacheFree - length)); \ + cacheFree -= length; \ + } \ } while (0) -#define UC64BE_WRITEBITS_NS(prefix, EC) \ - do { \ - UC64BE_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ - prefix ## BufI, EC); \ +#define UC64BE_WRITEBITS_NS(prefix, EC) \ + do { \ + UC64BE_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ + prefix ## BufI, EC); \ } while (0) -#define UC64BE_WRITEBITS_CTX(ctx, EC) \ - do { \ - UC64BE_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ - ctx ## valI, EC); \ +#define UC64BE_WRITEBITS_CTX(ctx, EC) \ + do { \ + UC64BE_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ + ctx ## valI, EC); \ } while (0) -#define UC64BE_DECODEDEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - if ((prefix ## Val & TOP_BIT64) == 0) { \ - length = 1; \ - prefix ## Val <<= 1; \ - val64 = 0; \ - UC64BE_READBITS_NS(prefix, EC); \ - } else { \ - if ((prefix ## Val & TOP_2_BITS64) != TOP_2_BITS64) { \ - length = 2; \ - prefix ## Val <<= 2; \ - val64 = 1; \ - UC64BE_READBITS_NS(prefix, EC); \ - } else { \ - length = 2; \ - prefix ## Val <<= 2; \ - UC64BE_READBITS_NS(prefix, EC); \ - UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \ - val64 += 2; \ - } \ - } \ +#define UC64BE_DECODEDEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + if ((prefix ## Val & TOP_BIT64) == 0) { \ + length = 1; \ + prefix ## Val <<= 1; \ + val64 = 0; \ + UC64BE_READBITS_NS(prefix, EC); \ + } else { \ + if ((prefix ## Val & TOP_2_BITS64) != TOP_2_BITS64) { \ + length = 2; \ + prefix ## Val <<= 2; \ + val64 = 1; \ + UC64BE_READBITS_NS(prefix, EC); \ + } else { \ + length = 2; \ + prefix ## Val <<= 2; \ + UC64BE_READBITS_NS(prefix, EC); \ + UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \ + val64 += 2; \ + } \ + } \ } while (0) -#define UC64BE_DECODED0EXPGOLOMB_NS(prefix, k, EC) \ - do { \ - if ((prefix ## Val & TOP_BIT64) == 0) { \ - length = 1; \ - prefix ## Val <<= 1; \ - val64 = 0; \ - UC64BE_READBITS_NS(prefix, EC); \ - } else { \ - length = 1; \ - prefix ## Val <<= 1; \ - UC64BE_READBITS_NS(prefix, EC); \ - UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \ - val64 += 1; \ - } \ +#define UC64BE_DECODED0EXPGOLOMB_NS(prefix, k, EC) \ + do { \ + if ((prefix ## Val & TOP_BIT64) == 0) { \ + length = 1; \ + prefix ## Val <<= 1; \ + val64 = 0; \ + UC64BE_READBITS_NS(prefix, EC); \ + } else { \ + length = 1; \ + prefix ## Val <<= 1; \ + UC64BE_READBITS_NS(prefix, EC); \ + UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \ + val64 += 1; \ + } \ } while (0) -#define UC64LE_READBITS(val, valI, preRead, cacheInt, EC) \ - do { \ - if (__builtin_expect(length <= preRead, true)) { \ - val |= ((cacheInt << (preRead - length)) & \ - ::search::bitcompression::CodingTables::_intMask64le[length]); \ - preRead -= length; \ - } else { \ - if (__builtin_expect(preRead > 0, true)) { \ - length -= preRead; \ - val |= ((cacheInt & \ - ::search::bitcompression::CodingTables:: \ - _intMask64le[preRead]) >> length); \ - } \ - cacheInt = EC::bswap(*valI++); \ - preRead = 64 - length; \ - val |= cacheInt << preRead; \ - } \ +#define UC64LE_READBITS(val, valI, preRead, cacheInt, EC) \ + do { \ + if (__builtin_expect(length <= preRead, true)) { \ + val |= ((cacheInt << (preRead - length)) & \ + ::search::bitcompression::CodingTables::_intMask64le[length]); \ + preRead -= length; \ + } else { \ + if (__builtin_expect(preRead > 0, true)) { \ + length -= preRead; \ + val |= ((cacheInt & \ + ::search::bitcompression::CodingTables:: \ + _intMask64le[preRead]) >> length); \ + } \ + cacheInt = EC::bswap(*valI++); \ + preRead = 64 - length; \ + val |= cacheInt << preRead; \ + } \ } while (0) -#define UC64LE_READBITS_NS(prefix, EC) \ - UC64LE_READBITS(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, EC) +#define UC64LE_READBITS_NS(prefix, EC) \ + UC64LE_READBITS(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, EC) -#define UC64LE_READBITS_CTX(ctx, EC) \ - UC64LE_READBITS(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC); +#define UC64LE_READBITS_CTX(ctx, EC) \ + UC64LE_READBITS(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC); -#define UC64LE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ - do { \ - cacheInt = EC::bswap(*valI++); \ - preRead = 64 - bitOffset; \ - val = 0; \ - length = 64; \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ + do { \ + cacheInt = EC::bswap(*valI++); \ + preRead = 64 - bitOffset; \ + val = 0; \ + length = 64; \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ - ns ## Compr = comprData; \ - UC64LE_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ - ns ## PreRead, ns ## CacheInt, EC); - -#define UC64LE_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ - ctx._valI = comprData; \ - UC64LE_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC); - -#define UC64LE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - unsigned int olength = \ - ::search::bitcompression::EncodeContext64LE::ffsl(val); \ - length = olength + 1; \ - val >>= length; \ - if (__builtin_expect(length == 64, false)) \ - val = 0; \ - if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ - length = 0; \ - } \ - val64 = (val & ((UINT64_C(1) << (olength + (k))) - 1)) + \ - (UINT64_C(1) << (olength + (k))) - (UINT64_C(1) << (k)); \ - val >>= olength + (k); \ - length += olength + (k); \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ + ns ## Compr = comprData; \ + UC64LE_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ + ns ## PreRead, ns ## CacheInt, EC); + +#define UC64LE_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ + ctx._valI = comprData; \ + UC64LE_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC); + +#define UC64LE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + unsigned int olength = \ + ::search::bitcompression::EncodeContext64LE::ffsl(val); \ + length = olength + 1; \ + val >>= length; \ + if (__builtin_expect(length == 64, false)) \ + val = 0; \ + if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ + length = 0; \ + } \ + val64 = (val & ((UINT64_C(1) << (olength + (k))) - 1)) + \ + (UINT64_C(1) << (olength + (k))) - (UINT64_C(1) << (k)); \ + val >>= olength + (k); \ + length += olength + (k); \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_DECODEEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64LE_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64LE_DECODEEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64LE_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64LE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ - EC) \ - do { \ - length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ - val >>= length + 1; \ - val64 = (val & ((UINT64_C(1) << (length + (k))) - 1)) + \ - (UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \ - val >>= length + (k); \ - length += length + 1 + (k); \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ + EC) \ + do { \ + length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ + val >>= length + 1; \ + val64 = (val & ((UINT64_C(1) << (length + (k))) - 1)) + \ + (UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \ + val >>= length + (k); \ + length += length + 1 + (k); \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64LE_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64LE_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64LE_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64LE_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ - do { \ - UC64LE_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, \ - k, EC); \ +#define UC64LE_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ + do { \ + UC64LE_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, \ + k, EC); \ } while (0) -#define UC64LE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt,\ - k, EC, resop) \ - do { \ - length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ - val >>= length + 1; \ - resop (val & ((UINT64_C(1) << (length + (k))) - 1)) + \ - (UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \ - val >>= length + (k); \ - length += length + 1 + (k); \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ + k, EC, resop) \ + do { \ + length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ + val >>= length + 1; \ + resop (val & ((UINT64_C(1) << (length + (k))) - 1)) + \ + (UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \ + val >>= length + (k); \ + length += length + 1 + (k); \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - unsigned int olength = \ - ::search::bitcompression::EncodeContext64LE::ffsl(val); \ - length = olength + 1; \ - val >>= length; \ - if (__builtin_expect(length == 64, false)) \ - val = 0; \ - if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ - length = 0; \ - } \ - val >>= olength + (k); \ - length += olength + (k); \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + unsigned int olength = \ + ::search::bitcompression::EncodeContext64LE::ffsl(val); \ + length = olength + 1; \ + val >>= length; \ + if (__builtin_expect(length == 64, false)) \ + val = 0; \ + if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ + length = 0; \ + } \ + val >>= olength + (k); \ + length += olength + (k); \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_SKIPEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64LE_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64LE_SKIPEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64LE_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64LE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ - EC) \ - do { \ - length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ - val >>= length + 1; \ - val >>= length + (k); \ - length += length + 1 + (k); \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ +#define UC64LE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ + EC) \ + do { \ + length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \ + val >>= length + 1; \ + val >>= length + (k); \ + length += length + 1 + (k); \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ } while (0) -#define UC64LE_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64LE_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64LE_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64LE_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64LE_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ - do { \ - if (length >= cacheFree) { \ - cacheInt |= (data << (64 - cacheFree)); \ - *bufI++ = EC::bswap(cacheInt); \ - data >>= cacheFree; \ - length -= cacheFree; \ - cacheInt = 0; \ - cacheFree = 64; \ - } \ - if (length > 0) { \ - uint64_t dataFragment = \ - (data & ::search::bitcompression::CodingTables:: \ - _intMask64[length]); \ - cacheInt |= (dataFragment << (64 - cacheFree)); \ - cacheFree -= length; \ - } \ +#define UC64LE_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ + do { \ + if (length >= cacheFree) { \ + cacheInt |= (data << (64 - cacheFree)); \ + *bufI++ = EC::bswap(cacheInt); \ + data >>= cacheFree; \ + length -= cacheFree; \ + cacheInt = 0; \ + cacheFree = 64; \ + } \ + if (length > 0) { \ + uint64_t dataFragment = \ + (data & ::search::bitcompression::CodingTables:: \ + _intMask64[length]); \ + cacheInt |= (dataFragment << (64 - cacheFree)); \ + cacheFree -= length; \ + } \ } while (0) -#define UC64LE_WRITEBITS_NS(prefix, EC) \ - do { \ - UC64LE_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ - prefix ## BufI, EC); \ +#define UC64LE_WRITEBITS_NS(prefix, EC) \ + do { \ + UC64LE_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ + prefix ## BufI, EC); \ } while (0) -#define UC64LE_WRITEBITS_CTX(ctx, EC) \ - do { \ - UC64LE_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ - ctx ## valI, EC); \ +#define UC64LE_WRITEBITS_CTX(ctx, EC) \ + do { \ + UC64LE_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ + ctx ## valI, EC); \ } while (0) -#define UC64_READBITS(val, valI, preRead, cacheInt, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ - } else { \ - UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ - } \ +#define UC64_READBITS(val, valI, preRead, cacheInt, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \ + } else { \ + UC64LE_READBITS(val, valI, preRead, cacheInt, EC); \ + } \ } while (0) -#define UC64_READBITS_NS(prefix, EC) \ - UC64_READBITS(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, EC) +#define UC64_READBITS_NS(prefix, EC) \ + UC64_READBITS(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, EC) -#define UC64_READBITS_CTX(ctx, EC) \ - UC64_READBITS(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC) +#define UC64_READBITS_CTX(ctx, EC) \ + UC64_READBITS(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC) -#define UC64_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC); \ - } else { \ - UC64LE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC); \ - } \ +#define UC64_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC); \ + } else { \ + UC64LE_SETUPBITS(bitOffset, val, valI, preRead, cacheInt, EC); \ + } \ } while (0) -#define UC64_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ - ns ## Compr = comprData; \ - UC64_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ - ns ## PreRead, ns ## CacheInt, EC); - -#define UC64_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ - ctx._valI = comprData; \ - UC64_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, EC); - -#define UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ - } else { \ - UC64LE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ - } \ +#define UC64_SETUPBITS_NS(ns, comprData, bitOffset, EC) \ + ns ## Compr = comprData; \ + UC64_SETUPBITS((bitOffset), ns ## Val, ns ## Compr, \ + ns ## PreRead, ns ## CacheInt, EC); + +#define UC64_SETUPBITS_CTX(ctx, comprData, bitOffset, EC) \ + ctx._valI = comprData; \ + UC64_SETUPBITS((bitOffset), ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, EC); + +#define UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ + } else { \ + UC64LE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ + } \ } while (0) -#define UC64_DECODEEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64_DECODEEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64_DECODEEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC);\ - } else { \ - UC64LE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC);\ - } \ +#define UC64_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ + } else { \ + UC64LE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ + } \ } while (0) -#define UC64_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64_DECODEEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64_DECODEEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ - do { \ - UC64_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ - ctx._preRead, ctx._cacheInt, \ - k, EC); \ +#define UC64_DECODEEXPGOLOMB_SMALL_CTX(ctx, k, EC) \ + do { \ + UC64_DECODEEXPGOLOMB_SMALL(ctx._val, ctx._valI, \ + ctx._preRead, ctx._cacheInt, \ + k, EC); \ } while (0) -#define UC64_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ - k, EC, resop) \ - do { \ - if (bigEndian) { \ - UC64BE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ - k, EC, resop); \ - } else { \ - UC64LE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ - k, EC, resop); \ - } \ +#define UC64_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ + k, EC, resop) \ + do { \ + if (bigEndian) { \ + UC64BE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ + k, EC, resop); \ + } else { \ + UC64LE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \ + k, EC, resop); \ + } \ } while (0) -#define UC64_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ - } else { \ - UC64LE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ - } \ +#define UC64_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ + } else { \ + UC64LE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC); \ + } \ } while (0) -#define UC64_SKIPEXPGOLOMB_NS(prefix, k, EC) \ - do { \ - UC64_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64_SKIPEXPGOLOMB_NS(prefix, k, EC) \ + do { \ + UC64_SKIPEXPGOLOMB(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ - EC) \ - do { \ - if (bigEndian) { \ - UC64BE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ - } else { \ - UC64LE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ - } \ +#define UC64_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \ + EC) \ + do { \ + if (bigEndian) { \ + UC64BE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ + } else { \ + UC64LE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, EC); \ + } \ } while (0) -#define UC64_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ - do { \ - UC64_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, prefix ## CacheInt, \ - k, EC); \ +#define UC64_SKIPEXPGOLOMB_SMALL_NS(prefix, k, EC) \ + do { \ + UC64_SKIPEXPGOLOMB_SMALL(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, prefix ## CacheInt, \ + k, EC); \ } while (0) -#define UC64_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ - do { \ - if (bigEndian) { \ - UC64BE_WRITEBITS(cacheInt, cacheFree, bufI, EC); \ - } else { \ - UC64LE_WRITEBITS(cacheInt, cacheFree, bufI, EC); \ - } \ +#define UC64_WRITEBITS(cacheInt, cacheFree, bufI, EC) \ + do { \ + if (bigEndian) { \ + UC64BE_WRITEBITS(cacheInt, cacheFree, bufI, EC); \ + } else { \ + UC64LE_WRITEBITS(cacheInt, cacheFree, bufI, EC); \ + } \ } while (0) -#define UC64_WRITEBITS_NS(prefix, EC) \ - do { \ - UC64_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ - prefix ## BufI, EC); \ +#define UC64_WRITEBITS_NS(prefix, EC) \ + do { \ + UC64_WRITEBITS(prefix ## CacheInt, prefix ## CacheFree, \ + prefix ## BufI, EC); \ } while (0) -#define UC64_WRITEBITS_CTX(ctx, EC) \ - do { \ - UC64_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ - ctx ## valI, EC); \ +#define UC64_WRITEBITS_CTX(ctx, EC) \ + do { \ + UC64_WRITEBITS(ctx ## cacheInt, ctx ## cacheFree, \ + ctx ## valI, EC); \ } while (0) -#define UC64_ENCODECONTEXT(prefix) \ - uint64_t *prefix ## BufI; \ - uint64_t prefix ## CacheInt; \ +#define UC64_ENCODECONTEXT(prefix) \ + uint64_t *prefix ## BufI; \ + uint64_t prefix ## CacheInt; \ uint32_t prefix ## CacheFree; -#define UC64_ENCODECONTEXT_CONSTRUCTOR(prefix, ctx) \ - uint64_t *prefix ## BufI = ctx ## valI; \ - uint64_t prefix ## CacheInt = ctx ## cacheInt; \ +#define UC64_ENCODECONTEXT_CONSTRUCTOR(prefix, ctx) \ + uint64_t *prefix ## BufI = ctx ## valI; \ + uint64_t prefix ## CacheInt = ctx ## cacheInt; \ uint32_t prefix ## CacheFree = ctx ## cacheFree; -#define UC64_ENCODECONTEXT_LOAD(prefix, ctx) \ - prefix ## BufI = ctx ## valI; \ - prefix ## CacheInt = ctx ## cacheInt; \ +#define UC64_ENCODECONTEXT_LOAD(prefix, ctx) \ + prefix ## BufI = ctx ## valI; \ + prefix ## CacheInt = ctx ## cacheInt; \ prefix ## CacheFree = ctx ## cacheFree; -#define UC64_ENCODECONTEXT_LOAD_PARTIAL(prefix, ctx) \ +#define UC64_ENCODECONTEXT_LOAD_PARTIAL(prefix, ctx) \ prefix ## BufI = ctx ## valI; -#define UC64_ENCODECONTEXT_STORE(prefix, ctx) \ - ctx ## valI = prefix ## BufI; \ - ctx ## cacheInt = prefix ## CacheInt; \ +#define UC64_ENCODECONTEXT_STORE(prefix, ctx) \ + ctx ## valI = prefix ## BufI; \ + ctx ## cacheInt = prefix ## CacheInt; \ ctx ## cacheFree = prefix ## CacheFree; -#define UC64_ENCODECONTEXT_STORE_PARTIAL(prefix, ctx) \ +#define UC64_ENCODECONTEXT_STORE_PARTIAL(prefix, ctx) \ ctx ## valI = prefix ## BufI; diff --git a/searchlib/src/vespa/searchlib/bitcompression/countcompression.h b/searchlib/src/vespa/searchlib/bitcompression/countcompression.h index 9601b1e1566..4a514e58e2a 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/countcompression.h +++ b/searchlib/src/vespa/searchlib/bitcompression/countcompression.h @@ -17,11 +17,11 @@ class PostingListCountFileDecodeContext : public FeatureDecodeContext<true> public: typedef FeatureDecodeContext<true> ParentClass; typedef index::PostingListCounts PostingListCounts; - uint32_t _avgBitsPerDoc; // Average number of bits per document - uint32_t _minChunkDocs; // Minimum number of documents for chunking - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) - uint64_t _numWordIds; // Number of words in dictionary - uint64_t _minWordNum; // Minimum word number + uint32_t _avgBitsPerDoc; // Average number of bits per document + uint32_t _minChunkDocs; // Minimum number of documents for chunking + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + uint64_t _numWordIds; // Number of words in dictionary + uint64_t _minWordNum; // Minimum word number PostingListCountFileDecodeContext() : ParentClass(), @@ -51,11 +51,11 @@ class PostingListCountFileEncodeContext : public FeatureEncodeContext<true> public: typedef FeatureEncodeContext<true> ParentClass; typedef index::PostingListCounts PostingListCounts; - uint32_t _avgBitsPerDoc; // Average number of bits per document - uint32_t _minChunkDocs; // Minimum number of documents for chunking - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) - uint64_t _numWordIds; // Number of words in dictionary - uint64_t _minWordNum; // Mininum word number + uint32_t _avgBitsPerDoc; // Average number of bits per document + uint32_t _minChunkDocs; // Minimum number of documents for chunking + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + uint64_t _numWordIds; // Number of words in dictionary + uint64_t _minWordNum; // Mininum word number PostingListCountFileEncodeContext() : ParentClass(), diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp index 7d3387c3399..b3cba84d575 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp @@ -270,7 +270,7 @@ PageDict4SSWriter::addL6Skip(const vespalib::stringref &word, startOffset[0]._fileOffset, _eL6.getWriteOffset()); #endif - _eL6.writeBits(0, 1); // Selector bit + _eL6.writeBits(0, 1); // Selector bit writeStartOffset(_eL6, startOffset, _l6StartOffset, @@ -331,7 +331,7 @@ addOverflowCounts(const vespalib::stringref &word, txtStartOffset.str().c_str(), txtL6StartOffset.str().c_str()); #endif - _eL6.writeBits(1, 1); // Selector bit + _eL6.writeBits(1, 1); // Selector bit writeStartOffset(_eL6, startOffset, _l6StartOffset, @@ -986,8 +986,8 @@ addCounts(const vespalib::stringref &word, (int) _headerSize); #endif if (_l1StrideCheck == 0u) { - _l1Size = _prevL1Size; // Undo L1 - _l2Size = _prevL2Size; // Undo L2 + _l1Size = _prevL1Size; // Undo L1 + _l2Size = _prevL2Size; // Undo L2 } if (_countsEntries > 0) { flushPage(); @@ -1054,7 +1054,7 @@ PageDict4PWriter::addOverflowCounts(const vespalib::stringref &word, e.writeBits(0, 12); e.smallAlign(64); e.writeComprBufferIfNeeded(); - e.writeBits(_wordNum, 64); // Identifies overflow for later read + e.writeBits(_wordNum, 64); // Identifies overflow for later read #if 0 LOG(info, "AddOverflowCounts wordnum %d", (int) _wordNum); @@ -1075,8 +1075,8 @@ PageDict4PWriter::addOverflowCounts(const vespalib::stringref &word, void PageDict4PWriter::addL1Skip(size_t &lcp) { - _prevL1Size = _l1Size; // Prepare for undo - _prevL2Size = _l2Size; // Prepare for undo + _prevL1Size = _l1Size; // Prepare for undo + _prevL2Size = _l2Size; // Prepare for undo size_t tlcp = getLCP(_pendingCountsWord, _l1Word); assert(tlcp <= lcp); if (tlcp < lcp) @@ -1284,7 +1284,7 @@ PageDict4SSReader::setup(DC &ssd) uint64_t pageNum = _pFirstPageNum; uint32_t sparsePageNum = _spFirstPageNum; uint32_t l7StrideCheck = 0; - uint32_t l7Ref = noL7Ref(); // Last L6 entry not after this L7 entry + uint32_t l7Ref = noL7Ref(); // Last L6 entry not after this L7 entry uint64_t l6Offset = dL6.getReadOffset(); uint64_t l6WordNum = 1; @@ -1317,7 +1317,7 @@ PageDict4SSReader::setup(DC &ssd) (l7StrideCheck > 0 && (overflow || forceL7Entry))) { // Don't update l7Ref if this L7 entry points to an overflow entry if (!forceL7Entry) - l7Ref = _l7.size(); // Self-ref if referencing L6 entry + l7Ref = _l7.size(); // Self-ref if referencing L6 entry _l7.push_back(L7Entry(word, startOffset, l6WordNum, l6Offset, sparsePageNum, pageNum, l7Ref)); l7StrideCheck = 0; @@ -1381,7 +1381,7 @@ PageDict4SSReader::setup(DC &ssd) } if (l7StrideCheck > 0) { if (!forceL7Entry) - l7Ref = _l7.size(); // Self-ref if referencing L6 entry + l7Ref = _l7.size(); // Self-ref if referencing L6 entry _l7.push_back(L7Entry(word, startOffset, l6WordNum, l6Offset, sparsePageNum, pageNum, l7Ref)); } @@ -1413,9 +1413,9 @@ lookup(const vespalib::stringref &key) uint64_t l6WordNum = 1; uint64_t wordNum = l6WordNum; - vespalib::string l6Word; // Last L6 entry word + vespalib::string l6Word; // Last L6 entry word vespalib::string word; - StartOffset l6StartOffset; // Last L6 entry file offset + StartOffset l6StartOffset; // Last L6 entry file offset // Setup for decoding of L6+overflow stream if (l7Pos > 0) { @@ -1504,16 +1504,16 @@ lookup(const vespalib::stringref &key) res._overflow = true; res._counts = counts; res._startOffset = startOffset; - l6WordNum = wordNum - 1; // overloaded meaning + l6WordNum = wordNum - 1; // overloaded meaning } - break; // key < counts + break; // key < counts } LOG(error, "FATAL: Missing L7 entry for overflow entry"); - abort(); // counts < key, should not happen (missing L7 entry) + abort(); // counts < key, should not happen (missing L7 entry) } else { bool l6NotLessThanKey = !(word < key); if (l6NotLessThanKey) - break; // key <= counts + break; // key <= counts UC64_DECODECONTEXT_LOAD(o, dL6._); UC64_DECODEEXPGOLOMB_NS(o, K_VALUE_COUNTFILE_L6_PAGENUM, @@ -1530,7 +1530,7 @@ lookup(const vespalib::stringref &key) assert(l6Offset <= _ssFileBitLen); res._l6Word = l6Word; if (l6Offset >= _ssFileBitLen) - res._lastWord.clear(); // Mark that word is beyond end of dictionary + res._lastWord.clear(); // Mark that word is beyond end of dictionary else res._lastWord = word; res._l6StartOffset = l6StartOffset; @@ -1718,9 +1718,9 @@ lookup(const SSReader &ssReader, { // const uint64_t *p = static_cast<const uint64_t *>(sparsePage); - DC dL3; // L3 stream - DC dL4; // L4 stream - DC dL5; // L5 stream + DC dL3; // L3 stream + DC dL4; // L4 stream + DC dL5; // L5 stream dL3.copyParams(ssReader.getSSD()); dL4.copyParams(ssReader.getSSD()); @@ -1913,9 +1913,9 @@ lookup(const SSReader &ssReader, const StartOffset &l3StartOffset, uint64_t l3WordNum) { - DC dCounts; // counts stream (sparse counts) - DC dL1; // L1 stream - DC dL2; // L2 stream + DC dCounts; // counts stream (sparse counts) + DC dL1; // L1 stream + DC dL2; // L2 stream dCounts.copyParams(ssReader.getSSD()); dL1.copyParams(ssReader.getSSD()); diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h index aca4f5c8460..2a4cd143cfa 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h +++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.h @@ -123,11 +123,11 @@ class PageDict4SSWriter : public PageDict4PageParams typedef EC SSEC; private: - EC &_eL6; // L6 stream - vespalib::string _l6Word; // L6 word - StartOffset _l6StartOffset; // file offsets + accnum - uint64_t _l6PageNum; // Page number for last L6 entry - uint32_t _l6SparsePageNum; // Sparse page number for last L6 entry + EC &_eL6; // L6 stream + vespalib::string _l6Word; // L6 word + StartOffset _l6StartOffset; // file offsets + accnum + uint64_t _l6PageNum; // Page number for last L6 entry + uint32_t _l6SparsePageNum; // Sparse page number for last L6 entry uint64_t _l6WordNum; public: @@ -194,19 +194,19 @@ class PageDict4SPWriter : public PageDict4PageParams typedef PageDict4SSWriter SSWriter; private: - EC _eL3; // L3 stream + EC _eL3; // L3 stream ComprFileWriteContext _wcL3;// L3 buffer - EC _eL4; // L4 stream + EC _eL4; // L4 stream ComprFileWriteContext _wcL4;// L4 buffer - EC _eL5; // L5 stream + EC _eL5; // L5 stream ComprFileWriteContext _wcL5;// L5 buffer - vespalib::string _l3Word; // last L3 word written - vespalib::string _l4Word; // last L4 word written - vespalib::string _l5Word; // last L5 word written - vespalib::string _l6Word; // word before this sparse page - uint32_t _l3WordOffset; // Offset for next L3 word to write - uint32_t _l4WordOffset; // Offset for last L4 word written - uint32_t _l5WordOffset; // Offset for last L5 word written + vespalib::string _l3Word; // last L3 word written + vespalib::string _l4Word; // last L4 word written + vespalib::string _l5Word; // last L5 word written + vespalib::string _l6Word; // word before this sparse page + uint32_t _l3WordOffset; // Offset for next L3 word to write + uint32_t _l4WordOffset; // Offset for last L4 word written + uint32_t _l5WordOffset; // Offset for last L5 word written // file offsets StartOffset _l3StartOffset; @@ -220,31 +220,31 @@ private: // Offsets in data files for last L6 entry StartOffset _l6StartOffset; - uint64_t _l3WordNum; // word number next L3 entry to write - uint64_t _l4WordNum; // word number last L4 entry - uint64_t _l5WordNum; // word number last L5 entry - uint64_t _l6WordNum; // word number last L6 entry + uint64_t _l3WordNum; // word number next L3 entry to write + uint64_t _l4WordNum; // word number last L4 entry + uint64_t _l5WordNum; // word number last L5 entry + uint64_t _l6WordNum; // word number last L6 entry - uint32_t _curL3OffsetL4; // Offset in L3 for last L4 entry - uint32_t _curL3OffsetL5; // Offset in L3 for last L5 entry - uint32_t _curL4OffsetL5; // Offset in L4 for last L5 entry + uint32_t _curL3OffsetL4; // Offset in L3 for last L4 entry + uint32_t _curL3OffsetL5; // Offset in L3 for last L5 entry + uint32_t _curL4OffsetL5; // Offset in L4 for last L5 entry - uint32_t _headerSize; // Size of page header + uint32_t _headerSize; // Size of page header - uint32_t _l3Entries; // Number of L3 entries on page - uint32_t _l4StrideCheck; // L3 entries since last L4 entry - uint32_t _l5StrideCheck; // L4 entries since last L5 entry + uint32_t _l3Entries; // Number of L3 entries on page + uint32_t _l4StrideCheck; // L3 entries since last L4 entry + uint32_t _l5StrideCheck; // L4 entries since last L5 entry - uint32_t _l3Size; // Size of L3 entries - uint32_t _l4Size; // Size of L4 entries - uint32_t _l5Size; // Size of L5 entries - uint32_t _prevL3Size; // Previous size of L3 entries - uint32_t _prevL4Size; // Previous size of L4 entries - uint32_t _prevL5Size; // Previous size of L5 entries - uint32_t _prevWordsSize; // previous size of words + uint32_t _l3Size; // Size of L3 entries + uint32_t _l4Size; // Size of L4 entries + uint32_t _l5Size; // Size of L5 entries + uint32_t _prevL3Size; // Previous size of L3 entries + uint32_t _prevL4Size; // Previous size of L4 entries + uint32_t _prevL5Size; // Previous size of L5 entries + uint32_t _prevWordsSize; // previous size of words uint32_t _sparsePageNum; - uint32_t _l3PageNum; // Page number for last L3 entry - std::vector<char> _words; // Word buffer + uint32_t _l3PageNum; // Page number for last L3 entry + std::vector<char> _words; // Word buffer // Sparse sparse entries and counts that don't fit in a page SSWriter &_ssWriter; @@ -348,20 +348,20 @@ public: typedef PostingListCountFileEncodeContext EC; private: - EC _eCounts; // counts stream (sparse counts) + EC _eCounts; // counts stream (sparse counts) ComprFileWriteContext _wcCounts;// counts buffer - EC _eL1; // L1 stream + EC _eL1; // L1 stream ComprFileWriteContext _wcL1;// L1 buffer - EC _eL2; // L2 stream + EC _eL2; // L2 stream ComprFileWriteContext _wcL2;// L2 buffer - vespalib::string _countsWord; // last counts on page - vespalib::string _l1Word; // Last L1 word written - vespalib::string _l2Word; // Last L2 word written - vespalib::string _l3Word; // word before this page + vespalib::string _countsWord; // last counts on page + vespalib::string _l1Word; // Last L1 word written + vespalib::string _l2Word; // Last L2 word written + vespalib::string _l3Word; // word before this page vespalib::string _pendingCountsWord; // pending counts word (counts written) - uint32_t _countsWordOffset; // Offset for next counts word to write - uint32_t _l1WordOffset; // Offset of last L1 word written - uint32_t _l2WordOffset; // Offset of last L2 word written + uint32_t _countsWordOffset; // Offset for next counts word to write + uint32_t _l1WordOffset; // Offset of last L1 word written + uint32_t _l2WordOffset; // Offset of last L2 word written // file offsets StartOffset _countsStartOffset; @@ -375,25 +375,25 @@ private: // Offsets in data files for last L3 entry StartOffset _l3StartOffset; - uint32_t _curCountOffsetL1; // Offset in eCounts for last L1 entry + uint32_t _curCountOffsetL1; // Offset in eCounts for last L1 entry uint32_t _curCountOffsetL2; // Offset in eCounts for last L2 entry - uint32_t _curL1OffsetL2; // Offset in eL1 for last L2 entry - - uint32_t _headerSize; // Size of page header - - uint32_t _countsEntries; // Number of count entries on page - uint32_t _l1StrideCheck; // Count entries since last L1 entry - uint32_t _l2StrideCheck; // L1 entries since last L2 entry - - uint32_t _countsSize; // Size of counts - uint32_t _l1Size; // Size of L1 entries - uint32_t _l2Size; // Size of L2 entries - uint32_t _prevL1Size; // Previous size of L1 entries - uint32_t _prevL2Size; // Previous size of L2 entries - uint64_t _pageNum; // Page number. - uint64_t _l3WordNum; // last L3 word num written - uint64_t _wordNum; // current word number - std::vector<char> _words; // Word buffer + uint32_t _curL1OffsetL2; // Offset in eL1 for last L2 entry + + uint32_t _headerSize; // Size of page header + + uint32_t _countsEntries; // Number of count entries on page + uint32_t _l1StrideCheck; // Count entries since last L1 entry + uint32_t _l2StrideCheck; // L1 entries since last L2 entry + + uint32_t _countsSize; // Size of counts + uint32_t _l1Size; // Size of L1 entries + uint32_t _l2Size; // Size of L2 entries + uint32_t _prevL1Size; // Previous size of L1 entries + uint32_t _prevL2Size; // Previous size of L2 entries + uint64_t _pageNum; // Page number. + uint64_t _l3WordNum; // last L3 word num written + uint64_t _wordNum; // current word number + std::vector<char> _words; // Word buffer SPWriter &_spWriter; // Encode context where paged counts go EC &_pe; @@ -462,14 +462,14 @@ public: using Counts = index::PostingListCounts; typedef PageDict4StartOffset StartOffset; - vespalib::string _l6Word; // last L6 word before key - vespalib::string _lastWord; // L6 or overflow word >= key - StartOffset _l6StartOffset; // File offsets - Counts _counts; // Counts valid if overflow + vespalib::string _l6Word; // last L6 word before key + vespalib::string _lastWord; // L6 or overflow word >= key + StartOffset _l6StartOffset; // File offsets + Counts _counts; // Counts valid if overflow uint64_t _pageNum; uint64_t _sparsePageNum; - uint64_t _l6WordNum; // wordnum if overflow - StartOffset _startOffset; // valid if overflow + uint64_t _l6WordNum; // wordnum if overflow + StartOffset _startOffset; // valid if overflow bool _res; bool _overflow; @@ -494,12 +494,12 @@ public: { public: vespalib::string _l7Word; - StartOffset _l7StartOffset; // Offsets in data files + StartOffset _l7StartOffset; // Offsets in data files uint64_t _l7WordNum; - uint64_t _l6Offset; // Offset in L6+overflow stream + uint64_t _l6Offset; // Offset in L6+overflow stream uint32_t _sparsePageNum;// page number for sparse file - uint64_t _pageNum; // page number in full file - uint32_t _l7Ref; // L7 entry before overflow, or self-ref if L6 + uint64_t _pageNum; // page number in full file + uint32_t _l7Ref; // L7 entry before overflow, or self-ref if L6 L7Entry() : _l7Word(), @@ -546,7 +546,7 @@ public: { public: uint64_t _wordNum; - uint32_t _l7Ref; // overflow entry in L7 table + uint32_t _l7Ref; // overflow entry in L7 table OverflowRef() : _wordNum(0), @@ -574,13 +574,13 @@ public: }; ComprBuffer _cb; - uint64_t _ssFileBitLen; // File size in bits - uint32_t _ssStartOffset; // Header size in bits + uint64_t _ssFileBitLen; // File size in bits + uint32_t _ssStartOffset; // Header size in bits typedef std::vector<L7Entry> L7Vector; L7Vector _l7;// Uncompressed skip list for sparse sparse file - DC _ssd; // used to store compression parameters + DC _ssd; // used to store compression parameters uint64_t _spFileBitLen; uint64_t _pFileBitLen; uint32_t _spStartOffset; @@ -634,7 +634,7 @@ class PageDict4SPLookupRes : public PageDict4PageParams public: vespalib::string _l3Word; - vespalib::string _lastWord; // L3 word >= key + vespalib::string _lastWord; // L3 word >= key StartOffset _l3StartOffset; uint64_t _pageNum; uint64_t _l3WordNum; diff --git a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp index c48e2e364ec..bb8921e8fae 100644 --- a/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp +++ b/searchlib/src/vespa/searchlib/bitcompression/posocccompression.cpp @@ -32,8 +32,8 @@ vespalib::string PosOccIdCooked = "PosOcc.3.Cooked"; namespace { -vespalib::string EG64PosOccId = "EG64PosOcc.3"; // Dynamic k values -vespalib::string EG64PosOccId2 = "EG64PosOcc.2"; // Fixed k values +vespalib::string EG64PosOccId = "EG64PosOcc.3"; // Dynamic k values +vespalib::string EG64PosOccId2 = "EG64PosOcc.2"; // Fixed k values } diff --git a/searchlib/src/vespa/searchlib/btree/btreebuilder.hpp b/searchlib/src/vespa/searchlib/btree/btreebuilder.hpp index c21b31e2f4b..0816f80826c 100644 --- a/searchlib/src/vespa/searchlib/btree/btreebuilder.hpp +++ b/searchlib/src/vespa/searchlib/btree/btreebuilder.hpp @@ -82,7 +82,7 @@ void BTreeBuilder<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, AggrCalcT>:: normalize() { - std::vector<NodeRef> leftInodes; // left to rightmost nodes in tree + std::vector<NodeRef> leftInodes; // left to rightmost nodes in tree LeafNodeType *leftLeaf; NodeRef child; unsigned int level; diff --git a/searchlib/src/vespa/searchlib/btree/btreeiterator.h b/searchlib/src/vespa/searchlib/btree/btreeiterator.h index fcf1ee030d2..3955a4de27c 100644 --- a/searchlib/src/vespa/searchlib/btree/btreeiterator.h +++ b/searchlib/src/vespa/searchlib/btree/btreeiterator.h @@ -216,11 +216,11 @@ protected: * parent of the leaf node) */ PathElement _path[PATH_SIZE]; - size_t _pathSize; + size_t _pathSize; const NodeAllocatorType *_allocator; - const LeafNodeType *_leafRoot; // Root node for small tree/array + const LeafNodeType *_leafRoot; // Root node for small tree/array // Temporary leaf node when iterating over short arrays std::unique_ptr<LeafNodeTempType> _compatLeafNode; diff --git a/searchlib/src/vespa/searchlib/btree/btreestore.hpp b/searchlib/src/vespa/searchlib/btree/btreestore.hpp index d734aa1340f..f97a647287f 100644 --- a/searchlib/src/vespa/searchlib/btree/btreestore.hpp +++ b/searchlib/src/vespa/searchlib/btree/btreestore.hpp @@ -63,7 +63,7 @@ template <typename KeyT, typename DataT, typename AggrT, typename CompareT, BTreeStore<KeyT, DataT, AggrT, CompareT,TraitsT, AggrCalcT>::~BTreeStore() { _builder.clear(); - _store.dropBuffers(); // Drop buffers before type handlers are dropped + _store.dropBuffers(); // Drop buffers before type handlers are dropped } @@ -238,7 +238,7 @@ insert(EntryRef &ref, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi < olde && !comp(key, oldi->_key)) - retVal = false; // key already present + retVal = false; // key already present } } KeyDataType addition(key, data); @@ -265,7 +265,7 @@ insert(EntryRef &ref, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi < olde && !comp(key, oldi->_key)) - return false; // key already present + return false; // key already present if (clusterSize < clusterLimit) { // Grow array KeyDataTypeRefPair kPair(allocKeyData(clusterSize + 1)); @@ -332,7 +332,7 @@ remove(EntryRef &ref, #ifdef FORCE_APPLY bool retVal = true; if (!ref.valid()) - retVal = false; // not found + retVal = false; // not found else { RefType iRef(ref); uint32_t clusterSize = getClusterSize(iRef); @@ -346,7 +346,7 @@ remove(EntryRef &ref, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi == olde || comp(key, oldi->_key)) - retVal = false; // not found + retVal = false; // not found } } std::vector<KeyDataType> additions; @@ -359,7 +359,7 @@ remove(EntryRef &ref, return retVal; #else if (!ref.valid()) - return false; // not found + return false; // not found RefType iRef(ref); uint32_t clusterSize = getClusterSize(iRef); if (clusterSize != 0) { @@ -367,7 +367,7 @@ remove(EntryRef &ref, const KeyDataType *olde = old + clusterSize; const KeyDataType *oldi = lower_bound(old, olde, key, comp); if (oldi == olde || comp(key, oldi->_key)) - return false; // not found + return false; // not found if (clusterSize == 1) { _store.holdElem(ref, 1); ref = EntryRef(); @@ -393,7 +393,7 @@ remove(EntryRef &ref, } BTreeType *tree = getWTreeEntry(iRef); if (!tree->remove(key, _allocator, comp, _aggrCalc)) - return false; // not found + return false; // not found EntryRef root = tree->getRoot(); assert(NodeAllocatorType::isValidRef(root)); if (!_allocator.isLeafRef(root)) @@ -766,7 +766,7 @@ normalizeTree(EntryRef &ref, assert(treeSize > 0); if (treeSize > clusterLimit) return; - assert(!wasArray); // Should never have used tree + assert(!wasArray); // Should never have used tree (void) wasArray; // Convert from tree to short array makeArray(ref, root, lNode); diff --git a/searchlib/src/vespa/searchlib/common/bitvector.cpp b/searchlib/src/vespa/searchlib/common/bitvector.cpp index 36ff325eb3e..9f78f6ff222 100644 --- a/searchlib/src/vespa/searchlib/common/bitvector.cpp +++ b/searchlib/src/vespa/searchlib/common/bitvector.cpp @@ -43,7 +43,7 @@ BitVector::allocatePaddedAndAligned(Index start, Index end, Index capacity) { assert(capacity >= end); uint32_t words = numActiveWords(start, capacity); - words += (-words & 15); // Pad to 64 byte alignment + words += (-words & 15); // Pad to 64 byte alignment const size_t sz(words * sizeof(Word)); Alloc alloc = Alloc::alloc(sz); assert(alloc.size()/sizeof(Word) >= words); diff --git a/searchlib/src/vespa/searchlib/common/location.h b/searchlib/src/vespa/searchlib/common/location.h index 92ccd9ea25a..4cdb5a81a1a 100644 --- a/searchlib/src/vespa/searchlib/common/location.h +++ b/searchlib/src/vespa/searchlib/common/location.h @@ -37,14 +37,14 @@ public: private: vespalib::geo::ZCurve::BoundingBox _zBoundingBox; - int32_t _x; /* Query X position */ - int32_t _y; /* Query Y position */ - uint32_t _xAspect; /* X distance multiplier fraction */ - uint32_t _radius; /* Radius for euclidian distance */ - int32_t _minx; /* Min X coordinate */ - int32_t _maxx; /* Max X coordinate */ - int32_t _miny; /* Min Y coordinate */ - int32_t _maxy; /* Max Y coordinate */ + int32_t _x; /* Query X position */ + int32_t _y; /* Query Y position */ + uint32_t _xAspect; /* X distance multiplier fraction */ + uint32_t _radius; /* Radius for euclidian distance */ + int32_t _minx; /* Min X coordinate */ + int32_t _maxx; /* Max X coordinate */ + int32_t _miny; /* Min Y coordinate */ + int32_t _maxy; /* Max Y coordinate */ bool _rankOnDistance; bool _pruneOnDistance; diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp index a0b64e2ef94..281d0c1541e 100644 --- a/searchlib/src/vespa/searchlib/common/packets.cpp +++ b/searchlib/src/vespa/searchlib/common/packets.cpp @@ -695,7 +695,7 @@ FS4Packet_MONITORQUERYX::Decode(FNET_DataBuffer *src, uint32_t len) return true; error: src->DataToDead(len); - return false; // FAIL + return false; // FAIL } @@ -808,10 +808,10 @@ FS4Packet_MONITORRESULTX::Decode(FNET_DataBuffer *src, uint32_t len) if (len != 0) goto error; - return true; // OK + return true; // OK error: src->DataToDead(len); - return false; // FAIL + return false; // FAIL } diff --git a/searchlib/src/vespa/searchlib/common/transport.h b/searchlib/src/vespa/searchlib/common/transport.h index 58b7b42c595..454c8404163 100644 --- a/searchlib/src/vespa/searchlib/common/transport.h +++ b/searchlib/src/vespa/searchlib/common/transport.h @@ -111,7 +111,7 @@ enum getdocsums_flags { const uint32_t SLIME_MAGIC_ID = 0x55555555; enum monitorquery_features { - MQF_QFLAGS = 0x00000002, + MQF_QFLAGS = 0x00000002, }; enum monitorquery_flags { @@ -119,33 +119,33 @@ enum monitorquery_flags { }; enum monitorresult_features { - MRF_MLD = 0x00000001, - MRF_RFLAGS = 0x00000008, - MRF_ACTIVEDOCS = 0x00000010, + MRF_MLD = 0x00000001, + MRF_RFLAGS = 0x00000008, + MRF_ACTIVEDOCS = 0x00000010, }; /** * Codes for packets between dispatch nodes and search nodes. * general packet (i.e. message) format: * uint32_t packetLength- length in bytes, EXCLUDING this length field - * packetcode pCode - see the enum below; same length as uint32_t - * packetData - variable length + * packetcode pCode - see the enum below; same length as uint32_t + * packetData - variable length */ enum packetcode { - PCODE_EOL = 200, /* ..fdispatch <-> ..fsearch. PacketData: - *0 {uint32_t queryId,} - only in new format!*/ + PCODE_EOL = 200, /* ..fdispatch <-> ..fsearch. PacketData: + *0 {uint32_t queryId,} - only in new format!*/ PCODE_QUERY_NOTUSED = 201, PCODE_QUERYRESULT_NOTUSED = 202, PCODE_ERROR = 203, /* ..fdispatch <- ..fsearch/..fdispatch - * {uint32_t queryId,} - only in new format! + * {uint32_t queryId,} - only in new format! * uint32_t error_code [see common/errorcodes.h] * uint32_t message_len * char[] message (UTF-8) */ PCODE_GETDOCSUMS_NOTUSED = 204, - PCODE_DOCSUM = 205, /* ..fdispatch <- ..fsearch. - *0 {uint32_t queryId,} - only in new format! - *1 uint32_t location - *2 char[] <title, incipit, URL, ...> + PCODE_DOCSUM = 205, /* ..fdispatch <- ..fsearch. + *0 {uint32_t queryId,} - only in new format! + *1 uint32_t location + *2 char[] <title, incipit, URL, ...> */ PCODE_MONITORQUERY_NOTUSED = 206, PCODE_MONITORRESULT_NOTUSED = 207, @@ -159,14 +159,14 @@ enum packetcode { PCODE_MLD_GETDOCSUMS2_NOTUSED = 215, PCODE_QUEUELEN_NOTUSED = 216, - PCODE_QUERYRESULTX = 217, /* - * {uint32_t queryId,} - only if persistent + PCODE_QUERYRESULTX = 217, /* + * {uint32_t queryId,} - only if persistent * uint32_t featureflags, - see 'queryresult_features' - * uint32_t offset, - * uint32_t numDocs, - * uint32_t totNumDocs, - * search::HitRank maxRank, - * uint32_t docstamp, + * uint32_t offset, + * uint32_t numDocs, + * uint32_t totNumDocs, + * search::HitRank maxRank, + * uint32_t docstamp, * uint32_t[numDocs] sortIndex - if QRF_SORTDATA * char[sidx[n - 1]] sortData - if QRF_SORTDATA * uint32_t groupDataLen - if QRF_GROUPDATA @@ -174,19 +174,19 @@ enum packetcode { * uint64_t coverageDocs - if QRF_COVERAGE * uint32_t coverageNodes - if QRF_COVERAGE * uint32_t coverageFull - if QRF_COVERAGE - * numDocs * hit { - * uint32_t docid, - * search::HitRank metric, + * numDocs * hit { + * uint32_t docid, + * search::HitRank metric, * uint32_t partid, - if QRF_MLD * uint32_t docstamp, - if QRF_MLD - * } */ - PCODE_QUERYX = 218, /* - * {uint32_t queryId,} - only if persistent + * } */ + PCODE_QUERYX = 218, /* + * {uint32_t queryId,} - only if persistent * uint32_t featureflags, - see 'query_features' - * uint32_t querytype - * uint32_t offset, - * uint32_t maxhits, - * uint32_t qflags, + * uint32_t querytype + * uint32_t offset, + * uint32_t maxhits, + * uint32_t qflags, * uint32_t minhits, - if QF_MINHITS * uint32_t numProperties - if QF_PROPERTIES * numProperties * props { - if QF_PROPERTIES @@ -207,7 +207,7 @@ enum packetcode { * uint32_t locationLen - if QF_LOCATION * char[locationLen] location - if QF_LOCATION * uint32_t numStackItems, - if QF_PARSEDQUERY - * multiple encoded stackitems: - if QF_PARSEDQUERY + * multiple encoded stackitems: - if QF_PARSEDQUERY - uint32_t OR|AND|NOT|RANK uint32_t arity - uint32_t PHRASE @@ -220,10 +220,10 @@ enum packetcode { uint32_t termLen char[] term */ - PCODE_GETDOCSUMSX = 219, /* - * {uint32_t queryId,} - only if persistent + PCODE_GETDOCSUMSX = 219, /* + * {uint32_t queryId,} - only if persistent * uint32_t featureflags, - see 'getdocsums_features' - * uint32_t docstamp, + * uint32_t docstamp, * uint32_t rankprofile, - if GDF_RANKP_QFLAGS * uint32_t qflags, - if GDF_RANKP_QFLAGS * uint32_t resClassNameLen - if GDF_RESCLASSNAME @@ -240,30 +240,30 @@ enum packetcode { * char[valueLen] value * } * } - * uint32_t stackItems, - if GDF_STACKDUMP - * uint32_t stackDumpLen, - if GDF_STACKDUMP - * char[stackDumpLen] stackDump, - if GDF_STACKDUMP + * uint32_t stackItems, - if GDF_STACKDUMP + * uint32_t stackDumpLen, - if GDF_STACKDUMP + * char[stackDumpLen] stackDump, - if GDF_STACKDUMP * uint32_t locationLen - if GDF_LOCATION * char[locationLen] location - if GDF_LOCATION - * N * doc { - * uint32_t docid, - * uint32_t partid, - if GDF_MLD - * uint32_t docstamp, - if GDF_MLD + * N * doc { + * uint32_t docid, + * uint32_t partid, - if GDF_MLD + * uint32_t docstamp, - if GDF_MLD * } */ PCODE_MONITORQUERYX = 220, /* - * uint32_t featureFlags; - * - see monitorquery_features + * uint32_t featureFlags; + * - see monitorquery_features */ PCODE_MONITORRESULTX = 221, /* - * uint32_t featureFlags; - * - see monitorresult_features - * uint32_t partitionId; - * uint32_t timestamp; - * uint32_t totalNodes; - if MRF_MLD - * uint32_t activeNodes; - if MRF_MLD - * uint32_t totalParts; - if MRF_MLD - * uint32_t activeParts; - if MRF_MLD + * uint32_t featureFlags; + * - see monitorresult_features + * uint32_t partitionId; + * uint32_t timestamp; + * uint32_t totalNodes; - if MRF_MLD + * uint32_t activeNodes; - if MRF_MLD + * uint32_t totalParts; - if MRF_MLD + * uint32_t activeParts; - if MRF_MLD */ PCODE_TRACEREPLY = 222, /* * numProperties * props { @@ -278,7 +278,7 @@ enum packetcode { * } * } */ - PCODE_LastCode = 223 // Used for consistency checking only, must be last. + PCODE_LastCode = 223 // Used for consistency checking only, must be last. }; } diff --git a/searchlib/src/vespa/searchlib/datastore/buffer_type.h b/searchlib/src/vespa/searchlib/datastore/buffer_type.h index 6fc5c4ab288..2b7ae4f0597 100644 --- a/searchlib/src/vespa/searchlib/datastore/buffer_type.h +++ b/searchlib/src/vespa/searchlib/datastore/buffer_type.h @@ -14,16 +14,16 @@ namespace search::datastore { class BufferTypeBase { protected: - uint32_t _clusterSize; // Number of elements in an allocation unit - uint32_t _minClusters; // Minimum number of clusters to allocate - uint32_t _maxClusters; // Maximum number of clusters to allocate + uint32_t _clusterSize; // Number of elements in an allocation unit + uint32_t _minClusters; // Minimum number of clusters to allocate + uint32_t _maxClusters; // Maximum number of clusters to allocate // Number of clusters needed before allocating a new buffer // instead of just resizing the first one uint32_t _numClustersForNewBuffer; uint32_t _activeBuffers; uint32_t _holdBuffers; - size_t _activeUsedElems; // used elements in all but last active buffer - size_t _holdUsedElems; // used elements in all held buffers + size_t _activeUsedElems; // used elements in all but last active buffer + size_t _holdUsedElems; // used elements in all held buffers const size_t *_lastUsedElems; // used elements in last active buffer public: diff --git a/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp b/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp index cf6c59b69c4..c2e7c9358e0 100644 --- a/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp +++ b/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp @@ -9,7 +9,7 @@ namespace search::datastore { BufferState::FreeListList::~FreeListList() { - assert(_head == NULL); // Owner should have disabled free lists + assert(_head == NULL); // Owner should have disabled free lists } diff --git a/searchlib/src/vespa/searchlib/datastore/bufferstate.h b/searchlib/src/vespa/searchlib/datastore/bufferstate.h index 904a5bbb16a..5f579c43751 100644 --- a/searchlib/src/vespa/searchlib/datastore/bufferstate.h +++ b/searchlib/src/vespa/searchlib/datastore/bufferstate.h @@ -49,7 +49,7 @@ private: // For simple types this is 0. size_t _extraHoldBytes; FreeList _freeList; - FreeListList *_freeListList; // non-NULL if free lists are enabled + FreeListList *_freeListList; // non-NULL if free lists are enabled // NULL pointers if not on circular list of buffer states with free elems BufferState *_nextHasFree; @@ -73,11 +73,11 @@ public: /** * Transition from FREE to ACTIVE state. * - * @param bufferId Id of buffer to be active. - * @param typeId registered data type for buffer. - * @param typeHandler type handler for registered data type. - * @param sizeNeeded Number of elements needed to be free - * @param buffer start of buffer. + * @param bufferId Id of buffer to be active. + * @param typeId registered data type for buffer. + * @param typeHandler type handler for registered data type. + * @param sizeNeeded Number of elements needed to be free + * @param buffer start of buffer. */ void onActive(uint32_t bufferId, uint32_t typeId, BufferTypeBase *typeHandler, size_t sizeNeeded, void *&buffer); @@ -95,8 +95,8 @@ public: /** * Set list of buffer states with nonempty free lists. * - * @param freeListList List of buffer states. If NULL then free lists - * are disabled. + * @param freeListList List of buffer states. If NULL then free lists + * are disabled. */ void setFreeListList(FreeListList *freeListList); diff --git a/searchlib/src/vespa/searchlib/datastore/datastore.h b/searchlib/src/vespa/searchlib/datastore/datastore.h index 26826ea0408..926503e5816 100644 --- a/searchlib/src/vespa/searchlib/datastore/datastore.h +++ b/searchlib/src/vespa/searchlib/datastore/datastore.h @@ -35,8 +35,8 @@ public: /** * Increase number of dead elements in buffer. * - * @param ref Reference to dead stored features - * @param dead Number of newly dead elements + * @param ref Reference to dead stored features + * @param dead Number of newly dead elements */ void incDead(EntryRef ref, uint64_t dead) { RefType intRef(ref); @@ -56,7 +56,7 @@ public: /** * Trim elem hold list, freeing elements that no longer needs to be held. * - * @param usedGen lowest generation that is still used. + * @param usedGen lowest generation that is still used. */ void trimElemHoldList(generation_t usedGen) override; diff --git a/searchlib/src/vespa/searchlib/datastore/datastore.hpp b/searchlib/src/vespa/searchlib/datastore/datastore.hpp index de9bd1bc161..f01129803ce 100644 --- a/searchlib/src/vespa/searchlib/datastore/datastore.hpp +++ b/searchlib/src/vespa/searchlib/datastore/datastore.hpp @@ -144,7 +144,7 @@ DataStore<EntryType, RefT>::DataStore() template <typename EntryType, typename RefT> DataStore<EntryType, RefT>::~DataStore() { - dropBuffers(); // Drop buffers before type handlers are dropped + dropBuffers(); // Drop buffers before type handlers are dropped } template <typename EntryType, typename RefT> diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp index ba0c8e05d77..b405542292d 100644 --- a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp +++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp @@ -189,7 +189,7 @@ DataStoreBase::doneHoldBuffer(uint32_t bufferId) void DataStoreBase::trimHoldLists(generation_t usedGen) { - trimElemHoldList(usedGen); // Trim entries before trimming buffers + trimElemHoldList(usedGen); // Trim entries before trimming buffers _genHolder.trimHoldLists(usedGen); } @@ -232,7 +232,7 @@ void DataStoreBase::holdBuffer(uint32_t bufferId) { _states[bufferId].onHold(); - size_t holdBytes = 0u; // getMemStats() still accounts held buffers + size_t holdBytes = 0u; // getMemStats() still accounts held buffers GenerationHeldBase::UP hold(new BufferHold(holdBytes, *this, bufferId)); _genHolder.hold(std::move(hold)); } diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.h b/searchlib/src/vespa/searchlib/datastore/datastorebase.h index 75e1ec8fb85..bdb49fec029 100644 --- a/searchlib/src/vespa/searchlib/datastore/datastorebase.h +++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.h @@ -23,7 +23,7 @@ public: { public: EntryRef _ref; - uint64_t _len; // Aligned length + uint64_t _len; // Aligned length ElemHold1ListElem(EntryRef ref, uint64_t len) : _ref(ref), @@ -157,8 +157,8 @@ protected: /** * Get next buffer id * - * @param bufferId current buffer id - * @return next buffer id + * @param bufferId current buffer id + * @return next buffer id */ uint32_t nextBufferId(uint32_t bufferId) { uint32_t ret = bufferId + 1; @@ -170,7 +170,7 @@ protected: /** * Get active buffer * - * @return active buffer + * @return active buffer */ void *activeBuffer(uint32_t typeId) { return _buffers[_activeBufferIds[typeId]].getBuffer(); @@ -179,7 +179,7 @@ protected: /** * Trim elem hold list, freeing elements that no longer needs to be held. * - * @param usedGen lowest generation that is still used. + * @param usedGen lowest generation that is still used. */ virtual void trimElemHoldList(generation_t usedGen) = 0; @@ -196,8 +196,8 @@ public: * Ensure that active buffer has a given number of elements free at end. * Switch to new buffer if current buffer is too full. * - * @param typeId registered data type for buffer. - * @param sizeNeeded Number of elements needed to be free + * @param typeId registered data type for buffer. + * @param sizeNeeded Number of elements needed to be free */ void ensureBufferCapacity(uint32_t typeId, size_t sizeNeeded) { if (__builtin_expect(sizeNeeded > @@ -210,7 +210,7 @@ public: /** * Put buffer on hold list, as part of compaction. * - * @param bufferId Id of buffer to be held. + * @param bufferId Id of buffer to be held. */ void holdBuffer(uint32_t bufferId); @@ -218,8 +218,8 @@ public: * Switch to new active buffer, typically in preparation for compaction * or when current active buffer no longer has free space. * - * @param typeId registered data type for buffer. - * @param sizeNeeded Number of elements needed to be free + * @param typeId registered data type for buffer. + * @param sizeNeeded Number of elements needed to be free */ void switchActiveBuffer(uint32_t typeId, size_t sizeNeeded); @@ -256,7 +256,7 @@ public: /** * Trim hold lists, freeing buffers that no longer needs to be held. * - * @param usedGen lowest generation that is still used. + * @param usedGen lowest generation that is still used. */ void trimHoldLists(generation_t usedGen); @@ -320,9 +320,9 @@ private: /** * Switch buffer state to active. * - * @param bufferId Id of buffer to be active. - * @param typeId registered data type for buffer. - * @param sizeNeeded Number of elements needed to be free + * @param bufferId Id of buffer to be active. + * @param typeId registered data type for buffer. + * @param sizeNeeded Number of elements needed to be free */ void onActive(uint32_t bufferId, uint32_t typeId, size_t sizeNeeded); public: diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h index af86eea45ac..0e19af34f00 100644 --- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h +++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.h @@ -44,8 +44,8 @@ private: public: protected: - uint32_t _numKeys; // Number of bitvectors and keys - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + uint32_t _numKeys; // Number of bitvectors and keys + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) uint32_t _idxHeaderLen; BitVectorKeyScope _scope; diff --git a/searchlib/src/vespa/searchlib/diskindex/docidmapper.h b/searchlib/src/vespa/searchlib/diskindex/docidmapper.h index 06e75c83339..415405f8ae8 100644 --- a/searchlib/src/vespa/searchlib/diskindex/docidmapper.h +++ b/searchlib/src/vespa/searchlib/diskindex/docidmapper.h @@ -17,7 +17,7 @@ class DocIdMapping { public: uint32_t _docIdLimit; - const SelectorArray *_selector; // External ownership + const SelectorArray *_selector; // External ownership uint8_t _selectorId; DocIdMapping(); diff --git a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp index f2237343c1b..c1964906f85 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fieldreader.cpp @@ -115,7 +115,7 @@ FieldReader::earlyOpen(const vespalib::string &prefix, FastOS_StatInfo statInfo; bool statres; - bool dynamicKPosOccFormat = false; // Will autodetect anyway + bool dynamicKPosOccFormat = false; // Will autodetect anyway statres = FastOS_File::Stat(name.c_str(), &statInfo); if (!statres) { LOG(error, @@ -246,11 +246,11 @@ FieldReader::allocFieldReader(const SchemaUtil::IndexIterator &index, { assert(index.isValid()); if (index.hasMatchingOldFields(oldSchema, false)) - return std::make_unique<FieldReader>(); // The common case + return std::make_unique<FieldReader>(); // The common case if (!index.hasOldFields(oldSchema, false)) return std::make_unique<FieldReaderEmpty>(index); // drop data // field exists in old schema with different collection type setting - return std::make_unique<FieldReaderStripInfo>(index); // degraded + return std::make_unique<FieldReaderStripInfo>(index); // degraded } @@ -345,7 +345,7 @@ FieldReaderStripInfo::read() } } else { if (element->getElementId() != 0) - continue; // Drop this entry, try to read new entry + continue; // Drop this entry, try to read new entry element->setWeight(1); features._wordPositions.resize(element->getNumOccs()); if (numElements > 1) { diff --git a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp index 7f2afeda837..7d4efe2d69d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fusion.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/fusion.cpp @@ -247,7 +247,7 @@ Fusion::selectCookedOrRawFeatures(Reader &reader, Writer &writer) cookedFormat = featureParams.getStr("cookedEncoding"); rawFormat = featureParams.getStr("encoding"); if (rawFormat == "") - rawFormatOK = false; // Typically uncompressed file + rawFormatOK = false; // Typically uncompressed file outFeatureParams = featureParams; } { @@ -259,7 +259,7 @@ Fusion::selectCookedOrRawFeatures(Reader &reader, Writer &writer) if (featureParams != outFeatureParams) rawFormatOK = false; if (!reader.allowRawFeatures()) - rawFormatOK = false; // Reader transforms data + rawFormatOK = false; // Reader transforms data } if (!cookedFormatOK) { LOG(error, diff --git a/searchlib/src/vespa/searchlib/diskindex/fusion.h b/searchlib/src/vespa/searchlib/diskindex/fusion.h index 3e59168a7b0..a99b7936d87 100644 --- a/searchlib/src/vespa/searchlib/diskindex/fusion.h +++ b/searchlib/src/vespa/searchlib/diskindex/fusion.h @@ -191,7 +191,7 @@ protected: typedef FusionInputIndex OldIndex; - const Schema *_schema; // External ownership + const Schema *_schema; // External ownership std::vector<std::shared_ptr<OldIndex> > _oldIndexes; typedef std::vector<std::shared_ptr<OldIndex> >::iterator OldIndexIterator; diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp index 9a483093194..aacfa400755 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.cpp @@ -162,9 +162,9 @@ public: uint32_t _docRef; uint32_t _elRef; bool _valid; - const Schema *_schema; // Ptr to allow being std::vector member + const Schema *_schema; // Ptr to allow being std::vector member uint32_t _fieldId; - IndexBuilder *_ib; // Ptr to allow being std::vector member + IndexBuilder *_ib; // Ptr to allow being std::vector member uint32_t _lowestOKElementId; uint32_t _lowestOKWordPos; diff --git a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h index db6084e5bfd..50cb17242da 100644 --- a/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h +++ b/searchlib/src/vespa/searchlib/diskindex/indexbuilder.h @@ -29,12 +29,12 @@ private: vespalib::string _curWord; bool _inWord; uint32_t _lowestOKFieldId; - std::vector<FieldHandle> _fields; // Defined fields. + std::vector<FieldHandle> _fields; // Defined fields. vespalib::string _prefix; uint32_t _docIdLimit; uint64_t _numWordIds; - const Schema &_schema; // Ptr to allow being std::vector member + const Schema &_schema; // Ptr to allow being std::vector member static uint32_t noDocId() { return std::numeric_limits<uint32_t>::max(); diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp index 738762333ed..9c63c5930b6 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4file.cpp @@ -556,7 +556,7 @@ PageDict4FileSeqWrite::makePHeader(const FileHeaderContext &fileHeaderContext) uint32_t headerLen = header.getSize(); headerLen += (-headerLen & 7); assert(e.getWriteOffset() == headerLen * 8); - assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned + assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned if (_pHeaderLen != 0) { assert(_pHeaderLen == headerLen); } @@ -588,7 +588,7 @@ PageDict4FileSeqWrite::makeSPHeader(const FileHeaderContext &fileHeaderContext) uint32_t headerLen = header.getSize(); headerLen += (-headerLen & 7); assert(e.getWriteOffset() == headerLen * 8); - assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned + assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned if (_spHeaderLen != 0) { assert(_spHeaderLen == headerLen); } @@ -620,7 +620,7 @@ PageDict4FileSeqWrite::makeSSHeader(const FileHeaderContext &fileHeaderContext) uint32_t headerLen = header.getSize(); headerLen += (-headerLen & 7); assert(e.getWriteOffset() == headerLen * 8); - assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned + assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned if (_ssHeaderLen != 0) { assert(_ssHeaderLen == headerLen); } diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp index c18e368b1c0..e610f7a9179 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp @@ -154,7 +154,7 @@ PageDict4RandRead::lookup(const vespalib::stringref &word, if (!ssRes._res) { offsetAndCounts._offset = ssRes._l6StartOffset._fileOffset; offsetAndCounts._accNumDocs = ssRes._l6StartOffset._accNumDocs; - wordNum = ssRes._l6WordNum; // XXX ? + wordNum = ssRes._l6WordNum; // XXX ? offsetAndCounts._counts.clear(); return false; } diff --git a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp index 0bc11dc30a6..00b6d23fbcf 100644 --- a/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/wordnummapper.cpp @@ -76,7 +76,7 @@ WordNumMapper::sanityCheck(bool allowHoles) uint64_t prevMappedWordNum = mappedWordNum; mappedWordNum = map(wordNum); if (mappedWordNum == 0u && allowHoles) - continue; // In case some words are being removed + continue; // In case some words are being removed assert(mappedWordNum > prevMappedWordNum); (void) prevMappedWordNum; } diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp index 444fb10e57f..c05001c2ab8 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp @@ -132,13 +132,13 @@ ZcPosOccRandRead::readPostingList(const PostingListCounts &counts, } else { uint64_t endOffset = (handle._bitOffset + _headerBitSize + handle._bitLength + 7) >> 3; - // Align end at 64-bit boundary + // Align end at 64-bit boundary endOffset += (-endOffset & 7); uint64_t vectorLen = endOffset - startOffset; size_t padBefore; size_t padAfter; - size_t padExtraAfter; // Decode prefetch space + size_t padExtraAfter; // Decode prefetch space _file->DirectIOPadding(startOffset, vectorLen, padBefore, padAfter); padExtraAfter = 0; if (padAfter < 16) diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h index 69aae834211..0dcca879cac 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.h @@ -15,13 +15,13 @@ class ZcPosOccRandRead : public index::PostingListFileRandRead { protected: std::unique_ptr<FastOS_FileInterface> _file; - uint64_t _fileSize; + uint64_t _fileSize; - uint32_t _minChunkDocs; // # of documents needed for chunking - uint32_t _minSkipDocs; // # of documents needed for skipping - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + uint32_t _minChunkDocs; // # of documents needed for chunking + uint32_t _minSkipDocs; // # of documents needed for skipping + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) - uint64_t _numWords; // Number of words in file + uint64_t _numWords; // Number of words in file uint64_t _fileBitSize; uint64_t _headerBitSize; bitcompression::PosOccFieldsParams _fieldsParams; diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp index ea4e6e5a18a..768ee972097 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.cpp @@ -103,7 +103,7 @@ Zc4PostingSeqRead:: readCommonWordDocIdAndFeatures(DocIdAndFeatures &features) { if (_zcDocIds._valI >= _zcDocIds._valE && _hasMore) - readWordStart(); // Read start of next chunk + readWordStart(); // Read start of next chunk // Split docid & features. assert(_zcDocIds._valI < _zcDocIds._valE); uint32_t docIdPos = _zcDocIds.pos(); @@ -480,7 +480,7 @@ Zc4PostingSeqRead::readWordStart() void Zc4PostingSeqRead::readCounts(const PostingListCounts &counts) { - assert(!_hasMore); // Previous words must have been read. + assert(!_hasMore); // Previous words must have been read. _counts = counts; @@ -646,7 +646,7 @@ Zc4PostingSeqRead::setPostingOffset(uint64_t offset, uint64_t endOffset, uint64_t readAheadOffset) { - assert(_residue == 0); // Only to be called between posting lists + assert(_residue == 0); // Only to be called between posting lists FeatureDecodeContextBE &d = *_decodeContext; @@ -743,7 +743,7 @@ Zc4PostingSeqWrite::flushWord() void Zc4PostingSeqWrite::checkPointWrite(nbostream &out) { - _writeContext.writeComprBuffer(true); // Also flush slack + _writeContext.writeComprBuffer(true); // Also flush slack out << _numWords; _writeContext.checkPointWrite(out); _featureWriteContext.checkPointWrite(out); @@ -852,9 +852,9 @@ Zc4PostingSeqWrite::makeHeader(const FileHeaderContext &fileHeaderContext) e.smallAlign(64); e.flush(); uint32_t headerLen = header.getSize(); - headerLen += (-headerLen & 7); // Then to uint64_t + headerLen += (-headerLen & 7); // Then to uint64_t assert(e.getWriteOffset() == headerLen * 8); - assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned + assert((e.getWriteOffset() & 63) == 0); // Header must be word aligned } @@ -916,7 +916,7 @@ Zc4PostingSeqWrite::open(const vespalib::string &name, _writePos = e.getWriteOffset(); } else { assert(bufferStartFilePos >= 8u); - uint32_t headerSize = readHeader(name); // Read existing header + uint32_t headerSize = readHeader(name); // Read existing header assert(bufferStartFilePos >= headerSize); (void) headerSize; e.afterWrite(_writeContext, 0, bufferStartFilePos); @@ -928,7 +928,7 @@ Zc4PostingSeqWrite::open(const vespalib::string &name, _l2Skip.maybeExpand(); _l3Skip.maybeExpand(); _l4Skip.maybeExpand(); - return true; // Assume success + return true; // Assume success } @@ -950,7 +950,7 @@ Zc4PostingSeqWrite::close() e.padBits(128); e.alignDirectIO(); e.flush(); - e.writeComprBuffer(); // Also flushes slack + e.writeComprBuffer(); // Also flushes slack _writeContext.dropComprBuf(); _file.Sync(); @@ -1220,7 +1220,7 @@ Zc4PostingSeqWrite::flushWordWithSkip(bool hasMore) K_VALUE_ZCPOSTING_LASTDOCID); } - e.smallAlign(8); // Byte align + e.smallAlign(8); // Byte align uint8_t *docIds = _zcDocIds._mallocStart; e.writeBits(reinterpret_cast<const uint64_t *>(docIds), diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposting.h b/searchlib/src/vespa/searchlib/diskindex/zcposting.h index 733bab6c9a4..64879aa05fb 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposting.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcposting.h @@ -29,26 +29,26 @@ protected: DecodeContext *_decodeContext; uint32_t _docIdK; - uint32_t _prevDocId; // Previous document id - uint32_t _numDocs; // Documents in chunk or word + uint32_t _prevDocId; // Previous document id + uint32_t _numDocs; // Documents in chunk or word search::ComprFileReadContext _readContext; FastOS_File _file; bool _hasMore; - bool _dynamicK; // Caclulate EG compression parameters ? - uint32_t _lastDocId; // last document in chunk or word - uint32_t _minChunkDocs; // # of documents needed for chunking - uint32_t _minSkipDocs; // # of documents needed for skipping - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) - - ZcBuf _zcDocIds; // Document id deltas - ZcBuf _l1Skip; // L1 skip info - ZcBuf _l2Skip; // L2 skip info - ZcBuf _l3Skip; // L3 skip info - ZcBuf _l4Skip; // L4 skip info - - uint64_t _numWords; // Number of words in file + bool _dynamicK; // Caclulate EG compression parameters ? + uint32_t _lastDocId; // last document in chunk or word + uint32_t _minChunkDocs; // # of documents needed for chunking + uint32_t _minSkipDocs; // # of documents needed for skipping + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + + ZcBuf _zcDocIds; // Document id deltas + ZcBuf _l1Skip; // L1 skip info + ZcBuf _l2Skip; // L2 skip info + ZcBuf _l3Skip; // L3 skip info + ZcBuf _l4Skip; // L4 skip info + + uint64_t _numWords; // Number of words in file uint64_t _fileBitSize; - uint32_t _chunkNo; // Chunk number + uint32_t _chunkNo; // Chunk number // Variables for validating skip information while reading uint32_t _l1SkipDocId; @@ -74,15 +74,15 @@ protected: uint64_t _featuresSize; index::PostingListCountFileSeqRead *const _countFile; - uint64_t _headerBitLen; // Size of file header in bits - uint64_t _rangeEndOffset; // End offset for word pair - uint64_t _readAheadEndOffset;// Readahead end offset for word pair - uint64_t _wordStart; // last word header position - uint64_t _checkPointPos; // file position when checkpointing - uint32_t _residue; // Number of unread documents after word header - uint32_t _checkPointChunkNo; // _chunkNo when checkpointing - uint32_t _checkPointResidue;// _residue when checkpointing - bool _checkPointHasMore; // _hasMore when checkpointing + uint64_t _headerBitLen; // Size of file header in bits + uint64_t _rangeEndOffset; // End offset for word pair + uint64_t _readAheadEndOffset; // Readahead end offset for word pair + uint64_t _wordStart; // last word header position + uint64_t _checkPointPos; // file position when checkpointing + uint32_t _residue; // Number of unread documents after word header + uint32_t _checkPointChunkNo; // _chunkNo when checkpointing + uint32_t _checkPointResidue; // _residue when checkpointing + bool _checkPointHasMore; // _hasMore when checkpointing public: Zc4PostingSeqRead(index::PostingListCountFileSeqRead *countFile); @@ -127,7 +127,7 @@ public: * @param Offset start of posting lists for word pair. * @param endOffset end of posting lists for word pair. * @param readAheadOffset end of posting list for either this or a - * later word pair, depending on disk seek cost. + * later word pair, depending on disk seek cost. */ void setPostingOffset(uint64_t offset, uint64_t endOffset, uint64_t readAheadOffset) override; }; @@ -144,26 +144,26 @@ protected: EncodeContext _encodeContext; search::ComprFileWriteContext _writeContext; FastOS_File _file; - uint32_t _minChunkDocs; // # of documents needed for chunking - uint32_t _minSkipDocs; // # of documents needed for skipping - uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) + uint32_t _minChunkDocs; // # of documents needed for chunking + uint32_t _minSkipDocs; // # of documents needed for skipping + uint32_t _docIdLimit; // Limit for document ids (docId < docIdLimit) // Unpacked document ids for word and feature sizes typedef std::pair<uint32_t, uint32_t> DocIdAndFeatureSize; std::vector<DocIdAndFeatureSize> _docIds; // Buffer up features in memory EncodeContext *_encodeFeatures; - uint64_t _featureOffset; // Bit offset of next feature + uint64_t _featureOffset; // Bit offset of next feature search::ComprFileWriteContext _featureWriteContext; - uint64_t _writePos; // Bit position for start of current word - bool _dynamicK; // Caclulate EG compression parameters ? - ZcBuf _zcDocIds; // Document id deltas - ZcBuf _l1Skip; // L1 skip info - ZcBuf _l2Skip; // L2 skip info - ZcBuf _l3Skip; // L3 skip info - ZcBuf _l4Skip; // L4 skip info - - uint64_t _numWords; // Number of words in file + uint64_t _writePos; // Bit position for start of current word + bool _dynamicK; // Caclulate EG compression parameters ? + ZcBuf _zcDocIds; // Document id deltas + ZcBuf _l1Skip; // L1 skip info + ZcBuf _l2Skip; // L2 skip info + ZcBuf _l3Skip; // L3 skip info + ZcBuf _l4Skip; // L4 skip info + + uint64_t _numWords; // Number of words in file uint64_t _fileBitSize; index::PostingListCountFileSeqWrite *const _countFile; public: diff --git a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp index 8a8b3980c6b..919004c378f 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.cpp @@ -343,7 +343,7 @@ ZcPostingIteratorBase::doChunkSkipSeek(uint32_t docId) _featureSeekPos = 0; featureSeek(_featuresSize); _chunkNo++; - readWordStart(getDocIdLimit()); // Read word start for next chunk + readWordStart(getDocIdLimit()); // Read word start for next chunk } if (docId > _chunk._lastDocId) { _l4._skipDocId = _l3._skipDocId = _l2._skipDocId = _l1._skipDocId = search::endDocId; diff --git a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h index 77ad4240f3d..a1f7a8b2e9f 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h +++ b/searchlib/src/vespa/searchlib/diskindex/zcpostingiterators.h @@ -13,34 +13,34 @@ namespace diskindex { using bitcompression::Position; -#define ZCDECODE(valI, resop) \ -do { \ - if (__builtin_expect(valI[0] < (1 << 7), true)) { \ - resop valI[0]; \ - valI += 1; \ - } else if (__builtin_expect(valI[1] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - (valI[1] << 7); \ - valI += 2; \ - } else if (__builtin_expect(valI[2] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - (valI[2] << 14); \ - valI += 3; \ - } else if (__builtin_expect(valI[3] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - ((valI[2] & ((1 << 7) - 1)) << 14) + \ - (valI[3] << 21); \ - valI += 4; \ - } else { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - ((valI[2] & ((1 << 7) - 1)) << 14) + \ - ((valI[3] & ((1 << 7) - 1)) << 21) + \ - (valI[4] << 28); \ - valI += 5; \ - } \ +#define ZCDECODE(valI, resop) \ +do { \ + if (__builtin_expect(valI[0] < (1 << 7), true)) { \ + resop valI[0]; \ + valI += 1; \ + } else if (__builtin_expect(valI[1] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + (valI[1] << 7); \ + valI += 2; \ + } else if (__builtin_expect(valI[2] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + (valI[2] << 14); \ + valI += 3; \ + } else if (__builtin_expect(valI[3] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + ((valI[2] & ((1 << 7) - 1)) << 14) + \ + (valI[3] << 21); \ + valI += 4; \ + } else { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + ((valI[2] & ((1 << 7) - 1)) << 14) + \ + ((valI[3] & ((1 << 7) - 1)) << 21) + \ + (valI[4] << 28); \ + valI += 5; \ + } \ } while (0) class ZcIteratorBase : public queryeval::RankedSearchIteratorBase diff --git a/searchlib/src/vespa/searchlib/engine/docsumrequest.h b/searchlib/src/vespa/searchlib/engine/docsumrequest.h index a0955aaa473..e2b724065b1 100644 --- a/searchlib/src/vespa/searchlib/engine/docsumrequest.h +++ b/searchlib/src/vespa/searchlib/engine/docsumrequest.h @@ -73,7 +73,7 @@ public: }; public: - uint32_t _flags; + uint32_t _flags; vespalib::string resultClassName; bool useWideHits; private: diff --git a/searchlib/src/vespa/searchlib/engine/errorcodes.h b/searchlib/src/vespa/searchlib/engine/errorcodes.h index 3e6bf91cd1c..36ab38a4555 100644 --- a/searchlib/src/vespa/searchlib/engine/errorcodes.h +++ b/searchlib/src/vespa/searchlib/engine/errorcodes.h @@ -20,7 +20,7 @@ enum ErrorCode { ECODE_OVERLOADED = 5, ECODE_NOT_IMPLEMENTED = 6, ECODE_QUERY_NOT_ALLOWED = 7, - ECODE_TIMEOUT = 8 + ECODE_TIMEOUT = 8 }; /** diff --git a/searchlib/src/vespa/searchlib/engine/searchreply.h b/searchlib/src/vespa/searchlib/engine/searchreply.h index 97d1e54e45d..554d4fb43c1 100644 --- a/searchlib/src/vespa/searchlib/engine/searchreply.h +++ b/searchlib/src/vespa/searchlib/engine/searchreply.h @@ -24,10 +24,10 @@ public: void setDistributionKey(uint32_t key) { _distributionKey = key; } uint32_t getDistributionKey() const { return _distributionKey; } document::GlobalId gid; - search::HitRank metric; - uint32_t path; // wide + search::HitRank metric; + uint32_t path; // wide private: - int32_t _distributionKey; // wide + int32_t _distributionKey; // wide }; class Coverage { diff --git a/searchlib/src/vespa/searchlib/index/docbuilder.h b/searchlib/src/vespa/searchlib/index/docbuilder.h index aa9664768ad..c141917fbd3 100644 --- a/searchlib/src/vespa/searchlib/index/docbuilder.h +++ b/searchlib/src/vespa/searchlib/index/docbuilder.h @@ -156,15 +156,15 @@ private: class IndexFieldHandle : public CollectionFieldHandle { vespalib::string _str; // adjusted as word comes along - size_t _strSymbols; // symbols in string, assuming UTF8 + size_t _strSymbols; // symbols in string, assuming UTF8 document::SpanList *_spanList; // owned by _spanTree document::SpanTree::UP _spanTree; const document::SpanNode *_lastSpan; - size_t _spanStart; // start of span - bool _autoAnnotate; // Add annotation when adding strings - bool _autoSpace; // Add space before strings - bool _skipAutoSpace; // one shot skip of adding space - bool _uriField; // URI handling (special struct case) + size_t _spanStart; // start of span + bool _autoAnnotate; // Add annotation when adding strings + bool _autoSpace; // Add space before strings + bool _skipAutoSpace; // one shot skip of adding space + bool _uriField; // URI handling (special struct case) vespalib::string _subField; const document::FixedTypeRepo & _repo; diff --git a/searchlib/src/vespa/searchlib/index/docidandfeatures.h b/searchlib/src/vespa/searchlib/index/docidandfeatures.h index f76dd55a0d6..5b8ded5f1e0 100644 --- a/searchlib/src/vespa/searchlib/index/docidandfeatures.h +++ b/searchlib/src/vespa/searchlib/index/docidandfeatures.h @@ -37,7 +37,7 @@ public: class WordDocFieldFeatures { public: - uint32_t _numElements; // Number of array indexes + uint32_t _numElements; // Number of array indexes // TODO: add support for user features WordDocFieldFeatures() @@ -57,7 +57,7 @@ public: class WordDocElementFeatures { public: - uint32_t _elementId; // Array index + uint32_t _elementId; // Array index uint32_t _numOccs; int32_t _weight; uint32_t _elementLen; @@ -129,7 +129,7 @@ public: class DocIdAndFeatures { public: - uint32_t _docId; // Current Docid + uint32_t _docId; // Current Docid // generic feature data, flattened to avoid excessive allocator usage WordDocFeatures _wordDocFeatures; std::vector<WordDocElementFeatures> _elements; @@ -142,10 +142,10 @@ public: // interleaved with predefined features (word position, word weight) #endif // raw data (file format specific, packed) - std::vector<uint64_t> _blob; // Feature data for (word, docid) pair - uint32_t _bitOffset; // Offset of feature start ([0..63]) - uint32_t _bitLength; // Length of features - bool _raw; // + std::vector<uint64_t> _blob; // Feature data for (word, docid) pair + uint32_t _bitOffset; // Offset of feature start ([0..63]) + uint32_t _bitLength; // Length of features + bool _raw; // DocIdAndFeatures(); DocIdAndFeatures(const DocIdAndFeatures &); @@ -189,7 +189,7 @@ public: /** * Append features from a single field to a field collection. * - * @param rhs features for a single field + * @param rhs features for a single field * @param localFieldId local field id for the field */ void append(const DocIdAndFeatures &rhs, uint32_t localFieldId); diff --git a/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp b/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp index 8948b8be407..71b83cc005c 100644 --- a/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp +++ b/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp @@ -295,7 +295,7 @@ document::DocumenttypesConfig DocTypeBuilder::makeConfig() const { const Schema::AttributeField &field = _schema.getAttributeField(i); UsedFields::const_iterator usf = usedFields.find(field.getName()); if (usf != usedFields.end()) - continue; // taken as index field + continue; // taken as index field const DataType *primitiveType = convert(field.getDataType()); header_struct.addField(field.getName(), type_cache.getType( @@ -308,7 +308,7 @@ document::DocumenttypesConfig DocTypeBuilder::makeConfig() const { const Schema::SummaryField &field = _schema.getSummaryField(i); UsedFields::const_iterator usf = usedFields.find(field.getName()); if (usf != usedFields.end()) - continue; // taken as index field or attribute field + continue; // taken as index field or attribute field const DataType *primitiveType(convert(field.getDataType())); header_struct.addField(field.getName(), type_cache.getType( primitiveType->getId(), field.getCollectionType())); diff --git a/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp b/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp index 76428e2c1f7..ea572e59b76 100644 --- a/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp +++ b/searchlib/src/vespa/searchlib/index/olddictionaryfile.cpp @@ -81,7 +81,7 @@ OldDictionaryIndexMapping::setupHelper(const Schema &schema) ++i, ++localId) { if (*i == Schema::UNKNOWN_FIELD_ID) - continue; // Field on file not in current schema + continue; // Field on file not in current schema assert(*i < schema.getNumIndexFields()); (void) schema; while (_fieldIdToLocalId.size() <= *i) diff --git a/searchlib/src/vespa/searchlib/index/postinglistcounts.h b/searchlib/src/vespa/searchlib/index/postinglistcounts.h index ac2f8a724ef..f59b906e982 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistcounts.h +++ b/searchlib/src/vespa/searchlib/index/postinglistcounts.h @@ -30,9 +30,9 @@ public: class Segment { public: - uint64_t _bitLength; // Length of segment - uint32_t _numDocs; // Number of documents in segment - uint32_t _lastDoc; // Last document id in segment + uint64_t _bitLength; // Length of segment + uint32_t _numDocs; // Number of documents in segment + uint32_t _lastDoc; // Last document id in segment Segment() : _bitLength(0), @@ -60,8 +60,8 @@ public: * for prefix search), numDocs is then sum of documents for each posting * list, which segment info is absent. */ - uint64_t _numDocs; // Number of documents for word(s) - uint64_t _bitLength; // Length of postings for word(s) + uint64_t _numDocs; // Number of documents for word(s) + uint64_t _bitLength; // Length of postings for word(s) /** * Very large posting lists with skip info are split into multiple @@ -107,7 +107,7 @@ class PostingListOffsetAndCounts { public: uint64_t _offset; - uint64_t _accNumDocs; // Used by prefix search for now. + uint64_t _accNumDocs; // Used by prefix search for now. PostingListCounts _counts; PostingListOffsetAndCounts() diff --git a/searchlib/src/vespa/searchlib/index/postinglistfile.h b/searchlib/src/vespa/searchlib/index/postinglistfile.h index 0a2f11984b9..43628bd798b 100644 --- a/searchlib/src/vespa/searchlib/index/postinglistfile.h +++ b/searchlib/src/vespa/searchlib/index/postinglistfile.h @@ -26,7 +26,7 @@ class PostingListFileSeqRead { protected: PostingListCounts _counts; - unsigned int _residueDocs; // Docids left to read for word + unsigned int _residueDocs; // Docids left to read for word public: PostingListFileSeqRead(); @@ -99,7 +99,7 @@ public: * @param Offset start of posting lists for word pair. * @param endOffset end of posting lists for word pair. * @param readAheadOffset end of posting list for either this or a - * later word pair, depending on disk seek cost. + * later word pair, depending on disk seek cost. */ virtual void setPostingOffset(uint64_t offset, uint64_t endOffset, uint64_t readAheadOffset) = 0; diff --git a/searchlib/src/vespa/searchlib/index/postinglisthandle.h b/searchlib/src/vespa/searchlib/index/postinglisthandle.h index f4a991717b1..595021a418c 100644 --- a/searchlib/src/vespa/searchlib/index/postinglisthandle.h +++ b/searchlib/src/vespa/searchlib/index/postinglisthandle.h @@ -23,17 +23,17 @@ class PostingListHandle public: typedef std::unique_ptr<PostingListHandle> UP; // Key portion - PostingListFileRandRead *_file; // File containing posting list - uint64_t _bitOffset; // posting list start relative to start of file - uint64_t _bitLength; // Length of posting list, in bits + PostingListFileRandRead *_file; // File containing posting list + uint64_t _bitOffset; // posting list start relative to start of file + uint64_t _bitLength; // Length of posting list, in bits // Value portion - uint32_t _firstSegment; // First segment for word - uint32_t _numSegments; // Number of segments - uint64_t _bitOffsetMem; // _mem relative to start of file - const void *_mem; // Memory backing posting list after read/mmap - void *_allocMem; // What to free after posting list - size_t _allocSize; // Size of allocated memory + uint32_t _firstSegment; // First segment for word + uint32_t _numSegments; // Number of segments + uint64_t _bitOffsetMem; // _mem relative to start of file + const void *_mem; // Memory backing posting list after read/mmap + void *_allocMem; // What to free after posting list + size_t _allocSize; // Size of allocated memory PostingListHandle() : _file(NULL), diff --git a/searchlib/src/vespa/searchlib/index/schemautil.cpp b/searchlib/src/vespa/searchlib/index/schemautil.cpp index 7b82a05eee5..c124d5ff8b5 100644 --- a/searchlib/src/vespa/searchlib/index/schemautil.cpp +++ b/searchlib/src/vespa/searchlib/index/schemautil.cpp @@ -65,7 +65,7 @@ SchemaUtil::IndexIterator::hasOldFields(const Schema &oldSchema, const Schema::IndexField &oldField = oldSchema.getIndexField(oldFieldId); if (oldField.getDataType() != newField.getDataType()) - return false; // wrong data type + return false; // wrong data type if (!phrases) return true; return oldField.hasPhrases(); diff --git a/searchlib/src/vespa/searchlib/index/schemautil.h b/searchlib/src/vespa/searchlib/index/schemautil.h index fd8df2e7057..cd404092a5c 100644 --- a/searchlib/src/vespa/searchlib/index/schemautil.h +++ b/searchlib/src/vespa/searchlib/index/schemautil.h @@ -15,7 +15,7 @@ public: class IndexSettings { schema::DataType _dataType; - bool _error; // Schema is bad. + bool _error; // Schema is bad. bool _prefix; bool _phrases; bool _positions; @@ -129,8 +129,8 @@ public: * with matching data type. If we want phrases then all input * fields usable for terms must also be usable for phrases. * - * @param oldSchema old schema, present in an input index - * @param phrases ask for phrase files + * @param oldSchema old schema, present in an input index + * @param phrases ask for phrase files */ bool hasOldFields(const Schema &oldSchema, bool phrases) const; @@ -140,8 +140,8 @@ public: * Field collections must have same set of fields which must * also match between new and old schema. * - * @param oldSchema old schema, present in an input index - * @param phrases ask for phrase files + * @param oldSchema old schema, present in an input index + * @param phrases ask for phrase files */ bool hasMatchingOldFields(const Schema &oldSchema, bool phrases) const; }; diff --git a/searchlib/src/vespa/searchlib/memoryindex/documentinverter.h b/searchlib/src/vespa/searchlib/memoryindex/documentinverter.h index ac202b14178..fa34cb2289c 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/documentinverter.h +++ b/searchlib/src/vespa/searchlib/memoryindex/documentinverter.h @@ -28,7 +28,7 @@ private: DocumentInverter(const DocumentInverter &) = delete; DocumentInverter &operator=(const DocumentInverter &) = delete; - const index::Schema &_schema; + const index::Schema &_schema; typedef index::DocTypeBuilder DocTypeBuilder; typedef DocTypeBuilder::UriField UriField; @@ -54,7 +54,7 @@ private: typedef document::Field FieldPath; typedef std::vector<std::unique_ptr<FieldPath> > IndexedFieldPaths; IndexedFieldPaths _indexedFieldPaths; - const document::DataType * _dataType; + const document::DataType * _dataType; DocTypeBuilder::SchemaIndexFields _schemaIndexFields; diff --git a/searchlib/src/vespa/searchlib/memoryindex/featurestore.h b/searchlib/src/vespa/searchlib/memoryindex/featurestore.h index e1300b9d71f..ecf21892f78 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/featurestore.h +++ b/searchlib/src/vespa/searchlib/memoryindex/featurestore.h @@ -91,9 +91,9 @@ public: /** * Constructor for feature store. * - * @param schema The schema describing fields and field - * collections available, used to derive - * coding parameters. + * @param schema The schema describing fields and field + * collections available, used to derive + * coding parameters. */ FeatureStore(const Schema &schema); @@ -102,10 +102,10 @@ public: /** * Add features to feature store * - * @param packedIndex The field or field collection owning features - * @param features The features to be encoded - * @return pair with reference to stored features and - * size of encoded features in bits + * @param packedIndex The field or field collection owning features + * @param features The features to be encoded + * @return pair with reference to stored features and + * size of encoded features in bits */ std::pair<datastore::EntryRef, uint64_t> addFeatures(uint32_t packedIndex, @@ -116,9 +116,9 @@ public: * Get features from feature store. Method signature is not * const since feature decoder is written to during calculation. * - * @param packedIndex The field or field collection owning features - * @param ref Reference to stored features - * @param features The features to be decoded + * @param packedIndex The field or field collection owning features + * @param ref Reference to stored features + * @param features The features to be decoded */ void getFeatures(uint32_t packedIndex, @@ -176,9 +176,9 @@ public: * Calculate size of encoded features. Method signature is not * const since feature decoder is written to during calculation. * - * @param packedIndex The field or field collection owning features - * @param ref Reference to stored features - * @return size of features in bits + * @param packedIndex The field or field collection owning features + * @param ref Reference to stored features + * @return size of features in bits */ size_t bitSize(uint32_t packedIndex, datastore::EntryRef ref); @@ -186,8 +186,8 @@ public: /** * Get byte address of stored features * - * @param ref Referennce to stored features - * @return byte address of stored features + * @param ref Referennce to stored features + * @return byte address of stored features */ const uint8_t * getBits(datastore::EntryRef ref) const @@ -199,9 +199,9 @@ public: /** * Move features to new location, as part of compaction. * - * @param packedIndex The field or field collection owning features - * @param ref Old reference to stored features - * @return New reference to stored features + * @param packedIndex The field or field collection owning features + * @param ref Old reference to stored features + * @return New reference to stored features */ datastore::EntryRef moveFeatures(uint32_t packedIndex, diff --git a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp index 133736b92bd..3238243ff0b 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.cpp @@ -203,7 +203,7 @@ FieldInverter::sortWords() // TODO: shrink word buffer to only contain unique words std::vector<uint32_t>::const_iterator w(_wordRefs.begin() + 1); std::vector<uint32_t>::const_iterator we(_wordRefs.end()); - uint32_t wordNum = 1; // First valid word number + uint32_t wordNum = 1; // First valid word number const char *lastWord = getWordFromRef(*w); updateWordNum(*w, wordNum); for (++w; w != we; ++w) { @@ -229,7 +229,7 @@ FieldInverter::sortWords() void FieldInverter::startElement(int32_t weight) { - _elems.push_back(ElemInfo(weight)); // Fill in length later + _elems.push_back(ElemInfo(weight)); // Fill in length later } @@ -493,7 +493,7 @@ FieldInverter::pushDocuments(IOrderedDocumentInserter &inserter) if (_positions.empty()) { reset(); - return; // All documents with words aborted + return; // All documents with words aborted } sortWords(); diff --git a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.h b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.h index a9c4fa5ea1d..08aec510002 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.h +++ b/searchlib/src/vespa/searchlib/memoryindex/fieldinverter.h @@ -29,11 +29,11 @@ public: class PosInfo { public: - uint32_t _wordNum; // XXX: Initially word reference + uint32_t _wordNum; // XXX: Initially word reference uint32_t _docId; uint32_t _elemId; uint32_t _wordPos; - uint32_t _elemRef; // Offset in _elems + uint32_t _elemRef; // Offset in _elems static constexpr uint32_t _elemRemoved = std::numeric_limits<uint32_t>::max(); @@ -181,14 +181,14 @@ private: uint32_t _docId; uint32_t _oldPosSize; - const index::Schema &_schema; + const index::Schema &_schema; - WordBuffer _words; - ElemInfoVec _elems; - PosInfoVec _positions; - index::DocIdAndPosOccFeatures _features; - std::vector<uint32_t> _elementWordRefs; - std::vector<uint32_t> _wordRefs; + WordBuffer _words; + ElemInfoVec _elems; + PosInfoVec _positions; + index::DocIdAndPosOccFeatures _features; + std::vector<uint32_t> _elementWordRefs; + std::vector<uint32_t> _wordRefs; typedef std::pair<document::Span, const document::FieldValue *> SpanTerm; typedef std::vector<SpanTerm> SpanTermVector; @@ -206,7 +206,7 @@ public: /** * Start a new element * - * @param weight element weight + * @param weight element weight */ void startElement(int32_t weight); @@ -221,10 +221,10 @@ private: /** * Save field value as word in word buffer. * - * @param word word to be saved - * @param len length of word to be saved. + * @param word word to be saved + * @param len length of word to be saved. * - * @return word reference + * @return word reference */ VESPA_DLL_LOCAL uint32_t saveWord(const vespalib::stringref word); @@ -232,9 +232,9 @@ private: /** * Save field value as word in word buffer. * - * @param fv field value containing word to be stored + * @param fv field value containing word to be stored * - * @return word reference + * @return word reference */ VESPA_DLL_LOCAL uint32_t saveWord(const document::FieldValue &fv); @@ -242,9 +242,9 @@ private: /** * Get pointer to saved word from a word reference. * - * @param wordRef word reference + * @param wordRef word reference * - * @return saved word + * @return saved word */ const char * getWordFromRef(uint32_t wordRef) const @@ -255,9 +255,9 @@ private: /** * Get pointer to saved word from a word number * - * @param wordNum word number + * @param wordNum word number * - * @return saved word + * @return saved word */ const char * getWordFromNum(uint32_t wordNum) const @@ -268,9 +268,9 @@ private: /** * Get word number from word reference * - * @param wordRef word reference + * @param wordRef word reference * - * @return word number + * @return word number */ uint32_t getWordNum(uint32_t wordRef) const @@ -282,8 +282,8 @@ private: /** * Update mapping from word reference to word number * - * @param wordRef word reference - * @param wordNum word number + * @param wordRef word reference + * @param wordNum word number */ void updateWordNum(uint32_t wordRef, uint32_t wordNum) @@ -296,7 +296,7 @@ private: * Add a word reference to posting list. Don't step word pos. * * - * @param wordRef word reference + * @param wordRef word reference */ void add(uint32_t wordRef) { diff --git a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp index ec33819d3e0..f6c3e5b5ea6 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/memoryfieldindex.cpp @@ -61,10 +61,10 @@ MemoryFieldIndex::~MemoryFieldIndex() } } _postingListStore.clearBuilder(); - freeze(); // Flush all pending posting list tree freezes + freeze(); // Flush all pending posting list tree freezes transferHoldLists(); - _dict.clear(); // Clear dictionary - freeze(); // Flush pending freeze for dictionary tree. + _dict.clear(); // Clear dictionary + freeze(); // Flush pending freeze for dictionary tree. transferHoldLists(); incGeneration(); trimHoldLists(); diff --git a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp index 4e83e3acf6a..8cd74b7d630 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/ordereddocumentinserter.cpp @@ -57,7 +57,7 @@ OrderedDocumentInserter::flushWord() &_removes[0], &_removes[0] + _removes.size()); if (pidx.ref() != _dItr.getData()) { - // Before updating ref + // Before updating ref std::atomic_thread_fence(std::memory_order_release); _dItr.writeData(pidx.ref()); } diff --git a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp index a10381e9b05..4ecd84fb7c3 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearsearch.cpp @@ -279,7 +279,7 @@ ONearSearch::Matcher::match(uint32_t docId) } curTermPos = *pos[i]; if (lastAllowed < curTermPos) { - // outside window + // outside window break; } LOG(spam, "Current position for term %d is %d.", i, curTermPos.getPosition()); diff --git a/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp b/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp index c130a07198a..aa6a9727352 100644 --- a/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp +++ b/searchlib/src/vespa/searchlib/test/diskindex/testdiskindex.cpp @@ -17,7 +17,7 @@ namespace diskindex { struct Builder { search::diskindex::IndexBuilder _ib; - TuneFileIndexing _tuneFileIndexing; + TuneFileIndexing _tuneFileIndexing; DummyFileHeaderContext _fileHeaderContext; Builder(const std::string &dir, @@ -99,7 +99,7 @@ TestDiskIndex::openIndex(const std::string &dir, bool directio, bool readmmap, bool fieldEmpty, bool docEmpty, bool wordEmpty) { buildIndex(dir, directio, fieldEmpty, docEmpty, wordEmpty); - TuneFileRandRead tuneFileRead; + TuneFileRandRead tuneFileRead; if (directio) { tuneFileRead.setWantDirectIO(); } diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp index cfaf8108672..67e40fa5061 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeegcompr64filterocc.cpp @@ -499,44 +499,44 @@ lowLevelAndPairPostingScanUnpack(const FakePosting &rhs) const return 0; } -#define UC64_FILTEROCC_READ_RESIDUE(val, valI, preRead, cacheInt, \ - residue, EC) \ - do { \ - UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, \ - K_VALUE_FILTEROCC_RESIDUE, EC); \ - residue = val64; \ +#define UC64_FILTEROCC_READ_RESIDUE(val, valI, preRead, cacheInt, \ + residue, EC) \ + do { \ + UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, \ + K_VALUE_FILTEROCC_RESIDUE, EC); \ + residue = val64; \ } while (0) -#define UC64_FILTEROCC_READ_FIRST_DOC(val, valI, preRead, cacheInt, \ - docId, EC) \ - do { \ - UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, \ - K_VALUE_FILTEROCC_FIRST_DOCID, EC); \ - docId = val64 + 1; \ +#define UC64_FILTEROCC_READ_FIRST_DOC(val, valI, preRead, cacheInt, \ + docId, EC) \ + do { \ + UC64_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, \ + K_VALUE_FILTEROCC_FIRST_DOCID, EC); \ + docId = val64 + 1; \ } while (0) -#define UC64_FILTEROCC_READ_NEXT_DOC(val, valI, preRead, cacheInt, \ - docId, EC) \ - do { \ - UC64_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, \ - K_VALUE_FILTEROCC_DELTA_DOCID, EC); \ - docId += val64 + 1; \ +#define UC64_FILTEROCC_READ_NEXT_DOC(val, valI, preRead, cacheInt, \ + docId, EC) \ + do { \ + UC64_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, \ + K_VALUE_FILTEROCC_DELTA_DOCID, EC); \ + docId += val64 + 1; \ } while (0) -#define UC64_FILTEROCC_READ_NEXT_DOC_NS(prefix, EC) \ - do { \ - UC64_FILTEROCC_READ_NEXT_DOC(prefix ## Val, prefix ## Compr, \ - prefix ## PreRead, \ - prefix ## CacheInt, \ - prefix ## DocId, EC); \ +#define UC64_FILTEROCC_READ_NEXT_DOC_NS(prefix, EC) \ + do { \ + UC64_FILTEROCC_READ_NEXT_DOC(prefix ## Val, prefix ## Compr, \ + prefix ## PreRead, \ + prefix ## CacheInt, \ + prefix ## DocId, EC); \ } while (0) -#define UC64_FILTEROCC_DECODECONTEXT \ - uint64_t val64; \ +#define UC64_FILTEROCC_DECODECONTEXT \ + uint64_t val64; \ unsigned int length; @@ -861,7 +861,7 @@ public: int compressedL3SkipBitOffset, const uint64_t *compressedL4SkipOccurrences, int compressedL4SkipBitOffset, - const std::string &name, + const std::string &name, const fef::TermFieldMatchDataArray &matchData); ~FakeFilterOccEGCompressed64SkipArrayIterator(); @@ -892,7 +892,7 @@ FakeFilterOccEGCompressed64SkipArrayIterator(const uint64_t *compressedOccurrenc int compressedL3SkipBitOffset, const uint64_t *compressedL4SkipOccurrences, int compressedL4SkipBitOffset, - const std::string &name, + const std::string &name, const fef::TermFieldMatchDataArray &matchData) : queryeval::RankedSearchIteratorBase(matchData), _docIdBits(compressedOccurrences, compressedBitOffset), diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h index 9b3ee172017..9417c32f1e5 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakeword.h @@ -68,7 +68,7 @@ public: uint32_t _docId; DocWordCollapsedFeature _collapsedDocWordFeatures; uint32_t _positions; - uint32_t _accPositions; // accumulated positions for previous words + uint32_t _accPositions; // accumulated positions for previous words DocWordFeature(); ~DocWordFeature(); @@ -155,7 +155,7 @@ public: DocWordFeatureList _extraPostings; DocWordPosFeatureList _extraWordPosFeatures; std::vector<Randomizer> _randomizer; - uint32_t _docIdLimit; // Documents in index + uint32_t _docIdLimit; // Documents in index std::string _name; const PosOccFieldsParams &_fieldsParams; uint32_t _packedIndex; diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp index 859ec6757ae..16a1d56883b 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcbfilterocc.cpp @@ -38,21 +38,21 @@ zcbEncode(std::vector<uint8_t> &bytes, } -#define ZCBDECODE(valI, resop) \ -do { \ - if (__builtin_expect((valI[0] & 1) != 0, true)) { \ - resop (valI[0] >> 1); \ - valI += 1; \ - } else if (__builtin_expect((valI[0] & 2) != 0, true)) { \ - resop (((*(const uint32_t *) valI) >> 2) & ((1 << 14) - 1)); \ - valI += 2; \ - } else if (__builtin_expect((valI[0] & 4) != 0, true)) { \ - resop (((*(const uint32_t *) valI) >> 3) & ((1 << 21) - 1)); \ - valI += 3; \ - } else { \ - resop ((*(const uint32_t *) valI) >> 4); \ - valI += 4; \ - } \ +#define ZCBDECODE(valI, resop) \ +do { \ + if (__builtin_expect((valI[0] & 1) != 0, true)) { \ + resop (valI[0] >> 1); \ + valI += 1; \ + } else if (__builtin_expect((valI[0] & 2) != 0, true)) { \ + resop (((*(const uint32_t *) valI) >> 2) & ((1 << 14) - 1)); \ + valI += 2; \ + } else if (__builtin_expect((valI[0] & 4) != 0, true)) { \ + resop (((*(const uint32_t *) valI) >> 3) & ((1 << 21) - 1)); \ + valI += 3; \ + } else { \ + resop ((*(const uint32_t *) valI) >> 4); \ + valI += 4; \ + } \ } while (0) FakeZcbFilterOcc::FakeZcbFilterOcc(const FakeWord &fw) diff --git a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp index abdcdec97f7..3c16fc8e9a8 100644 --- a/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp +++ b/searchlib/src/vespa/searchlib/test/fakedata/fakezcfilterocc.cpp @@ -48,34 +48,34 @@ writeZcBuf(EC &e, ZcBuf &buf) bytesOffset * 8, size * 8); } -#define ZCDECODE(valI, resop) \ -do { \ - if (__builtin_expect(valI[0] < (1 << 7), true)) { \ - resop valI[0]; \ - valI += 1; \ - } else if (__builtin_expect(valI[1] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - (valI[1] << 7); \ - valI += 2; \ - } else if (__builtin_expect(valI[2] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - (valI[2] << 14); \ - valI += 3; \ - } else if (__builtin_expect(valI[3] < (1 << 7), true)) { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - ((valI[2] & ((1 << 7) - 1)) << 14) + \ - (valI[3] << 21); \ - valI += 4; \ - } else { \ - resop (valI[0] & ((1 << 7) - 1)) + \ - ((valI[1] & ((1 << 7) - 1)) << 7) + \ - ((valI[2] & ((1 << 7) - 1)) << 14) + \ - ((valI[3] & ((1 << 7) - 1)) << 21) + \ - (valI[4] << 28); \ - valI += 5; \ - } \ +#define ZCDECODE(valI, resop) \ +do { \ + if (__builtin_expect(valI[0] < (1 << 7), true)) { \ + resop valI[0]; \ + valI += 1; \ + } else if (__builtin_expect(valI[1] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + (valI[1] << 7); \ + valI += 2; \ + } else if (__builtin_expect(valI[2] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + (valI[2] << 14); \ + valI += 3; \ + } else if (__builtin_expect(valI[3] < (1 << 7), true)) { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + ((valI[2] & ((1 << 7) - 1)) << 14) + \ + (valI[3] << 21); \ + valI += 4; \ + } else { \ + resop (valI[0] & ((1 << 7) - 1)) + \ + ((valI[1] & ((1 << 7) - 1)) << 7) + \ + ((valI[2] & ((1 << 7) - 1)) << 14) + \ + ((valI[3] & ((1 << 7) - 1)) << 21) + \ + (valI[4] << 28); \ + valI += 5; \ + } \ } while (0) FakeZcFilterOcc::FakeZcFilterOcc(const FakeWord &fw) diff --git a/searchlib/src/vespa/searchlib/util/comprbuffer.h b/searchlib/src/vespa/searchlib/util/comprbuffer.h index 670e9345191..bb568073cbd 100644 --- a/searchlib/src/vespa/searchlib/util/comprbuffer.h +++ b/searchlib/src/vespa/searchlib/util/comprbuffer.h @@ -15,7 +15,7 @@ private: public: void *_comprBuf; size_t _comprBufSize; - uint32_t _unitSize; // Size of unit in bytes, doubles up as alignment + uint32_t _unitSize; // Size of unit in bytes, doubles up as alignment bool _padBefore; void *_comprBufMalloc; FileAlign _aligner; diff --git a/searchlib/src/vespa/searchlib/util/comprfile.cpp b/searchlib/src/vespa/searchlib/util/comprfile.cpp index 35891e43270..194bed95d58 100644 --- a/searchlib/src/vespa/searchlib/util/comprfile.cpp +++ b/searchlib/src/vespa/searchlib/util/comprfile.cpp @@ -27,7 +27,7 @@ ComprFileReadBase::ReadComprBuffer(uint64_t stopOffset, retry: if (decodeContext.lastChunk()) - return; // Already reached end of file. + return; // Already reached end of file. int remainingUnits = decodeContext.remainingUnits(); // There's a good amount of data here already. @@ -53,7 +53,7 @@ ComprFileReadBase::ReadComprBuffer(uint64_t stopOffset, if (readAll) stopOffset = fileSize << 3; else if (!isretryread) { - stopOffset += 8 * cbuf.getUnitBitSize(); // XXX: Magic integer + stopOffset += 8 * cbuf.getUnitBitSize(); // XXX: Magic integer // Realign stop offset to direct IO alignment boundary uint64_t fileDirectIOBitAlign = static_cast<uint64_t>(fileDirectIOAlign) << 3; @@ -144,7 +144,7 @@ ComprFileReadBase::ReadComprBuffer(uint64_t stopOffset, decodeContext.endOfChunk() && isMore) { isretryread = true; - goto retry; // Alignment caused too short read + goto retry; // Alignment caused too short read } if (bitOffset != -1) { @@ -517,7 +517,7 @@ ComprFileReadContext::checkPointRead(nbostream &in) ComprBuffer::checkPointRead(in); ComprFileDecodeContext &d = *_decodeContext; d.checkPointRead(in); - in >> _checkPointOffset; // Cannot seek until file is opened + in >> _checkPointOffset; // Cannot seek until file is opened _checkPointOffsetValid = true; } diff --git a/searchlib/src/vespa/searchlib/util/comprfile.h b/searchlib/src/vespa/searchlib/util/comprfile.h index f09cc3184ba..b69ef140868 100644 --- a/searchlib/src/vespa/searchlib/util/comprfile.h +++ b/searchlib/src/vespa/searchlib/util/comprfile.h @@ -110,9 +110,9 @@ private: int _bitOffset; uint64_t _stopOffset; bool _readAll; - bool _checkPointOffsetValid; // Set only if checkpoint has been read + bool _checkPointOffsetValid; // Set only if checkpoint has been read FastOS_FileInterface *_file; - uint64_t _checkPointOffset; // bit offset saved by checkPointRead + uint64_t _checkPointOffset; // bit offset saved by checkPointRead public: ComprFileReadContext(ComprFileDecodeContext &decodeContext); diff --git a/searchlib/src/vespa/searchlib/util/filealign.h b/searchlib/src/vespa/searchlib/util/filealign.h index d2ed8289892..3e75fb2f371 100644 --- a/searchlib/src/vespa/searchlib/util/filealign.h +++ b/searchlib/src/vespa/searchlib/util/filealign.h @@ -55,7 +55,7 @@ public: /** * Setup alignment * - * @param elements suggested number of elements in buffer + * @param elements suggested number of elements in buffer * @param elemSize size of each elements * @param file File interface for IO * @param preferredFileAlignment prefered alignment for IO diff --git a/searchlib/src/vespa/searchlib/util/postingpriorityqueue.h b/searchlib/src/vespa/searchlib/util/postingpriorityqueue.h index c0fce0ac296..532c9e6711f 100644 --- a/searchlib/src/vespa/searchlib/util/postingpriorityqueue.h +++ b/searchlib/src/vespa/searchlib/util/postingpriorityqueue.h @@ -120,23 +120,23 @@ PostingPriorityQueue<IN>::adjust() { typedef typename Vector::iterator VIT; if (!_vec.front().get()->isValid()) { - _vec.erase(_vec.begin()); // Iterator no longer valid + _vec.erase(_vec.begin()); // Iterator no longer valid return; } - if (_vec.size() == 1) // Only one iterator left + if (_vec.size() == 1) // Only one iterator left return; // Peform binary search to find first element higher than changed value VIT gt = std::upper_bound(_vec.begin() + 1, _vec.end(), _vec.front()); VIT to = _vec.begin(); VIT from = to; ++from; - Ref changed = *to; // Remember changed value + Ref changed = *to; // Remember changed value while (from != gt) { // Shift elements to make space for changed value *to = *from; ++from; ++to; } - *to = changed; // Save changed value at right location + *to = changed; // Save changed value at right location } diff --git a/searchlib/src/vespa/searchlib/util/rawbuf.h b/searchlib/src/vespa/searchlib/util/rawbuf.h index d119e3a931f..123ceeaf5f7 100644 --- a/searchlib/src/vespa/searchlib/util/rawbuf.h +++ b/searchlib/src/vespa/searchlib/util/rawbuf.h @@ -24,10 +24,10 @@ private: RawBuf(const RawBuf &); RawBuf& operator=(const RawBuf &); - char* _bufStart; // ref. to start of buffer (don't move this!) - char* _bufEnd; // ref. to byte after last in buffer (don't mo) - char* _bufFillPos; // ref. to byte where next should be put in - char* _bufDrainPos; // ref. to next byte to take out of buffer + char* _bufStart; // ref. to start of buffer (don't move this!) + char* _bufEnd; // ref. to byte after last in buffer (don't mo) + char* _bufFillPos; // ref. to byte where next should be put in + char* _bufDrainPos; // ref. to next byte to take out of buffer char* _initialBufStart; size_t _initialSize; @@ -35,26 +35,26 @@ private: public: RawBuf(char *start, size_t size);// Initially use provided buffer - RawBuf(size_t size); // malloc-s given size, assigns to _bufStart - ~RawBuf(); // Frees _bufStart, i.e. the char[]. + RawBuf(size_t size); // malloc-s given size, assigns to _bufStart + ~RawBuf(); // Frees _bufStart, i.e. the char[]. - void operator+=(const char *src); - void operator+=(const RawBuf& buffer); + void operator+=(const char *src); + void operator+=(const RawBuf& buffer); bool operator==(const RawBuf &buffer); - void addNum(size_t num, size_t fieldw, char fill); + void addNum(size_t num, size_t fieldw, char fill); void addNum32(int32_t num, size_t fieldw, char fill); - void addNum64(int64_t num, size_t fieldw, char fill); + void addNum64(int64_t num, size_t fieldw, char fill); void addHitRank(HitRank num); void addSignedHitRank(SignedHitRank num); - void append(const void *data, size_t len); - void append(uint8_t byte); + void append(const void *data, size_t len); + void append(uint8_t byte); void appendLong(uint64_t n); void appendCompressedPositiveNumber(uint64_t n); void appendCompressedNumber(int64_t n); - bool IsEmpty(); // Return whether all written. - void expandBuf(size_t needlen); + bool IsEmpty(); // Return whether all written. + void expandBuf(size_t needlen); size_t GetFreeLen() const { return _bufEnd - _bufFillPos; } size_t GetDrainLen() const { return _bufDrainPos - _bufStart; } const char *GetDrainPos() const { return _bufDrainPos; } @@ -63,14 +63,14 @@ public: char * GetWritableFillPos(size_t len) { preAlloc(len); return _bufFillPos; } char * GetWritableDrainPos(size_t offset) { return _bufDrainPos + offset; } void truncate(size_t offset) { _bufFillPos = _bufDrainPos + offset; } - void preAlloc(size_t len); // Ensure room for 'len' more bytes. + void preAlloc(size_t len); // Ensure room for 'len' more bytes. size_t readFile(FastOS_FileInterface &file, size_t maxlen); - void reset() { _bufDrainPos = _bufFillPos = _bufStart; } + void reset() { _bufDrainPos = _bufFillPos = _bufStart; } void Compact(); void Reuse(); size_t GetUsedAndDrainLen() const { return _bufFillPos - _bufStart; } size_t GetUsedLen() const { return _bufFillPos - _bufDrainPos; } - void Drain(size_t len); // Adjust drain pos. + void Drain(size_t len); // Adjust drain pos. void Fill(size_t len) { _bufFillPos += len; } void ensureSize(size_t size) { @@ -102,7 +102,7 @@ public: */ static unsigned char* ToInet(uint16_t src, unsigned char* dst) { *(dst + 1) = static_cast<unsigned char>(src); // The least significant 8 bits - src >>= 8; // of 'src' are stored. + src >>= 8; // of 'src' are stored. *dst = static_cast<unsigned char>(src); return dst + 2; }; @@ -113,8 +113,8 @@ public: reinterpret_cast<unsigned char*>(_bufFillPos))); }; static unsigned char* ToInet(uint32_t src, unsigned char* dst) { - *(dst + 3) = src; // The least significant 8 bits - src >>= 8; // of 'src' are stored. + *(dst + 3) = src; // The least significant 8 bits + src >>= 8; // of 'src' are stored. *(dst + 2) = src; src >>= 8; *(dst + 1) = src; diff --git a/searchlib/src/vespa/searchlib/util/url.cpp b/searchlib/src/vespa/searchlib/util/url.cpp index d60acfa31d5..9c9a5ca5b51 100644 --- a/searchlib/src/vespa/searchlib/util/url.cpp +++ b/searchlib/src/vespa/searchlib/util/url.cpp @@ -140,8 +140,8 @@ URL::IsTokenChar(unsigned char c) // According to FAST URL tokenization template <bool (*IsPartChar)(unsigned char c)> unsigned char * URL::ParseURLPart(unsigned char *src, - unsigned char *dest, - unsigned int destsize) + unsigned char *dest, + unsigned int destsize) { unsigned char *p = src; unsigned int len = 0; |