[Libreoffice-commits] core.git: 3 commits - bridges/source config_host.mk.in configure.ac connectivity/source fpicker/source sfx2/source shell/source solenv/gbuild vcl/osx vcl/quartz

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 6 18:23:30 UTC 2019


 bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx    |    4 +++
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx |    4 +++
 config_host.mk.in                                    |    1 
 configure.ac                                         |   20 ++++++++++++---
 connectivity/source/drivers/macab/MacabServices.cxx  |    2 +
 connectivity/source/drivers/macab/MacabStatement.cxx |    1 
 fpicker/source/aqua/resourceprovider.mm              |    8 ++----
 sfx2/source/appl/shutdowniconaqua.mm                 |    4 +++
 shell/source/backends/macbe/macbackend.mm            |    7 ++---
 solenv/gbuild/LinkTarget.mk                          |    2 -
 solenv/gbuild/platform/com_GCC_defs.mk               |    2 -
 solenv/gbuild/platform/com_MSC_defs.mk               |    2 -
 vcl/osx/DataFlavorMapping.cxx                        |   25 +++++++++++++++++--
 vcl/osx/printaccessoryview.mm                        |   12 +++++++++
 vcl/osx/salinst.cxx                                  |    4 +++
 vcl/osx/salobj.cxx                                   |    4 +++
 vcl/quartz/ctfonts.cxx                               |    6 +++-
 vcl/quartz/salbmp.cxx                                |    9 +++++-
 vcl/quartz/salgdi.cxx                                |    4 +++
 19 files changed, 101 insertions(+), 20 deletions(-)

New commits:
commit 2ccaf4eecacaa912997d71a857dd84edf5af58cf
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 6 16:58:02 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Dec 6 19:21:53 2019 +0100

    loplugin:redundantcast (macOS)
    
    Change-Id: Ia514e105d913b8cf77d4fe931deb6b559b3525d3
    Reviewed-on: https://gerrit.libreoffice.org/84655
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d100e03b8910..4f9657b993b4 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -257,7 +257,7 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
 
 hb_font_t* CoreTextStyle::ImplInitHbFont()
 {
-    hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, const_cast<PhysicalFontFace*>(GetFontFace()), nullptr);
+    hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, GetFontFace(), nullptr);
 
     return InitHbFont(pHbFace);
 }
commit b1acb9c62701d8f09fafdf5b7c2b690249a277b8
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 6 16:50:38 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Dec 6 19:21:21 2019 +0100

    loplugin:external (macOS)
    
    * OldEntry in fpicker/source/aqua/resourceprovider.mm was apparently unused ever
      since it got introduced with 00657aef09d854c74fb426a935a3e8b1fc390bb0
      "migrate to boost::gettext"
    
    * impl_throwError is used from multiple TU,
      connectivity/source/drivers/macab/MacabStatement.cxx just missed the relevant
      #include
    
    Change-Id: Iba131da57aa20085bb1c634ba9a3a59566070abd
    Reviewed-on: https://gerrit.libreoffice.org/84653
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
index 3da3adac5fc3..ceed901f9e11 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/abi.cxx
@@ -58,6 +58,8 @@
 
 using namespace x86_64;
 
