summaryrefslogtreecommitdiff
path: root/libcmis
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-22 14:30:44 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-22 14:40:36 +0300
commit5bc1eac4a9f7147b26496e8e46b959bbe72def3f (patch)
tree80035be1774474f071f02ab712976ae70824876a /libcmis
parentb6bcbb675afedba0c47654dd78dc446dac0630d1 (diff)
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
Diffstat (limited to 'libcmis')
-rw-r--r--libcmis/libcmis-0.3.0-warnings.patch9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcmis/libcmis-0.3.0-warnings.patch b/libcmis/libcmis-0.3.0-warnings.patch
index ae69f4796429..b67ae47180b3 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 );
}