From f4f7a4e212dc96146a9b71c8a09d375a1cd9980e Mon Sep 17 00:00:00 2001 From: Jason Gilanfarr Date: Thu, 26 Sep 2013 16:46:23 -0700 Subject: [PATCH] Add support for compiling with c++11. --- include/Array.h | 2 +- include/AttributeSource.h | 2 +- include/Collection.h | 2 +- include/HashMap.h | 2 +- include/HashSet.h | 2 +- include/Map.h | 2 +- include/MiscUtils.h | 2 +- include/Set.h | 2 +- src/core/include/_FieldCacheRangeFilter.h | 2 +- src/core/index/DirectoryReader.cpp | 2 +- src/core/index/IndexWriter.cpp | 2 +- src/core/index/MultiLevelSkipListReader.cpp | 2 +- src/core/index/SegmentMerger.cpp | 2 +- src/core/index/SegmentReader.cpp | 4 ++-- src/core/queryparser/QueryParserTokenManager.cpp | 7 ++++--- src/core/search/FieldCacheRangeFilter.cpp | 2 +- src/core/search/Query.cpp | 2 +- src/core/store/NativeFSLockFactory.cpp | 2 +- src/core/util/OpenBitSetIterator.cpp | 2 +- 19 files changed, 23 insertions(+), 22 deletions(-) diff --git a/include/Array.h b/include/Array.h index 774d58a..46f38aa 100644 --- a/include/Array.h +++ b/include/Array.h @@ -119,7 +119,7 @@ namespace Lucene operator bool () const { - return container; + return container.get() != NULL; } bool operator! () const diff --git a/include/AttributeSource.h b/include/AttributeSource.h index ed3895b..13f716e 100644 --- a/include/AttributeSource.h +++ b/include/AttributeSource.h @@ -95,7 +95,7 @@ namespace Lucene template bool hasAttribute() { - return getAttribute(ATTR::_getClassName()); + return getAttribute(ATTR::_getClassName()).get() != NULL; } /// Returns the instance of the passed in Attribute contained in this AttributeSource. diff --git a/include/Collection.h b/include/Collection.h index 2e05a82..31d475e 100644 --- a/include/Collection.h +++ b/include/Collection.h @@ -211,7 +211,7 @@ namespace Lucene operator bool() const { - return container; + return container.get() != NULL; } bool operator! () const diff --git a/include/HashMap.h b/include/HashMap.h index 2d40f5d..217c774 100644 --- a/include/HashMap.h +++ b/include/HashMap.h @@ -82,7 +82,7 @@ namespace Lucene operator bool() const { - return mapContainer; + return mapContainer.get() != NULL; } bool operator! () const diff --git a/include/HashSet.h b/include/HashSet.h index cefd533..b7dff18 100644 --- a/include/HashSet.h +++ b/include/HashSet.h @@ -88,7 +88,7 @@ namespace Lucene operator bool() const { - return setContainer; + return setContainer.get() != NULL; } bool operator! () const diff --git a/include/Map.h b/include/Map.h index c7dabcd..36e8cd9 100644 --- a/include/Map.h +++ b/include/Map.h @@ -82,7 +82,7 @@ namespace Lucene operator bool() const { - return mapContainer; + return mapContainer.get() != NULL; } bool operator! () const diff --git a/include/MiscUtils.h b/include/MiscUtils.h index ed65f70..7227b93 100644 --- a/include/MiscUtils.h +++ b/include/MiscUtils.h @@ -125,7 +125,7 @@ namespace Lucene template static bool typeOf(LuceneObjectPtr object) { - return boost::dynamic_pointer_cast(object); + return boost::dynamic_pointer_cast(object).get() != NULL; } /// Return whether given Lucene objects are of equal type. diff --git a/include/Set.h b/include/Set.h index bc62f17..7adff10 100644 --- a/include/Set.h +++ b/include/Set.h @@ -132,7 +132,7 @@ namespace Lucene operator bool() const { - return setContainer; + return setContainer.get() != NULL; } bool operator! () const diff --git a/src/core/include/_FieldCacheRangeFilter.h b/src/core/include/_FieldCacheRangeFilter.h index 7e494fd..ba44022 100644 --- a/src/core/include/_FieldCacheRangeFilter.h +++ b/src/core/include/_FieldCacheRangeFilter.h @@ -146,7 +146,7 @@ namespace Lucene return false; if (lowerVal != otherFilter->lowerVal || upperVal != otherFilter->upperVal) return false; - if (parser ? !parser->equals(otherFilter->parser) : otherFilter->parser) + if (parser.get() != NULL ? !parser->equals(otherFilter->parser) : otherFilter->parser.get() != NULL) return false; return true; } diff --git a/src/core/index/DirectoryReader.cpp b/src/core/index/DirectoryReader.cpp index 2d2d1ce..9fddf41 100644 --- a/src/core/index/DirectoryReader.cpp +++ b/src/core/index/DirectoryReader.cpp @@ -976,7 +976,7 @@ namespace Lucene SegmentMergeInfoPtr smi(newLucene(starts[i], termEnum, reader)); smi->ord = i; - if (t ? termEnum->term() : smi->next()) + if (t.get() != NULL ? termEnum->term().get() != NULL : smi->next()) queue->add(smi); // initialize queue else smi->close(); diff --git a/src/core/index/IndexWriter.cpp b/src/core/index/IndexWriter.cpp index aabb6e4..11926e9 100644 --- a/src/core/index/IndexWriter.cpp +++ b/src/core/index/IndexWriter.cpp @@ -687,7 +687,7 @@ namespace Lucene bool IndexWriter::verbose() { - return infoStream; + return infoStream.get() != NULL; } void IndexWriter::setWriteLockTimeout(int64_t writeLockTimeout) diff --git a/src/core/index/MultiLevelSkipListReader.cpp b/src/core/index/MultiLevelSkipListReader.cpp index 19096b6..c38fd60 100644 --- a/src/core/index/MultiLevelSkipListReader.cpp +++ b/src/core/index/MultiLevelSkipListReader.cpp @@ -27,7 +27,7 @@ namespace Lucene this->maxNumberOfSkipLevels = maxSkipLevels; this->skipInterval = Collection::newInstance(maxSkipLevels); this->skipStream[0] = skipStream; - this->inputIsBuffered = boost::dynamic_pointer_cast(skipStream); + this->inputIsBuffered = boost::dynamic_pointer_cast(skipStream).get() != NULL; this->skipInterval[0] = skipInterval; this->skipDoc = Collection::newInstance(maxSkipLevels); diff --git a/src/core/index/SegmentMerger.cpp b/src/core/index/SegmentMerger.cpp index d532501..41f4dc5 100644 --- a/src/core/index/SegmentMerger.cpp +++ b/src/core/index/SegmentMerger.cpp @@ -38,7 +38,7 @@ namespace Lucene const int32_t SegmentMerger::MAX_RAW_MERGE_DOCS = 4192; /// norms header placeholder - const uint8_t SegmentMerger::NORMS_HEADER[] = {'N', 'R', 'M', -1}; + const uint8_t SegmentMerger::NORMS_HEADER[] = {'N', 'R', 'M', static_cast(-1) }; const int32_t SegmentMerger::NORMS_HEADER_LENGTH = 4; SegmentMerger::SegmentMerger(DirectoryPtr dir, const String& name) diff --git a/src/core/index/SegmentReader.cpp b/src/core/index/SegmentReader.cpp index 2be0b1f..d9d1b79 100644 --- a/src/core/index/SegmentReader.cpp +++ b/src/core/index/SegmentReader.cpp @@ -376,7 +376,7 @@ namespace Lucene bool SegmentReader::hasDeletions() { // Don't call ensureOpen() here (it could affect performance) - return deletedDocs; + return deletedDocs.get() != NULL; } bool SegmentReader::usesCompoundFile(SegmentInfoPtr si) @@ -923,7 +923,7 @@ namespace Lucene bool CoreReaders::termsIndexIsLoaded() { SyncLock syncLock(this); - return tis; + return tis.get() != NULL; } void CoreReaders::loadTermsIndex(SegmentInfoPtr si, int32_t termsIndexDivisor) diff --git a/src/core/queryparser/QueryParserTokenManager.cpp b/src/core/queryparser/QueryParserTokenManager.cpp index e769470..cb64c97 100644 --- a/src/core/queryparser/QueryParserTokenManager.cpp +++ b/src/core/queryparser/QueryParserTokenManager.cpp @@ -15,9 +15,10 @@ namespace Lucene { const int64_t QueryParserTokenManager::jjbitVec0[] = {0x1LL, 0x0LL, 0x0LL, 0x0LL}; - const int64_t QueryParserTokenManager::jjbitVec1[] = {0xfffffffffffffffeLL, 0xffffffffffffffffLL, 0xffffffffffffffffLL, 0xffffffffffffffffLL}; - const int64_t QueryParserTokenManager::jjbitVec3[] = {0x0LL, 0x0LL, 0xffffffffffffffffLL, 0xffffffffffffffffLL}; - const int64_t QueryParserTokenManager::jjbitVec4[] = {0xfffefffffffffffeLL, 0xffffffffffffffffLL, 0xffffffffffffffffLL, 0xffffffffffffffffLL}; + const int64_t QueryParserTokenManager::jjbitVec1[] = {static_cast(0xfffffffffffffffeLL), static_cast(0xffffffffffffffffLL), static_cast(0xffffffffffffffffLL), static_cast(0xffffffffffffffffLL)}; + const int64_t QueryParserTokenManager::jjbitVec3[] = {0x0LL, 0x0LL, static_cast(0xffffffffffffffffLL), static_cast(0xffffffffffffffffLL)}; + const int64_t QueryParserTokenManager::jjbitVec4[] = {static_cast(0xfffefffffffffffeLL), static_cast(0xffffffffffffffffLL), static_cast(0xffffffffffffffffLL), static_cast(0xffffffffffffffffLL)}; + const int32_t QueryParserTokenManager::jjnextStates[] = {15, 16, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27, 2, 4, 5, 0, 1}; /// Token literal values. diff --git a/src/core/search/FieldCacheRangeFilter.cpp b/src/core/search/FieldCacheRangeFilter.cpp index ce82a28..1585121 100644 --- a/src/core/search/FieldCacheRangeFilter.cpp +++ b/src/core/search/FieldCacheRangeFilter.cpp @@ -170,7 +170,7 @@ namespace Lucene return false; if (lowerVal != otherFilter->lowerVal || upperVal != otherFilter->upperVal) return false; - if (parser ? !parser->equals(otherFilter->parser) : otherFilter->parser) + if (parser.get() != NULL ? !parser->equals(otherFilter->parser) : otherFilter->parser.get() != NULL) return false; return true; } diff --git a/src/core/search/Query.cpp b/src/core/search/Query.cpp index 33aac96..0cfc482 100644 --- a/src/core/search/Query.cpp +++ b/src/core/search/Query.cpp @@ -73,7 +73,7 @@ namespace Lucene Collection clauses; BooleanQueryPtr bq(boost::dynamic_pointer_cast(*query)); // check if we can split the query into clauses - bool splittable = bq; + bool splittable = bq.get() != NULL; if (splittable) { splittable = bq->isCoordDisabled(); diff --git a/src/core/store/NativeFSLockFactory.cpp b/src/core/store/NativeFSLockFactory.cpp index 06f9a47..cc5e96e 100644 --- a/src/core/store/NativeFSLockFactory.cpp +++ b/src/core/store/NativeFSLockFactory.cpp @@ -79,7 +79,7 @@ namespace Lucene bool NativeFSLock::lockExists() { SyncLock syncLock(this); - return lock; + return lock.get() != NULL; } bool NativeFSLock::obtain() diff --git a/src/core/util/OpenBitSetIterator.cpp b/src/core/util/OpenBitSetIterator.cpp index 5d61c13..3d43e06 100644 --- a/src/core/util/OpenBitSetIterator.cpp +++ b/src/core/util/OpenBitSetIterator.cpp @@ -43,7 +43,7 @@ namespace Lucene 0x876, 0x8761, 0x8762, 0x87621, 0x8763, 0x87631, 0x87632, 0x876321, 0x8764, 0x87641, 0x87642, 0x876421, 0x87643, 0x876431, 0x876432, 0x8764321, 0x8765, 0x87651, 0x87652, 0x876521, 0x87653, 0x876531, 0x876532, 0x8765321, 0x87654, - 0x876541, 0x876542, 0x8765421, 0x876543, 0x8765431, 0x8765432, 0x87654321 + 0x876541, 0x876542, 0x8765421, 0x876543, 0x8765431, 0x8765432, static_cast(0x87654321) }; OpenBitSetIterator::OpenBitSetIterator(OpenBitSetPtr bitSet) -- 1.8.5.2