[Libreoffice-commits] core.git: 7 commits - compilerplugins/clang compilerplugins/Makefile-clang.mk extensions/source include/sal vcl/generic vcl/headless vcl/inc vcl/ios vcl/osx vcl/quartz vcl/source vcl/unx vcl/win

Stephan Bergmann sbergman at redhat.com
Fri Feb 21 14:47:55 PST 2014


 compilerplugins/Makefile-clang.mk                 |    6 +++++-
 compilerplugins/clang/implicitboolconversion.cxx  |    9 ++++++---
 compilerplugins/clang/literaltoboolconversion.cxx |   20 +++++++++++++-------
 compilerplugins/clang/plugin.cxx                  |   15 +++++++++++++++
 compilerplugins/clang/plugin.hxx                  |    4 +++-
 extensions/source/update/check/updatecheck.cxx    |    2 ++
 include/sal/log-areas.dox                         |    1 +
 vcl/generic/fontmanager/fontmanager.cxx           |    8 ++++----
 vcl/headless/svpframe.cxx                         |    2 +-
 vcl/inc/headless/svpframe.hxx                     |    2 +-
 vcl/inc/osx/salframe.h                            |    2 +-
 vcl/inc/salframe.hxx                              |    2 +-
 vcl/inc/sft.hxx                                   |   10 +++++-----
 vcl/inc/unx/gtk/gtkframe.hxx                      |    2 +-
 vcl/inc/unx/salframe.h                            |    2 +-
 vcl/inc/win/salframe.h                            |    2 +-
 vcl/ios/iosinst.cxx                               |    2 +-
 vcl/osx/DataFlavorMapping.cxx                     |    3 ++-
 vcl/osx/DragSource.cxx                            |    5 +++--
 vcl/osx/HtmlFmtFlt.cxx                            |    7 +++----
 vcl/osx/PictToBmpFlt.cxx                          |    4 ++--
 vcl/osx/salframe.cxx                              |   10 +++++-----
 vcl/osx/salinst.cxx                               |    2 +-
 vcl/osx/salmenu.cxx                               |    4 ++--
 vcl/osx/salnativewidgets.cxx                      |   12 ++++++------
 vcl/osx/salprn.cxx                                |   10 +++++-----
 vcl/quartz/salgdi.cxx                             |    2 +-
 vcl/quartz/salgdicommon.cxx                       |   14 +++++++-------
 vcl/source/fontsubset/gsub.cxx                    |    2 +-
 vcl/source/fontsubset/gsub.h                      |    2 +-
 vcl/source/fontsubset/sft.cxx                     |   18 +++++++++---------
 vcl/unx/generic/window/salframe.cxx               |    4 ++--
 vcl/unx/gtk/window/gtksalframe.cxx                |    2 +-
 vcl/win/source/gdi/salgdi3.cxx                    |    6 +++---
 vcl/win/source/window/salframe.cxx                |    2 +-
 35 files changed, 117 insertions(+), 83 deletions(-)

New commits:
commit 9377e44cf85a3871cf8b38f9cc1fb96da3490477
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:46:59 2014 +0100

    -Werror,-Wunused-function
    
    Change-Id: Ic792930c291bae1cf18ffd65548908e910c69c45

diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 2e0ab73..33ffd7e 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -106,12 +106,14 @@ static inline OUString getBuildId()
 }
 
 //------------------------------------------------------------------------------
+#if defined LINUX || defined SOLARIS
 static inline OUString getBaseInstallation()
 {
     OUString aPathVal("$BRAND_BASE_DIR");
     rtl::Bootstrap::expandMacros(aPathVal);
     return aPathVal;
 }
+#endif
 
 //------------------------------------------------------------------------------
 
commit fe7a4bccfdc6ff7e10789e5512ac469a4dc44f55
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:46:33 2014 +0100

    Adapt vcl to various loplugin warnings on Mac OS X
    
    Change-Id: I4553ce218fbcf2ac681b284c71e7d558a451511c

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 6f4b496..11b7613 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -363,6 +363,7 @@ certain functionality.
 @li @c vcl.kde4 - KDE4
 @li @c vcl.layout - Widget layout
 @li @c vcl.plugadapt - the Unix/X11 backend plugin mechanism
+ at li @c vcl.osx
 @li @c vcl.osx.print
 @li @c vcl.scrollbar - Scroll Bars
 @li @c vcl.sm - Session Manager
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index afd6ed5..4102df7 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -234,7 +234,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
 
         int nCharacters = nPage < 255 ? 256 : 254;
         MapString( pTTFont, table, nCharacters, NULL, false );
