summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-01-21 18:28:58 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-01-22 11:56:27 +0000
commitaab9c9deee38de1776acebaa8c0877cf945dca83 (patch)
tree33cb922fb7ae42bdccb656062b2554666eb6392d /tools
parentb9c21b972ee044e2cfe5e8271ef232738669c7fa (diff)
Detect SvStream::operator<< calls with bool args w/o using -Wsign-promo
...as -Wsign-promo caused other problems and has been removed again with 488823a140217e393298bc83e75084041a85ed45 "Remove -Wsign-promo." It had originally been introduced with e8bbb76827dd7a0e30d7d1db34a812a84d85f390 "ensure correct export size type in stream operation," apparently to detect an SvStream::operator<< call with a bool argument that would pick the "int" overload instead of the "unsigned char" (aka sal_Bool) one (which would have happened to trigger the -Wsign-promo warning "by luck," given that sal_Bool is unsigned char and not signed char, say). Change-Id: I0bf4389753e53a535bd90ca2a98b6a5be63d179a Reviewed-on: https://gerrit.libreoffice.org/1798 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/stream.hxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index abd6520b1ba0..23d4a0498cd1 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -324,6 +324,8 @@ public:
SvStream& operator<<( sal_Int32 nInt32 );
SvStream& operator<<( sal_Int64 nInt64 );
+ SvStream& operator<<( bool b )
+ { return operator<<(static_cast< sal_Bool >(b)); }
SvStream& operator<<( signed char nChar );
SvStream& operator<<( char nChar );
SvStream& operator<<( unsigned char nChar );