[Libreoffice-commits] .: tools/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 03:56:47 PST 2013


 tools/inc/tools/stream.hxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit aab9c9deee38de1776acebaa8c0877cf945dca83
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 21 18:28:58 2013 +0100

    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 at suse.cz>
    Tested-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index abd6520..23d4a04 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 );


More information about the Libreoffice-commits mailing list