-        TTSimpleGlyphMetrics* pMetrics = GetTTSimpleCharMetrics( pTTFont, nPage*256, nCharacters, 0 );
+        TTSimpleGlyphMetrics* pMetrics = GetTTSimpleCharMetrics( pTTFont, nPage*256, nCharacters, false );
         if( pMetrics )
         {
             for( i = 0; i < nCharacters; i++ )
@@ -253,7 +253,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
         for( i = 0; i < 256; i++ )
             table_vert[ i ] = 256*nPage + i;
         MapString( pTTFont, table_vert, nCharacters, NULL, true );
-        pMetrics = GetTTSimpleCharMetrics( pTTFont, nPage*256, nCharacters, 1 );
+        pMetrics = GetTTSimpleCharMetrics( pTTFont, nPage*256, nCharacters, true );
         if( pMetrics )
         {
             for( i = 0; i < nCharacters; i++ )
@@ -2028,7 +2028,7 @@ bool PrintFontManager::createFontSubset(
     TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics( pTTFont,
                                                               pGID,
                                                               nGlyphs,
-                                                              bVertical ? 1 : 0 );
+                                                              bVertical );
     if( pMetrics )
     {
         for( int i = 0; i < nGlyphs; i++ )
@@ -2080,7 +2080,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
             TTSimpleGlyphMetrics* pMetrics = GetTTSimpleGlyphMetrics( pTTFont,
                                                                       &aGlyphIds[0],
                                                                       nGlyphs,
-                                                                      bVertical ? 1 : 0 );
+                                                                      bVertical );
             if( pMetrics )
             {
                 for( int i = 0; i< nGlyphs; i++ )
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index db5d08d..98f0a44 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -366,7 +366,7 @@ bool SvpSalFrame::GetWindowState( SalFrameState* pState )
     return true;
 }
 
-void SvpSalFrame::ShowFullScreen( sal_Bool, sal_Int32 )
+void SvpSalFrame::ShowFullScreen( bool, sal_Int32 )
 {
     SetPosSize( 0, 0, VIRTUAL_DESKTOP_WIDTH, VIRTUAL_DESKTOP_HEIGHT,
                 SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index c4e88c3..6068ba5 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -97,7 +97,7 @@ public:
     virtual SalFrame*           GetParent() const;
     virtual void                SetWindowState( const SalFrameState* pState );
     virtual bool            GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay );
     virtual void                StartPresentation( sal_Bool bStart );
     virtual void                SetAlwaysOnTop( sal_Bool bOnTop );
     virtual void                ToTop( sal_uInt16 nFlags );
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index ed9f61c..4386107 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -126,7 +126,7 @@ public:
     virtual SalFrame*           GetParent() const;
     virtual void                SetWindowState( const SalFrameState* pState );
     virtual bool                GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay );
     virtual void                StartPresentation( sal_Bool bStart );
     virtual void                SetAlwaysOnTop( sal_Bool bOnTop );
     virtual void                ToTop( sal_uInt16 nFlags );
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index a30ca80..8f8621a 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -143,7 +143,7 @@ public:
 
     virtual void            SetWindowState( const SalFrameState* pState ) = 0;
     virtual bool        GetWindowState( SalFrameState* pState ) = 0;
-    virtual void            ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ) = 0;
+    virtual void            ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) = 0;
 
     // Enable/Disable ScreenSaver, SystemAgents, ...
     virtual void            StartPresentation( sal_Bool bStart ) = 0;
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index ba69bda..5c0120a 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -464,11 +464,11 @@ namespace vcl
  * @param ttf         pointer to the TrueTypeFont structure
  * @param glyphArray  pointer to an array of glyphs that are to be extracted from ttf
  * @param nGlyphs     number of glyph IDs in glyphArray and encoding values in encoding
- * @param mode        writing mode: 0 - horizontal, 1 - vertical
+ * @param vertical    writing mode: false - horizontal, true - vertical
  * @ingroup sft
  *
  */
-    TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, int mode);
+    TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, bool vertical);
 
 #ifndef NO_MAPPERS
 /**
@@ -479,13 +479,13 @@ namespace vcl
  * @param ttf         pointer to the TrueTypeFont structure
  * @param firstChar   Unicode value of the first character in the range
  * @param nChars      number of Unicode characters in the range
- * @param mode        writing mode: 0 - horizontal, 1 - vertical
+ * @param vertical    writing mode: false - horizontal, true - vertical
  *
  * @see GetTTSimpleGlyphMetrics
  * @ingroup sft
  *
  */
-    TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont *ttf, sal_uInt16 firstChar, int nChars, int mode);
+    TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont *ttf, sal_uInt16 firstChar, int nChars, bool vertical);
 
 /**
  * Maps a Unicode (UCS-2) string to a glyph array. Returns the number of glyphs in the array,
@@ -516,7 +516,7 @@ namespace vcl
  * @return glyph ID, if the character is missing in the font, the return value is 0.
  * @ingroup sft
  */
