This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d4ff69188f icc: Fix SampleICC 1.6.11 build errors on FreeBSD 15.1 
(reported by Damjan Jovanovic)
d4ff69188f is described below

commit d4ff69188f92e103daf2eb23b5791867f296eea4
Author: Pedro Giffuni <[email protected]>
AuthorDate: Thu Oct 29 11:08:17 2026 -0500

    icc: Fix SampleICC 1.6.11 build errors on FreeBSD 15.1 (reported by Damjan 
Jovanovic)
    
    Fix const-correctness and typo errors in CIccUTF16String methods
    that were introduced in the SampleICC 1.6.11 upgrade and caught
    by newer LLVM/Clang on FreeBSD 15.1:
    
    - FromWString: assign buf.c_str() (const) to const wchar_t*
    - ToWString: use &buf[0] for mutable buffer access with if(buf.size()) guard
    - ToWString: fix strStr -> srcStr typo and (const UTF16**) cast
    
    These methods did not exist in SampleICC 1.3.2, hence were not
    covered by the previous patches.
---
 main/icc/README                 |  4 ++++
 main/icc/SampleICC-1.6.11.patch | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/main/icc/README b/main/icc/README
index b263ed8419..4496931d58 100644
--- a/main/icc/README
+++ b/main/icc/README
@@ -42,6 +42,10 @@ SampleICC-1.6.11.patch performs the following modifications:
 - Normalizes \\r\\n to \\n in string literals across library source
 - Preserves ICC_ENUM_CONVENIENCE define (native in 1.6.11, provides
   in-enum max values for type-safe case labels with Clang 16+)
+- Fixes const-correctness in IccUtil.cpp: FromWString() assigns
+  buf.c_str() (const) to a const pointer; ToWString() uses mutable
+  &buf[0] instead of c_str() and guards with if(buf.size())
+- Fixes typo in ToWString(): strStr -> srcStr
 
 Note: The older 1.3.2 patches for format-security warnings and Win64
 support are no longer needed as these are already fixed in 1.6.11.
diff --git a/main/icc/SampleICC-1.6.11.patch b/main/icc/SampleICC-1.6.11.patch
index 968fd3d908..6593cf45b9 100644
--- a/main/icc/SampleICC-1.6.11.patch
+++ b/main/icc/SampleICC-1.6.11.patch
@@ -2381,3 +2381,21 @@
      sReport += buf;
      rv = icMaxStatus(rv, icValidateWarning);
    }
+@@ -1919,5 +1919,5 @@
+ #ifdef ICC_WCHAR_32BIT
+   size_t sizeSrc = buf.size();
+-  wchar_t *szStr = buf.c_str();
++  const wchar_t *szStr = buf.c_str();
+ 
+   if (sizeSrc) {
+@@ -1973,4 +1973,7 @@
+   icUInt16Number *srcStr = m_str;
+-  UTF32 *dstStr = buf.c_str();
+-
+-  icConvertUTF16toUTF32((UTF16**)&srcStr, &strStr[m_len], &dstStr, 
&dstStr[buf.size()], lenientConversion);
++
++  if (buf.size()) {
++    UTF32 *dstStr = (UTF32*)&buf[0];
++
++    icConvertUTF16toUTF32((const UTF16**)&srcStr, &srcStr[m_len], &dstStr, 
&dstStr[buf.size()], lenientConversion);
++  }

Reply via email to