summaryrefslogtreecommitdiff
path: root/community/lucene++/0001-Add-support-for-compiling-with-c-11.patch
blob: afd4dd7cd928093391d208ad051697c6d58a1316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
From f4f7a4e212dc96146a9b71c8a09d375a1cd9980e Mon Sep 17 00:00:00 2001
From: Jason Gilanfarr <jason@upthere.com>
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 <class ATTR>
         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 <typename TYPE>
         static bool typeOf(LuceneObjectPtr object)
         {
-            return boost::dynamic_pointer_cast<TYPE>(object);
+            return boost::dynamic_pointer_cast<TYPE>(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<SegmentMergeInfo>(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<int32_t>::newInstance(maxSkipLevels);
         this->skipStream[0] = skipStream;
-        this->inputIsBuffered = boost::dynamic_pointer_cast<BufferedIndexInput>(skipStream);
+        this->inputIsBuffered = boost::dynamic_pointer_cast<BufferedIndexInput>(skipStream).get() != NULL;
         this->skipInterval[0] = skipInterval;
         this->skipDoc = Collection<int32_t>::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<uint8_t>(-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<int64_t>(0xfffffffffffffffeLL), static_cast<int64_t>(0xffffffffffffffffLL), static_cast<int64_t>(0xffffffffffffffffLL), static_cast<int64_t>(0xffffffffffffffffLL)};
+    const int64_t QueryParserTokenManager::jjbitVec3[] = {0x0LL, 0x0LL, static_cast<int64_t>(0xffffffffffffffffLL), static_cast<int64_t>(0xffffffffffffffffLL)};
+    const int64_t QueryParserTokenManager::jjbitVec4[] = {static_cast<int64_t>(0xfffefffffffffffeLL), static_cast<int64_t>(0xffffffffffffffffLL), static_cast<int64_t>(0xffffffffffffffffLL), static_cast<int64_t>(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<BooleanClausePtr> clauses;
             BooleanQueryPtr bq(boost::dynamic_pointer_cast<BooleanQuery>(*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<int32_t>(0x87654321)
     };
     
     OpenBitSetIterator::OpenBitSetIterator(OpenBitSetPtr bitSet)
-- 
1.8.5.2