-    sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, int bvertical);
+    sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, bool bvertical);
 
 /**
  * Returns 0 when the font does not substitute vertical glyphs
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index bd2fd96..9d0184c 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -380,7 +380,7 @@ public:
     virtual SalFrame*           GetParent() const;
     virtual void                SetWindowState( const SalFrameState* pState );
     virtual bool            GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay );
     // Enable/Disable ScreenSaver, SystemAgents, ...
     virtual void                StartPresentation( sal_Bool bStart );
     // Show Window over all other Windows
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index d76218b..a41fac4 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -235,7 +235,7 @@ public:
     virtual SalFrame*           GetParent() const;
     virtual void                SetWindowState( const SalFrameState* pState );
     virtual bool                GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nMonitor );
+    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nMonitor );
     virtual void                StartPresentation( sal_Bool bStart );
     virtual void                SetAlwaysOnTop( sal_Bool bOnTop );
     virtual void                ToTop( sal_uInt16 nFlags );
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index 2aa3eed..2309a1b 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -106,7 +106,7 @@ public:
     virtual SalFrame*           GetParent() const;
     virtual void                SetWindowState( const SalFrameState* pState );
     virtual bool                GetWindowState( SalFrameState* pState );
-    virtual void                ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay );
+    virtual void                ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay );
     virtual void                StartPresentation( sal_Bool bStart );
     virtual void                SetAlwaysOnTop( sal_Bool bOnTop );
     virtual void                ToTop( sal_uInt16 nFlags );
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index a8dccdf..4ffc689 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -171,7 +171,7 @@ public:
         IosSalInstance::getInstance()->GetWorkArea( rRect );
     }
 
-    void ShowFullScreen( sal_Bool, sal_Int32 )
+    void ShowFullScreen( bool, sal_Int32 )
     {
         SetPosSize( 0, 0, viewWidth, viewHeight,
                     SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 4590e97..b24dffc 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -31,6 +31,7 @@
 #include <rtl/ustring.hxx>
 #include <osl/endian.h>
 
+#include <cassert>
 #include <stdio.h>
 #include <string.h>
 
@@ -58,7 +59,7 @@ namespace // private
 
   OUString NSStringToOUString( const NSString* cfString)
   {
-    BOOST_ASSERT(cfString && "Invalid parameter");
+    assert(cfString && "Invalid parameter");
 
     const char* utf8Str = [cfString UTF8String];
     unsigned int len = rtl_str_getLength(utf8Str);
diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx
index 1e5e5eb..6c22424 100644
--- a/vcl/osx/DragSource.cxx
+++ b/vcl/osx/DragSource.cxx
@@ -34,6 +34,7 @@
 
 #include "osx/salframe.h"
 
+#include <cassert>
 #include <memory>
 
 
@@ -230,8 +231,8 @@ void SAL_CALL DragSource::startDrag(const DragGestureEvent& trigger,
 {
   MutexGuard guard(m_aMutex);
 
-  OSL_ASSERT(listener.is() && "DragSource::startDrag: No XDragSourceListener provided\n");
-  OSL_ASSERT(transferable.is() && "DragSource::startDrag: No transferable provided\n");
+  assert(listener.is() && "DragSource::startDrag: No XDragSourceListener provided\n");
+  assert(transferable.is() && "DragSource::startDrag: No transferable provided\n");
 
   trigger.Event >>= mMouseEvent;
   m_MouseButton= mMouseEvent.Buttons;
diff --git a/vcl/osx/HtmlFmtFlt.cxx b/vcl/osx/HtmlFmtFlt.cxx
index f5e0b22..74779df 100644
--- a/vcl/osx/HtmlFmtFlt.cxx
+++ b/vcl/osx/HtmlFmtFlt.cxx
@@ -25,8 +25,7 @@
 #include <sstream>
 #include <vector>
 #include <iomanip>
-
-#include <boost/assert.hpp>
+#include <cassert>
 
 using namespace com::sun::star::uno;
 
@@ -122,14 +121,14 @@ const char* HtmlStartTag = "<html";
 
 Sequence<sal_Int8> HTMLFormatToTextHtml(const Sequence<sal_Int8>& aHTMLFormat)
 {
-  BOOST_ASSERT(isHTMLFormat(aHTMLFormat) && "No HTML Format provided");
+  assert(isHTMLFormat(aHTMLFormat) && "No HTML Format provided");
 
   Sequence<sal_Int8>& nonconstHTMLFormatRef = const_cast< Sequence<sal_Int8>& >(aHTMLFormat);
   sal_Char* dataStart = reinterpret_cast<sal_Char*>(nonconstHTMLFormatRef.getArray());
   sal_Char* dataEnd = dataStart + nonconstHTMLFormatRef.getLength() - 1;
   const sal_Char* htmlStartTag = strcasestr(dataStart, HtmlStartTag);
 
-  BOOST_ASSERT(htmlStartTag && "Seems to be no HTML at all");
+  assert(htmlStartTag && "Seems to be no HTML at all");
 
   // It doesn't seem to be HTML? Well then simply return what has been
   // provided in non-debug builds
diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx
index 91ed2bc..77c67a6 100644
--- a/vcl/osx/PictToBmpFlt.cxx
+++ b/vcl/osx/PictToBmpFlt.cxx
@@ -59,8 +59,8 @@ bool PNGToImage( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
     if( !pData)
         return false;
 
-        NSBitmapImageRep* pRep = [NSBitmapImageRep imageRepWithData: pData];
-        if( !pRep)
+    NSBitmapImageRep* pRep = [NSBitmapImageRep imageRepWithData: pData];
+    if( !pRep)
         return false;
 
     NSData* pOut = [pRep representationUsingType: eOutFormat properties: nil];
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 6231886..3ce28c9 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -722,7 +722,7 @@ void AquaSalFrame::SetApplicationID( const OUString &/*rApplicationID*/ )
 
 // -----------------------------------------------------------------------
 
