From 928b1b04adc1cd49cc5d00069084e03675a320f3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 24 Sep 2018 15:41:53 +0200 Subject: loplugin:external (clang-cl) Including: * expanding STDAPI to its definition (as per "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../indexingfilter/restartindexingservice.cxx | 4 ++-- .../win32/customactions/quickstarter/quickstarter.cxx | 2 +- .../win32/customactions/reg4allmsdoc/reg4allmsi.cxx | 4 ++-- .../source/win32/customactions/regactivex/regactivex.cxx | 16 ++++++++-------- .../source/win32/customactions/sellang/sellang.cxx | 6 +++--- .../source/win32/customactions/tools/checkversion.cxx | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'setup_native/source') diff --git a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx index 4558d6f8a399..e1c26501b002 100644 --- a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx +++ b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx @@ -32,7 +32,7 @@ const wchar_t * const INDEXING_SERVICE_NAME = L"cisvc"; -bool StopIndexingService(SC_HANDLE hService) +static bool StopIndexingService(SC_HANDLE hService) { SERVICE_STATUS status; @@ -78,7 +78,7 @@ bool StopIndexingService(SC_HANDLE hService) return (status.dwCurrentState == SERVICE_STOPPED); } -void StartIndexingService(SC_HANDLE hService) +static void StartIndexingService(SC_HANDLE hService) { if (StartServiceW(hService, 0, nullptr)) { diff --git a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx index 0e83d9964e80..9581ce32f008 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; } -inline bool IsValidHandle( HANDLE handle ) +static inline 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 5982dc8f6b13..f8be58bcdcda 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx +++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx @@ -132,7 +132,7 @@ static BOOL CheckExtensionInRegistry( LPCWSTR lpSubKey ) return bRet; } -bool GetMsiPropW( MSIHANDLE handle, LPCWSTR name, /*out*/std::wstring& value ) +static bool GetMsiPropW( MSIHANDLE handle, LPCWSTR name, /*out*/std::wstring& value ) { DWORD sz = 0; LPWSTR dummy = const_cast(L""); @@ -149,7 +149,7 @@ bool GetMsiPropW( MSIHANDLE handle, LPCWSTR name, /*out*/std::wstring& value ) return false; } -bool IsSetMsiPropW( MSIHANDLE handle, LPCWSTR name ) +static bool IsSetMsiPropW( MSIHANDLE handle, LPCWSTR name ) { std::wstring val; GetMsiPropW( handle, name, val ); diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx index c9fb5b5db250..94c0740792ab 100644 --- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx +++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx @@ -36,7 +36,7 @@ typedef int ( __stdcall * DllNativeRegProc ) ( int, BOOL, BOOL, const wchar_t* ); typedef int ( __stdcall * DllNativeUnregProc ) ( int, BOOL, BOOL ); -BOOL UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) +static BOOL UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) { if ( pStr1 == nullptr && pStr2 == nullptr ) return TRUE; @@ -53,7 +53,7 @@ BOOL UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) } -void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) +static void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) { HINSTANCE hModule = LoadLibraryExW( pActiveXPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH ); if( hModule ) @@ -80,7 +80,7 @@ void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL Install } -void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) +static void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) { HINSTANCE hModule = LoadLibraryExW( pActiveXPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH ); if( hModule ) @@ -94,7 +94,7 @@ void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL Insta } -BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) +static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyW( hMSI, pPropName, const_cast(L""), &sz ) == ERROR_MORE_DATA ) @@ -113,7 +113,7 @@ BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) } -BOOL GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) +static BOOL GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) { wchar_t* pProgPath = nullptr; if ( GetMsiPropW( hMSI, L"INSTALLLOCATION", &pProgPath ) && pProgPath ) @@ -133,7 +133,7 @@ BOOL GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) } -BOOL GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, int& nDeinstallMode ) +static BOOL GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, int& nDeinstallMode ) { // for now the chart is always installed nOldInstallMode = CHART_COMPONENT; @@ -232,7 +232,7 @@ BOOL GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, int& nDe } -BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) +static BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) { BOOL bResult = FALSE; wchar_t* pVal = nullptr; @@ -246,7 +246,7 @@ BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) } -BOOL MakeInstallFor64Bit( MSIHANDLE hMSI ) +static BOOL MakeInstallFor64Bit( MSIHANDLE hMSI ) { BOOL bResult = FALSE; wchar_t* pVal = nullptr; diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index e177ba918445..bde31d03ab76 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -37,7 +37,7 @@ #include -BOOL GetMsiPropA( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) +static BOOL GetMsiPropA( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyA( hMSI, pPropName, const_cast(""), &sz ) == ERROR_MORE_DATA ) { @@ -162,14 +162,14 @@ langid_to_string( LANGID langid ) static const char *ui_langs[MAX_LANGUAGES]; static int num_ui_langs = 0; -void add_ui_lang(char const * lang) +static void add_ui_lang(char const * lang) { if (lang != nullptr && num_ui_langs != SAL_N_ELEMENTS(ui_langs)) { ui_langs[num_ui_langs++] = lang; } } -BOOL CALLBACK +static BOOL CALLBACK enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) { long langid = strtol(language, nullptr, 16); diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx index 7c4ffec501a4..80e56be0cdb1 100644 --- a/setup_native/source/win32/customactions/tools/checkversion.cxx +++ b/setup_native/source/win32/customactions/tools/checkversion.cxx @@ -29,7 +29,7 @@ #include "seterror.hxx" -BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) +static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyW( hMSI, pPropName, const_cast(L""), &sz ) == ERROR_MORE_DATA ) -- cgit