+namespace {
+
 /* Register class used for passing given 64bit part of the argument.
    These represent classes as documented by the PS ABI, with the exception
    of SSESF, SSEDF classes, that are basically SSE class, just gcc will
@@ -80,6 +82,8 @@ enum x86_64_reg_class
     X86_64_MEMORY_CLASS
 };
 
+}
+
 #define MAX_CLASSES 4
 
 /* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index c31cf180a704..c4cfe5123ec9 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -141,6 +141,8 @@ static OUString toUNOname( char const * p )
 #endif
 }
 
+namespace {
+
 class RTTI
 {
     typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
@@ -158,6 +160,8 @@ public:
     std::type_info * getRTTI( typelib_CompoundTypeDescription * );
 };
 
+}
+
 RTTI::RTTI()
     : m_hApp( dlopen( nullptr, RTLD_LAZY ) )
 {
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
index 8642c03e61e3..a550fcb94f58 100644
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ b/connectivity/source/drivers/macab/MacabServices.cxx
@@ -37,6 +37,7 @@ typedef Reference< XSingleServiceFactory > (*createFactoryFunc)
             rtl_ModuleCount*
         );
 
+namespace {
 
 struct ProviderRequest
 {
@@ -74,6 +75,7 @@ struct ProviderRequest
     void* getProvider() const { return xRet.get(); }
 };
 
+}
 
 extern "C" SAL_DLLPUBLIC_EXPORT void* macab_component_getFactory(
                     const sal_Char* pImplementationName,
diff --git a/connectivity/source/drivers/macab/MacabStatement.cxx b/connectivity/source/drivers/macab/MacabStatement.cxx
index a418b85c2d94..db6e3876b993 100644
--- a/connectivity/source/drivers/macab/MacabStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabStatement.cxx
@@ -27,6 +27,7 @@
 #include "MacabResultSetMetaData.hxx"
 #include "macabcondition.hxx"
 #include "macaborder.hxx"
+#include "macabutilities.hxx"
 #include <TConnection.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <connectivity/dbexception.hxx>
diff --git a/fpicker/source/aqua/resourceprovider.mm b/fpicker/source/aqua/resourceprovider.mm
index b5ec09532ea2..4daa24b9ff07 100644
--- a/fpicker/source/aqua/resourceprovider.mm
+++ b/fpicker/source/aqua/resourceprovider.mm
@@ -37,17 +37,15 @@ using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
 
 // we have to translate control ids to resource ids
 
+namespace {
+
 struct Entry
 {
     sal_Int32 ctrlId;
     const char* resId;
 };
 
-struct OldEntry
-{
-    sal_Int32 ctrlId;
-    sal_Int16 resId;
-};
+}
 
 Entry const CtrlIdToResIdTable[] = {
     { CHECKBOX_AUTOEXTENSION,                   STR_SVT_FILEPICKER_AUTO_EXTENSION },
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 14bb2d2efeb9..4a0f61b5dcf5 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -122,6 +122,8 @@ static NSString* getAutoreleasedString( const OUString& rStr )
     return [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rStr.getStr()) length: rStr.getLength()] autorelease];
 }
 
+namespace {
+
 struct RecentMenuEntry
 {
     OUString aURL;
@@ -142,6 +144,8 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin
         }
 };
 
+}
+
 @interface RecentMenuDelegate : NSObject
 {
     std::vector< RecentMenuEntry >* m_pRecentFilesItems;
diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm
index cb730c93d66c..54bd4726c6e3 100644
--- a/shell/source/backends/macbe/macbackend.mm
+++ b/shell/source/backends/macbe/macbackend.mm
@@ -38,16 +38,15 @@
 #define SPACE      ' '
 #define SEMI_COLON ';'
 
+namespace
+{
+
 typedef enum {
     sHTTP,
     sHTTPS,
     sFTP
 } ServiceType;
 
-
-namespace
-{
-
 /*
  * Returns current proxy settings for selected service type (HTTP or
  * FTP) as a C string (in the buffer specified by host and hostSize)
diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 48dc56a3037c..c63bc3321d16 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -146,8 +146,6 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     return (theType == cppu::UnoType<OUString>::get() );
   }
 
-} // unnamed namespace
-
 /* A base class for other data provider.
  */
 class DataProviderBaseImpl : public DataProvider
@@ -163,6 +161,8 @@ protected:
   id mSystemData;
 };
 
+} // unnamed namespace
+
 DataProviderBaseImpl::DataProviderBaseImpl(const Any& data) :
   mData(data),
   mSystemData(nil)
@@ -183,6 +183,8 @@ DataProviderBaseImpl::~DataProviderBaseImpl()
     }
 }
 
+namespace {
+
 class UniDataProvider : public DataProviderBaseImpl
 {
 public:
@@ -195,6 +197,8 @@ public:
   virtual Any getOOoData() override;
 };
 
+}
+
 UniDataProvider::UniDataProvider(const Any& data) :
   DataProviderBaseImpl(data)
 {
@@ -234,6 +238,8 @@ Any UniDataProvider::getOOoData()
   return oOOData;
 }
 
+namespace {
+
 class ByteSequenceDataProvider : public DataProviderBaseImpl
 {
 public:
@@ -246,6 +252,8 @@ public:
   virtual Any getOOoData() override;
 };
 
+}
+
 ByteSequenceDataProvider::ByteSequenceDataProvider(const Any& data) :
   DataProviderBaseImpl(data)
 {
@@ -284,6 +292,8 @@ Any ByteSequenceDataProvider::getOOoData()
   return oOOData;
 }
 