-void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
+void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
 {
     if ( !mpNSWindow )
         return;
@@ -730,7 +730,7 @@ void AquaSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
     // #i113170# may not be the main thread if called from UNO API
     SalData::ensureThreadAutoreleasePool();
 
-    SAL_INFO("vcl.macosx", OSL_THIS_FUNC << ": mbFullScreen=" << mbFullScreen << ", bFullScreen=" << bFullScreen);
+    SAL_INFO("vcl.osx", OSL_THIS_FUNC << ": mbFullScreen=" << mbFullScreen << ", bFullScreen=" << bFullScreen);
 
     if( mbFullScreen == bFullScreen )
         return;
@@ -1297,8 +1297,8 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
 
     // images in menus false for MacOSX
     aStyleSettings.SetPreferredUseImagesInMenus( false );
-    aStyleSettings.SetHideDisabledMenuItems( sal_True );
-    aStyleSettings.SetAcceleratorsInContextMenus( sal_False );
+    aStyleSettings.SetHideDisabledMenuItems( true );
+    aStyleSettings.SetAcceleratorsInContextMenus( false );
 
     rSettings.SetStyleSettings( aStyleSettings );
 
@@ -1535,7 +1535,7 @@ bool AquaSalFrame::SetPluginParent( SystemParentData* )
     // plugging process;
 
     //TODO: implement
-    return sal_False;
+    return false;
 }
 
 bool AquaSalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& )
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 3d16998..e960e8d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -808,7 +808,7 @@ bool AquaSalInstance::AnyInput( sal_uInt16 nType )
     if( !nType)
         return false;
 
-        NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: nil
+    NSEvent* pEvent = [NSApp nextEventMatchingMask: nEventMask untilDate: nil
                             inMode: NSDefaultRunLoopMode dequeue: NO];
     return (pEvent != NULL);
 }
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 57bc23f..8c6006f 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -526,11 +526,11 @@ bool AquaSalMenu::VisibleMenuBar()
     static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
 
     if ( pExperimental && !strcasecmp(pExperimental, "FALSE") )
-        return sal_False;
+        return false;
 
     // End of experimental code enable/disable part
 
-    return sal_True;
+    return true;
 }
 
 void AquaSalMenu::SetFrame( const SalFrame *pFrame )
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index cb0cfb0..422cab7 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -270,7 +270,7 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */  ControlPart nPart,
  */
 bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
-    bool bOk = sal_False;
+    bool bOk = false;
 
     // Native controls are now defaults
     // If you want to disable experimental native controls code,
@@ -421,20 +421,20 @@ bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
                 {
                     // the left 4 pixels are not hit sensitive
                     if( rPos.X() - aRect.Left() < 4 )
-                        rIsInside = sal_False;
+                        rIsInside = false;
                 }
                 else if( nPart == PART_TRACK_VERT_AREA )
                 {
                     // the top 4 pixels are not hit sensitive
                     if( rPos.Y() - aRect.Top() < 4 )
-                        rIsInside = sal_False;
+                        rIsInside = false;
                 }
             }
         }
         return bValid;
     }  //  CTRL_SCROLLBAR
 
