From 7ceee0f1ec0e349d0df4980d7fdedbd13c7917c5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 9 Oct 2018 10:28:48 +0200 Subject: Extend loplugin:redundantinline to catch inline functions w/o external linkage ...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/source/gdi/bmpfast.cxx | 18 +++++++++--------- vcl/source/gdi/dibtools.cxx | 4 ++-- vcl/source/gdi/metaact.cxx | 8 ++++---- vcl/source/gdi/pdfwriter_impl.cxx | 6 +++--- vcl/source/gdi/pdfwriter_impl2.cxx | 2 +- vcl/source/gdi/region.cxx | 2 +- vcl/source/gdi/sallayout.cxx | 2 +- vcl/source/gdi/scrptrun.cxx | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) (limited to 'vcl/source/gdi') diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx index 76f083663ba0..93318fbd30ae 100644 --- a/vcl/source/gdi/bmpfast.cxx +++ b/vcl/source/gdi/bmpfast.cxx @@ -232,7 +232,7 @@ class TrueColorPixelPtr // converting truecolor formats template -static inline void ImplConvertPixel( const TrueColorPixelPtr& rDst, +static void ImplConvertPixel( const TrueColorPixelPtr& rDst, const TrueColorPixelPtr& rSrc ) { rDst.SetColor( rSrc.GetRed(), rSrc.GetGreen(), rSrc.GetBlue() ); @@ -240,7 +240,7 @@ static inline void ImplConvertPixel( const TrueColorPixelPtr& rDst, } template <> -inline void ImplConvertPixel ( +void ImplConvertPixel ( const TrueColorPixelPtr& rDst, const TrueColorPixelPtr& rSrc ) { @@ -252,7 +252,7 @@ inline void ImplConvertPixel -static inline void ImplConvertLine( const TrueColorPixelPtr& rDst, +static void ImplConvertLine( const TrueColorPixelPtr& rDst, const TrueColorPixelPtr& rSrc, int nPixelCount ) { TrueColorPixelPtr aDst( rDst ); @@ -267,7 +267,7 @@ static inline void ImplConvertLine( const TrueColorPixelPtr& rDst, // alpha blending truecolor pixels template -static inline void ImplBlendPixels( const TrueColorPixelPtr& rDst, +static void ImplBlendPixels( const TrueColorPixelPtr& rDst, const TrueColorPixelPtr& rSrc, unsigned nAlphaVal ) { static const unsigned nAlphaShift = 8; @@ -294,7 +294,7 @@ static inline void ImplBlendPixels( const TrueColorPixelPtr& rDst, } template -static inline void ImplBlendLines( const TrueColorPixelPtr& rDst, +static void ImplBlendLines( const TrueColorPixelPtr& rDst, const TrueColorPixelPtr& rSrc, const TrueColorPixelPtr& rMsk, int nPixelCount ) { @@ -376,7 +376,7 @@ static bool ImplConvertToBitmap( TrueColorPixelPtr& rSrcLine, } template -static inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) +static bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc ) { TrueColorPixelPtr aSrcType; aSrcType.SetRawPtr( rSrc.mpBits ); @@ -581,7 +581,7 @@ static bool ImplBlendToBitmap( TrueColorPixelPtr& rSrcLine, // some specializations to reduce the code size template <> -inline bool ImplBlendToBitmap( +bool ImplBlendToBitmap( TrueColorPixelPtr&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) @@ -591,7 +591,7 @@ inline bool ImplBlendToBitmap -inline bool ImplBlendToBitmap( +bool ImplBlendToBitmap( TrueColorPixelPtr&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) @@ -601,7 +601,7 @@ inline bool ImplBlendToBitmap -inline bool ImplBlendToBitmap( +bool ImplBlendToBitmap( TrueColorPixelPtr&, BitmapBuffer& rDstBuffer, const BitmapBuffer& rSrcBuffer, const BitmapBuffer& rMskBuffer ) diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 62262bae7990..1b4c13458ea6 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -135,14 +135,14 @@ struct DIBV5Header : public DIBInfoHeader {} }; -inline sal_uInt16 discretizeBitcount( sal_uInt16 nInputCount ) +sal_uInt16 discretizeBitcount( sal_uInt16 nInputCount ) { return ( nInputCount <= 1 ) ? 1 : ( nInputCount <= 4 ) ? 4 : ( nInputCount <= 8 ) ? 8 : 24; } -inline bool isBitfieldCompression( ScanlineFormat nScanlineFormat ) +bool isBitfieldCompression( ScanlineFormat nScanlineFormat ) { return (ScanlineFormat::N16BitTcLsbMask == nScanlineFormat) || (ScanlineFormat::N32BitTcMask == nScanlineFormat); } diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 5a733c8dd9f2..8a6bbbd5cf76 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -108,13 +108,13 @@ meta_action_name(MetaActionType nMetaAction) #endif } -inline void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY ) +void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY ) { rPt.setX( FRound( fScaleX * rPt.X() ) ); rPt.setY( FRound( fScaleY * rPt.Y() ) ); } -inline void ImplScaleRect( tools::Rectangle& rRect, double fScaleX, double fScaleY ) +void ImplScaleRect( tools::Rectangle& rRect, double fScaleX, double fScaleY ) { Point aTL( rRect.TopLeft() ); Point aBR( rRect.BottomRight() ); @@ -126,13 +126,13 @@ inline void ImplScaleRect( tools::Rectangle& rRect, double fScaleX, double fScal rRect.Justify(); } -inline void ImplScalePoly( tools::Polygon& rPoly, double fScaleX, double fScaleY ) +void ImplScalePoly( tools::Polygon& rPoly, double fScaleX, double fScaleY ) { for( sal_uInt16 i = 0, nCount = rPoly.GetSize(); i < nCount; i++ ) ImplScalePoint( rPoly[ i ], fScaleX, fScaleY ); } -inline void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScaleY ) +void ImplScaleLineInfo( LineInfo& rLineInfo, double fScaleX, double fScaleY ) { if( !rLineInfo.IsDefault() ) { diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 59c605349dc1..a70c73c3a2ed 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -508,8 +508,8 @@ void doTestCode() static const sal_Int32 nLog10Divisor = 3; static const double fDivisor = 1000.0; -static inline double pixelToPoint( double px ) { return px/fDivisor; } -static inline sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); } +static double pixelToPoint( double px ) { return px/fDivisor; } +static sal_Int32 pointToPixel( double pt ) { return sal_Int32(pt*fDivisor); } const sal_uInt8 PDFWriterImpl::s_nPadString[32] = { @@ -4093,7 +4093,7 @@ sal_Int32 PDFWriterImpl::getBestBuiltinFont( const vcl::Font& rFont ) return nBest; } -static inline const Color& replaceColor( const Color& rCol1, const Color& rCol2 ) +static const Color& replaceColor( const Color& rCol1, const Color& rCol2 ) { return (rCol1 == COL_TRANSPARENT) ? rCol2 : rCol1; } diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 59448f1f8635..a4ce58af0e20 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1547,7 +1547,7 @@ static const long setRun[256] = 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ }; -static inline bool isSet( const Scanline i_pLine, long i_nIndex ) +static bool isSet( const Scanline i_pLine, long i_nIndex ) { return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0; } diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 5af7829b0e03..ce2d60ba7d66 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1677,7 +1677,7 @@ void vcl::Region::GetRegionRectangles(RectangleVector& rTarget) const } } -static inline bool ImplPolygonRectTest( const tools::Polygon& rPoly, tools::Rectangle* pRectOut = nullptr ) +static bool ImplPolygonRectTest( const tools::Polygon& rPoly, tools::Rectangle* pRectOut = nullptr ) { bool bIsRect = false; const Point* pPoints = rPoly.GetConstPointAry(); diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index e2fd9aeb88a3..510120b9c068 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; } -static inline bool IsControlChar( sal_UCS4 cChar ) +static bool IsControlChar( sal_UCS4 cChar ) { // C0 control characters if( (0x0001 <= cChar) && (cChar <= 0x001F) ) diff --git a/vcl/source/gdi/scrptrun.cxx b/vcl/source/gdi/scrptrun.cxx index 38db1ac2fa35..cbf16d6e85bd 100644 --- a/vcl/source/gdi/scrptrun.cxx +++ b/vcl/source/gdi/scrptrun.cxx @@ -124,7 +124,7 @@ namespace vcl { const char ScriptRun::fgClassID=0; -static inline UBool sameScript(int32_t scriptOne, int32_t scriptTwo) +static UBool sameScript(int32_t scriptOne, int32_t scriptTwo) { return scriptOne <= USCRIPT_INHERITED || scriptTwo <= USCRIPT_INHERITED || scriptOne == scriptTwo; } -- cgit