From d0265c128c5c2c7d12e2f955ccb02aa255a2bf3c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 30 Jan 2019 14:23:15 +0100 Subject: loplugin:redundantinline (clang-cl) Change-Id: Ib6320ddc049e93cca4c5931ad28d1873d34bd8b4 Reviewed-on: https://gerrit.libreoffice.org/67137 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx | 2 +- bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 4 ++-- canvas/source/directx/dx_9rm.cxx | 8 ++++---- canvas/source/directx/dx_impltools.cxx | 2 +- dtrans/source/win32/dtobj/DOTransferable.cxx | 3 --- dtrans/source/win32/dtobj/XTDataObject.cxx | 3 --- dtrans/source/win32/ftransl/ftransl.cxx | 2 +- fpicker/source/win32/FilterContainer.cxx | 2 +- fpicker/source/win32/VistaFilePickerImpl.cxx | 2 +- sal/osl/w32/file_dirvol.cxx | 14 +++++++------- sal/osl/w32/procimpl.cxx | 2 +- sal/osl/w32/profile.cxx | 2 +- .../win32/customactions/quickstarter/quickstarter.cxx | 2 +- .../source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx | 2 +- .../win32/customactions/shellextensions/checkpatches.cxx | 2 +- .../source/win32/customactions/shellextensions/upgrade.cxx | 4 ++-- .../source/win32/customactions/tools/checkversion.cxx | 2 +- setup_native/source/win32/customactions/tools/seterror.cxx | 2 +- shell/source/win32/simplemail/senddoc.cxx | 2 +- solenv/bin/concat-deps.c | 2 +- stoc/source/typeconv/convert.cxx | 2 +- vcl/win/gdi/salbmp.cxx | 2 +- vcl/win/gdi/salfont.cxx | 12 ++++++------ vcl/win/window/salframe.cxx | 4 ++-- 24 files changed, 39 insertions(+), 45 deletions(-) diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx index cf266de14873..d8b2220fc94c 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx @@ -35,7 +35,7 @@ using namespace ::com::sun::star::uno; -static inline typelib_TypeClass cpp2uno_call( +static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy * pThis, const typelib_TypeDescription * pMemberTD, typelib_TypeDescriptionReference * pReturnTypeRef, // NULL indicates void return diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx index 090ec5c13e38..753f814a3367 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -265,7 +265,7 @@ namespace CPPU_CURRENT_NAMESPACE static int mscx_getRTTI_len(OUString const & rUNOname); -static inline OUString toUNOname( +static OUString toUNOname( OUString const & rRTTIname ) throw () { @@ -285,7 +285,7 @@ static inline OUString toUNOname( return aRet.makeStringAndClear(); } -static inline OUString toRTTIname( +static OUString toRTTIname( OUString const & rUNOname ) throw () { diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index 52462dd49699..86894825c16f 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -146,8 +146,8 @@ namespace dxcanvas ImplRenderModuleGuard(const ImplRenderModuleGuard&) = delete; const ImplRenderModuleGuard& operator=(const ImplRenderModuleGuard&) = delete; - explicit inline ImplRenderModuleGuard( DXRenderModule& rRenderModule ); - inline ~ImplRenderModuleGuard(); + explicit ImplRenderModuleGuard( DXRenderModule& rRenderModule ); + ~ImplRenderModuleGuard(); private: DXRenderModule& mrRenderModule; @@ -246,14 +246,14 @@ namespace dxcanvas // DXSurface::ImplRenderModuleGuard - inline DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( + DXSurface::ImplRenderModuleGuard::ImplRenderModuleGuard( DXRenderModule& rRenderModule ) : mrRenderModule( rRenderModule ) { mrRenderModule.lock(); } - inline DXSurface::ImplRenderModuleGuard::~ImplRenderModuleGuard() + DXSurface::ImplRenderModuleGuard::~ImplRenderModuleGuard() { mrRenderModule.unlock(); } diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 27fc270f94c7..392d0ddf7adb 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -166,7 +166,7 @@ namespace dxcanvas { // TODO(P2): Check whether this gets inlined. If not, make functor // out of it - inline Gdiplus::PointF implGdiPlusPointFromRealPoint2D( const css::geometry::RealPoint2D& rPoint ) + Gdiplus::PointF implGdiPlusPointFromRealPoint2D( const css::geometry::RealPoint2D& rPoint ) { return Gdiplus::PointF( static_cast(rPoint.X), static_cast(rPoint.Y) ); diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx index db70196e18a3..846a0859bb67 100644 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -49,7 +49,6 @@ namespace const Type CPPUTYPE_SEQINT8 = cppu::UnoType>::get(); const Type CPPUTYPE_OUSTRING = cppu::UnoType::get(); - inline bool isValidFlavor( const DataFlavor& aFlavor ) { return ( aFlavor.MimeType.getLength( ) && @@ -89,7 +88,6 @@ void clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, CDOTransferable:: memTransferHelper.read( aByteSequence.getArray( ), nMemSize ); } -inline OUString byteStreamToOUString( CDOTransferable::ByteSequence_t& aByteStream ) { sal_Int32 nWChars; @@ -105,7 +103,6 @@ OUString byteStreamToOUString( CDOTransferable::ByteSequence_t& aByteStream ) return OUString( reinterpret_cast< sal_Unicode* >( aByteStream.getArray( ) ), nWChars ); } -inline Any byteStreamToAny( CDOTransferable::ByteSequence_t& aByteStream, const Type& aRequestedDataType ) { Any aAny; diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index 2fba02835ec1..50d84c5da619 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -105,7 +105,6 @@ public: explicit CInvalidFormatEtcException( HRESULT hr ) : m_hr( hr ) {}; }; -inline void validateFormatEtc( LPFORMATETC lpFormatEtc ) { OSL_ASSERT( lpFormatEtc ); @@ -132,13 +131,11 @@ void validateFormatEtc( LPFORMATETC lpFormatEtc ) throw CInvalidFormatEtcException( DV_E_TYMED ); } -inline void invalidateStgMedium( STGMEDIUM& stgmedium ) { stgmedium.tymed = TYMED_NULL; } -inline HRESULT translateStgExceptionCode( HRESULT hr ) { HRESULT hrTransl; diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx index c498472442e0..1ab6e1c87089 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -441,7 +441,7 @@ void findStdFormatIdOrNativeFormatNameForFullMediaType( } } -inline bool isTextPlainMediaType( const OUString& fullMediaType ) +bool isTextPlainMediaType( const OUString& fullMediaType ) { return fullMediaType.equalsIgnoreAsciiCase("text/plain"); } diff --git a/fpicker/source/win32/FilterContainer.cxx b/fpicker/source/win32/FilterContainer.cxx index 4fabed1460e4..8b3ceb4926af 100644 --- a/fpicker/source/win32/FilterContainer.cxx +++ b/fpicker/source/win32/FilterContainer.cxx @@ -222,7 +222,7 @@ static sal_uInt32 getTotalFilterLength( CFilterContainer& aFilterContainer ) return ( totalLength > 0 ) ? totalLength + 1 : totalLength; } -static inline +static void wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) { memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) ); diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx index 1bd177f1d7f4..d404e71b71d4 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/VistaFilePickerImpl.cxx @@ -38,7 +38,7 @@ #include #include -static inline bool is_current_process_window(HWND hwnd) +static bool is_current_process_window(HWND hwnd) { DWORD pid; GetWindowThreadProcessId(hwnd, &pid); diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index b8f8ad4e261f..cfdf957ef0de 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -120,7 +120,7 @@ namespace Component resource_; }; - inline bool is_UNC_path(const sal_Unicode* path) + bool is_UNC_path(const sal_Unicode* path) { return (0 == wcsncmp(UNC_PREFIX, o3tl::toW(path), SAL_N_ELEMENTS(UNC_PREFIX) - 1)); } void parse_UNC_path(const sal_Unicode* path, UNCComponents* puncc) @@ -179,7 +179,7 @@ namespace return has_parent; } - inline bool has_path_parent(const OUString& path) + bool has_path_parent(const OUString& path) { return has_path_parent(path.getStr()); } } @@ -1143,10 +1143,10 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, oslDirectoryItem b) return false; } -static inline bool is_floppy_A_present() +static bool is_floppy_A_present() { return (GetLogicalDrives() & 1); } -static inline bool is_floppy_B_present() +static bool is_floppy_B_present() { return (GetLogicalDrives() & 2); } static bool is_floppy_volume_mount_point(const OUString& path) @@ -1235,7 +1235,7 @@ static UINT get_volume_mount_point_drive_type(const OUString& path) return DRIVE_NO_ROOT_DIR; } -static inline bool is_drivetype_request(sal_uInt32 field_mask) +static bool is_drivetype_request(sal_uInt32 field_mask) { return (field_mask & osl_VolumeInfo_Mask_Attributes); } @@ -1286,7 +1286,7 @@ static oslFileError osl_get_drive_type( return osl_File_E_None; } -static inline bool is_volume_space_info_request(sal_uInt32 field_mask) +static bool is_volume_space_info_request(sal_uInt32 field_mask) { return (field_mask & (osl_VolumeInfo_Mask_TotalSpace | @@ -1312,7 +1312,7 @@ static void get_volume_space_information( } } -static inline bool is_filesystem_attributes_request(sal_uInt32 field_mask) +static bool is_filesystem_attributes_request(sal_uInt32 field_mask) { return (field_mask & (osl_VolumeInfo_Mask_MaxNameLength | diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index d9cbaaa19617..418ccd40e661 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -87,7 +87,7 @@ namespace /* private */ size_t sum_; }; - inline size_t calc_sum_of_string_lengths(const std::vector& string_cont) + size_t calc_sum_of_string_lengths(const std::vector& string_cont) { return std::for_each( string_cont.begin(), string_cont.end(), sum_of_string_lengths()); diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx index ccf96ff35e03..df5dc0971b4a 100644 --- a/sal/osl/w32/profile.cxx +++ b/sal/osl/w32/profile.cxx @@ -35,7 +35,7 @@ #include #include using std::min; -static inline void copy_ustr_n( void *dest, const void *source, size_t length ) { memcpy(dest, source, length*sizeof(sal_Unicode)); } +static void copy_ustr_n( void *dest, const void *source, size_t length ) { memcpy(dest, source, length*sizeof(sal_Unicode)); } #define LINES_INI 32 #define LINES_ADD 10 diff --git a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx index 9581ce32f008..7b0f9a5bd18d 100644 --- a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx +++ b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx @@ -86,7 +86,7 @@ std::wstring GetQuickstarterLinkNameW(MSIHANDLE handle) return quickstarterlinkname; } -static inline bool IsValidHandle( HANDLE handle ) +static bool IsValidHandle( HANDLE handle ) { return nullptr != handle && INVALID_HANDLE_VALUE != handle; } diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx index f8be58bcdcda..b1ffb6976c87 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx +++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx @@ -84,7 +84,7 @@ inline void OutputDebugStringFormatW( LPCWSTR pFormat, ... ) va_end(args); } #else -static inline void OutputDebugStringFormatW( LPCWSTR, ... ) +static void OutputDebugStringFormatW( LPCWSTR, ... ) { } #endif diff --git a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx index 836b3e655e75..0a879dc1b80e 100644 --- a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx +++ b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx @@ -33,7 +33,7 @@ inline void OutputDebugStringFormatW( PCWSTR pFormat, ... ) va_end(args); } #else -static inline void OutputDebugStringFormatW( PCWSTR, ... ) +static void OutputDebugStringFormatW( PCWSTR, ... ) { } #endif diff --git a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx index 3b5262ca9826..494cfaedad91 100644 --- a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx +++ b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx @@ -93,12 +93,12 @@ namespace return convertedGuid; } - inline bool IsSetMsiPropertyW(MSIHANDLE handle, const std::wstring& sProperty) + bool IsSetMsiPropertyW(MSIHANDLE handle, const std::wstring& sProperty) { return (GetMsiPropertyW(handle, sProperty).length() > 0); } - inline void SetMsiPropertyW(MSIHANDLE handle, const std::wstring& sProperty) + void SetMsiPropertyW(MSIHANDLE handle, const std::wstring& sProperty) { MsiSetPropertyW(handle, sProperty.c_str(), L"1"); } diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx index 80e56be0cdb1..ffb7a8aa4216 100644 --- a/setup_native/source/win32/customactions/tools/checkversion.cxx +++ b/setup_native/source/win32/customactions/tools/checkversion.cxx @@ -60,7 +60,7 @@ inline void OutputDebugStringFormatW( PCWSTR pFormat, ... ) va_end(args); } #else -static inline void OutputDebugStringFormatW( PCWSTR, ... ) +static void OutputDebugStringFormatW( PCWSTR, ... ) { } #endif diff --git a/setup_native/source/win32/customactions/tools/seterror.cxx b/setup_native/source/win32/customactions/tools/seterror.cxx index e0c4389fd1a7..f1800ffb7ffb 100644 --- a/setup_native/source/win32/customactions/tools/seterror.cxx +++ b/setup_native/source/win32/customactions/tools/seterror.cxx @@ -40,7 +40,7 @@ inline void OutputDebugStringFormatW( PCWSTR pFormat, ... ) va_end(args); } #else -static inline void OutputDebugStringFormatW( PCWSTR, ... ) +static void OutputDebugStringFormatW( PCWSTR, ... ) { } #endif diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx index 04cb153a2b4f..b685cc906104 100644 --- a/shell/source/win32/simplemail/senddoc.cxx +++ b/shell/source/win32/simplemail/senddoc.cxx @@ -76,7 +76,7 @@ namespace /* private */ @returns the email address prefixed with the specified prefix. */ -static inline std::wstring prefixEmailAddress( +static std::wstring prefixEmailAddress( const std::wstring& aEmailAddress, const std::wstring& aPrefix = L"SMTP:") { diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index b01d7b69bbcd..64a7f1dfa315 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -129,7 +129,7 @@ static size_t work_dir_len; #ifdef __GNUC__ #define clz __builtin_clz #else -static inline int clz(unsigned int value) +static int clz(unsigned int value) { int result = 32; diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index 67aa604cef6c..bcde920b2942 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -66,7 +66,7 @@ static const sal_Int64 SAL_INT64_MIN = #ifdef _MSC_VER static const double DOUBLE_SAL_UINT64_MAX = (((double(SAL_INT64_MAX)) * 2) + 1); -static inline double unsigned_int64_to_double( sal_uInt64 n ) +static double unsigned_int64_to_double( sal_uInt64 n ) { sal_uInt64 n2 = (n / 3); n -= (2 * n2); diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx index 87f88c88ce90..07e90d2efe82 100644 --- a/vcl/win/gdi/salbmp.cxx +++ b/vcl/win/gdi/salbmp.cxx @@ -49,7 +49,7 @@ #undef max #endif -static inline void ImplSetPixel4( sal_uInt8* pScanline, long nX, const BYTE cIndex ) +static void ImplSetPixel4( sal_uInt8* pScanline, long nX, const BYTE cIndex ) { BYTE& rByte = pScanline[ nX >> 1 ]; diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 9c4b4995f9ca..181bbcec633b 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -64,13 +64,13 @@ using namespace vcl; static const int MAXFONTHEIGHT = 2048; -static inline FIXED FixedFromDouble( double d ) +static FIXED FixedFromDouble( double d ) { const long l = static_cast( d * 65536. ); return *reinterpret_cast(&l); } -static inline int IntTimes256FromFixed(FIXED f) +static int IntTimes256FromFixed(FIXED f) { int nFixedTimes256 = (f.value << 8) + ((f.fract+0x80) >> 8); return nFixedTimes256; @@ -490,7 +490,7 @@ static int ImplWeightToWin( FontWeight eWeight ) return 0; } -static inline FontPitch ImplLogPitchToSal( BYTE nPitch ) +static FontPitch ImplLogPitchToSal( BYTE nPitch ) { if ( nPitch & FIXED_PITCH ) return PITCH_FIXED; @@ -498,7 +498,7 @@ static inline FontPitch ImplLogPitchToSal( BYTE nPitch ) return PITCH_VARIABLE; } -static inline FontPitch ImplMetricPitchToSal( BYTE nPitch ) +static FontPitch ImplMetricPitchToSal( BYTE nPitch ) { // Grrrr! See NT help if ( !(nPitch & TMPF_FIXED_PITCH) ) @@ -507,7 +507,7 @@ static inline FontPitch ImplMetricPitchToSal( BYTE nPitch ) return PITCH_VARIABLE; } -static inline BYTE ImplPitchToWin( FontPitch ePitch ) +static BYTE ImplPitchToWin( FontPitch ePitch ) { if ( ePitch == PITCH_FIXED ) return FIXED_PITCH; @@ -661,7 +661,7 @@ rtl::Reference WinFontFace::CreateFontInstance(const FontSe return new WinFontInstance(*this, rFSD); } -static inline DWORD CalcTag( const char p[5]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); } +static DWORD CalcTag( const char p[5]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); } void WinFontFace::UpdateFromHDC( HDC hDC ) const { diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 99c7694e7b13..27b55ffffa2e 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -2500,7 +2500,7 @@ OUString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode ) return OUString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) ); } -static inline Color ImplWinColorToSal( COLORREF nColor ) +static Color ImplWinColorToSal( COLORREF nColor ) { return Color( GetRValue( nColor ), GetGValue( nColor ), GetBValue( nColor ) ); } @@ -3668,7 +3668,7 @@ enum class DeferPolicy }; // Remember to release the solar mutex on success! -static inline WinSalFrame* ProcessOrDeferMessage( HWND hWnd, INT nMsg, WPARAM pWParam = 0, +static WinSalFrame* ProcessOrDeferMessage( HWND hWnd, INT nMsg, WPARAM pWParam = 0, DeferPolicy eCanDefer = DeferPolicy::Allowed ) { bool bFailedCondition = false, bGotMutex = false; -- cgit