-    return sal_False;
+    return false;
 }
 
 /*
@@ -1353,8 +1353,8 @@ bool AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
                 else if( nPart == PART_BUTTON_DOWN )
                 {
                     w = aCtrlBoundRect.GetWidth();
-                if( w < 3+2*FOCUS_RING_WIDTH )
-                    w = 3+2*FOCUS_RING_WIDTH;
+                    if( w < 3+2*FOCUS_RING_WIDTH )
+                        w = 3+2*FOCUS_RING_WIDTH;
                     h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height
 
                     x += w-DROPDOWN_BUTTON_WIDTH - FOCUS_RING_WIDTH;
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index d57f7e6..c0e13b2 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -166,7 +166,7 @@ void AquaSalInfoPrinter::ReleaseGraphics( SalGraphics* )
 
 bool AquaSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* )
 {
-    return sal_False;
+    return false;
 }
 
 // -----------------------------------------------------------------------
@@ -244,7 +244,7 @@ void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientatio
 bool AquaSalInfoPrinter::SetData( sal_uLong i_nFlags, ImplJobSetup* io_pSetupData )
 {
     if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC )
-        return sal_False;
+        return false;
 
 
     if( mpPrintInfo )
@@ -395,7 +395,7 @@ sal_Bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
     sal_Int32 nAllPages = 0;
 
     // reset IsLastPage
-    i_rController.setLastPage( sal_False );
+    i_rController.setLastPage( false );
 
     // update job data
     if( i_pSetupData )
@@ -545,7 +545,7 @@ sal_Bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
     // inform application that it can release its data
     // this is awkward, but the XRenderable interface has no method for this,
     // so we need to call XRenderadble::render one last time with IsLastPage = sal_True
-    i_rController.setLastPage( sal_True );
+    i_rController.setLastPage( true );
     GDIMetaFile aPageFile;
     if( mrContext )
         SetupPrinterGraphics( mrContext );
@@ -643,7 +643,7 @@ bool AquaSalPrinter::StartJob( const OUString* /*i_pFileName*/,
                                ImplJobSetup* )
 {
     OSL_FAIL( "should never be called" );
-    return sal_False;
+    return false;
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 252a025..91ff6cb 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -596,7 +596,7 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
 
     // prepare a byte buffer for a fake font
     int nTableCount = 7;
-    nTableCount += (nPrepSize>0) + (nCvtSize>0) + (nFpgmSize>0) + (nGlyfSize>0);
+    nTableCount += (nPrepSize>0?1:0) + (nCvtSize>0?1:0) + (nFpgmSize>0?1:0) + (nGlyfSize>0?1:0);
     const ByteCount nFdirSize = 12 + 16*nTableCount;
     ByteCount nTotalSize = nFdirSize;
     nTotalSize += nHeadSize + nMaxpSize + nNameSize + nCmapSize;
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index b1c8121..06a3cfe 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -154,7 +154,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
     // prepare the requested file name for writing the font-subset file
     OUString aSysPath;
     if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
-        return sal_False;
+        return false;
     const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
     const OString aToFile( OUStringToOString( aSysPath, aThreadEncoding ) );
 
@@ -162,7 +162,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
     ByteVector aBuffer;
     bool bCffOnly = false;
     if( !GetRawFontData( pFontData, aBuffer, &bCffOnly ) )
-        return sal_False;
+        return false;
 
     // handle CFF-subsetting
     if( bCffOnly )
@@ -189,7 +189,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
     TrueTypeFont* pSftFont = NULL;
     int nRC = ::OpenTTFontBuffer( (void*)&aBuffer[0], aBuffer.size(), 0, &pSftFont);
     if( nRC != SF_OK )
-        return sal_False;
+        return false;
 
     // get details about the subsetted font
     TTGlobalFontInfo aTTInfo;
@@ -264,7 +264,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
     TTSimpleGlyphMetrics* pGlyphMetrics =
         ::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical );
     if( !pGlyphMetrics )
-        return sal_False;
+        return false;
     sal_uInt16 nNotDefAdv       = pGlyphMetrics[0].adv;
     pGlyphMetrics[0].adv        = pGlyphMetrics[nNotDef].adv;
     pGlyphMetrics[nNotDef].adv  = nNotDefAdv;
@@ -859,7 +859,7 @@ bool AquaSalGraphics::drawPolyLine(
 
 bool AquaSalGraphics::drawPolyLineBezier( sal_uInt32, const SalPoint*, const sal_uInt8* )
 {
-    return sal_False;
+    return false;
 }
 
 bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly,
@@ -1084,13 +1084,13 @@ void AquaSalGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint *pPtAry )
 
 bool AquaSalGraphics::drawPolygonBezier( sal_uInt32, const SalPoint*, const sal_uInt8* )
 {
-    return sal_False;
+    return false;
 }
 
 bool AquaSalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
                                                  const SalPoint* const*, const sal_uInt8* const* )
 {
-    return sal_False;
+    return false;
 }
 
 void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index 68ba401..3d5c5d1 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -325,7 +325,7 @@ void ReleaseGSUB(struct _TrueTypeFont* pTTFile)
         delete pGlyphSubstitution;
 }
 