+namespace {
+
 class HTMLFormatDataProvider : public DataProviderBaseImpl
 {
 public:
@@ -294,6 +304,8 @@ public:
   virtual Any getOOoData() override;
 };
 
+}
+
 HTMLFormatDataProvider::HTMLFormatDataProvider(NSData* data) :
   DataProviderBaseImpl(data)
 {
@@ -340,6 +352,9 @@ Any HTMLFormatDataProvider::getOOoData()
   return oOOData;
 }
 
+namespace {
+
+
 class PNGDataProvider : public DataProviderBaseImpl
 {
     NSBitmapImageFileType meImageType;
@@ -353,6 +368,8 @@ public:
     virtual Any getOOoData() override;
 };
 
+}
+
 PNGDataProvider::PNGDataProvider( const Any& data, NSBitmapImageFileType eImageType) :
   DataProviderBaseImpl(data),
   meImageType( eImageType )
@@ -404,6 +421,8 @@ Any PNGDataProvider::getOOoData()
     return oOOData;
 }
 
+namespace {
+
 class FileListDataProvider : public DataProviderBaseImpl
 {
 public:
@@ -414,6 +433,8 @@ public:
   virtual Any getOOoData() override;
 };
 
+}
+
 FileListDataProvider::FileListDataProvider(const Any& data) :
   DataProviderBaseImpl(data)
 {
diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index c494ec7b2b7c..48d99ec384ba 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -46,8 +46,12 @@ using namespace com::sun::star;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::uno;
 
+namespace {
+
 class ControllerProperties;
 
+}
+
 @interface ControlTarget : NSObject
 {
     ControllerProperties* mpController;
@@ -149,6 +153,8 @@ class ControllerProperties;
 
 @end
 
+namespace {
+
 class ControllerProperties
 {
     std::map< int, OUString >      maTagToPropertyName;
@@ -315,6 +321,8 @@ public:
 
 };
 
+}
+
 static OUString filterAccelerator( OUString const & rText )
 {
     OUStringBuffer aBuf( rText.getLength() );
@@ -419,6 +427,8 @@ static OUString filterAccelerator( OUString const & rText )
 
 @end
 
+namespace {
+
 struct ColumnItem
 {
     NSControl*      pControl;
@@ -450,6 +460,8 @@ struct ColumnItem
     }
 };
 
+}
+
 static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
                                    std::vector< ColumnItem >& rLeftColumn,
                                    std::vector< ColumnItem >& rRightColumn
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index ae8074295c59..6b5c177bc755 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -83,6 +83,8 @@ static int* gpnInit = nullptr;
 static NSMenu* pDockMenu = nil;
 static bool bLeftMain = false;
 
+namespace {
+
 class AquaDelayedSettingsChanged : public Idle
 {
     bool            mbInvalidate;
@@ -113,6 +115,8 @@ public:
     }
 };
 
+}
+
 void AquaSalInstance::delayedSettingsChanged( bool bInvalidate )
 {
     osl::Guard< comphelper::SolarMutex > aGuard( *GetYieldMutex() );
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 34679dcdbaf7..75969d4e6b8c 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -287,6 +287,8 @@ const SystemEnvData* AquaSalObject::GetSystemData() const
     return &maSysData;
 }
 
+namespace {
+
 class AquaOpenGLContext : public OpenGLContext
 {
 public:
@@ -310,6 +312,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     virtual void swapBuffers() override;
 };
 
+}
+
 void AquaOpenGLContext::resetCurrent()
 {
     OSX_SALDATA_RUNINMAIN( resetCurrent() )
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 252720a0aa4e..d100e03b8910 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -143,9 +143,13 @@ bool CoreTextStyle::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& rRe
     return true;
 }
 
+namespace {
+
 // callbacks from CTFontCreatePathForGlyph+CGPathApply for GetGlyphOutline()
 struct GgoData { basegfx::B2DPolygon maPolygon; basegfx::B2DPolyPolygon* mpPolyPoly; };
 
+}
+
 static void MyCGPathApplierFunc( void* pData, const CGPathElement* pElement )
 {
     basegfx::B2DPolygon& rPolygon = static_cast<GgoData*>(pData)->maPolygon;
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 117c038c844e..2f6820b2877e 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -599,13 +599,18 @@ sal_uInt16 QuartzSalBitmap::GetBitCount() const
     return mnBits;
 }
 
-static struct pal_entry
+namespace {
+
+struct pal_entry
 {
     sal_uInt8 mnRed;
     sal_uInt8 mnGreen;
     sal_uInt8 mnBlue;
+};
+
 }
-const aImplSalSysPalEntryAry[ 16 ] =
+
+static pal_entry const aImplSalSysPalEntryAry[ 16 ] =
 {
 {    0,    0,    0 },
 {    0,    0, 0x80 },
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index b6df53319e28..000141123d7e 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -57,6 +57,8 @@
 
 using namespace vcl;
 
+namespace {
+
 class CoreTextGlyphFallbackSubstititution
 :    public ImplGlyphFallbackFontSubstitution
 {
@@ -64,6 +66,8 @@ public:
     bool FindFontSubstitute(FontSelectPattern&, LogicalFontInstance* pLogicalFont, OUString&) const override;
 };
 
+}
+
 bool CoreTextGlyphFallbackSubstititution::FindFontSubstitute(FontSelectPattern& rPattern, LogicalFontInstance* pLogicalFont,
     OUString& rMissingChars) const
 {
commit 0a803c0a41f46be4019ddd2768b4be5669b7ab59
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 6 16:26:27 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Dec 6 19:20:48 2019 +0100

    Honor BISON passed into configure
    
    ...and require new-enough Bison for --enable-compiler-plugins to not generate
    bogus loplugin:external warnings in Bison boilerplate code.  (As happend for me
    on macOS where /usr/bin/bison is version 2.3.  Not sure which versions exactly
    are too old, but at least 3.4.1 is known good.  If other versions newer than 2.3
    turn out to be problematic too, the configure.ac check will need to be adapted.)
    
    No idea why there need to be three places across solenv/gbuild/ that set
    gb_YACC (to the same bison in each case), but leave that to be cleaned up later.
    
    Change-Id: I01d8219726f8df7895631b817866207327367759
    Reviewed-on: https://gerrit.libreoffice.org/84650
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 35f92df1d641..ffd553acecc0 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -36,6 +36,7 @@ export AVAHI_LIBS=$(gb_SPACE)@AVAHI_LIBS@
 export LIBATOMIC_OPS_CFLAGS=$(gb_SPACE)@LIBATOMIC_OPS_CFLAGS@
 export LIBATOMIC_OPS_LIBS=$(gb_SPACE)@LIBATOMIC_OPS_LIBS@
 export BINDIR=@BINDIR@
+export BISON=@BISON@
 export BOOST_CPPFLAGS=@BOOST_CPPFLAGS@
 export BOOST_CXXFLAGS=@BOOST_CXXFLAGS@
 export BOOST_LOCALE_LIB=@BOOST_LOCALE_LIB@
diff --git a/configure.ac b/configure.ac
index da3e9b9db02a..651e9d60c2d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10418,11 +10418,25 @@ else
     AC_MSG_CHECKING([the bison version])
     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
-    # Accept newer than 2.0
-    if test "$_bison_longver" -lt 2000; then
-        AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
+    dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
+    dnl cause
+    dnl
+    dnl   idlc/source/parser.y:222:15: error: externally available entity 'YYSTYPE' is not previously declared in an included file (if it is only used in this translation unit, put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]
+    dnl   typedef union YYSTYPE
+    dnl           ~~~~~~^~~~~~~
+    dnl
+    dnl while at least 3.4.1 is know to be good:
+    if test "$COMPILER_PLUGINS" = TRUE; then
+        if test "$_bison_longver" -lt 2004; then
+            AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
+        fi
+    else
+        if test "$_bison_longver" -lt 2000; then
+            AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
+        fi
     fi
 fi
+AC_SUBST([BISON])
 
 AC_PATH_PROG(FLEX, flex)
 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 695becffd076..0d9d2cb11bf6 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -403,7 +403,7 @@ $(call gb_YaccTarget_get_header_target,$(1)) : $(call gb_YaccTarget_get_target,$
 
 endef
 
-gb_YACC := bison
+gb_YACC := $(BISON)
 
 
 # LexTarget class
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 712a61df544f..1996135e2195 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -8,7 +8,7 @@
 #
 
 gb_AWK := awk
-gb_YACC := bison
+gb_YACC := $(BISON)
 
 gb_CLASSPATHSEP := :
 gb_LICENSE := LICENSE
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 8ba47447df32..2e4424e29cc8 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -29,7 +29,7 @@ gb_LINK := link
 gb_AWK := awk
 gb_CLASSPATHSEP := ;
 gb_RC := rc
-gb_YACC := bison
+gb_YACC := $(BISON)
 
 # use CC/CXX if they are nondefaults
 ifneq ($(origin CC),default)


More information about the Libreoffice-commits mailing list