From 12bf0314937b208b9c07d15972314d61ef845006 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 12 Feb 2023 22:08:41 -0600 Subject: user/clucene: Retire to legacy/ No upstream commits in years. No response to bug reports from other teams. Really weird test failures on 32-bit architectures, likely caused by interactions with signedness and 64-bit integers. Ref: #873 #880 --- legacy/clucene/narrowing.patch | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 legacy/clucene/narrowing.patch (limited to 'legacy/clucene/narrowing.patch') diff --git a/legacy/clucene/narrowing.patch b/legacy/clucene/narrowing.patch new file mode 100644 index 000000000..656e5a457 --- /dev/null +++ b/legacy/clucene/narrowing.patch @@ -0,0 +1,54 @@ +Use larger ints to avoid narrowing casts. + +--- a/src/core/CLucene/queryParser/QueryParser.cpp 2011-03-17 00:21:07.000000000 +0000 ++++ b/src/core/CLucene/queryParser/QueryParser.cpp +@@ -79,8 +79,8 @@ const TCHAR* QueryParserConstants::token + _T("") + }; + +-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_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0}; ++const int64_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 int64_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 { + public: +--- a/src/core/CLucene/queryParser/QueryParser.h 2011-03-17 00:21:07.000000000 +0000 ++++ b/src/core/CLucene/queryParser/QueryParser.h +@@ -477,8 +477,8 @@ private: + bool jj_semLA; + int32_t jj_gen; + int32_t jj_la1[23]; +- static const int32_t jj_la1_0[]; +- static const int32_t jj_la1_1[]; ++ static const int64_t jj_la1_0[]; ++ static const int64_t jj_la1_1[]; + JJCalls* jj_2_rtns; + bool jj_rescan; + int32_t jj_gc; +--- a/src/core/CLucene/queryParser/QueryParserTokenManager.cpp 2011-03-17 00:21:07.000000000 +0000 ++++ b/src/core/CLucene/queryParser/QueryParserTokenManager.cpp +@@ -15,8 +15,8 @@ + + CL_NS_DEF(queryParser) + +-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)}; +-const int64_t QueryParserTokenManager::jjbitVec0[] = { ++const uint64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)}; ++const uint64_t QueryParserTokenManager::jjbitVec0[] = { + _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff) + }; + const int32_t QueryParserTokenManager::jjnextStates[]={ +--- a/src/core/CLucene/queryParser/QueryParserTokenManager.h 2011-03-17 00:21:07.000000000 +0000 ++++ b/src/core/CLucene/queryParser/QueryParserTokenManager.h +@@ -35,8 +35,8 @@ private: + void jjCheckNAddStates(int32_t start, const int32_t end); + void jjCheckNAddStates(const int32_t start); + +- static const int64_t jjbitVec0[]; +- static const int64_t jjbitVec2[]; ++ static const uint64_t jjbitVec0[]; ++ static const uint64_t jjbitVec2[]; + + int32_t jjMoveNfa_3(const int32_t startState, int32_t curPos); + -- cgit v1.2.3-60-g2f50