-int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph, bool /*wmode*/ )
+int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph )
 {
     GlyphSubstitution* pGlyphSubstitution = (GlyphSubstitution*)pTTFile->pGSubstitution;
     if( pGlyphSubstitution != 0 )
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
index ece5aae..362a619 100644
--- a/vcl/source/fontsubset/gsub.h
+++ b/vcl/source/fontsubset/gsub.h
@@ -25,7 +25,7 @@ namespace vcl
 
 int HasVerticalGSUB( struct vcl::_TrueTypeFont* pTTFile );
 
-int UseGSUB( struct vcl::_TrueTypeFont* pTTFile, int nGlyph, bool wmode );
+int UseGSUB( struct vcl::_TrueTypeFont* pTTFile, int nGlyph );
 
 bool ReadGSUB( struct vcl::_TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
 
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 93257ad..b439477 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2282,12 +2282,12 @@ int MapString(TrueTypeFont *ttf, sal_uInt16 *str, int nchars, sal_uInt16 *glyphA
     for (i = 0; i < nchars; i++) {
         cp[i] = (sal_uInt16)ttf->mapper(ttf->cmap, cp[i]);
         if (cp[i]!=0 && bvertical)
-            cp[i] = (sal_uInt16)UseGSUB(ttf,cp[i],bvertical);
+            cp[i] = (sal_uInt16)UseGSUB(ttf,cp[i]);
     }
     return nchars;
 }
 
-sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, int bvertical)
+sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, bool bvertical)
 {
     switch (ttf->cmapType) {
         case CMAP_MS_Symbol:
@@ -2305,8 +2305,8 @@ sal_uInt16 MapChar(TrueTypeFont *ttf, sal_uInt16 ch, int bvertical)
         default:                return 0;
     }
     ch = (sal_uInt16)ttf->mapper(ttf->cmap, ch);
-    if (ch!=0 && bvertical!=0)
-        ch = (sal_uInt16)UseGSUB(ttf,ch,bvertical);
+    if (ch!=0 && bvertical)
+        ch = (sal_uInt16)UseGSUB(ttf,ch);
     return ch;
 }
 
@@ -2336,13 +2336,13 @@ bool GetSfntTable( TrueTypeFont* ttf, int nSubtableIndex,
     return bOk;
 }
 
-TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, int mode)
+TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, bool vertical)
 {
     const sal_uInt8* pTable;
     sal_uInt32 n;
     int nTableSize;
 
-    if (mode == 0) {
+    if (!vertical) {
         n = ttf->numberOfHMetrics;
         pTable = getTable( ttf, O_hmtx );
         nTableSize = getTableSize( ttf, O_hmtx );
@@ -2391,7 +2391,7 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly
 }
 
 #ifndef NO_MAPPERS
-TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firstChar, int nChars, int mode)
+TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firstChar, int nChars, bool vertical)
 {
     TTSimpleGlyphMetrics *res = 0;
     int i, n;
@@ -2400,8 +2400,8 @@ TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firs
     assert(str != 0);
 
     for (i=0; i<nChars; i++) str[i] = (sal_uInt16)(firstChar + i);
-    if ((n = MapString(ttf, str, nChars, 0, mode)) != -1) {
-        res = GetTTSimpleGlyphMetrics(ttf, str, n, mode);
+    if ((n = MapString(ttf, str, nChars, 0, vertical)) != -1) {
+        res = GetTTSimpleGlyphMetrics(ttf, str, n, vertical);
     }
 
     free(str);
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 481f44f..50ba7dc 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -800,7 +800,7 @@ X11SalFrame::~X11SalFrame()
         XSelectInput( GetXDisplay(), GetShellWindow(), 0 );
     XSelectInput( GetXDisplay(), GetWindow(), 0 );
 
-    ShowFullScreen( sal_False, 0 );
+    ShowFullScreen( false, 0 );
 
     if( bMapped_ )
         Show( sal_False );
@@ -2056,7 +2056,7 @@ void X11SalFrame::updateWMClass()
     XFree( pClass );
 }
 
-void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
+void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
 {
     if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 )
     {
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 324a066..f5356db8 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2420,7 +2420,7 @@ void GtkSalFrame::SetApplicationID( const OUString &rWMClass )
     }
 }
 
