diff options
Diffstat (limited to 'vcl')
84 files changed, 224 insertions, 184 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index 3b1627c33b8f..239f47bd7ead 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -51,7 +51,7 @@ using namespace css; -void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, +static void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, vcl::RenderContext& rRenderContext) { long nWidth = rRect.GetWidth(); @@ -67,7 +67,7 @@ void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap, rRenderContext.DrawBitmap(aPoint, aBitmap); } -void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) +static void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext, BmpScaleFlag aFlag = BmpScaleFlag::Fast) { long nWidth = rRect.GetWidth(); long nHeight = rRect.GetHeight(); @@ -81,7 +81,7 @@ void drawBitmapScaledAndCentered(tools::Rectangle const & rRect, Bitmap aBitmap, drawBitmapCentered(rRect, aBitmap, rRenderContext); } -void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::RenderContext& rRenderContext) +static void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::RenderContext& rRenderContext) { rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR); rRenderContext.SetFillColor(aColor); @@ -90,7 +90,7 @@ void drawBackgroundRect(tools::Rectangle const & rRect, Color aColor, vcl::Rende rRenderContext.Pop(); } -void assertAndSetBackground(vcl::test::TestResult eResult, tools::Rectangle const & rRect, vcl::RenderContext& rRenderContext) +static void assertAndSetBackground(vcl::test::TestResult eResult, tools::Rectangle const & rRect, vcl::RenderContext& rRenderContext) { if (eResult == vcl::test::TestResult::Passed) drawBackgroundRect(rRect, COL_GREEN, rRenderContext); diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 543e2ba8574e..824fb847a732 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -39,7 +39,7 @@ SvpSalBitmap::~SvpSalBitmap() Destroy(); } -std::unique_ptr<BitmapBuffer> ImplCreateDIB( +static std::unique_ptr<BitmapBuffer> ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal) diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 56bd740dbe40..ea70321ff2fa 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -820,7 +820,7 @@ void SvpSalGraphics::drawPolyPolygon(sal_uInt32 nPoly, 0.0); } -basegfx::B2DPoint impPixelSnap( +static basegfx::B2DPoint impPixelSnap( const basegfx::B2DPolygon& rPolygon, const basegfx::B2DHomMatrix& rObjectToDevice, basegfx::B2DHomMatrix& rObjectToDeviceInv, diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx index b9c74f4d8aa5..4404fe4144b0 100644 --- a/vcl/headless/svpprn.cxx +++ b/vcl/headless/svpprn.cxx @@ -56,7 +56,7 @@ static OUString getPdfDir( const PrinterInfo& rInfo ) return aDir; } -inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } +static inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 8cbbae5496a0..e013c5d602a9 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -51,7 +51,7 @@ using namespace vcl::unotools; namespace com { namespace sun { namespace star { namespace rendering { -bool operator==( const RGBColor& rLHS, const ARGBColor& rRHS ) +static bool operator==( const RGBColor& rLHS, const ARGBColor& rRHS ) { return rLHS.Red == rRHS.Red && rLHS.Green == rRHS.Green && rLHS.Blue == rRHS.Blue; } diff --git a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx index d63b6b276a58..b61d10096da5 100644 --- a/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegReaderTest.cxx @@ -37,7 +37,7 @@ public: CPPUNIT_TEST_SUITE_END(); }; -int deltaColor(BitmapColor aColor1, BitmapColor aColor2) +static int deltaColor(BitmapColor aColor1, BitmapColor aColor2) { int deltaR = std::abs(aColor1.GetRed() - aColor2.GetRed()); int deltaG = std::abs(aColor1.GetGreen() - aColor2.GetGreen()); @@ -46,7 +46,7 @@ int deltaColor(BitmapColor aColor1, BitmapColor aColor2) return std::max(std::max(deltaR, deltaG), deltaB); } -bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWidth, Color aExpectedColor, int nMaxDelta) +static bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWidth, Color aExpectedColor, int nMaxDelta) { BitmapScopedWriteAccess pAccess(rBitmap); @@ -88,7 +88,7 @@ bool checkRect(Bitmap& rBitmap, int aLayerNumber, long nAreaHeight, long nAreaWi return true; } -int getNumberOfImageComponents(const Graphic& rGraphic) +static int getNumberOfImageComponents(const Graphic& rGraphic) { GfxLink aLink = rGraphic.GetGfxLink(); SvMemoryStream aMemoryStream(const_cast<sal_uInt8*>(aLink.GetData()), aLink.GetDataSize(), diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 0015706c8a0f..116bf0ab6758 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -138,7 +138,7 @@ public: CPPUNIT_TEST_SUITE_END(); }; -void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) +static void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) { rDevice.SetConnectMetaFile(&rMeta); Size aVDSize(10, 10); @@ -147,7 +147,7 @@ void setupBaseVirtualDevice(VirtualDevice& rDevice, GDIMetaFile& rMeta) rDevice.Erase(); } -GDIMetaFile readMetafile(const OUString& rUrl) +static GDIMetaFile readMetafile(const OUString& rUrl) { SvFileStream aFileStream(rUrl, StreamMode::READ); GDIMetaFile aResultMetafile; @@ -156,7 +156,7 @@ GDIMetaFile readMetafile(const OUString& rUrl) return aResultMetafile; } -void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) +static void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) { SvFileStream aFileStream(rUrl, StreamMode::WRITE); aFileStream.Seek(STREAM_SEEK_TO_BEGIN); @@ -164,7 +164,7 @@ void writeMetaFile(GDIMetaFile& rInputMetafile, const OUString& rUrl) aFileStream.Close(); } -GDIMetaFile writeAndRead(GDIMetaFile& rMetaFile, const OUString& sUrl) +static GDIMetaFile writeAndRead(GDIMetaFile& rMetaFile, const OUString& sUrl) { // Turn on to output the SVM bitstreams to files (using the input URL) // to inspect the content or to create a reference file, otherwise leave diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 18be768c04c0..d98cdafe0137 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -36,7 +36,8 @@ @param nControlState State of the widget (default, focused, ...) in Native Widget Framework. @param aValue Value held by the widget (on, off, ...) */ -QStyle::State vclStateValue2StateFlag(ControlState nControlState, const ImplControlValue& aValue) +static QStyle::State vclStateValue2StateFlag(ControlState nControlState, + const ImplControlValue& aValue) { QStyle::State nState = ((nControlState & ControlState::ENABLED) ? QStyle::State_Enabled : QStyle::State_None) diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 1f8db580f978..b27eed124f6c 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star; -void ImplDbgTestSolarMutex() +static void ImplDbgTestSolarMutex() { assert(ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && "SolarMutex not owned!"); } diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index acbb9311d03b..45234e9bab00 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -75,7 +75,7 @@ LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const return *mpLocaleDataWrapper; } -inline bool is_formatting_mark( sal_Unicode c ) +static inline bool is_formatting_mark( sal_Unicode c ) { if( (c >= 0x200B) && (c <= 0x200F) ) // BiDi and zero-width-markers return true; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index d4a0ae409acf..ec151895815a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -453,7 +453,7 @@ void Application::Execute() pSVData->maAppData.mbInAppExecute = false; } -inline bool ImplYield(bool i_bWait, bool i_bAllEvents) +static inline bool ImplYield(bool i_bWait, bool i_bAllEvents) { ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index f87354a37316..3ca22053452d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -114,7 +114,7 @@ static bool g_bIsLeanException; static bool isInitVCL(); -oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo) +static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo) { static volatile bool bIn = false; diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index d47311c50bc7..2491efe0228e 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1807,7 +1807,7 @@ static bool ImplCurrencyProcessKeyInput( const KeyEvent& rKEvt, return ImplNumericProcessKeyInput( rKEvt, false, bUseThousandSep, rWrapper ); } -inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, +static inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper ) { // fetch number diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 3d46cf92d27c..3a0a0b9da8f2 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -212,7 +212,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue, } // namespace -inline bool ImplLongCurrencyGetValue( const OUString& rStr, BigInt& rValue, +static inline bool ImplLongCurrencyGetValue( const OUString& rStr, BigInt& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper ) { return ImplCurrencyGetValue( rStr, rValue, nDecDigits, rLocaleDataWrapper ); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index a7082008eeb3..c8eba348db53 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -285,7 +285,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) // http://stackoverflow.com/questions/9071205/balanced-word-wrap-minimum-raggedness-in-php namespace MinimumRaggednessWrap { - std::deque<size_t> GetEndOfLineIndexes(const std::vector<sal_Int32>& rWidthsOf, sal_Int32 nLineWidth) + static std::deque<size_t> GetEndOfLineIndexes(const std::vector<sal_Int32>& rWidthsOf, sal_Int32 nLineWidth) { ++nLineWidth; diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 369fc3989f04..30f6e4399511 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -118,7 +118,7 @@ OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName() @throws It let pass RuntimeExceptions only. */ -Reference< XInterface > openConfig(const char* sPackage) +static Reference< XInterface > openConfig(const char* sPackage) { Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 7aa82f10031b..c2146b962248 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -167,7 +167,7 @@ sal_uInt8* ImplSearchEntry( sal_uInt8* pSource, sal_uInt8 const * pDest, sal_uLo return nullptr; } -inline OUString ImpGetExtension( const OUString &rPath ) +static inline OUString ImpGetExtension( const OUString &rPath ) { OUString aExt; INetURLObject aURL( rPath ); diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index f9b5ae775c7f..32ad4b51947a 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -214,7 +214,7 @@ bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ) } // returns the next jpeg marker, a return value of 0 represents an error -sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) +static sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) { sal_uInt8 nByte; do diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 7b307d7f97cb..1e21b012f0d9 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -32,11 +32,13 @@ #define BUFFER_SIZE 4096 +extern "C" { + /* * Initialize source --- called by jpeg_read_header * before any data is actually read. */ -extern "C" void init_source (j_decompress_ptr cinfo) +static void init_source (j_decompress_ptr cinfo) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); @@ -48,7 +50,9 @@ extern "C" void init_source (j_decompress_ptr cinfo) source->no_data_available = FALSE; } -long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) +} + +static long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) { long nRead = 0; @@ -71,7 +75,9 @@ long StreamRead( SvStream* pStream, void* pBuffer, long nBufferSize ) return nRead; } -extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) +extern "C" { + +static boolean fill_input_buffer (j_decompress_ptr cinfo) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); size_t nbytes; @@ -99,7 +105,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo) return TRUE; } -extern "C" void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) +static void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) { SourceManagerStruct * source = reinterpret_cast<SourceManagerStruct *>(cinfo->src); @@ -123,11 +129,13 @@ extern "C" void skip_input_data (j_decompress_ptr cinfo, long numberOfBytes) } } -extern "C" void term_source (j_decompress_ptr) +static void term_source (j_decompress_ptr) { /* no work necessary here */ } +} + void jpeg_svstream_src (j_decompress_ptr cinfo, void* input) { SourceManagerStruct * source; diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index 49e4c6057858..f246c3ea53b3 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -38,7 +38,9 @@ struct DestinationManagerStruct JOCTET * buffer; /* start of buffer */ }; -extern "C" void init_destination (j_compress_ptr cinfo) +extern "C" { + +static void init_destination (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); @@ -50,7 +52,7 @@ extern "C" void init_destination (j_compress_ptr cinfo) destination->pub.free_in_buffer = BUFFER_SIZE; } -extern "C" boolean empty_output_buffer (j_compress_ptr cinfo) +static boolean empty_output_buffer (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); @@ -65,7 +67,7 @@ extern "C" boolean empty_output_buffer (j_compress_ptr cinfo) return TRUE; } -extern "C" void term_destination (j_compress_ptr cinfo) +static void term_destination (j_compress_ptr cinfo) { DestinationManagerStruct * destination = reinterpret_cast<DestinationManagerStruct *>(cinfo->dest); size_t datacount = BUFFER_SIZE - destination->pub.free_in_buffer; @@ -80,6 +82,8 @@ extern "C" void term_destination (j_compress_ptr cinfo) } } +} + void jpeg_svstream_dest (j_compress_ptr cinfo, void* output) { SvStream* stream = static_cast<SvStream*>(output); diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index cd87781ebd4f..ab56a35c0de7 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -55,7 +55,9 @@ struct ErrorManagerStruct #pragma warning(pop) #endif -extern "C" void errorExit (j_common_ptr cinfo) +extern "C" { + +static void errorExit (j_common_ptr cinfo) { char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); @@ -64,19 +66,23 @@ extern "C" void errorExit (j_common_ptr cinfo) longjmp(error->setjmp_buffer, 1); } -extern "C" void outputMessage (j_common_ptr cinfo) +static void outputMessage (j_common_ptr cinfo) { char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message) (cinfo, buffer); SAL_WARN("vcl.filter", "failure reading JPEG: " << buffer); } +} + static int GetWarningLimit() { return utl::ConfigManager::IsFuzzing() ? 5 : 1000; } -extern "C" void emitMessage (j_common_ptr cinfo, int msg_level) +extern "C" { + +static void emitMessage (j_common_ptr cinfo, int msg_level) { if (msg_level < 0) { @@ -93,6 +99,8 @@ extern "C" void emitMessage (j_common_ptr cinfo, int msg_level) cinfo->err->output_message(cinfo); } +} + class JpegDecompressOwner { public: @@ -139,7 +147,7 @@ struct JpegStuff std::vector<sal_uInt8> pCYMKBuffer; }; -void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputStream, long* pLines, +static void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputStream, long* pLines, Size const & previewSize, GraphicFilterImportFlags nImportFlags, BitmapScopedWriteAccess* ppAccess) { diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index a877c30c6352..f91c0fbee9d1 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1703,7 +1703,7 @@ void Type1Emitter::emitAllCrypted() // #i110387# quick-and-dirty double->ascii conversion // needed because sprintf/ecvt/etc. alone are too localized (LC_NUMERIC) // also strip off trailing zeros in fraction while we are at it -inline int dbl2str( char* pOut, double fVal) +static inline int dbl2str( char* pOut, double fVal) { const int nLen = psp::getValueOfDouble( pOut, fVal, 6); return nLen; diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 85aef9aa7ea0..40a5e0bf0999 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2610,7 +2610,7 @@ void DisposeNameRecords(NameRecord* nr, int n) free(nr); } -template<size_t N> void +template<size_t N> static void append(std::bitset<N> & rSet, size_t const nOffset, sal_uInt32 const nValue) { for (size_t i = 0; i < 32; ++i) diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index ebc181e42d07..76f083663ba0 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -232,7 +232,7 @@ class TrueColorPixelPtr<ScanlineFormat::N8BitPal> // converting truecolor formats template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplConvertPixel( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc ) { rDst.SetColor( rSrc.GetRed(), rSrc.GetGreen(), rSrc.GetBlue() ); @@ -252,7 +252,7 @@ inline void ImplConvertPixel<ScanlineFormat::N16BitTcLsbMask, ScanlineFormat::N1 } template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, int nPixelCount ) { TrueColorPixelPtr<DSTFMT> aDst( rDst ); @@ -267,7 +267,7 @@ inline void ImplConvertLine( const TrueColorPixelPtr<DSTFMT>& rDst, // alpha blending truecolor pixels template <ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, unsigned nAlphaVal ) { static const unsigned nAlphaShift = 8; @@ -294,7 +294,7 @@ inline void ImplBlendPixels( const TrueColorPixelPtr<DSTFMT>& rDst, } template <ScanlineFormat MASKFMT, ScanlineFormat SRCFMT, ScanlineFormat DSTFMT> -inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst, +static inline void ImplBlendLines( const TrueColorPixelPtr<DSTFMT>& rDst, const TrueColorPixelPtr<SRCFMT>& rSrc, const TrueColorPixelPtr<MASKFMT>& rMsk, int nPixelCount ) { @@ -345,7 +345,7 @@ static bool ImplCopyImage( BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuf } template <ScanlineFormat DSTFMT,ScanlineFormat SRCFMT> -bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, +static bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer ) { // help the compiler to avoid instantiations of unneeded conversions @@ -376,7 +376,7 @@ bool ImplConvertToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, } template <ScanlineFormat SRCFMT> -inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) +static inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); @@ -536,7 +536,7 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc, } template <ScanlineFormat DSTFMT, ScanlineFormat SRCFMT> //,sal_uLong MSKFMT> -bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, +static bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) { @@ -611,7 +611,7 @@ inline bool ImplBlendToBitmap<ScanlineFormat::N32BitTcBgra,ScanlineFormat::N32Bi } template <ScanlineFormat SRCFMT> -bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk ) +static bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const BitmapBuffer& rMsk ) { TrueColorPixelPtr<SRCFMT> aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 8c779743c5a0..e785aae0aeb7 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -53,11 +53,11 @@ class ImplChain; namespace ImplVectorizer { - ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ); - void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce ); - bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain ); - bool ImplIsUp( ImplVectMap const * pMap, long nY, long nX ); - void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly ); + static ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ); + static void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce ); + static bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain ); + static bool ImplIsUp( ImplVectMap const * pMap, long nY, long nX ); + static void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly ); } struct ChainMove { long nDX; long nDY; }; @@ -102,7 +102,9 @@ struct ImplColorSet bool mbSet = false; }; -extern "C" int ImplColorSetCmpFnc( const void* p1, const void* p2 ) +extern "C" { + +static int ImplColorSetCmpFnc( const void* p1, const void* p2 ) { ImplColorSet const * pSet1 = static_cast<ImplColorSet const *>(p1); ImplColorSet const * pSet2 = static_cast<ImplColorSet const *>(p2); @@ -124,6 +126,8 @@ extern "C" int ImplColorSetCmpFnc( const void* p1, const void* p2 ) return nRet; } +} + class ImplPointArray { std::unique_ptr<Point[]> mpArray; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 562927d505b0..1a3e67d366d7 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1340,7 +1340,7 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject ) namespace vcl { template < class GEOMETRY > -GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) +static GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject ) { GEOMETRY aPoint; if ( MapUnit::MapPixel == _rSource.GetMapUnit() ) diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 5ad75f843302..e87f2acfbd0d 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1561,12 +1561,12 @@ static const long setRun[256] = 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ }; -inline bool isSet( const Scanline i_pLine, long i_nIndex ) +static inline bool isSet( const Scanline i_pLine, long i_nIndex ) { return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0; } -long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet ) +static long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet ) { long nIndex = i_nStartIndex; if( nIndex < i_nW ) @@ -1629,7 +1629,7 @@ long findBitRunImpl( const Scanline i_pLine, long i_nStartIndex, long i_nW, bool return std::min(nIndex, i_nW); } -long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet) +static long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bSet) { if (i_nStartIndex < 0) return i_nW; @@ -1637,7 +1637,7 @@ long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW, bool i_bS return findBitRunImpl(i_pLine, i_nStartIndex, i_nW, i_bSet); } -long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW) +static long findBitRun(const Scanline i_pLine, long i_nStartIndex, long i_nW) { if (i_nStartIndex < 0) return i_nW; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index abfc5ad55357..5af7829b0e03 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -234,7 +234,7 @@ bool vcl::Region::IsEmpty() const } -std::unique_ptr<RegionBand> ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) +static std::unique_ptr<RegionBand> ImplCreateRegionBandFromPolyPolygon(const tools::PolyPolygon& rPolyPolygon) { std::unique_ptr<RegionBand> pRetval; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index b9cc988fdbbb..e2fd9aeb88a3 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -210,7 +210,7 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) return nChar; } -inline bool IsControlChar( sal_UCS4 cChar ) +static inline bool IsControlChar( sal_UCS4 cChar ) { // C0 control characters if( (0x0001 <= cChar) && (cChar <= 0x001F) ) diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 8393c482e41d..b00fdfdce81b 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -37,7 +37,7 @@ #include <o3tl/make_unique.hxx> // Inlines -void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) +static void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) { Point aTL; Point aBR; @@ -48,7 +48,7 @@ void ImplReadRect( SvStream& rIStm, tools::Rectangle& rRect ) rRect = tools::Rectangle( aTL, aBR ); } -bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) +static bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) { sal_Int32 nSize32(0); rIStm.ReadInt32(nSize32); @@ -69,7 +69,7 @@ bool ImplReadPoly(SvStream& rIStm, tools::Polygon& rPoly) return rIStm.good(); } -bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) +static bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) { bool bSuccess = true; @@ -91,7 +91,7 @@ bool ImplReadPolyPoly(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) return bSuccess && rIStm.good(); } -void ImplReadColor( SvStream& rIStm, Color& rColor ) +static void ImplReadColor( SvStream& rIStm, Color& rColor ) { sal_Int16 nVal(0); @@ -100,7 +100,7 @@ void ImplReadColor( SvStream& rIStm, Color& rColor ) rIStm.ReadInt16( nVal ); rColor.SetBlue( sal::static_int_cast<sal_uInt8>(static_cast<sal_uInt16>(nVal) >> 8) ); } -bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) +static bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) { sal_Int16 nUnit(0); rIStm.ReadInt16(nUnit); @@ -128,7 +128,7 @@ bool ImplReadMapMode(SvStream& rIStm, MapMode& rMapMode) return true; } -void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rString ) +static void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rString ) { sal_uInt32 nOld = rIStm.Tell(); if ( nStrmPos ) @@ -149,7 +149,7 @@ void ImplReadUnicodeComment( sal_uInt32 nStrmPos, SvStream& rIStm, OUString& rSt rIStm.Seek( nOld ); } -void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) +static void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) { sal_Int32 nActionSize; sal_Int16 nType; @@ -162,7 +162,7 @@ void ImplSkipActions(SvStream& rIStm, sal_uLong nSkipCount) } } -void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) +static void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPolyPoly) { rPolyPoly.Clear(); sal_uInt16 nPolygonCount(0); diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index 662c2505553d..08aebe0a1b3d 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -90,7 +90,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( return aRetval; } -size_t estimateSize( +static size_t estimateSize( std::deque<uno::Reference<graphic::XPrimitive2D>> const& rSequence) { size_t nRet(0); diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 1eaab88e4747..378832b55611 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -39,7 +39,7 @@ using namespace css::uno; namespace vcl { namespace CommandInfoProvider { -Reference<container::XNameAccess> const GetCommandDescription() +static Reference<container::XNameAccess> const GetCommandDescription() { static WeakReference<container::XNameAccess> xWeakRef; css::uno::Reference<container::XNameAccess> xRef(xWeakRef); @@ -53,7 +53,7 @@ Reference<container::XNameAccess> const GetCommandDescription() return xRef; } -Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfigurationSupplier() +static Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfigurationSupplier() { static WeakReference<ui::XModuleUIConfigurationManagerSupplier> xWeakRef; css::uno::Reference<ui::XModuleUIConfigurationManagerSupplier> xRef(xWeakRef); @@ -67,7 +67,7 @@ Reference<ui::XModuleUIConfigurationManagerSupplier> const GetModuleConfiguratio return xRef; } -Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration() +static Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration() { static WeakReference<ui::XAcceleratorConfiguration> xWeakRef; css::uno::Reference<ui::XAcceleratorConfiguration> xRef(xWeakRef); @@ -81,7 +81,7 @@ Reference<ui::XAcceleratorConfiguration> const GetGlobalAcceleratorConfiguration return xRef; } -Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) +static Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) { Reference<frame::XController> xController = rxFrame->getController(); if (xController.is()) @@ -100,7 +100,7 @@ Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfigurati return nullptr; } -Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) +static Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration(const Reference<frame::XFrame>& rxFrame) { css::uno::Reference<css::ui::XAcceleratorConfiguration> curModuleAcceleratorConfiguration; try @@ -119,7 +119,7 @@ Reference<ui::XAcceleratorConfiguration> const GetModuleAcceleratorConfiguration return curModuleAcceleratorConfiguration; } -vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) +static vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) { bool bShift = ((aAWTKey.Modifiers & awt::KeyModifier::SHIFT) == awt::KeyModifier::SHIFT ); bool bMod1 = ((aAWTKey.Modifiers & awt::KeyModifier::MOD1 ) == awt::KeyModifier::MOD1 ); @@ -130,7 +130,7 @@ vcl::KeyCode AWTKey2VCLKey(const awt::KeyEvent& aAWTKey) return vcl::KeyCode(nKey, bShift, bMod1, bMod2, bMod3); } -OUString RetrieveShortcutsFromConfiguration( +static OUString RetrieveShortcutsFromConfiguration( const Reference<ui::XAcceleratorConfiguration>& rxConfiguration, const OUString& rsCommandName) { @@ -157,7 +157,7 @@ OUString RetrieveShortcutsFromConfiguration( return OUString(); } -bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandName, const OUString& rsModuleName) +static bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandName, const OUString& rsModuleName) { Sequence< OUString > aSequence; try @@ -183,7 +183,7 @@ bool ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandNam return false; } -Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) +static Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandName, const OUString& rsModuleName) { Sequence<beans::PropertyValue> aProperties; @@ -204,7 +204,7 @@ Sequence<beans::PropertyValue> GetCommandProperties(const OUString& rsCommandNam return aProperties; } -OUString GetCommandProperty(const OUString& rsProperty, const OUString& rsCommandName, const OUString& rsModuleName) +static OUString GetCommandProperty(const OUString& rsProperty, const OUString& rsCommandName, const OUString& rsModuleName) { const Sequence<beans::PropertyValue> aProperties (GetCommandProperties(rsCommandName, rsModuleName)); for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) @@ -294,7 +294,7 @@ OUString GetRealCommandForCommand(const OUString& rCommandName, return GetCommandProperty("TargetURL", rCommandName, rsModuleName); } -BitmapEx GetBitmapForCommand(const OUString& rsCommandName, +static BitmapEx GetBitmapForCommand(const OUString& rsCommandName, const Reference<frame::XFrame>& rxFrame, vcl::ImageType eImageType) { diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index fd1025dec240..af5329ec379e 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -332,7 +332,7 @@ bool ImplImageTree::loadImage(OUString const & rName, OUString const & rStyle, B return false; } -OUString createVariant(ImageRequestParameters& rParameters) +static OUString createVariant(ImageRequestParameters& rParameters) { bool bConvertToDarkTheme = rParameters.convertToDarkTheme(); sal_Int32 aScalePercentage = rParameters.scalePercentage(); @@ -345,7 +345,7 @@ OUString createVariant(ImageRequestParameters& rParameters) return aVariant; } -bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rParameters) +static bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rParameters) { OUString sUrl(getIconCacheUrl(rParameters.msStyle, sVariant, rParameters.msName)); if (!urlExists(sUrl)) @@ -357,7 +357,7 @@ bool loadDiskCachedVersion(OUString const & sVariant, ImageRequestParameters& rP return true; } -void cacheBitmapToDisk(OUString const & sVariant, ImageRequestParameters const & rParameters) +static void cacheBitmapToDisk(OUString const & sVariant, ImageRequestParameters const & rParameters) { OUString sUrl(createIconCacheUrl(rParameters.msStyle, sVariant, rParameters.msName)); vcl::PNGWriter aWriter(rParameters.mrBitmap); diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 5dc4090bdaa0..875589e00df1 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -238,7 +238,7 @@ bool OpenGLContext::ImplInit() return false; } -OUString getGLString(GLenum eGlEnum) +static OUString getGLString(GLenum eGlEnum) { OUString sString; const GLubyte* pString = glGetString(eGlEnum); diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 2059aa364824..79b2c7e7f83a 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -35,7 +35,9 @@ #define HATCH_MAXPOINTS 1024 -extern "C" int HatchCmpFnc( const void* p1, const void* p2 ) +extern "C" { + +static int HatchCmpFnc( const void* p1, const void* p2 ) { const long nX1 = static_cast<Point const *>(p1)->X(); const long nX2 = static_cast<Point const *>(p2)->X(); @@ -45,6 +47,8 @@ extern "C" int HatchCmpFnc( const void* p1, const void* p2 ) return ( nX1 > nX2 ? 1 : nX1 == nX2 ? nY1 > nY2 ? 1: nY1 == nY2 ? 0 : -1 : -1 ); } +} + void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& rHatch ) { assert(!is_double_buffered_window()); diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index d88960d9da9b..c890037017e7 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -313,7 +313,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, rMapRes.mnMapScDenomY = aTempY.GetDenominator(); } -inline void ImplCalcMapResolution( const MapMode& rMapMode, +static inline void ImplCalcMapResolution( const MapMode& rMapMode, long nDPIX, long nDPIY, ImplMapRes& rMapRes, ImplThresholdRes& rThresRes ) diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 69a556e0ecaa..7ba39842a2af 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -37,7 +37,7 @@ public: ImplAccelList maIdList; // Id-List }; -sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, +static sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, sal_uInt16* pIndex = nullptr ) { size_t nLow; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9b1a1d322916..3bfff31b910e 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -57,7 +57,7 @@ #include <dlfcn.h> #endif -bool toBool(const OString &rValue) +static bool toBool(const OString &rValue) { return (!rValue.isEmpty() && (rValue[0] == 't' || rValue[0] == 'T' || rValue[0] == '1')); } @@ -3267,7 +3267,7 @@ void VclBuilder::insertMenuObject(PopupMenu *pParent, PopupMenu *pSubMenu, const /// Insert items to a ComboBox or a ListBox. /// They have no common ancestor that would have 'InsertEntry()', so use a template. -template<typename T> bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<ComboBoxTextItem> &rItems) +template<typename T> static bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, const std::vector<ComboBoxTextItem> &rItems) { T *pContainer = dynamic_cast<T*>(pWindow); if (!pContainer) diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 5f4d4c441d30..8aeb7b07cb74 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <accel.h> #include <salinst.hxx> #include <salframe.hxx> #include <svdata.hxx> diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index fd45676424a7..2b4ac9c11b9c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -183,7 +183,7 @@ void VclContainer::queue_resize(StateChangedType eReason) } -Button* isVisibleButtonWithText(vcl::Window* pCandidate) +static Button* isVisibleButtonWithText(vcl::Window* pCandidate) { if (!pCandidate) return nullptr; @@ -1234,12 +1234,12 @@ static void calcMaxs(const array_type &A, std::vector<VclGrid::Value> &rWidths, } } -bool compareValues(const VclGrid::Value &i, const VclGrid::Value &j) +static bool compareValues(const VclGrid::Value &i, const VclGrid::Value &j) { return i.m_nValue < j.m_nValue; } -VclGrid::Value accumulateValues(const VclGrid::Value &i, const VclGrid::Value &j) +static VclGrid::Value accumulateValues(const VclGrid::Value &i, const VclGrid::Value &j) { VclGrid::Value aRet; aRet.m_nValue = i.m_nValue + j.m_nValue; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 1fc1ca4b991f..b92daf20f10c 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -548,7 +548,7 @@ void Menu::RemoveItem( sal_uInt16 nPos ) ImplCallEventListeners( VclEventId::MenuRemoveItem, nPos ); } -void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) +static void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) { MenuItemType eType = rMenu.GetItemType( nPos ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 9be367442e21..819b3c7ca6e3 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -883,7 +883,7 @@ bool PrintDialog::isSingleJobs() return maOptionsPage.mpCollateSingleJobsBox->IsChecked(); } -void setHelpId( vcl::Window* i_pWindow, const Sequence< OUString >& i_rHelpIds, sal_Int32 i_nIndex ) +static void setHelpId( vcl::Window* i_pWindow, const Sequence< OUString >& i_rHelpIds, sal_Int32 i_nIndex ) { if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() ) i_pWindow->SetHelpId( OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) ); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 666824613b34..86d1c6eadc3e 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -79,7 +79,7 @@ struct ImplStatusItem std::unique_ptr<SalLayout> mxLayoutCache; }; -inline long ImplCalcProgressWidth( sal_uInt16 nMax, long nSize ) +static inline long ImplCalcProgressWidth( sal_uInt16 nMax, long nSize ) { return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2)); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index b96123ddc637..28063ce19c63 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star; -void ImplSysChildProc( void* pInst, SalObjEvent nEvent ) +static void ImplSysChildProc( void* pInst, SalObjEvent nEvent ) { VclPtr<SystemChildWindow> pWindow = static_cast<SystemChildWindow*>(pInst); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 187667e288a7..c5db670b3c6d 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -112,7 +112,7 @@ void SystemWindow::dispose() Window::dispose(); } -void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow ) +static void ImplHandleControlAccelerator( vcl::Window* pWindow, bool bShow ) { Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow()); if (pControl && pControl->GetText().indexOf('~') != -1) diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 1cda73af9e44..9a6c01d2478a 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -242,7 +242,7 @@ void TabDialog::StateChanged( StateChangedType nType ) Dialog::StateChanged( nType ); } -vcl::Window* findTabControl(vcl::Window* pCurrent) +static vcl::Window* findTabControl(vcl::Window* pCurrent) { if (!pCurrent) { diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index c21499e00d29..66563c6b9ee7 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -145,7 +145,7 @@ int ToolBox::ImplGetDragWidth() const return ToolBox::ImplGetDragWidth( *this, mbHorz ); } -ButtonType determineButtonType( ImplToolItem const * pItem, ButtonType defaultType ) +static ButtonType determineButtonType( ImplToolItem const * pItem, ButtonType defaultType ) { ButtonType tmpButtonType = defaultType; ToolBoxItemBits nBits = pItem->mnBits & ( ToolBoxItemBits::TEXT_ONLY | ToolBoxItemBits::ICON_ONLY ); @@ -4466,7 +4466,7 @@ bool ToolBox::ImplActivateItem( vcl::KeyCode aKeyCode ) return bRet; } -bool ImplCloseLastPopup( vcl::Window const *pParent ) +static bool ImplCloseLastPopup( vcl::Window const *pParent ) { // close last popup toolbox (see also: // ImplHandleMouseFloatMode(...) in winproc.cxx ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index be926265c755..829f7e3f5b27 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -382,7 +382,7 @@ void Window::SetZoom( const Fraction& rZoom ) } } -inline long WinFloatRound( double fVal ) +static inline long WinFloatRound( double fVal ) { return( fVal > 0.0 ? static_cast<long>( fVal + 0.5 ) : -static_cast<long>( -fVal + 0.5 ) ); } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index ff2d63626b65..590032d10753 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1866,7 +1866,7 @@ static void DelayedCloseEventLink( void* pCEvent, void* ) delete pEv; } -void ImplHandleClose( vcl::Window* pWindow ) +static void ImplHandleClose( vcl::Window* pWindow ) { ImplSVData* pSVData = ImplGetSVData(); @@ -1961,7 +1961,7 @@ static MouseEventModifiers ImplGetMouseButtonMode( SalMouseEvent const * pEvent return nMode; } -inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEMOVE, true, pEvent->mnX, pEvent->mnY, @@ -1969,7 +1969,7 @@ inline bool ImplHandleSalMouseLeave( vcl::Window* pWindow, SalMouseEvent const * ImplGetMouseMoveMode( pEvent ) ); } -inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEMOVE, false, pEvent->mnX, pEvent->mnY, @@ -1977,7 +1977,7 @@ inline bool ImplHandleSalMouseMove( vcl::Window* pWindow, SalMouseEvent const * ImplGetMouseMoveMode( pEvent ) ); } -inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEBUTTONDOWN, false, pEvent->mnX, pEvent->mnY, @@ -1990,7 +1990,7 @@ inline bool ImplHandleSalMouseButtonDown( vcl::Window* pWindow, SalMouseEvent co ImplGetMouseButtonMode( pEvent ) ); } -inline bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent const * pEvent ) +static inline bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent const * pEvent ) { return ImplHandleMouseEvent( pWindow, MouseNotifyEvent::MOUSEBUTTONUP, false, pEvent->mnX, pEvent->mnY, diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index b62f5306de04..0b6cdc49b3dd 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -70,7 +70,7 @@ PreeditDoneCallback ( XIC, XPointer client_data, XPointer ) // Handle deletion of text in a preedit_draw_callback // from and howmuch are guaranteed to be nonnegative -void +static void Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) { // If we've been asked to delete no text then just set @@ -116,7 +116,7 @@ Preedit_DeleteText(preedit_text_t *ptext, int from, int howmuch) // reallocate the textbuffer with sufficiently large size 2^x // nnewlimit is presupposed to be larger than ptext->size -void +static void enlarge_buffer ( preedit_text_t *ptext, int nnewlimit ) { size_t nnewsize = ptext->nSize; @@ -134,7 +134,7 @@ enlarge_buffer ( preedit_text_t *ptext, int nnewlimit ) // Handle insertion of text in a preedit_draw_callback // string field of XIMText struct is guaranteed to be != NULL -void +static void Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) { sal_Unicode *pInsertTextString; @@ -224,7 +224,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where) // Handle the change of attributes in a preedit_draw_callback -void +static void Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback const * feedback, int from, int amount ) { @@ -245,7 +245,7 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback const * feedback, // Convert the XIM feedback values into appropriate VCL // EXTTEXTINPUT_ATTR values // returns an allocate list of attributes, which must be freed by caller -ExtTextInputAttr* +static ExtTextInputAttr* Preedit_FeedbackToSAL ( const XIMFeedback* pfeedback, int nlength, std::vector<ExtTextInputAttr>& rSalAttr ) { ExtTextInputAttr *psalattr; diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index cf3ba86da73b..860f8fc0def8 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -461,7 +461,7 @@ void SalXLib::Init() } extern "C" { -void EmitFontpathWarning() +static void EmitFontpathWarning() { static Bool bOnce = False; if ( !bOnce ) diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index bd2b9d080611..469bb0012193 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -83,21 +83,21 @@ typedef unsigned long Pixel; using namespace vcl_sal; #ifdef DBG_UTIL -inline const char *Null( const char *p ) { return p ? p : ""; } -inline const char *GetEnv( const char *p ) { return Null( getenv( p ) ); } -inline const char *KeyStr( KeySym n ) { return Null( XKeysymToString( n ) ); } +static inline const char *Null( const char *p ) { return p ? p : ""; } +static inline const char *GetEnv( const char *p ) { return Null( getenv( p ) ); } +static inline const char *KeyStr( KeySym n ) { return Null( XKeysymToString( n ) ); } -inline const char *GetAtomName( Display *d, Atom a ) +static inline const char *GetAtomName( Display *d, Atom a ) { return Null( XGetAtomName( d, a ) ); } -inline double Hypothenuse( long w, long h ) +static inline double Hypothenuse( long w, long h ) { return sqrt( static_cast<double>((w*w)+(h*h)) ); } #endif -inline int ColorDiff( int r, int g, int b ) +static inline int ColorDiff( int r, int g, int b ) { return (r*r)+(g*g)+(b*b); } -inline int ColorDiff( Color c1, int r, int g, int b ) +static inline int ColorDiff( Color c1, int r, int g, int b ) { return ColorDiff( static_cast<int>(c1.GetRed())-r, static_cast<int>(c1.GetGreen())-g, static_cast<int>(c1.GetBlue())-b ); } @@ -765,7 +765,7 @@ OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const return aRet; } -inline KeySym sal_XModifier2Keysym( Display *pDisplay, +static inline KeySym sal_XModifier2Keysym( Display *pDisplay, XModifierKeymap const *pXModMap, int n ) { diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 96ab14e5596b..e7be404010e2 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -99,7 +99,7 @@ struct PredicateReturn }; extern "C" { -Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) +static Bool ImplPredicateEvent( Display *, XEvent *pEvent, char *pData ) { PredicateReturn *pPre = reinterpret_cast<PredicateReturn *>(pData); diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 25b516c000f3..b750845a0eb7 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -109,11 +109,15 @@ bool IceSalSession::cancelShutdown() return false; } -extern "C" void ICEWatchProc( +extern "C" { + +static void ICEWatchProc( IceConn ice_conn, IcePointer client_data, Bool opening, IcePointer * watch_data); -extern "C" void ICEConnectionWorker(void * data); +static void ICEConnectionWorker(void * data); + +} class ICEConnectionObserver { diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 38a2822e049a..fd5ed013982a 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -3826,7 +3826,7 @@ static bool bWasError = false; extern "C" { - int local_xerror_handler(Display* , XErrorEvent*) + static int local_xerror_handler(Display* , XErrorEvent*) { bWasError = true; return 0; diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx index 8b7f342bfbb6..e6748166e132 100644 --- a/vcl/unx/generic/dtrans/bmp.cxx +++ b/vcl/unx/generic/dtrans/bmp.cxx @@ -41,13 +41,13 @@ using namespace x11; * helper functions */ -inline void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) +static inline void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); } -inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) +static inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); @@ -55,7 +55,7 @@ inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) pBuffer[ 3 ] = ((nNumber>>24)&0xff); } -inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) +static inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) { //This is untainted data which comes from a controlled source //so, using a byte-swapping pattern which coverity doesn't @@ -66,7 +66,7 @@ inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) return v; } -inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) +static inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) { //This is untainted data which comes from a controlled source //so, using a byte-swapping pattern which coverity doesn't @@ -83,7 +83,7 @@ inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) * scanline helpers */ -inline void X11_writeScanlinePixel( unsigned long nColor, sal_uInt8* pScanline, int depth, int x ) +static inline void X11_writeScanlinePixel( unsigned long nColor, sal_uInt8* pScanline, int depth, int x ) { switch( depth ) { @@ -194,12 +194,12 @@ static sal_uInt8* X11_getPaletteBmpFromImage( return pBuffer; } -inline unsigned long doRightShift( unsigned long nValue, int nShift ) +static inline unsigned long doRightShift( unsigned long nValue, int nShift ) { return (nShift > 0) ? (nValue >> nShift) : (nValue << (-nShift)); } -inline unsigned long doLeftShift( unsigned long nValue, int nShift ) +static inline unsigned long doLeftShift( unsigned long nValue, int nShift ) { return (nShift > 0) ? (nValue << nShift) : (nValue >> (-nShift)); } diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index b2e3862cefdb..8b6ad13471a0 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -81,7 +81,7 @@ using namespace com::sun::star::lang; * static helpers */ -inline sal_uInt16 getUInt16BE( const sal_uInt8*& pBuffer ) +static inline sal_uInt16 getUInt16BE( const sal_uInt8*& pBuffer ) { sal_uInt16 nRet = static_cast<sal_uInt16>(pBuffer[1]) | (static_cast<sal_uInt16>(pBuffer[0]) << 8); diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 8ccbfafb75a0..b7aabb648a6e 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -138,9 +138,9 @@ namespace } } -inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } +static inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } -inline int TenMuToPt( int nUnits ) { return static_cast<int>((static_cast<double>(nUnits)/35.27777778)+0.5); } +static inline int TenMuToPt( int nUnits ) { return static_cast<int>((static_cast<double>(nUnits)/35.27777778)+0.5); } static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index 8b5cb726fdf9..c1f1a0f718d4 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -51,7 +51,7 @@ using namespace psp; namespace psp { -bool +static bool AppendPS (FILE* pDst, osl::File* pSrc, unsigned char* pBuffer) { assert(pBuffer); @@ -183,7 +183,7 @@ PrinterJob::PrinterJob() /* remove all our temporary files, uses external program "rm", since osl functionality is inadequate */ -void +static void removeSpoolDir (const OUString& rSpoolDir) { OUString aSysPath; @@ -202,7 +202,7 @@ removeSpoolDir (const OUString& rSpoolDir) /* creates a spool directory with a "pidgin random" value based on current system time */ -OUString +static OUString createSpoolDir () { TimeValue aCur; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 7446dbf360f2..1ecbcdd5e5d5 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2873,7 +2873,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx index 2988bb214507..675b79269627 100644 --- a/vcl/unx/generic/window/screensaverinhibitor.cxx +++ b/vcl/unx/generic/window/screensaverinhibitor.cxx @@ -66,7 +66,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason, } #if ENABLE_GIO -void dbusInhibit( bool bInhibit, +static void dbusInhibit( bool bInhibit, const gchar* service, const gchar* path, const gchar* interface, const std::function<GVariant*( GDBusProxy*, GError*& )>& fInhibit, const std::function<GVariant*( GDBusProxy*, const guint, GError*& )>& fUnInhibit, diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index 70d34fb7318d..8b5265c88709 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -101,7 +101,7 @@ x_error_handler(Display *, XErrorEvent *ev) return 0; } -void glxtest() +static void glxtest() { signal(SIGPIPE, SIG_IGN); // we want to redirect to /dev/null stdout, stderr, and while we're at it, diff --git a/vcl/unx/gtk/a11y/atkcomponent.cxx b/vcl/unx/gtk/a11y/atkcomponent.cxx index 7d8a4bdc5bba..f79d1749dc2b 100644 --- a/vcl/unx/gtk/a11y/atkcomponent.cxx +++ b/vcl/unx/gtk/a11y/atkcomponent.cxx @@ -23,7 +23,7 @@ using namespace ::com::sun::star; -AtkObjectWrapper* getObjectWrapper(AtkComponent *pComponent) +static AtkObjectWrapper* getObjectWrapper(AtkComponent *pComponent) { AtkObjectWrapper *pWrap = nullptr; if (ATK_IS_OBJECT_WRAPPER(pComponent)) diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx index 5c163cd38ece..c95830f752df 100644 --- a/vcl/unx/gtk/a11y/atkfactory.cxx +++ b/vcl/unx/gtk/a11y/atkfactory.cxx @@ -74,7 +74,7 @@ atk_noop_object_wrapper_get_type() return type; } -AtkObject* +static AtkObject* atk_noop_object_wrapper_new() { AtkObject *accessible; diff --git a/vcl/unx/gtk/a11y/atklistener.cxx b/vcl/unx/gtk/a11y/atklistener.cxx index 1c1cff15dd4b..bba1a3a09d53 100644 --- a/vcl/unx/gtk/a11y/atklistener.cxx +++ b/vcl/unx/gtk/a11y/atklistener.cxx @@ -64,7 +64,7 @@ AtkListener::~AtkListener() /*****************************************************************************/ -AtkStateType mapState( const uno::Any &rAny ) +static AtkStateType mapState( const uno::Any &rAny ) { sal_Int16 nState = accessibility::AccessibleStateType::INVALID; rAny >>= nState; diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx index 5faac5ee526c..532b55013ddd 100644 --- a/vcl/unx/gtk/a11y/atktext.cxx +++ b/vcl/unx/gtk/a11y/atktext.cxx @@ -409,7 +409,7 @@ text_wrapper_set_caret_offset (AtkText *text, } // #i92232# -AtkAttributeSet* +static AtkAttributeSet* handle_text_markup_as_run_attribute( css::uno::Reference<css::accessibility::XAccessibleTextMarkup> const & pTextMarkup, const gint nTextMarkupType, const gint offset, diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx index 018a755fd234..b40598a65fd1 100644 --- a/vcl/unx/gtk/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk/a11y/atktextattributes.cxx @@ -1015,7 +1015,9 @@ DefaultTabStops2String( const uno::Any& rAny ) /*****************************************************************************/ -extern "C" int +extern "C" { + +static int attr_compare(const void *p1,const void *p2) { const rtl_uString * pustr = static_cast<const rtl_uString *>(p1); @@ -1024,6 +1026,8 @@ attr_compare(const void *p1,const void *p2) return rtl_ustr_ascii_compare_WithLength(pustr->buffer, pustr->length, pc); } +} + static void find_exported_attributes( sal_Int32 *pArray, const css::uno::Sequence< css::beans::PropertyValue >& rAttributeList ) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index b5748c12d1a9..d714b08f2dde 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -620,7 +620,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) /*****************************************************************************/ -void WindowEventHandler(void *, VclSimpleEvent& rEvent) +static void WindowEventHandler(void *, VclSimpleEvent& rEvent) { try { diff --git a/vcl/unx/gtk/gloactiongroup.cxx b/vcl/unx/gtk/gloactiongroup.cxx index 0ba1112f928f..b058417b821f 100644 --- a/vcl/unx/gtk/gloactiongroup.cxx +++ b/vcl/unx/gtk/gloactiongroup.cxx @@ -49,7 +49,7 @@ G_DEFINE_TYPE (GLOAction, g_lo_action, G_TYPE_OBJECT); #pragma GCC diagnostic pop #endif -GLOAction* +static GLOAction* g_lo_action_new() { return G_LO_ACTION (g_object_new (G_TYPE_LO_ACTION, nullptr)); diff --git a/vcl/unx/gtk/glomenu.cxx b/vcl/unx/gtk/glomenu.cxx index 4ba8f3f8587c..5457ac6eaa05 100644 --- a/vcl/unx/gtk/glomenu.cxx +++ b/vcl/unx/gtk/glomenu.cxx @@ -169,7 +169,7 @@ g_lo_menu_new() return G_LO_MENU( g_object_new (G_TYPE_LO_MENU, nullptr) ); } -void +static void g_lo_menu_set_attribute_value (GLOMenu *menu, gint position, const gchar *attribute, @@ -190,7 +190,7 @@ g_lo_menu_set_attribute_value (GLOMenu *menu, g_hash_table_remove (menu_item.attributes, attribute); } -GVariant* +static GVariant* g_lo_menu_get_attribute_value_from_item_in_section (GLOMenu *menu, gint section, gint position, @@ -468,7 +468,7 @@ g_lo_menu_get_command_from_item_in_section (GLOMenu *menu, return command; } -void +static void g_lo_menu_set_link (GLOMenu *menu, gint position, const gchar *link, diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx index 7263685368ce..298442954c83 100644 --- a/vcl/unx/gtk/gtkdata.cxx +++ b/vcl/unx/gtk/gtkdata.cxx @@ -55,7 +55,7 @@ using namespace vcl_sal; * class GtkSalDisplay * ***************************************************************/ extern "C" { -GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, +static GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, GdkEvent* /*event*/, gpointer data ) { @@ -103,13 +103,13 @@ GtkSalDisplay::~GtkSalDisplay() extern "C" { -void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) +static void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->screenSizeChanged( pScreen ); } -void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) +static void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->monitorsChanged( pScreen ); diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index c3f9b25d677b..8b96ea38e577 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -348,7 +348,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -585,7 +585,7 @@ static const GActionEntry app_entries[] = { { "New", activate_uno, nullptr, nullptr, nullptr, {0} } }; -gboolean ensure_dbus_setup( gpointer data ) +static gboolean ensure_dbus_setup( gpointer data ) { GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); @@ -3645,7 +3645,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_hand pThis->updateIMSpotLocation(); } -uno::Reference<accessibility::XAccessibleEditableText> +static uno::Reference<accessibility::XAccessibleEditableText> FindFocus(const uno::Reference< accessibility::XAccessibleContext >& xContext) { if (!xContext.is()) diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 84add236d0be..aa2f0eeab396 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -58,7 +58,7 @@ bool GtkSalMenu::PrepUpdate() * Menu updating methods */ -void RemoveSpareItemsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, unsigned nSection, unsigned nValidItems ) +static void RemoveSpareItemsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, unsigned nSection, unsigned nValidItems ) { sal_Int32 nSectionItems = g_lo_menu_get_n_items_from_section( pMenu, nSection ); @@ -97,7 +97,7 @@ namespace } } -void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, +static void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nSection, GActionGroup* pActionGroup) { while (nSection >= 0) @@ -156,7 +156,7 @@ void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList, } } -void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nLastSection ) +static void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nLastSection ) { if ( pMenu == nullptr || pOldCommandList == nullptr ) return; @@ -170,12 +170,12 @@ void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, } } -gint CompareStr( gpointer str1, gpointer str2 ) +static gint CompareStr( gpointer str1, gpointer str2 ) { return g_strcmp0( static_cast<const gchar*>(str1), static_cast<const gchar*>(str2) ); } -void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList, GList* pNewCommandList ) +static void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList, GList* pNewCommandList ) { if ( pActionGroup == nullptr || pOldCommandList == nullptr ) { diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index f932cd4ba47c..ac188941d819 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -450,7 +450,7 @@ void NWPixmapCacheList::ThemeChanged( ) /********************************************************* * Make border manipulation easier *********************************************************/ -inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc ) +static inline void NW_gtk_border_set_from_border( GtkBorder& aDst, const GtkBorder * pSrc ) { aDst.left = pSrc->left; aDst.top = pSrc->top; diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx index 48047240e643..db810d745cd4 100644 --- a/vcl/unx/gtk3/gtk3gtkdata.cxx +++ b/vcl/unx/gtk3/gtk3gtkdata.cxx @@ -61,7 +61,7 @@ using namespace vcl_sal; * class GtkSalDisplay * ***************************************************************/ extern "C" { -GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, +static GdkFilterReturn call_filterGdkEvent( GdkXEvent* sys_event, GdkEvent* /*event*/, gpointer data ) { @@ -103,13 +103,13 @@ GtkSalDisplay::~GtkSalDisplay() extern "C" { -void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) +static void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->screenSizeChanged( pScreen ); } -void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) +static void signalMonitorsChanged( GdkScreen* pScreen, gpointer data ) { GtkSalDisplay* pDisp = static_cast<GtkSalDisplay*>(data); pDisp->monitorsChanged( pScreen ); diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 1f36f039a58c..1953c055a39a 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -351,7 +351,7 @@ struct KeyAlternate KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; -inline KeyAlternate +static inline KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -599,7 +599,7 @@ static const GActionEntry app_entries[] = { { "New", activate_uno, nullptr, nullptr, nullptr, {0} } }; -gboolean ensure_dbus_setup( gpointer data ) +static gboolean ensure_dbus_setup( gpointer data ) { GtkSalFrame* pSalFrame = static_cast< GtkSalFrame* >( data ); GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() ); @@ -4176,7 +4176,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditEnd( GtkIMContext*, gpointer im_hand pThis->updateIMSpotLocation(); } -uno::Reference<accessibility::XAccessibleEditableText> +static uno::Reference<accessibility::XAccessibleEditableText> FindFocus(uno::Reference< accessibility::XAccessibleContext > const & xContext) { if (!xContext.is()) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 1d5ca9e415ef..d99fa04f09fb 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2235,7 +2235,7 @@ public: } }; -GType crippled_viewport_get_type(); +static GType crippled_viewport_get_type(); #define CRIPPLED_TYPE_VIEWPORT (crippled_viewport_get_type ()) #define CRIPPLED_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CRIPPLED_TYPE_VIEWPORT, CrippledViewport)) @@ -2380,7 +2380,7 @@ GType crippled_viewport_get_type() return type; } -VclPolicyType GtkToVcl(GtkPolicyType eType) +static VclPolicyType GtkToVcl(GtkPolicyType eType) { VclPolicyType eRet(VclPolicyType::NEVER); switch (eType) @@ -2399,7 +2399,7 @@ VclPolicyType GtkToVcl(GtkPolicyType eType) return eRet; } -GtkPolicyType VclToGtk(VclPolicyType eType) +static GtkPolicyType VclToGtk(VclPolicyType eType) { GtkPolicyType eRet(GTK_POLICY_ALWAYS); switch (eType) @@ -2417,7 +2417,7 @@ GtkPolicyType VclToGtk(VclPolicyType eType) return eRet; } -GtkMessageType VclToGtk(VclMessageType eType) +static GtkMessageType VclToGtk(VclMessageType eType) { GtkMessageType eRet(GTK_MESSAGE_INFO); switch (eType) @@ -2438,7 +2438,7 @@ GtkMessageType VclToGtk(VclMessageType eType) return eRet; } -GtkButtonsType VclToGtk(VclButtonsType eType) +static GtkButtonsType VclToGtk(VclButtonsType eType) { GtkButtonsType eRet(GTK_BUTTONS_NONE); switch (eType) diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 9037cff8c11b..17433d0a8f8e 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2577,7 +2577,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co return true; } -tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget* widget) +static tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget* widget) { GtkRequisition aReq; gtk_widget_get_preferred_size(widget, nullptr, &aReq); @@ -2585,7 +2585,7 @@ tools::Rectangle GetWidgetSize(const tools::Rectangle& rControlRegion, GtkWidget return tools::Rectangle(rControlRegion.TopLeft(), Size(rControlRegion.GetWidth(), nHeight)); } -tools::Rectangle AdjustRectForTextBordersPadding(GtkStyleContext* pStyle, long nContentWidth, long nContentHeight, const tools::Rectangle& rControlRegion) +static tools::Rectangle AdjustRectForTextBordersPadding(GtkStyleContext* pStyle, long nContentWidth, long nContentHeight, const tools::Rectangle& rControlRegion) { GtkBorder border; gtk_style_context_get_border(pStyle, gtk_style_context_get_state(pStyle), &border); diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx index aeb864eae2ef..15ff95f02074 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx @@ -44,7 +44,7 @@ void sendIpcArg(std::ostream& stream, const QString& string) sendIpcStringArg(stream, utf8.size(), utf8.data()); } -void sendIpcArg(std::ostream& stream, const QStringList& list) +static void sendIpcArg(std::ostream& stream, const QStringList& list) { stream << static_cast<uint32_t>(list.size()) << ' '; for (const auto& entry : list) diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index c6ce35128e09..5454344b949d 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -98,13 +98,13 @@ namespace } } -OUString toOUString(const QString& s) +static OUString toOUString(const QString& s) { // QString stores UTF16, just like OUString return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length()); } -QString toQString(const OUString& s) +static QString toQString(const OUString& s) { return QString::fromUtf16( reinterpret_cast<ushort const *>(s.getStr()), s.getLength()); diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx index 01da2c5fad8f..7cbcfeab3ed6 100644 --- a/vcl/unx/kde4/KDESalGraphics.cxx +++ b/vcl/unx/kde4/KDESalGraphics.cxx @@ -41,7 +41,7 @@ @param nControlState State of the widget (default, focused, ...) in Native Widget Framework. @param aValue Value held by the widget (on, off, ...) */ -QStyle::State vclStateValue2StateFlag( ControlState nControlState, +static QStyle::State vclStateValue2StateFlag( ControlState nControlState, const ImplControlValue& aValue ) { QStyle::State nState = @@ -67,7 +67,7 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState, @param rControlRegion The tools::Rectangle to convert. @return The matching QRect */ -QRect region2QRect( const tools::Rectangle& rControlRegion ) +static QRect region2QRect( const tools::Rectangle& rControlRegion ) { return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight()); } diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index a2750f532e9e..579141839cc4 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index b096a205572d..eb2fa77e3240 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -56,7 +56,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 09a99b4f003a..e2425807a8e9 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -47,7 +47,7 @@ using namespace ::com::sun::star::lang; using namespace cppu; // Forward declaration -void Main(); +static void Main(); SAL_IMPLEMENT_MAIN() { |