[Libreoffice-commits] core.git: libcmis/libcmis-0.3.0-warnings.patch

Tor Lillqvist tml at iki.fi
Mon Apr 22 04:43:20 PDT 2013


 libcmis/libcmis-0.3.0-warnings.patch |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 5bc1eac4a9f7147b26496e8e46b959bbe72def3f
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Apr 22 14:30:44 2013 +0300

    Ugly fix for '%ld' vs. 'std::basic_string<char>::size_type' mismatch
    
    Just cast the size() return value to long int, which of course can cause
    breakage when the size_type (is that always the same as size_t?) is larger
    than long int. For 64-bit Windows code size_t is 64 bits but long is 32
    bits. I couldn't think of any simple totally correct solution that would work
    also on compilers without <stdint.h> and <inttypes.h> (MSVC2008), or without
    the z format specifier (all MSVC versions?).
    
    (Our SAL_PRI_SIZET is not available to a 3rd-party library like
    libcmis. Should libcmis grow corresponding configury to find out that?)
    
    Why does a C++ library like libcmis use C-style printf formats anyway? ;)
    
    Change-Id: I093655577bc1a50c137c79b648058f0823cc66c1

diff --git a/libcmis/libcmis-0.3.0-warnings.patch b/libcmis/libcmis-0.3.0-warnings.patch
index ae69f47..b67ae47 100644
--- a/libcmis/libcmis-0.3.0-warnings.patch
+++ b/libcmis/libcmis-0.3.0-warnings.patch
@@ -200,6 +200,15 @@ diff --git src/libcmis/ws-requests.cxx src/libcmis/ws-requests.cxx
 index 2b421b2..e13ae07 100644
 --- src/libcmis/ws-requests.cxx
 +++ src/libcmis/ws-requests.cxx
+@@ -105,7 +105,7 @@
+     string content( buf, size );
+     delete[ ] buf;
+ 
+-    xmlTextWriterWriteFormatElement( writer, BAD_CAST( "cmism:length" ), "%ld", content.size( ) );
++    xmlTextWriterWriteFormatElement( writer, BAD_CAST( "cmism:length" ), "%ld", (long int) content.size( ) );
+     xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:mimeType" ), BAD_CAST( contentType.c_str( ) ) );
+     if ( !filename.empty( ) )
+         xmlTextWriterWriteElement( writer, BAD_CAST( "cmism:filename" ), BAD_CAST( filename.c_str( ) ) );
 @@ -349,7 +349,7 @@ void UpdateProperties::toXml( xmlTextWriterPtr writer )
      xmlTextWriterEndElement( writer );
  }


More information about the Libreoffice-commits mailing list