-void GtkSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen )
+void GtkSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen )
 {
     m_bFullscreen = bFullScreen;
 
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index fb33dfa..be8ea78 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1339,7 +1339,7 @@ void ImplWinFontData::ReadGsubTable( HDC hDC ) const
 
     for( const sal_Unicode* pPair = aGSUBCandidates; *pPair; pPair += 2 )
         for( sal_Unicode cChar = pPair[0]; cChar < pPair[1]; ++cChar )
-            if( ::MapChar( pTTFont, cChar, 0 ) != ::MapChar( pTTFont, cChar, 1 ) )
+            if( ::MapChar( pTTFont, cChar, false ) != ::MapChar( pTTFont, cChar, true ) )
                 maGsubTable.insert( cChar ); // insert GSUBbed unicodes
 
     CloseTTFont( pTTFont );
@@ -2826,7 +2826,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
             TTSimpleGlyphMetrics* pMetrics = ::GetTTSimpleGlyphMetrics( aSftTTF.get(),
                                                                         &aGlyphIds[0],
                                                                         nGlyphs,
-                                                                        bVertical ? 1 : 0 );
+                                                                        bVertical );
             if( pMetrics )
             {
                 for( int i = 0; i< nGlyphs; i++ )
@@ -2847,7 +2847,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
                 {
                     sal_uInt16 nGlyph = ::MapChar( aSftTTF.get(),
                                                    static_cast<sal_Ucs>(nChar),
-                                                   bVertical ? 1 : 0 );
+                                                   bVertical );
                     if( nGlyph )
                         rUnicodeEnc[ static_cast<sal_Unicode>(nChar) ] = nGlyph;
                 }
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 74fbe8a..a217112 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -1946,7 +1946,7 @@ void WinSalFrame::SetApplicationID( const OUString &rApplicationID )
 
 // -----------------------------------------------------------------------
 
-void WinSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
+void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
 {
     if ( (mbFullScreen == bFullScreen) && (!bFullScreen || (mnDisplay == nDisplay)) )
         return;
commit 216bcceee1ba908f617deb3f2404aff8085d5358
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:42:46 2014 +0100

    Special handling of __builtin_expect in boolean expressions
    
    ...as found in Mac OS X' assert macro definition,
    
      __builtin_expect(!(e), 0) ? ... : ...
    
    with type
    
      long __builtin_expect(long, long)
    
    The code in literaltoboolconversion.cxx is needed for
    
      assert(false);
    
    Change-Id: I42f87482c56986af74b2ec849db9852f74c7c938

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index b03a32e..0327f9f 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -192,7 +192,9 @@ bool ImplicitBoolConversion::TraverseCallExpr(CallExpr * expr) {
                     && !(compat::getParamType(*t, n)->isSpecificBuiltinType(
                              BuiltinType::Int)
                          || (compat::getParamType(*t, n)->isSpecificBuiltinType(
-                                 BuiltinType::UInt))))
+                                 BuiltinType::UInt))
+                         || (compat::getParamType(*t, n)->isSpecificBuiltinType(
+                                 BuiltinType::Long))))
                 {
                     reportWarning(i);
                 }
diff --git a/compilerplugins/clang/literaltoboolconversion.cxx b/compilerplugins/clang/literaltoboolconversion.cxx
index d156e9b..1bbdc05 100644
--- a/compilerplugins/clang/literaltoboolconversion.cxx
+++ b/compilerplugins/clang/literaltoboolconversion.cxx
@@ -1,3 +1,4 @@
+#include<iostream>
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
@@ -135,13 +136,18 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
             << expr->getType() << expr->getSourceRange();
 #endif
     } else if (sub->isIntegerConstantExpr(compiler.getASTContext())) {
-        report(
-            DiagnosticsEngine::Warning,
-            ("implicit conversion (%0) of integer constant expression of type"
-             " %1 to %2"),
-            expr->getLocStart())
-            << expr->getCastKindName() << expr->getSubExpr()->getType()
-            << expr->getType() << expr->getSourceRange();
+        CallExpr const * ce = dyn_cast<CallExpr>(sub);
+        if (ce == nullptr
+            || ce->getBuiltinCallee() != Builtin::BI__builtin_expect)
+        {
+            report(
+                DiagnosticsEngine::Warning,
+                ("implicit conversion (%0) of integer constant expression of"
+                 " type %1 to %2"),
+                expr->getLocStart())
+                << expr->getCastKindName() << expr->getSubExpr()->getType()
+                << expr->getType() << expr->getSourceRange();
+        }
     }
     return true;
 }
commit 3316202888f8849e26afe750cbb7db3087b9c416
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:42:05 2014 +0100

    implicitboolconversion: support for Objective C BOOL
    
    Change-Id: Id63f42fa8875211af9f41c21f3fa128403f8a880

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index 740f767..b03a32e 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -43,8 +43,9 @@ if(t1->isSpecificBuiltinType(BuiltinType::UChar))return true;
         return false;
     }
     std::string name(t2->getDecl()->getNameAsString());
