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 <[email protected]>
AuthorDate: Wed Jan 6 10:28:53 2021 +0100
Commit:     Stephan Bergmann <[email protected]>
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 <[email protected]>

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. */
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to