mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-21 00:25:50 +00:00
Fix compiler warnings. Note some patches were obtained from LibreOffice.
This commit is contained in:
parent
bc1217b210
commit
0dac7c3390
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=359182
@ -3,7 +3,7 @@
|
||||
|
||||
PORTNAME= clucene
|
||||
PORTVERSION= 2.3.3.4
|
||||
PORTREVISION= 3
|
||||
PORTREVISION= 4
|
||||
CATEGORIES= textproc
|
||||
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-core-unstable/2.3
|
||||
DISTNAME= ${PORTNAME}-core-${PORTVERSION}
|
||||
|
@ -0,0 +1,11 @@
|
||||
--- src/core/CLucene/analysis/AnalysisHeader.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/analysis/AnalysisHeader.cpp 2014-06-24 18:57:17.000000000 -0400
|
||||
@@ -212,7 +212,7 @@
|
||||
sb.append(_T(","));
|
||||
sb.appendInt( _endOffset );
|
||||
|
||||
- if (!_tcscmp( _type, _T("word")) == 0 ){
|
||||
+ if (_tcscmp( _type, _T("word")) != 0) {
|
||||
sb.append(_T(",type="));
|
||||
sb.append(_type);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
--- src/core/CLucene/index/DocumentsWriterThreadState.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/index/DocumentsWriterThreadState.cpp 2014-06-24 18:37:18.000000000 -0400
|
||||
@@ -994,7 +994,7 @@
|
||||
const TCHAR* tokenText = token->termBuffer();
|
||||
const int32_t tokenTextLen = token->termLength();
|
||||
|
||||
- int32_t code = 0;
|
||||
+ uint32_t code = 0;
|
||||
|
||||
// Compute hashcode
|
||||
int32_t downto = tokenTextLen;
|
||||
@@ -1203,7 +1203,8 @@
|
||||
const int32_t newMask = newSize-1;
|
||||
|
||||
ValueArray<Posting*> newHash(newSize);
|
||||
- int32_t hashPos, code;
|
||||
+ int32_t hashPos;
|
||||
+ uint32_t code;
|
||||
const TCHAR* pos = NULL;
|
||||
const TCHAR* start = NULL;
|
||||
Posting* p0;
|
@ -0,0 +1,11 @@
|
||||
--- src/core/CLucene/index/IndexFileDeleter.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/index/IndexFileDeleter.cpp 2014-06-24 19:06:58.000000000 -0400
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
string& fileName = files.at(i);
|
||||
|
||||
- if (filter->accept(NULL, fileName.c_str()) && !fileName.compare(IndexFileNames::SEGMENTS_GEN) == 0) {
|
||||
+ if (filter->accept(NULL, fileName.c_str()) && fileName.compare(IndexFileNames::SEGMENTS_GEN) != 0) {
|
||||
|
||||
// Add this file to refCounts with initial count 0:
|
||||
getRefCount(fileName.c_str());
|
@ -1,6 +1,14 @@
|
||||
--- src/core/CLucene/index/IndexWriter.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/index/IndexWriter.cpp 2013-03-27 16:56:54.000000000 -0400
|
||||
@@ -814,7 +814,7 @@
|
||||
+++ src/core/CLucene/index/IndexWriter.cpp 2014-06-24 19:10:36.000000000 -0400
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
DEFINE_MUTEX(IndexWriter::MESSAGE_ID_LOCK)
|
||||
int32_t IndexWriter::MESSAGE_ID = 0;
|
||||
-const int32_t IndexWriter::MAX_TERM_LENGTH = DocumentsWriter::MAX_TERM_LENGTH;
|
||||
|
||||
class IndexWriter::Internal{
|
||||
public:
|
||||
@@ -814,7 +813,7 @@
|
||||
ensureOpen();
|
||||
|
||||
if (maxNumSegments < 1)
|
||||
@ -9,3 +17,30 @@
|
||||
|
||||
if (infoStream != NULL)
|
||||
message("optimize: index now " + segString());
|
||||
@@ -1392,7 +1391,7 @@
|
||||
// Check if the doc stores must be separately flushed
|
||||
// because other segments, besides the one we are about
|
||||
// to flush, reference it
|
||||
- if (_flushDocStores && (!flushDocs || !docWriter->getSegment().compare(docWriter->getDocStoreSegment())==0 )) {
|
||||
+ if (_flushDocStores && (!flushDocs || docWriter->getSegment().compare(docWriter->getDocStoreSegment()) != 0)) {
|
||||
// We must separately flush the doc store
|
||||
if (infoStream != NULL)
|
||||
message(" flush shared docStore segment " + docStoreSegment);
|
||||
@@ -1631,7 +1630,7 @@
|
||||
// Load deletes present @ start of merge, for this segment:
|
||||
BitVector previousDeletes(previousInfo->dir, previousInfo->getDelFileName().c_str());
|
||||
|
||||
- if (!currentInfo->getDelFileName().compare(previousInfo->getDelFileName())==0 ){
|
||||
+ if (currentInfo->getDelFileName().compare(previousInfo->getDelFileName()) != 0) {
|
||||
// This means this segment has had new deletes
|
||||
// committed since we started the merge, so we
|
||||
// must merge them:
|
||||
@@ -1928,7 +1927,7 @@
|
||||
mergeDocStores = true;
|
||||
else if (lastDocStoreSegment.empty())
|
||||
lastDocStoreSegment = docStoreSegment;
|
||||
- else if (!lastDocStoreSegment.compare(docStoreSegment)==0 )
|
||||
+ else if (lastDocStoreSegment.compare(docStoreSegment) != 0)
|
||||
mergeDocStores = true;
|
||||
|
||||
// Segments' docScoreOffsets must be in-order,
|
||||
|
@ -0,0 +1,17 @@
|
||||
--- src/core/CLucene/index/IndexWriter.h.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/index/IndexWriter.h 2014-06-24 18:17:57.000000000 -0400
|
||||
@@ -384,14 +384,6 @@
|
||||
*/
|
||||
static const int32_t DEFAULT_MAX_MERGE_DOCS;
|
||||
|
||||
- /**
|
||||
- * Absolute hard maximum length for a term. If a term
|
||||
- * arrives from the analyzer longer than this length, it
|
||||
- * is skipped and a message is printed to infoStream, if
|
||||
- * set (see {@link #setInfoStream}).
|
||||
- */
|
||||
- static const int32_t MAX_TERM_LENGTH;
|
||||
-
|
||||
|
||||
/* Determines how often segment indices are merged by addDocument(). With
|
||||
* smaller values, less RAM is used while indexing, and searches on
|
@ -0,0 +1,11 @@
|
||||
--- src/core/CLucene/index/TermInfosReader.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/index/TermInfosReader.cpp 2014-06-24 18:19:42.000000000 -0400
|
||||
@@ -111,7 +111,7 @@
|
||||
//destroy their elements
|
||||
#ifdef _DEBUG
|
||||
for ( int32_t i=0; i<indexTermsLength;++i ){
|
||||
- indexTerms[i].__cl_refcount--;
|
||||
+ indexTerms[i].__cl_decref();
|
||||
}
|
||||
#endif
|
||||
//Delete the arrays
|
@ -0,0 +1,11 @@
|
||||
--- src/core/CLucene/queryParser/QueryParser.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/queryParser/QueryParser.cpp 2014-06-24 18:33:06.000000000 -0400
|
||||
@@ -79,7 +79,7 @@
|
||||
_T("<RANGEEX_GOOP>")
|
||||
};
|
||||
|
||||
-const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
|
||||
+const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,int32_t(0x80000000),0x20000000,int32_t(0x80000000),0x10000,0x80000,0x10000,0x1f68000};
|
||||
const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
|
||||
|
||||
struct QueryParser::JJCalls {
|
@ -0,0 +1,62 @@
|
||||
--- src/core/CLucene/queryParser/QueryParserTokenManager.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/queryParser/QueryParserTokenManager.cpp 2014-06-24 19:34:09.000000000 -0400
|
||||
@@ -15,9 +15,9 @@
|
||||
|
||||
CL_NS_DEF(queryParser)
|
||||
|
||||
-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
|
||||
+const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))};
|
||||
const int64_t QueryParserTokenManager::jjbitVec0[] = {
|
||||
- _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
|
||||
+ int64_t(_ILONGLONG(0xfffffffffffffffe)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))
|
||||
};
|
||||
const int32_t QueryParserTokenManager::jjnextStates[]={
|
||||
15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27,
|
||||
@@ -544,7 +544,10 @@
|
||||
kind = 0x7fffffff;
|
||||
}
|
||||
++curPos;
|
||||
- if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
|
||||
+ i = jjnewStateCnt;
|
||||
+ jjnewStateCnt = startsAt;
|
||||
+ startsAt = 36 - jjnewStateCnt;
|
||||
+ if (i == startsAt)
|
||||
return curPos;
|
||||
try { curChar = input_stream->readChar(); }
|
||||
catch(CLuceneError& e) {
|
||||
@@ -756,7 +759,10 @@
|
||||
kind = 0x7fffffff;
|
||||
}
|
||||
++curPos;
|
||||
- if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
|
||||
+ i = jjnewStateCnt;
|
||||
+ jjnewStateCnt = startsAt;
|
||||
+ startsAt = 7 - jjnewStateCnt;
|
||||
+ if (i == startsAt)
|
||||
return curPos;
|
||||
try { curChar = input_stream->readChar(); }
|
||||
catch(CLuceneError& e) {
|
||||
@@ -854,7 +860,10 @@
|
||||
kind = 0x7fffffff;
|
||||
}
|
||||
++curPos;
|
||||
- if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
|
||||
+ i = jjnewStateCnt;
|
||||
+ jjnewStateCnt = startsAt;
|
||||
+ startsAt = 3 - jjnewStateCnt;
|
||||
+ if (i == startsAt)
|
||||
return curPos;
|
||||
try { curChar = input_stream->readChar(); }
|
||||
catch(CLuceneError& e) {
|
||||
@@ -1066,7 +1075,10 @@
|
||||
kind = 0x7fffffff;
|
||||
}
|
||||
++curPos;
|
||||
- if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
|
||||
+ i = jjnewStateCnt;
|
||||
+ jjnewStateCnt = startsAt;
|
||||
+ startsAt = 7 - jjnewStateCnt;
|
||||
+ if (i == startsAt)
|
||||
return curPos;
|
||||
try { curChar = input_stream->readChar(); }
|
||||
catch(CLuceneError& e) {
|
@ -0,0 +1,11 @@
|
||||
--- src/core/CLucene/queryParser/legacy/Lexer.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/queryParser/legacy/Lexer.cpp 2014-06-24 18:33:06.000000000 -0400
|
||||
@@ -117,7 +117,7 @@
|
||||
if( _istspace(ch)!=0 ) {
|
||||
continue;
|
||||
}
|
||||
- TCHAR buf[2] = {ch,'\0'};
|
||||
+ TCHAR buf[2] = {TCHAR(ch),'\0'};
|
||||
switch(ch) {
|
||||
case '+':
|
||||
token->set(buf, QueryToken::PLUS);
|
@ -0,0 +1,14 @@
|
||||
--- src/core/CLucene/store/FSDirectory.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/store/FSDirectory.cpp 2014-06-24 18:26:54.000000000 -0400
|
||||
@@ -219,9 +219,8 @@
|
||||
_CLDECDELETE(handle);
|
||||
|
||||
//printf("handle=%d\n", handle->__cl_refcount);
|
||||
- if ( dounlock ){
|
||||
- mutex->unlock();
|
||||
- }else{
|
||||
+ mutex->unlock();
|
||||
+ if ( !dounlock ) {
|
||||
delete mutex;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
--- src/core/CLucene/store/IndexInput.cpp.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/store/IndexInput.cpp 2014-06-24 18:38:50.000000000 -0400
|
||||
@@ -41,8 +41,8 @@
|
||||
}
|
||||
|
||||
int64_t IndexInput::readLong() {
|
||||
- int64_t i = ((int64_t)readInt() << 32);
|
||||
- return (i | ((int64_t)readInt() & 0xFFFFFFFFL));
|
||||
+ uint64_t i = ((uint64_t)readInt() << 32);
|
||||
+ return (i | ((uint64_t)readInt() & 0xFFFFFFFFL));
|
||||
}
|
||||
|
||||
int64_t IndexInput::readVLong() {
|
@ -1,6 +1,20 @@
|
||||
--- src/core/CLucene/util/VoidMap.h.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/core/CLucene/util/VoidMap.h 2013-01-08 17:37:43.000000000 -0500
|
||||
@@ -83,7 +83,7 @@
|
||||
+++ src/core/CLucene/util/VoidMap.h 2014-06-24 18:48:01.000000000 -0400
|
||||
@@ -11,8 +11,13 @@
|
||||
#include "CLucene/LuceneThreads.h"
|
||||
|
||||
#if defined(_CL_HAVE_TR1_UNORDERED_MAP) && defined(_CL_HAVE_TR1_UNORDERED_SET)
|
||||
+#if defined(_LIBCPP_VERSION)
|
||||
+ #include <unordered_map>
|
||||
+ #include <unordered_set>
|
||||
+#else
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
+#endif
|
||||
#elif defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET)
|
||||
//hashing is all or nothing!
|
||||
#include <hash_map>
|
||||
@@ -83,7 +88,7 @@
|
||||
_vt get( _kt k) const {
|
||||
const_iterator itr = base::find(k);
|
||||
if ( itr==base::end() )
|
||||
@ -9,7 +23,7 @@
|
||||
else
|
||||
return itr->second;
|
||||
}
|
||||
@@ -316,6 +316,7 @@
|
||||
@@ -316,6 +321,7 @@
|
||||
if ( _this::dk || _this::dv )
|
||||
_this::remove(k);
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
--- src/shared/cmake/CheckHashmaps.cmake.orig 2011-03-16 20:21:07.000000000 -0400
|
||||
+++ src/shared/cmake/CheckHashmaps.cmake 2014-06-24 19:20:14.000000000 -0400
|
||||
@@ -35,8 +35,12 @@
|
||||
#elif defined(_CL_HAVE_EXT_HASH_MAP)
|
||||
#include <ext/hash_map>
|
||||
#elif defined(_CL_HAVE_TR1_UNORDERED_MAP)
|
||||
+#if defined(_LIBCPP_VERSION)
|
||||
+ #include <unordered_map>
|
||||
+#else
|
||||
#include <tr1/unordered_map>
|
||||
#endif
|
||||
+#endif
|
||||
int main() {
|
||||
${namespace}::${_CL_HASH_MAP}<int,char> a;
|
||||
return 0;
|
Loading…
Reference in New Issue
Block a user