diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 10:28:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 14:47:17 +0200 |
commit | 7ceee0f1ec0e349d0df4980d7fdedbd13c7917c5 (patch) | |
tree | 616ab419fe0f01e94740de7faacb393775420589 /vcl/unx/generic | |
parent | 664db0d945fbb23e115eeea8377e3a4e88541da1 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/dtrans/bmp.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/glyphs/glyphcache.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/print/genprnpsp.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 2 |
7 files changed, 21 insertions, 21 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index b3251495b323..dbe1995f5150 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -85,21 +85,21 @@ typedef unsigned long Pixel; using namespace vcl_sal; #ifdef DBG_UTIL -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 ) ); } +static const char *Null( const char *p ) { return p ? p : ""; } +static const char *GetEnv( const char *p ) { return Null( getenv( p ) ); } +static const char *KeyStr( KeySym n ) { return Null( XKeysymToString( n ) ); } -static inline const char *GetAtomName( Display *d, Atom a ) +static const char *GetAtomName( Display *d, Atom a ) { return Null( XGetAtomName( d, a ) ); } -static inline double Hypothenuse( long w, long h ) +static double Hypothenuse( long w, long h ) { return sqrt( static_cast<double>((w*w)+(h*h)) ); } #endif -static inline int ColorDiff( int r, int g, int b ) +static int ColorDiff( int r, int g, int b ) { return (r*r)+(g*g)+(b*b); } -static inline int ColorDiff( Color c1, int r, int g, int b ) +static 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 ); } @@ -788,7 +788,7 @@ OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const return aRet; } -static inline KeySym sal_XModifier2Keysym( Display *pDisplay, +static KeySym sal_XModifier2Keysym( Display *pDisplay, XModifierKeymap const *pXModMap, int n ) { diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index 56f6fe1d2d6c..eccba34fdce2 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -119,7 +119,7 @@ static bool is_gnome_desktop( Display* pDisplay ) static bool bWasXError = false; -static inline bool WasXError() +static bool WasXError() { bool bRet = bWasXError; bWasXError = false; diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx index 7f3f27022099..57399b238c89 100644 --- a/vcl/unx/generic/dtrans/bmp.cxx +++ b/vcl/unx/generic/dtrans/bmp.cxx @@ -41,13 +41,13 @@ using namespace x11; * helper functions */ -static inline void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) +static void writeLE( sal_uInt16 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); } -static inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) +static void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) { pBuffer[ 0 ] = (nNumber & 0xff); pBuffer[ 1 ] = ((nNumber>>8)&0xff); @@ -55,7 +55,7 @@ static inline void writeLE( sal_uInt32 nNumber, sal_uInt8* pBuffer ) pBuffer[ 3 ] = ((nNumber>>24)&0xff); } -static inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) +static 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 @@ static inline sal_uInt16 readLE16( const sal_uInt8* pBuffer ) return v; } -static inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) +static 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 @@ static inline sal_uInt32 readLE32( const sal_uInt8* pBuffer ) * scanline helpers */ -static inline void X11_writeScanlinePixel( unsigned long nColor, sal_uInt8* pScanline, int depth, int x ) +static 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; } -static inline unsigned long doRightShift( unsigned long nValue, int nShift ) +static unsigned long doRightShift( unsigned long nValue, int nShift ) { return (nShift > 0) ? (nValue >> nShift) : (nValue << (-nShift)); } -static inline unsigned long doLeftShift( unsigned long nValue, int nShift ) +static 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 7ea19def9e67..06ee4f180b1b 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 */ -static inline sal_uInt16 getUInt16BE( const sal_uInt8*& pBuffer ) +static 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/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx index e1960f36dfb3..f008a0294df0 100644 --- a/vcl/unx/generic/glyphs/glyphcache.cxx +++ b/vcl/unx/generic/glyphs/glyphcache.cxx @@ -61,7 +61,7 @@ void GlyphCache::ClearFontOptions() } } -static inline sal_IntPtr GetFontId(const LogicalFontInstance& rFontInstance) +static sal_IntPtr GetFontId(const LogicalFontInstance& rFontInstance) { if (rFontInstance.GetFontFace()) return rFontInstance.GetFontFace()->GetFontId(); diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index b7aabb648a6e..873abc28575f 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -138,9 +138,9 @@ namespace } } -static inline int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } +static int PtTo10Mu( int nPoints ) { return static_cast<int>((static_cast<double>(nPoints)*35.27777778)+0.5); } -static inline int TenMuToPt( int nUnits ) { return static_cast<int>((static_cast<double>(nUnits)/35.27777778)+0.5); } +static 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/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 1ecbcdd5e5d5..560c7caf4af6 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 ) {} }; -static inline KeyAlternate +static KeyAlternate GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; |