-    return name == "sal_Bool" || name == "FcBool" || name == "UBool"
-        || name == "dbus_bool_t" || name == "gboolean" || name == "hb_bool_t";
+    return name == "sal_Bool" || name == "BOOL" || name == "FcBool"
+        || name == "UBool" || name == "dbus_bool_t" || name == "gboolean"
+        || name == "hb_bool_t";
 }
 
 bool isBoolExpr(Expr const * expr) {
commit fa4afe020d48ce872f6d7dfde946314c7b2a30c8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:40:22 2014 +0100

    Handle ImplicitCastExpr w/ invalid loc from Objective C code
    
    Change-Id: I82cb8aa53ea5fd86d6ff46af876dd3f55e1123d1

diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx
index 796ebef..b70fd78 100644
--- a/compilerplugins/clang/plugin.hxx
+++ b/compilerplugins/clang/plugin.hxx
@@ -180,7 +180,9 @@ bool Plugin::ignoreLocation( const Decl* decl )
 inline
 bool Plugin::ignoreLocation( const Stmt* stmt )
     {
-    return ignoreLocation( stmt->getLocStart());
+    // Invalid location can happen at least for ImplicitCastExpr of
+    // ImplicitParam 'self' in Objective C method declarations:
+    return stmt->getLocStart().isValid() && ignoreLocation( stmt->getLocStart());
     }
 
 template< typename T >
commit 411fcfff58bc49699b525a0e43d75b9f6121da6f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:38:54 2014 +0100

    ParentBuilder needs support for ObjCMethodDecl
    
    Change-Id: I8883649da31eabbc5a0f9780fb953ad58f154e1e

diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 88841ea..48c9843 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -60,6 +60,7 @@ const Stmt* Plugin::parentStmt( const Stmt* stmt )
     {
     if( parents.empty())
         buildParents( compiler );
+if(parents.count(stmt)!=1)stmt->dump();
     assert( parents.count( stmt ) == 1 );
     return parents[ stmt ];
     }
@@ -79,6 +80,7 @@ class ParentBuilder
     {
     public:
         bool VisitFunctionDecl( const FunctionDecl* function );
+        bool VisitObjCMethodDecl( const ObjCMethodDecl* method );
         void walk( const Stmt* stmt );
         unordered_map< const Stmt*, const Stmt* >* parents;
     };
@@ -107,6 +109,19 @@ bool ParentBuilder::VisitFunctionDecl( const FunctionDecl* function )
     return true;
     }
 
+bool ParentBuilder::VisitObjCMethodDecl( const ObjCMethodDecl* method )
+    {
+//    if( ignoreLocation( declaration ))
+//        return true; ???
+    if( method->hasBody())
+        {
+        const Stmt* body = method->getBody();
+        (*parents)[ body ] = NULL; // no parent
+        walk( body );
+        }
+    return true;
+    }
+
 void ParentBuilder::walk( const Stmt* stmt )
     {
     for( ConstStmtIterator it = stmt->child_begin();
commit 278409c3f175b562453c8a7a0e139eadfe41ba11
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 21 23:36:09 2014 +0100

    Allow building compilerplugins/clang on Mac OS X
    
    (at least against a self-built Clang configured --enable-keep-symbols)
    
    Change-Id: I6e38688c78f78aca1864530042159cdcef7a0694

diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index b7d8212..5d09346 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -8,6 +8,8 @@
 
 # Make sure variables in this Makefile do not conflict with other variables (e.g. from gbuild).
 
+CLANG_COMMA :=,
+
 # You may occassionally want to override some of these
 CLANGCXX=$(filter-out -m32 -m64,$(CXX))
 
@@ -86,7 +88,9 @@ $(foreach src, $(CLANGSRC), $(eval $(call clangbuildsrc,$(src),$(CLANGINDIR)/$(s
 
 $(CLANGOUTDIR)/plugin.so: $(CLANGOBJS)
 	@echo [build LNK] $(subst $(BUILDDIR)/,,$@)
-	$(QUIET)$(CLANGCXX) -shared $(CLANGOBJS) -o $@
+	$(QUIET)$(CLANGCXX) -shared $(CLANGOBJS) -o $@ \
+		$(if $(filter MACOSX,$(OS)),-Wl$(CLANG_COMMA)-flat_namespace \
+			-Wl$(CLANG_COMMA)-undefined -Wl$(CLANG_COMMA)suppress)
 
 # Clang most probably doesn't maintain binary compatibility, so rebuild when clang changes.
 $(CLANGOUTDIR)/clang-timestamp: $(CLANGBUILD)/bin/clang


More information about the Libreoffice-commits mailing list