[Libreoffice-commits] core.git: external/clucene

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 6 11:57:41 UTC 2021


 external/clucene/UnpackedTarball_clucene.mk  |    1 +
 external/clucene/patches/write-strings.patch |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

New commits:
commit 101fa3fc1e03f82c864069338956a26dd85de219
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 6 10:28:53 2021 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Jan 6 12:56:58 2021 +0100

    external/clucene: Fix MSVC /Zc:strictStrings
    
    ...which is apparently enabled at least in MSVC 2019 16.8.3 when building with
    --with-latest-c++ (i.e., /std:c++latest):
    
    > C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(124): error C2664: 'bool lucene::analysis::PorterStemmer::ends(TCHAR *)': cannot convert argument 1 from 'const wchar_t [5]' to 'TCHAR *'
    > C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(124): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
    > C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(97): note: see declaration of 'lucene::analysis::PorterStemmer::ends'
    
    etc. (and which is not silenced by gb_Library_set_warnings_disabled in
    external/clucene/Library_clucene.mk, unlike the corresponding Clang/GCC
    -Wwrite-strings)
    
    Change-Id: Id3c8eefa4658bf942de6c8ae9b219212eba79995
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108840
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/external/clucene/UnpackedTarball_clucene.mk b/external/clucene/UnpackedTarball_clucene.mk
index 0aded2ceedd6..37c1c16dab0f 100644
--- a/external/clucene/UnpackedTarball_clucene.mk
+++ b/external/clucene/UnpackedTarball_clucene.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,clucene,\
 	external/clucene/patches/ostream-wchar_t.patch \
 	external/clucene/patches/heap-buffer-overflow.patch \
 	external/clucene/patches/c++20.patch \
+	external/clucene/patches/write-strings.patch \
 ))
 
 ifneq ($(OS),WNT)
diff --git a/external/clucene/patches/write-strings.patch b/external/clucene/patches/write-strings.patch
new file mode 100644
index 000000000000..d1661ee727d1
--- /dev/null
+++ b/external/clucene/patches/write-strings.patch
@@ -0,0 +1,22 @@
+--- src/contribs-lib/CLucene/analysis/PorterStemmer.cpp
++++ src/contribs-lib/CLucene/analysis/PorterStemmer.cpp
+@@ -94,7 +94,7 @@
+     return true;
+   }
+ 
+-  bool PorterStemmer::ends(TCHAR *s) {
++  bool PorterStemmer::ends(const TCHAR *s) {
+ 	size_t l = _tcslen(s);
+     size_t o = k-l+1;
+     if (o < k0)
+--- src/contribs-lib/CLucene/analysis/PorterStemmer.h
++++ src/contribs-lib/CLucene/analysis/PorterStemmer.h
+@@ -68,7 +68,7 @@
+   */
+    bool cvc(size_t i);
+ 
+-  bool ends(TCHAR *s);
++  bool ends(const TCHAR *s);
+ 
+   /* setto(s) sets (j+1),...k to the characters in the string s, readjusting
+      k. */


More information about the Libreoffice-commits mailing list