summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-24 15:41:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-24 17:22:05 +0200
commit928b1b04adc1cd49cc5d00069084e03675a320f3 (patch)
tree8710687a4a66a628bd12c5482d7d93cc27f8996a /extensions
parentec709a8d5e808b970a8930a389c0a5a6f61fe8c7 (diff)
loplugin:external (clang-cl)
Including: * expanding STDAPI to its definition (as per <https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at <https://gerrit.libreoffice.org/#/c/60691/> "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 <sbergman@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/activex/SOActiveX.cxx7
-rw-r--r--extensions/source/activex/so_activex.cxx14
-rw-r--r--extensions/source/scanner/scanwin.cxx4
3 files changed, 14 insertions, 11 deletions
diff --git a/extensions/source/activex/SOActiveX.cxx b/extensions/source/activex/SOActiveX.cxx
index 50515047d937..ee74dfdaa0fd 100644
--- a/extensions/source/activex/SOActiveX.cxx
+++ b/extensions/source/activex/SOActiveX.cxx
@@ -24,6 +24,7 @@
#include "SOComWindowPeer.h"
#include "SODispatchInterceptor.h"
#include "SOActionsApproval.h"
+#include "com_uno_helper.h"
#if defined __clang__
#pragma clang diagnostic push
@@ -37,7 +38,7 @@
#define STAROFFICE_WINDOWCLASS L"SOParentWindow"
-void OutputError_Impl( HWND hw, HRESULT ErrorCode )
+static void OutputError_Impl( HWND hw, HRESULT ErrorCode )
{
LPWSTR sMessage = nullptr;
FormatMessageW(
@@ -81,7 +82,7 @@ HRESULT ExecuteFunc( IDispatch* idispUnoObject,
return hr;
}
-HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
+static HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
OLECHAR const * sFuncName,
CComVariant* params,
unsigned int count,
@@ -102,7 +103,7 @@ HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
return S_OK;
}
-HRESULT PutPropertiesToIDisp( IDispatch* pdispObject,
+static HRESULT PutPropertiesToIDisp( IDispatch* pdispObject,
OLECHAR const ** sMemberNames,
CComVariant* pVariant,
unsigned int count )
diff --git a/extensions/source/activex/so_activex.cxx b/extensions/source/activex/so_activex.cxx
index fb3e324494c2..5935af977437 100644
--- a/extensions/source/activex/so_activex.cxx
+++ b/extensions/source/activex/so_activex.cxx
@@ -194,7 +194,7 @@ const char* const aProxyStubActApprove = "{00020424-0000-0000-C000-000000000046}
// The following prefix is required for HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER ( not for HKEY_CLASSES_ROOT )
const char* const aLocalPrefix = "Software\\Classes\\";
-BOOL createKey( HKEY hkey,
+static BOOL createKey( HKEY hkey,
const char* aKeyToCreate,
REGSAM nKeyAccess,
const char* aValue = nullptr,
@@ -220,7 +220,7 @@ BOOL createKey( HKEY hkey,
}
-BOOL createKey( HKEY hkey,
+static BOOL createKey( HKEY hkey,
const wchar_t* aKeyToCreate,
REGSAM nKeyAccess,
const wchar_t* aValue = nullptr,
@@ -246,7 +246,7 @@ BOOL createKey( HKEY hkey,
}
-STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit );
+EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit );
static HRESULT DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess, const wchar_t* pProgramPath, const wchar_t* pLibName )
{
BOOL aResult = FALSE;
@@ -389,7 +389,7 @@ static HRESULT DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSA
return HRESULT(aResult);
}
-STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const wchar_t* pProgramPath )
+EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const wchar_t* pProgramPath )
{
HRESULT hr = S_OK;
if ( bFor64Bit )
@@ -403,7 +403,7 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, co
// DllUnregisterServer - Removes entries from the system registry
-HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess )
+static HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess )
{
HKEY hkey1 = nullptr;
@@ -542,7 +542,7 @@ const char* const aMSMimeType[] = { "application/msword",
"application/mspowerpoint" };
const int nForMSModes[] = { 1, 1, 2, 2, 4, 4, 4 };
-STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit );
+EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit );
static HRESULT DllRegisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess )
{
BOOL aResult = TRUE;
@@ -630,7 +630,7 @@ static HRESULT DllRegisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM n
return HRESULT(aResult);
}
-STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit )
+EXTERN_C __declspec(dllexport) HRESULT STDAPICALLTYPE DllRegisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit )
{
HRESULT hr = S_OK;
if ( bFor64Bit )
diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx
index 45f1c6a71ab8..36880f01c132 100644
--- a/extensions/source/scanner/scanwin.cxx
+++ b/extensions/source/scanner/scanwin.cxx
@@ -69,6 +69,8 @@ enum TwainState
TWAIN_STATE_CANCELED = 3
};
+static LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam );
+
class ImpTwain : public ::cppu::WeakImplHelper< util::XCloseListener >
{
friend LRESULT CALLBACK TwainMsgProc( int nCode, WPARAM wParam, LPARAM lParam );
@@ -118,7 +120,7 @@ public:
static ImpTwain* pImpTwainInstance = nullptr;
-LRESULT CALLBACK TwainWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
+static LRESULT CALLBACK TwainWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
{
return DefWindowProcW( hWnd, nMsg, nPar1, nPar2 );
}