Kaydet (Commit) 928b1b04 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ec709a8d
......@@ -36,7 +36,7 @@ using namespace ::com::sun::star;
namespace avmedia { namespace win {
LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
static LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
{
Player* pPlayer = reinterpret_cast<Player*>(::GetWindowLongPtrW( hWnd, 0 ));
bool bProcessed = true;
......
......@@ -35,7 +35,7 @@ using namespace ::com::sun::star;
namespace avmedia { namespace win {
LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
static LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM nPar2 )
{
Window* pWindow = reinterpret_cast<Window*>(GetWindowLongPtrW( hWnd, 0 ));
bool bProcessed = true;
......@@ -133,7 +133,7 @@ LRESULT CALLBACK MediaPlayerWndProc( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM n
return( bProcessed ? 0 : DefWindowProcW( hWnd, nMsg, nPar1, nPar2 ) );
}
WNDCLASSW* lcl_getWndClass()
static WNDCLASSW* lcl_getWndClass()
{
WNDCLASSW* s_pWndClass = new WNDCLASSW;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_MSVC_WIN32_X86_64_CALL_HXX
#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_MSVC_WIN32_X86_64_CALL_HXX
#include <sal/config.h>
#include <sal/types.h>
#include <typelib/typeclass.h>
extern "C" typelib_TypeClass cpp_vtable_call(sal_Int64 nOffsetAndIndex, void** pStack);
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -30,6 +30,7 @@
#include <types.hxx>
#include <vtablefactory.hxx>
#include "call.hxx"
#include "mscx.hxx"
using namespace ::com::sun::star::uno;
......@@ -382,7 +383,7 @@ extern "C" char privateSnippetExecutor;
// - Loads functionIndex and vtableOffset into scratch registers
// - Jumps to privateSnippetExecutor
unsigned char * codeSnippet(
static unsigned char * codeSnippet(
unsigned char * code,
CPPU_CURRENT_NAMESPACE::RegParamKind param_kind[4],
sal_Int32 nFunctionIndex,
......
......@@ -262,7 +262,7 @@ using namespace ::osl;
namespace CPPU_CURRENT_NAMESPACE
{
int mscx_getRTTI_len(OUString const & rUNOname);
static int mscx_getRTTI_len(OUString const & rUNOname);
static inline OUString toUNOname(
......@@ -425,7 +425,7 @@ RTTInfos::RTTInfos() throw ()
{
}
void * __cdecl copyConstruct(
static void * __cdecl copyConstruct(
void * pExcThis,
void * pSource,
typelib_TypeDescription * pTD ) throw ()
......@@ -434,7 +434,7 @@ void * __cdecl copyConstruct(
return pExcThis;
}
void * __cdecl destruct(
static void * __cdecl destruct(
void * pExcThis,
typelib_TypeDescription * pTD ) throw ()
{
......@@ -444,7 +444,7 @@ void * __cdecl destruct(
const int codeSnippetSize = 40;
void GenerateConstructorTrampoline(
static void GenerateConstructorTrampoline(
unsigned char * code,
typelib_TypeDescription * pTD ) throw ()
{
......@@ -464,7 +464,7 @@ void GenerateConstructorTrampoline(
assert( p < code + codeSnippetSize );
}
void GenerateDestructorTrampoline(
static void GenerateDestructorTrampoline(
unsigned char * code,
typelib_TypeDescription * pTD ) throw ()
{
......
......@@ -126,20 +126,29 @@ public:
{
return true;
}
if (decl->isMain())
if (decl->isMain() || decl->isMSVCRTEntryPoint())
{
return true;
}
if (hasCLanguageLinkageType(decl)
&& loplugin::DeclCheck(decl).Function("_DllMainCRTStartup").GlobalNamespace())
{
return true;
}
// If the function definition is explicit marked SAL_DLLPUBLIC_EXPORT or similar, then
// assume that it needs to be present (e.g., only called via dlopen, or a backwards-
// compatibility stub like in sal/osl/all/compat.cxx):
if (auto const attr = decl->getAttr<VisibilityAttr>())
{
if (attr->getVisibility() == VisibilityAttr::Default)
{
// If the function definition has explicit default visibility, then assume that it
// needs to be present (e.g., only called via dlopen, or a backwards-compatibility
// stub like in sal/osl/all/compat.cxx):
return true;
}
}
else if (decl->hasAttr<DLLExportAttr>())
{
return true;
}
auto const canon = decl->getCanonicalDecl();
if (hasCLanguageLinkageType(canon)
&& (canon->hasAttr<ConstructorAttr>() || canon->hasAttr<DestructorAttr>()))
......@@ -177,6 +186,10 @@ public:
{
return true;
}
if (loplugin::DeclCheck(decl).Var("_pRawDllMain").GlobalNamespace())
{
return true;
}
return handleDeclaration(decl);
}
......@@ -261,14 +274,27 @@ private:
return true;
}
}
if (compiler.getSourceManager().isMacroBodyExpansion(decl->getLocation())
&& (Lexer::getImmediateMacroName(decl->getLocation(), compiler.getSourceManager(),
if (compiler.getSourceManager().isMacroBodyExpansion(decl->getLocation()))
{
if (Lexer::getImmediateMacroName(decl->getLocation(), compiler.getSourceManager(),
compiler.getLangOpts())
== "MDDS_MTV_DEFINE_ELEMENT_CALLBACKS"))
== "MDDS_MTV_DEFINE_ELEMENT_CALLBACKS")
{
// Even wrapping in an unnamed namespace or sneaking "static" into the macro
// wouldn't help, as then some of the functions it defines would be flagged as
// unused:
return true;
}
}
else if (compiler.getSourceManager().isMacroArgExpansion(decl->getLocation()))
{
// Even wrapping in an unnamed namespace or sneaking "static" into the macro wouldn't
// help, as then some of the functions it defines would be flagged as unused:
return true;
if (Lexer::getImmediateMacroName(decl->getLocation(), compiler.getSourceManager(),
compiler.getLangOpts())
== "DEFINE_GUID")
{
// Windows, guiddef.h:
return true;
}
}
TypedefNameDecl const* typedefed = nullptr;
if (auto const d = dyn_cast<TagDecl>(decl))
......
......@@ -32,7 +32,7 @@
typedef SQLRETURN (SQL_API* TSQLManageDataSource) (SQLHWND hwndParent);
// displays the error text for the last error (GetLastError), and returns this error value
int displayLastError()
static int displayLastError()
{
DWORD dwError = GetLastError();
......@@ -58,7 +58,7 @@ int displayLastError()
/** registers the window class for our application's main window
*/
BOOL registerWindowClass( HINSTANCE _hAppInstance )
static BOOL registerWindowClass( HINSTANCE _hAppInstance )
{
WNDCLASSEXW wcx;
......@@ -79,7 +79,7 @@ BOOL registerWindowClass( HINSTANCE _hAppInstance )
}
/// initializes the application instances
HWND initInstance( HINSTANCE _hAppInstance )
static HWND initInstance( HINSTANCE _hAppInstance )
{
HWND hWindow = CreateWindowW(
L"ODBCConfigMainClass", // name of window class
......
......@@ -465,7 +465,7 @@ Reference<XInterface> resolveUnoURL(
}
#ifdef _WIN32
void writeConsoleWithStream(OUString const & sText, HANDLE stream)
static void writeConsoleWithStream(OUString const & sText, HANDLE stream)
{
DWORD nWrittenChars = 0;
WriteFile(stream, sText.getStr(),
......
......@@ -34,13 +34,13 @@
#include <malloc.h>
#include <memory.h>
bool SofficeRuns()
static bool SofficeRuns()
{
// check for soffice by searching the communication window
return FindWindowExW( nullptr, nullptr, QUICKSTART_CLASSNAME, nullptr ) != nullptr;
}
bool launchSoffice( )
static bool launchSoffice( )
{
if ( !SofficeRuns() )
{
......
......@@ -157,7 +157,7 @@ CMtaOleClipboard* CMtaOleClipboard::s_theMtaOleClipboardInst = nullptr;
// marshal an IDataObject
//inline
HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStream )
static HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStream )
{
OSL_ASSERT( nullptr != pIDataObject );
OSL_ASSERT( nullptr != ppStream );
......@@ -173,7 +173,7 @@ HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStrea
// unmarshal an IDataObject
//inline
HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** ppIDataObject )
static HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** ppIDataObject )
{
OSL_ASSERT( nullptr != lpStream );
OSL_ASSERT( nullptr != ppIDataObject );
......
......@@ -30,13 +30,13 @@ using namespace ::com::sun::star::registry ;
using namespace ::cppu ;
using namespace ::com::sun::star::lang;
Reference< XInterface > createDragSource( const Reference< XMultiServiceFactory >& rServiceManager )
static Reference< XInterface > createDragSource( const Reference< XMultiServiceFactory >& rServiceManager )
{
DragSource* pSource= new DragSource( comphelper::getComponentContext(rServiceManager) );
return Reference<XInterface>( static_cast<XInitialization*>(pSource), UNO_QUERY);
}
Reference< XInterface > createDropTarget( const Reference< XMultiServiceFactory >& rServiceManager )
static Reference< XInterface > createDropTarget( const Reference< XMultiServiceFactory >& rServiceManager )
{
DropTarget* pTarget= new DropTarget( comphelper::getComponentContext(rServiceManager) );
return Reference<XInterface>( static_cast<XInitialization*>(pTarget), UNO_QUERY);
......
......@@ -46,7 +46,7 @@ using namespace com::sun::star::awt::MouseButton;
using namespace com::sun::star::awt;
using namespace com::sun::star::lang;
unsigned __stdcall DndOleSTAFunc(LPVOID pParams);
static unsigned __stdcall DndOleSTAFunc(LPVOID pParams);
DragSource::DragSource( const Reference<XComponentContext>& rxContext):
WeakComponentImplHelper< XDragSource, XInitialization, XServiceInfo >(m_mutex),
......
......@@ -214,7 +214,7 @@ Sequence< sal_Int8 > OOBmpToWinDIB( Sequence< sal_Int8 >& aOOBmp )
return winDIBStream;
}
std::string GetHtmlFormatHeader(size_t startHtml, size_t endHtml, size_t startFragment, size_t endFragment)
static std::string GetHtmlFormatHeader(size_t startHtml, size_t endHtml, size_t startFragment, size_t endFragment)
{
std::ostringstream htmlHeader;
htmlHeader << "Version:1.0" << '\r' << '\n';
......@@ -272,7 +272,7 @@ Sequence<sal_Int8> TextHtmlToHTMLFormat(Sequence<sal_Int8> const & aTextHtml)
return byteSequence;
}
std::wstring getFileExtension(const std::wstring& aFilename)
static std::wstring getFileExtension(const std::wstring& aFilename)
{
std::wstring::size_type idx = aFilename.rfind(L".");
if (idx != std::wstring::npos)
......@@ -284,7 +284,7 @@ std::wstring getFileExtension(const std::wstring& aFilename)
const std::wstring SHELL_LINK_FILE_EXTENSION = L".lnk";
bool isShellLink(const std::wstring& aFilename)
static bool isShellLink(const std::wstring& aFilename)
{
std::wstring ext = getFileExtension(aFilename);
return (_wcsicmp(ext.c_str(), SHELL_LINK_FILE_EXTENSION.c_str()) == 0);
......@@ -293,7 +293,7 @@ bool isShellLink(const std::wstring& aFilename)
/** Resolve a Windows Shell Link (lnk) file. If a resolution
is not possible simply return the provided name of the
lnk file. */
std::wstring getShellLinkTarget(const std::wstring& aLnkFile)
static std::wstring getShellLinkTarget(const std::wstring& aLnkFile)
{
OSL_ASSERT(isShellLink(aLnkFile));
......@@ -339,7 +339,7 @@ typedef Sequence<sal_Int8> ByteSequence_t;
/* Calculate the size required for turning a string list into
a double '\0' terminated string buffer */
size_t CalcSizeForStringListBuffer(const std::vector<std::wstring>& fileList)
static size_t CalcSizeForStringListBuffer(const std::vector<std::wstring>& fileList)
{
if ( fileList.empty() )
return 0;
......@@ -352,7 +352,7 @@ size_t CalcSizeForStringListBuffer(const std::vector<std::wstring>& fileList)
return (size * sizeof(std::vector<std::wstring>::value_type::value_type));
}
ByteSequence_t FileListToByteSequence(const std::vector<std::wstring>& fileList)
static ByteSequence_t FileListToByteSequence(const std::vector<std::wstring>& fileList)
{
ByteSequence_t bseq;
size_t size = CalcSizeForStringListBuffer(fileList);
......
......@@ -27,7 +27,7 @@ using namespace ::com::sun::star::uno;
// assuming a '\0' terminated string if no length specified
int CalcBuffSizeForTextConversion( UINT code_page, LPCSTR lpMultiByteString, int nLen = -1 )
static int CalcBuffSizeForTextConversion( UINT code_page, LPCSTR lpMultiByteString, int nLen = -1 )
{
return ( MultiByteToWideChar( code_page,
0,
......@@ -39,7 +39,7 @@ int CalcBuffSizeForTextConversion( UINT code_page, LPCSTR lpMultiByteString, int
// assuming a '\0' terminated string if no length specified
int CalcBuffSizeForTextConversion( UINT code_page, LPCWSTR lpWideCharString, int nLen = -1 )
static int CalcBuffSizeForTextConversion( UINT code_page, LPCWSTR lpWideCharString, int nLen = -1 )
{
return WideCharToMultiByte( code_page,
0,
......
......@@ -224,7 +224,7 @@ struct OleComponentNative_Impl {
};
DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor )
static DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor )
{
if ( aFlavor.MimeType.indexOf( ";Aspect=THUMBNAIL" ) != -1 )
return DVASPECT_THUMBNAIL;
......@@ -237,7 +237,7 @@ DWORD GetAspectFromFlavor( const datatransfer::DataFlavor& aFlavor )
}
OUString GetFlavorSuffixFromAspect( DWORD nAsp )
static OUString GetFlavorSuffixFromAspect( DWORD nAsp )
{
OUString aResult;
......@@ -254,7 +254,7 @@ OUString GetFlavorSuffixFromAspect( DWORD nAsp )
}
HRESULT OpenIStorageFromURL_Impl( const OUString& aURL, IStorage** ppIStorage )
static HRESULT OpenIStorageFromURL_Impl( const OUString& aURL, IStorage** ppIStorage )
{
OSL_ENSURE( ppIStorage, "The pointer must not be empty!" );
......@@ -375,7 +375,7 @@ bool OleComponentNative_Impl::GraphicalFlavor( const datatransfer::DataFlavor& a
}
bool GetClassIDFromSequence_Impl( uno::Sequence< sal_Int8 > const & aSeq, CLSID& aResult )
static bool GetClassIDFromSequence_Impl( uno::Sequence< sal_Int8 > const & aSeq, CLSID& aResult )
{
if ( aSeq.getLength() == 16 )
{
......@@ -392,7 +392,7 @@ bool GetClassIDFromSequence_Impl( uno::Sequence< sal_Int8 > const & aSeq, CLSID&
}
OUString WinAccToVcl_Impl( const sal_Unicode* pStr )
static OUString WinAccToVcl_Impl( const sal_Unicode* pStr )
{
OUString aResult;
......
......@@ -155,7 +155,7 @@ OUString GetNewFilledTempFile_Impl( const uno::Reference< io::XInputStream >& xI
#ifdef _WIN32
/// @throws io::IOException
/// @throws uno::RuntimeException
OUString GetNewFilledTempFile_Impl( const uno::Reference< embed::XOptimizedStorage >& xParentStorage, const OUString& aEntryName, const uno::Reference< lang::XMultiServiceFactory >& xFactory )
static OUString GetNewFilledTempFile_Impl( const uno::Reference< embed::XOptimizedStorage >& xParentStorage, const OUString& aEntryName, const uno::Reference< lang::XMultiServiceFactory >& xFactory )
{
OUString aResult;
......@@ -187,7 +187,7 @@ OUString GetNewFilledTempFile_Impl( const uno::Reference< embed::XOptimizedStora
}
void SetStreamMediaType_Impl( const uno::Reference< io::XStream >& xStream, const OUString& aMediaType )
static void SetStreamMediaType_Impl( const uno::Reference< io::XStream >& xStream, const OUString& aMediaType )
{
uno::Reference< beans::XPropertySet > xPropSet( xStream, uno::UNO_QUERY_THROW );
xPropSet->setPropertyValue("MediaType", uno::makeAny( aMediaType ) );
......
......@@ -69,7 +69,7 @@ typedef UINT STDAPICALLTYPE OleUIInsertObjectA_Type(LPOLEUIINSERTOBJECTA);
using namespace ::com::sun::star;
using namespace ::comphelper;
uno::Sequence< sal_Int8 > GetRelatedInternalID_Impl( const uno::Sequence< sal_Int8 >& aClassID )
static uno::Sequence< sal_Int8 > GetRelatedInternalID_Impl( const uno::Sequence< sal_Int8 >& aClassID )
{
// Writer
if ( MimeConfigurationHelper::ClassIDsEqual( aClassID, MimeConfigurationHelper::GetSequenceClassID( SO3_SW_OLE_EMBED_CLASSID_60 ) )
......
......@@ -499,7 +499,7 @@ void DocumentHolder::UIDeactivate()
return;
}
void CopyToOLEMenu(HMENU hOrig,WORD origPos,HMENU hDest,WORD destPos)
static void CopyToOLEMenu(HMENU hOrig,WORD origPos,HMENU hDest,WORD destPos)
{
HMENU subMenu(nullptr);
wchar_t buffer[256];
......
......@@ -56,7 +56,7 @@ using namespace ::com::sun::star;
const OUString aOfficeEmbedStreamName( "package_stream" );
const OUString aExtentStreamName( "properties_stream" );
uno::Reference< io::XInputStream > createTempXInStreamFromIStream(
static uno::Reference< io::XInputStream > createTempXInStreamFromIStream(
uno::Reference< lang::XMultiServiceFactory > const & xFactory,
IStream *pStream )
{
......@@ -110,7 +110,7 @@ uno::Reference< io::XInputStream > createTempXInStreamFromIStream(
return xResult;
}
HRESULT copyXTempOutToIStream( uno::Reference< io::XOutputStream > const & xTempOut, IStream* pStream )
static HRESULT copyXTempOutToIStream( uno::Reference< io::XOutputStream > const & xTempOut, IStream* pStream )
{
if ( !xTempOut.is() || !pStream )
return E_FAIL;
......
......@@ -29,20 +29,20 @@
using namespace ::com::sun::star;
/// @throws uno::Exception
uno::Reference<uno::XInterface> EmbedServer_createInstance(
static uno::Reference<uno::XInterface> EmbedServer_createInstance(
const uno::Reference<lang::XMultiServiceFactory> & xSMgr)
{
uno::Reference<uno::XInterface > xService = *new EmbedServer_Impl( xSMgr );
return xService;
}
OUString EmbedServer_getImplementationName() throw()
static OUString EmbedServer_getImplementationName() throw()
{
return OUString("com.sun.star.comp.ole.EmbedServer");
}
uno::Sequence< OUString > EmbedServer_getSupportedServiceNames() throw()
static uno::Sequence< OUString > EmbedServer_getSupportedServiceNames() throw()
{
uno::Sequence<OUString> aServiceNames { "com.sun.star.document.OleEmbeddedServerRegistration" };
return aServiceNames;
......
......@@ -78,7 +78,7 @@ void *CurThreadData::getData()
return osl_getThreadKeyData(m_hKey);
}
void o2u_attachCurrentThread()
static void o2u_attachCurrentThread()
{
static CurThreadData oleThreadData;
......
......@@ -79,7 +79,7 @@ const AFX_RECTINFO afxRectInfo[] =
};
HBRUSH HalftoneBrush()
static HBRUSH HalftoneBrush()
{
if (afxHalftoneBrush == nullptr)
{
......@@ -97,7 +97,7 @@ HBRUSH HalftoneBrush()
}
void DrawDragRect(
static void DrawDragRect(
HDC hDC,LPRECT lpRect,SIZE size,
LPRECT lpRectLast,SIZE sizeLast,
HBRUSH hBrush = nullptr,HBRUSH hBrushLast = nullptr)
......@@ -185,7 +185,7 @@ void winwrap::TransformRect(LPRECT rect,HWND pWnd,HWND pWndClipTo)
}
void NormalizeRect(LPRECT rp)
static void NormalizeRect(LPRECT rp)
{
if(rp->left > rp->right) {
UINT tmp = rp->left;
......
......@@ -23,6 +23,8 @@
#include "inprocembobj.h"
#include <embservconst.h>
#include <olectl.h> // declarations of DllRegisterServer/DllUnregisterServer
static const GUID* guidList[ SUPPORTED_FACTORIES_NUM ] = {
&OID_WriterTextServer,
&OID_WriterOASISTextServer,
......
......@@ -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 )
......
......@@ -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 )
......
......@@ -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 );
}
......
......@@ -219,7 +219,7 @@ static sal_uInt32 getTotalFilterLength( CFilterContainer& aFilterContainer )
return ( totalLength > 0 ) ? totalLength + 1 : totalLength;
}
inline
static inline
void wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength )
{
memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) );
......
......@@ -38,14 +38,14 @@
#include <shlguid.h>
#include <shlobj.h>
inline bool is_current_process_window(HWND hwnd)
static inline bool is_current_process_window(HWND hwnd)
{
DWORD pid;
GetWindowThreadProcessId(hwnd, &pid);
return (pid == GetCurrentProcessId());
}
HWND choose_parent_window()
static HWND choose_parent_window()
{
HWND hwnd_parent = GetForegroundWindow();