summaryrefslogtreecommitdiff
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
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>
-rw-r--r--avmedia/source/win/player.cxx2
-rw-r--r--avmedia/source/win/window.cxx4
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/call.hxx32
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx3
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx10
-rw-r--r--compilerplugins/clang/external.cxx46
-rw-r--r--dbaccess/win32/source/odbcconfig/odbcconfig.cxx6
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx2
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.cxx4
-rw-r--r--dtrans/source/win32/clipb/MtaOleClipb.cxx4
-rw-r--r--dtrans/source/win32/dnd/dndentry.cxx4
-rw-r--r--dtrans/source/win32/dnd/source.cxx2
-rw-r--r--dtrans/source/win32/dtobj/FmtFilter.cxx12
-rw-r--r--dtrans/source/win32/dtobj/TxtCnvtHlp.cxx4
-rw-r--r--embeddedobj/source/msole/olecomponent.cxx10
-rw-r--r--embeddedobj/source/msole/olepersist.cxx4
-rw-r--r--embeddedobj/source/msole/xdialogcreator.cxx2
-rw-r--r--embedserv/source/embed/docholder.cxx2
-rw-r--r--embedserv/source/embed/ed_ipersiststr.cxx4
-rw-r--r--embedserv/source/embed/register.cxx6
-rw-r--r--embedserv/source/embed/servprov.cxx2
-rw-r--r--embedserv/source/embed/tracker.cxx6
-rw-r--r--embedserv/source/inprocserv/dllentry.cxx2
-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
-rw-r--r--fpicker/source/win32/FilterContainer.cxx2
-rw-r--r--fpicker/source/win32/VistaFilePickerImpl.cxx10
-rw-r--r--fpicker/source/win32/WinImplHelper.cxx2
-rw-r--r--fpicker/source/win32/resourceprovider.cxx2
-rw-r--r--hwpfilter/source/grammar.cxx2
-rw-r--r--idlc/source/options.cxx2
-rw-r--r--jurt/source/pipe/wrapper/wrapper.c2
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx8
-rw-r--r--odk/source/unoapploader/win/unoapploader.c10
-rw-r--r--pyuno/zipcore/python.cxx2
-rw-r--r--sal/osl/w32/file-impl.hxx2
-rw-r--r--sal/osl/w32/file.cxx1
-rw-r--r--sal/osl/w32/file_dirvol.cxx4
-rw-r--r--sal/osl/w32/nlsupport.cxx4
-rw-r--r--sal/osl/w32/pipe.cxx4
-rw-r--r--sal/osl/w32/socket.cxx4
-rw-r--r--sal/qa/osl/process/osl_process_child.cxx4
-rw-r--r--setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx4
-rw-r--r--setup_native/source/win32/customactions/quickstarter/quickstarter.cxx2
-rw-r--r--setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx4
-rw-r--r--setup_native/source/win32/customactions/regactivex/regactivex.cxx16
-rw-r--r--setup_native/source/win32/customactions/sellang/sellang.cxx6
-rw-r--r--setup_native/source/win32/customactions/tools/checkversion.cxx2
-rw-r--r--sfx2/source/appl/appdde.cxx2
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx10
-rw-r--r--shell/source/backends/localebe/localebackend.cxx2
-rw-r--r--shell/source/tools/regsvrex/regsvrex.cxx2
-rw-r--r--shell/source/win32/ooofilereader/metainforeader.cxx2
-rw-r--r--shell/source/win32/shlxthandler/infotips/infotips.cxx8
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx4
-rw-r--r--shell/source/win32/shlxthandler/shlxthdl.cxx1
-rw-r--r--shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx6
-rw-r--r--shell/source/win32/simplemail/senddoc.cxx20
-rw-r--r--shell/source/win32/spsupp/COMOpenDocuments.cxx4
-rw-r--r--shell/source/win32/spsupp/spsuppServ.cxx2
-rw-r--r--smoketest/libtest.cxx4
-rw-r--r--sw/source/ui/vba/vbasystem.cxx2
-rw-r--r--vcl/opengl/win/gdiimpl.cxx8
-rw-r--r--vcl/win/app/salinst.cxx2
-rw-r--r--vcl/win/gdi/gdiimpl.cxx10
-rw-r--r--vcl/win/gdi/salbmp.cxx2
-rw-r--r--vcl/win/gdi/salfont.cxx14
-rw-r--r--vcl/win/gdi/salnativewidgets-luna.cxx8
-rw-r--r--vcl/win/gdi/salprn.cxx2
-rw-r--r--vcl/win/window/salframe.cxx6
-rw-r--r--vcl/win/window/salmenu.cxx2
-rw-r--r--vcl/win/window/salobj.cxx12
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx2
-rw-r--r--winaccessibility/source/service/msaaservice_impl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx12
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx8
77 files changed, 265 insertions, 191 deletions
diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx
index 12e2abd65290..7e3dd0a4965c 100644
--- a/avmedia/source/win/player.cxx
+++ b/avmedia/source/win/player.cxx
@@ -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;
diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx
index fd77cd80b118..9b90787d728b 100644
--- a/avmedia/source/win/window.cxx
+++ b/avmedia/source/win/window.cxx
@@ -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;
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/call.hxx b/bridges/source/cpp_uno/msvc_win32_x86-64/call.hxx
new file mode 100644
index 000000000000..668fb523edbd
--- /dev/null
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/call.hxx
@@ -0,0 +1,32 @@
+/* -*- 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: */
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 216f261d6d55..3abbfaf9b7dd 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
@@ -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,
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 b1e14fbdf234..27879b066a59 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -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 ()
{
diff --git a/compilerplugins/clang/external.cxx b/compilerplugins/clang/external.cxx
index bb4bcbf36d08..d30b8cba3c5f 100644
--- a/compilerplugins/clang/external.cxx
+++ b/compilerplugins/clang/external.cxx
@@ -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))
diff --git a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
index 7874bb4c056f..71cb8286ff86 100644
--- a/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
+++ b/dbaccess/win32/source/odbcconfig/odbcconfig.cxx
@@ -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
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 9ccb179747c9..50cc7cb72890 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -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(),
diff --git a/desktop/win32/source/QuickStart/QuickStart.cxx b/desktop/win32/source/QuickStart/QuickStart.cxx
index 476f6533d530..1f5f912a88e3 100644
--- a/desktop/win32/source/QuickStart/QuickStart.cxx
+++ b/desktop/win32/source/QuickStart/QuickStart.cxx
@@ -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() )
{
diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx
index 36afcbe99a49..4d7ee04bfa30 100644
--- a/dtrans/source/win32/clipb/MtaOleClipb.cxx
+++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx
@@ -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 );
diff --git a/dtrans/source/win32/dnd/dndentry.cxx b/dtrans/source/win32/dnd/dndentry.cxx
index 9a06cbc6f3b9..58ec08f45858 100644
--- a/dtrans/source/win32/dnd/dndentry.cxx
+++ b/dtrans/source/win32/dnd/dndentry.cxx
@@ -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);
diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx
index 5b1bc1d3d1b3..45337ec764c4 100644
--- a/dtrans/source/win32/dnd/source.cxx
+++ b/dtrans/source/win32/dnd/source.cxx
@@ -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),
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index 3397b46e964a..29569230bc8a 100644
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -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);
diff --git a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx
index 529a0b49969f..b4fa6c012e60 100644
--- a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx
+++ b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx
@@ -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,
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index 03e49fc83115..bcf2600236c1 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -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;
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 8965c478caf1..286f24b709fc 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -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 ) );
diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx
index 44141b5101f8..f94020a65a8f 100644
--- a/embeddedobj/source/msole/xdialogcreator.cxx
+++ b/embeddedobj/source/msole/xdialogcreator.cxx
@@ -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 ) )
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 03131f36896c..37255f8ed27b 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -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];
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index 632297274451..44757a5eb35c 100644
--- a/embedserv/source/embed/ed_ipersiststr.cxx
+++ b/embedserv/source/embed/ed_ipersiststr.cxx
@@ -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;
diff --git a/embedserv/source/embed/register.cxx b/embedserv/source/embed/register.cxx
index 25c25b7a5aa3..573aedd470f8 100644
--- a/embedserv/source/embed/register.cxx
+++ b/embedserv/source/embed/register.cxx
@@ -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;
diff --git a/embedserv/source/embed/servprov.cxx b/embedserv/source/embed/servprov.cxx
index a78a7c9278fc..429c86e0dc89 100644
--- a/embedserv/source/embed/servprov.cxx
+++ b/embedserv/source/embed/servprov.cxx
@@ -78,7 +78,7 @@ void *CurThreadData::getData()
return osl_getThreadKeyData(m_hKey);
}
-void o2u_attachCurrentThread()
+static void o2u_attachCurrentThread()
{
static CurThreadData oleThreadData;
diff --git a/embedserv/source/embed/tracker.cxx b/embedserv/source/embed/tracker.cxx
index 823f25588ccd..99022f653db4 100644
--- a/embedserv/source/embed/tracker.cxx
+++ b/embedserv/source/embed/tracker.cxx
@@ -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;
diff --git a/embedserv/source/inprocserv/dllentry.cxx b/embedserv/source/inprocserv/dllentry.cxx
index 65d8bc550a4b..963342c819f8 100644
--- a/embedserv/source/inprocserv/dllentry.cxx
+++ b/embedserv/source/inprocserv/dllentry.cxx
@@ -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,
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 );
}
diff --git a/fpicker/source/win32/FilterContainer.cxx b/fpicker/source/win32/FilterContainer.cxx
index 088c4744db05..a9a85f3ca48e 100644
--- a/fpicker/source/win32/FilterContainer.cxx
+++ b/fpicker/source/win32/FilterContainer.cxx
@@ -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 ) );
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx
index d4a9915a5dd5..168595f63d41 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -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();
if (!is_current_process_window(hwnd_parent))
@@ -93,7 +93,7 @@ static const GUID CLIENTID_FILEOPEN_PLAY = {0x32CFB147, 0xF5AE, 0x4F9
static const GUID CLIENTID_FILEOPEN_LINK = {0x39AC4BAE, 0x7D2D, 0x46BC, 0xBE, 0x2E, 0xF8, 0x8C, 0xB5, 0x65, 0x5E, 0x6A};
-OUString lcl_getURLFromShellItem (IShellItem* pItem)
+static OUString lcl_getURLFromShellItem (IShellItem* pItem)
{
LPWSTR pStr = nullptr;
OUString sURL;
@@ -148,7 +148,7 @@ bailout:
}
-::std::vector< COMDLG_FILTERSPEC > lcl_buildFilterList(CFilterContainer& rContainer)
+static ::std::vector< COMDLG_FILTERSPEC > lcl_buildFilterList(CFilterContainer& rContainer)
{
::std::vector< COMDLG_FILTERSPEC > lList ;
CFilterContainer::FILTER_ENTRY_T aFilter;
@@ -1088,7 +1088,7 @@ TFileDialogCustomize VistaFilePickerImpl::impl_getCustomizeInterface()
}
-void lcl_removeControlItemsWorkaround(const TFileDialogCustomize& iCustom ,
+static void lcl_removeControlItemsWorkaround(const TFileDialogCustomize& iCustom ,
::sal_Int16 nControlId)
{
::sal_Int32 i = 0;
diff --git a/fpicker/source/win32/WinImplHelper.cxx b/fpicker/source/win32/WinImplHelper.cxx
index 09de0484e134..71d391f19aee 100644
--- a/fpicker/source/win32/WinImplHelper.cxx
+++ b/fpicker/source/win32/WinImplHelper.cxx
@@ -48,7 +48,7 @@ const sal_Unicode AMPERSAND_SIGN = L'&';
// Windows ME VER_PLATFORM_WIN32_WINDOWS 4 90
-void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, OUStringBuffer& aBuffer )
+static void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, OUStringBuffer& aBuffer )
{
OSL_ASSERT( aLabel.getLength( ) );
OSL_ASSERT( aBuffer.getCapacity( ) >= (aLabel.getLength( )) );
diff --git a/fpicker/source/win32/resourceprovider.cxx b/fpicker/source/win32/resourceprovider.cxx
index a0d536f23032..4d0d76e0f997 100644
--- a/fpicker/source/win32/resourceprovider.cxx
+++ b/fpicker/source/win32/resourceprovider.cxx
@@ -68,7 +68,7 @@ Entry const CtrlIdToResIdTable[] = {
const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable );
-const char* CtrlIdToResId( sal_Int32 aControlId )
+static const char* CtrlIdToResId( sal_Int32 aControlId )
{
const char* pResId = nullptr;
diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx
index 8ecb9696fa83..fe8a11de80bd 100644
--- a/hwpfilter/source/grammar.cxx
+++ b/hwpfilter/source/grammar.cxx
@@ -445,7 +445,7 @@ static int yyparse();
#endif
#endif
-int
+static int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index a188cf5d765b..b4b7584af060 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -187,7 +187,7 @@ bool Options::setOption(char const * option, std::string const & rArg)
a windows short Url. The ucpp preprocessor has problems with such paths and returns
with error.
*/
-OString convertIncPathtoShortWindowsPath(const OString& incPath) {
+static OString convertIncPathtoShortWindowsPath(const OString& incPath) {
OUString path = OStringToOUString(incPath, RTL_TEXTENCODING_UTF8);
std::vector<sal_Unicode> vec(path.getLength() + 1);
diff --git a/jurt/source/pipe/wrapper/wrapper.c b/jurt/source/pipe/wrapper/wrapper.c
index 28d16690b54e..83e70dc6fb84 100644
--- a/jurt/source/pipe/wrapper/wrapper.c
+++ b/jurt/source/pipe/wrapper/wrapper.c
@@ -33,7 +33,7 @@ static HMODULE module = NULL;
static HINSTANCE hInstDLL = NULL;
static CRITICAL_SECTION CriticalSection;
-void InitWrapper(void) {
+static void InitWrapper(void) {
#define MAXPATH 512
wchar_t path[MAXPATH];
DWORD size;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 250a7655ffba..52a9b063c900 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -114,8 +114,8 @@ char const *g_arSearchPaths[] = {
namespace jfw_plugin
{
#if defined(_WIN32)
-bool getSDKInfoFromRegistry(vector<OUString> & vecHome);
-bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome);
+static bool getSDKInfoFromRegistry(vector<OUString> & vecHome);
+static bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome);
#endif
static bool decodeOutput(const OString& s, OUString* out);
@@ -568,7 +568,7 @@ bool decodeOutput(const OString& s, OUString* out)
#if defined(_WIN32)
-bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
+static bool getJavaInfoFromRegistry(const wchar_t* szRegKey,
vector<OUString>& vecJavaHome)
{
HKEY hRoot;
@@ -650,7 +650,7 @@ bool getJREInfoFromRegistry(vector<OUString>& vecJavaHome)
return getJavaInfoFromRegistry(HKEY_SUN_JRE, vecJavaHome);
}
-void addJavaInfoFromWinReg(
+static void addJavaInfoFromWinReg(
std::vector<rtl::Reference<VendorBase> > & allInfos,
std::vector<rtl::Reference<VendorBase> > & addedInfos)
{
diff --git a/odk/source/unoapploader/win/unoapploader.c b/odk/source/unoapploader/win/unoapploader.c
index d7a20e8f13ec..dd5cfaf78439 100644
--- a/odk/source/unoapploader/win/unoapploader.c
+++ b/odk/source/unoapploader/win/unoapploader.c
@@ -33,11 +33,11 @@
#define MY_SIZE(s) (sizeof (s) / sizeof *(s))
#define MY_LENGTH(s) (MY_SIZE(s) - 1)
-wchar_t* getPath(void);
-wchar_t* createCommandLine( wchar_t const * lpCmdLine );
-FILE* getErrorFile( int create );
-void writeError( const char* errstr );
-void closeErrorFile(void);
+static wchar_t* getPath(void);
+static wchar_t* createCommandLine( wchar_t const * lpCmdLine );
+static FILE* getErrorFile( int create );
+static void writeError( const char* errstr );
+static void closeErrorFile(void);
/*
* The main function implements a loader for applications which use UNO.
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index c26d58c36fb8..7580e32789e3 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -31,7 +31,7 @@
#define MY_LENGTH(s) (sizeof (s) / sizeof *(s) - 1)
#define MY_STRING(s) (s), MY_LENGTH(s)
-wchar_t * encode(wchar_t * buffer, wchar_t const * text) {
+static wchar_t * encode(wchar_t * buffer, wchar_t const * text) {
*buffer++ = L'"';
std::size_t n = 0;
for (;;) {
diff --git a/sal/osl/w32/file-impl.hxx b/sal/osl/w32/file-impl.hxx
index 4db7b3eb257b..550a22dbf6f9 100644
--- a/sal/osl/w32/file-impl.hxx
+++ b/sal/osl/w32/file-impl.hxx
@@ -18,7 +18,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-extern "C" oslFileHandle SAL_CALL osl_createFileHandleFromOSHandle(
+extern "C" oslFileHandle osl_createFileHandleFromOSHandle(
HANDLE hFile, sal_uInt32 uFlags);
#endif
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 78dfaa046939..c8b001e9847d 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -25,6 +25,7 @@
#include <sal/log.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
+#include "file-impl.hxx"
#include "file_url.hxx"
#include "file_error.hxx"
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index 268c32a75dda..5e630c95a5ee 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -367,7 +367,7 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath)
return static_cast<HANDLE>(pDirectory);
}
-BOOL WINAPI EnumDirectory(HANDLE hDirectory, LPWIN32_FIND_DATAW pFindData)
+static BOOL WINAPI EnumDirectory(HANDLE hDirectory, LPWIN32_FIND_DATAW pFindData)
{
BOOL fSuccess = FALSE;
LPDIRECTORY pDirectory = static_cast<LPDIRECTORY>(hDirectory);
@@ -1149,7 +1149,7 @@ static inline bool is_floppy_A_present()
static inline bool is_floppy_B_present()
{ return (GetLogicalDrives() & 2); }
-bool is_floppy_volume_mount_point(const rtl::OUString& path)
+static bool is_floppy_volume_mount_point(const rtl::OUString& path)
{
// determines if a volume mount point shows to a floppy
// disk by comparing the unique volume names
diff --git a/sal/osl/w32/nlsupport.cxx b/sal/osl/w32/nlsupport.cxx
index d79d49bdd2f5..10888b9d6915 100644
--- a/sal/osl/w32/nlsupport.cxx
+++ b/sal/osl/w32/nlsupport.cxx
@@ -57,7 +57,7 @@ static DWORD g_dwTLSLocaleEncId = DWORD(-1);
* callback function test
*****************************************************************************/
-BOOL CALLBACK EnumLocalesProcW( LPWSTR lpLocaleStringW )
+static BOOL CALLBACK EnumLocalesProcW( LPWSTR lpLocaleStringW )
{
/* check params received via TLS */
EnumLocalesParams * params = static_cast<EnumLocalesParams *>(TlsGetValue( g_dwTLSLocaleEncId ));
@@ -111,7 +111,7 @@ BOOL CALLBACK EnumLocalesProcW( LPWSTR lpLocaleStringW )
return TRUE;
}
-rtl_TextEncoding GetTextEncodingFromLCID( LCID localeId )
+static rtl_TextEncoding GetTextEncodingFromLCID( LCID localeId )
{
rtl_TextEncoding Encoding = RTL_TEXTENCODING_DONTKNOW;
WCHAR ansiCP[6];
diff --git a/sal/osl/w32/pipe.cxx b/sal/osl/w32/pipe.cxx
index 92ec4f918354..2e469b93e8c5 100644
--- a/sal/osl/w32/pipe.cxx
+++ b/sal/osl/w32/pipe.cxx
@@ -59,7 +59,7 @@ struct oslPipeImpl
bool m_bClosed;
};
-oslPipe osl_createPipeImpl(void)
+static oslPipe osl_createPipeImpl(void)
{
oslPipe pPipe;
@@ -78,7 +78,7 @@ oslPipe osl_createPipeImpl(void)
return pPipe;
}
-void osl_destroyPipeImpl(oslPipe pPipe)
+static void osl_destroyPipeImpl(oslPipe pPipe)
{
if (pPipe)
{
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index e25e35cbdc24..130bdcdb9f05 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -224,7 +224,7 @@ struct LeakWarning
static LeakWarning socketWarning;
#endif
-oslSocket createSocketImpl(SOCKET Socket)
+static oslSocket createSocketImpl(SOCKET Socket)
{
oslSocket pSockImpl = static_cast<oslSocket>(rtl_allocateZeroMemory( sizeof(struct oslSocketImpl)));
pSockImpl->m_Socket = Socket;
@@ -232,7 +232,7 @@ oslSocket createSocketImpl(SOCKET Socket)
return pSockImpl;
}
-void destroySocketImpl(oslSocketImpl *pImpl)
+static void destroySocketImpl(oslSocketImpl *pImpl)
{
if (pImpl)
{
diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx
index 22c5df241c21..17f749bc270c 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -52,12 +52,12 @@ static void wait_for_seconds(char* time)
#ifdef _WIN32
-void w_to_a(LPCWSTR strW, LPSTR strA, DWORD size)
+static void w_to_a(LPCWSTR strW, LPSTR strA, DWORD size)
{
WideCharToMultiByte(CP_ACP, 0, strW, -1, strA, size, nullptr, nullptr);
}
- void dump_env(char* file_path)
+ static void dump_env(char* file_path)
{
LPWSTR env = GetEnvironmentStringsW();
LPWSTR p = env;
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<LPWSTR>(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<wchar_t *>(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 <spellchecker_selection.hxx>
-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<char *>(""), &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<wchar_t *>(L""), &sz ) == ERROR_MORE_DATA )
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index bec2b5cbf825..261ef18a1fa3 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -50,7 +50,7 @@
#if defined(_WIN32)
-OUString SfxDdeServiceName_Impl( const OUString& sIn )
+static OUString SfxDdeServiceName_Impl( const OUString& sIn )
{
OUStringBuffer sReturn(sIn.getLength());
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index 47fb95c37f4a..6575d098f1d2 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -263,7 +263,7 @@ static void addTaskbarIcon( HWND hWnd )
}
-LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static UINT s_uTaskbarRestart = 0;
static UINT s_uMsgKillTray = 0;
@@ -387,7 +387,7 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
}
-LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
@@ -447,7 +447,7 @@ LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
}
-DWORD WINAPI SystrayThread( LPVOID /*lpParam*/ )
+static DWORD WINAPI SystrayThread( LPVOID /*lpParam*/ )
{
osl_setThreadName("SystrayThread");
@@ -673,7 +673,7 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
// code from setup2 project
-void SHFree_( void *pv )
+static void SHFree_( void *pv )
{
IMalloc *pMalloc;
if( NOERROR == SHGetMalloc(&pMalloc) )
@@ -729,7 +729,7 @@ static HRESULT WINAPI SHCoCreateInstance( LPVOID lpszReserved, REFCLSID clsid, L
return hResult;
}
-BOOL CreateShortcut( const OUString& rAbsObject, const OUString& rAbsObjectPath,
+static BOOL CreateShortcut( const OUString& rAbsObject, const OUString& rAbsObjectPath,
const OUString& rAbsShortcut, const OUString& rDescription, const OUString& rParameter )
{
HRESULT hres;
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index 0e0f53c10e4f..87d021a6d0e7 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -40,7 +40,7 @@
#endif
#include <windows.h>
-css::beans::Optional<css::uno::Any> ImplGetLocale(LCID lcid)
+static css::beans::Optional<css::uno::Any> ImplGetLocale(LCID lcid)
{
WCHAR buffer[8];
PWSTR cp = buffer;
diff --git a/shell/source/tools/regsvrex/regsvrex.cxx b/shell/source/tools/regsvrex/regsvrex.cxx
index 7fe5a0d95c3b..c7fb87943a5d 100644
--- a/shell/source/tools/regsvrex/regsvrex.cxx
+++ b/shell/source/tools/regsvrex/regsvrex.cxx
@@ -24,7 +24,7 @@
typedef HRESULT (__stdcall *lpfnDllRegisterServer)();
typedef HRESULT (__stdcall *lpfnDllUnregisterServer)();
-bool IsUnregisterParameter(const wchar_t* Param)
+static bool IsUnregisterParameter(const wchar_t* Param)
{
return ((0 == _wcsicmp(Param, L"/u")) ||
(0 == _wcsicmp(Param, L"-u")));
diff --git a/shell/source/win32/ooofilereader/metainforeader.cxx b/shell/source/win32/ooofilereader/metainforeader.cxx
index 52a9117d7e4e..1f87bba8dccb 100644
--- a/shell/source/win32/ooofilereader/metainforeader.cxx
+++ b/shell/source/win32/ooofilereader/metainforeader.cxx
@@ -168,7 +168,7 @@ std::wstring CMetaInfoReader::getTagAttribute(const std::wstring& TagName, cons
*/
const LocaleSet_t EN_US_LOCALE( ::std::make_pair( ::std::wstring( L"en" ), ::std::wstring( L"US" )));
-bool isValidLocale(const ::std::wstring& Locale)
+static bool isValidLocale(const ::std::wstring& Locale)
{
return ( Locale.length() == 5 );
}
diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx
index 088eb8e5a983..3a18895bf189 100644
--- a/shell/source/win32/shlxthandler/infotips/infotips.cxx
+++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx
@@ -101,7 +101,7 @@ ULONG STDMETHODCALLTYPE CInfoTip::Release()
/** get file type information from registry.
*/
-std::wstring getFileTypeInfo(const std::wstring& file_extension)
+static std::wstring getFileTypeInfo(const std::wstring& file_extension)
{
wchar_t extKeyValue[MAX_STRING];
wchar_t typeKeyValue[MAX_STRING];
@@ -115,7 +115,7 @@ std::wstring getFileTypeInfo(const std::wstring& file_extension)
/** get file size.
*/
-DWORD getSizeOfFile( wchar_t const * FileName )
+static DWORD getSizeOfFile( wchar_t const * FileName )
{
HANDLE hFile = CreateFileW(FileName, // open file
GENERIC_READ, // open for reading
@@ -137,7 +137,7 @@ DWORD getSizeOfFile( wchar_t const * FileName )
/** format file size in to be more readable.
*/
-std::wstring formatSizeOfFile( DWORD dwSize )
+static std::wstring formatSizeOfFile( DWORD dwSize )
{
if ( dwSize < 1000 )
{
@@ -178,7 +178,7 @@ std::wstring formatSizeOfFile( DWORD dwSize )
/** get file size information.
*/
-std::wstring getFileSizeInfo(wchar_t const * FileName)
+static std::wstring getFileSizeInfo(wchar_t const * FileName)
{
DWORD dwSize=getSizeOfFile(FileName);
if (dwSize != INVALID_FILE_SIZE)
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 8782704180ad..8f9ac227b137 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -62,6 +62,8 @@
#include <stream_helper.hxx>
+#include <olectl.h> // declarations of DllRegisterServer/DllUnregisterServer
+
//C-------------------------------------------------------------------------
// Class: COooFilter
// Summary: Implements LibreOffice filter class
@@ -436,7 +438,7 @@ SCODE STDMETHODCALLTYPE COooFilter::GetText(ULONG * pcwcBuffer, WCHAR * awcBuffe
// Returns: corresponding metainfo names.
-::std::wstring GetMetaInfoNameFromPropertyId( ULONG ulPropID )
+static ::std::wstring GetMetaInfoNameFromPropertyId( ULONG ulPropID )
{
switch ( ulPropID )
{
diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx
index 8cf408688ab6..6ca91f0d98ed 100644
--- a/shell/source/win32/shlxthandler/shlxthdl.cxx
+++ b/shell/source/win32/shlxthandler/shlxthdl.cxx
@@ -28,6 +28,7 @@
#include <string>
#include <shlobj.h>
+#include <olectl.h> // declarations of DllRegisterServer/DllUnregisterServer
// Module global
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index cdc5d97622ec..c6dc1253b953 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -45,7 +45,7 @@ namespace internal
/* The signet.png used for thumbnails of signed documents
is contained as resource in this module, the resource
id is 2000 */
- void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& buffer)
+ static void LoadSignetImageFromResource(ZipFile::ZipContentBuffer_t& buffer)
{
HRSRC hrc = FindResourceW(g_hModule, L"#2000", RT_RCDATA);
DWORD size = SizeofResource(g_hModule, hrc);
@@ -54,12 +54,12 @@ namespace internal
buffer = ZipFile::ZipContentBuffer_t(data, data + size);
}
- bool IsSignedDocument(const ZipFile* zipfile)
+ static bool IsSignedDocument(const ZipFile* zipfile)
{
return zipfile->HasContent("META-INF/documentsignatures.xml");
}
- Gdiplus::Point CalcSignetPosition(
+ static Gdiplus::Point CalcSignetPosition(
const Gdiplus::Rect& canvas, const Gdiplus::Rect& thumbnail_border, const Gdiplus::Rect& signet)
{
int x = 0;
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index e4f9c3b3dfd9..fc56630504c6 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -39,7 +39,7 @@
#include <stdexcept>
#if OSL_DEBUG_LEVEL > 0
- void dumpParameter();
+ static void dumpParameter();
#endif
typedef std::vector<MapiRecipDescW> MapiRecipientList_t;
@@ -75,7 +75,7 @@ namespace /* private */
@returns
the email address prefixed with the specified prefix.
*/
-inline std::wstring prefixEmailAddress(
+static inline std::wstring prefixEmailAddress(
const std::wstring& aEmailAddress,
const std::wstring& aPrefix = L"SMTP:")
{
@@ -83,7 +83,7 @@ inline std::wstring prefixEmailAddress(
}
/** @internal */
-void addRecipient(
+static void addRecipient(
ULONG recipClass,
const std::wstring& recipAddress,
MapiRecipientList_t* pMapiRecipientList)
@@ -98,7 +98,7 @@ void addRecipient(
}
/** @internal */
-void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
+static void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
{
OSL_ASSERT(pMapiRecipientList->empty());
@@ -116,7 +116,7 @@ void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
}
/** @internal */
-void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
+static void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
{
OSL_ASSERT(pMapiAttachmentList->empty());
@@ -140,7 +140,7 @@ void initAttachmentList(MapiAttachmentList_t* pMapiAttachmentList)
}
/** @internal */
-void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
+static void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
{
ZeroMemory(pMapiOriginator, sizeof(*pMapiOriginator));
@@ -150,7 +150,7 @@ void initMapiOriginator(MapiRecipDescW* pMapiOriginator)
}
/** @internal */
-void initMapiMessage(
+static void initMapiMessage(
MapiRecipDescW* aMapiOriginator,
MapiRecipientList_t& aMapiRecipientList,
MapiAttachmentList_t& aMapiAttachmentList,
@@ -184,7 +184,7 @@ const wchar_t* const KnownParameters[] =
};
/** @internal */
-bool isKnownParameter(const wchar_t* aParameterName)
+static bool isKnownParameter(const wchar_t* aParameterName)
{
for (const wchar_t* KnownParameter : KnownParameters)
if (_wcsicmp(aParameterName, KnownParameter) == 0)
@@ -194,7 +194,7 @@ bool isKnownParameter(const wchar_t* aParameterName)
}
/** @internal */
-void initParameter(int argc, wchar_t* argv[])
+static void initParameter(int argc, wchar_t* argv[])
{
for (int i = 1; i < argc; i++)
{
@@ -249,7 +249,7 @@ void initParameter(int argc, wchar_t* argv[])
}
}
-void ShowError(ULONG nMAPIResult)
+static void ShowError(ULONG nMAPIResult)
{
if (!gBootstrap.isEmpty())
rtl::Bootstrap::setIniFilename(gBootstrap);
diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 829d1923fe5f..c4818263b832 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -17,7 +17,7 @@
#include <stdio.h>
// Display confirmation dialog, return false on negative answer
-bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
+static bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
{
// TODO: change wording (currently taken from MS Office), use LO localization
wchar_t sBuf[65536];
@@ -30,7 +30,7 @@ bool SecurityWarning(const wchar_t* sProgram, const wchar_t* sDocument)
}
// Returns S_OK if successful
-HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool bDoSecurityWarning)
+static HRESULT LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath, bool bDoSecurityWarning)
{
const wchar_t* sProgram = GetLOPath();
if (bDoSecurityWarning && !SecurityWarning(sProgram, sFilePath))
diff --git a/shell/source/win32/spsupp/spsuppServ.cxx b/shell/source/win32/spsupp/spsuppServ.cxx
index 6fdd4c0e5396..78af725bec60 100644
--- a/shell/source/win32/spsupp/spsuppServ.cxx
+++ b/shell/source/win32/spsupp/spsuppServ.cxx
@@ -26,6 +26,8 @@
#include <COMOpenDocuments.hpp>
#include <registrar.hpp>
+#include <shlwapi.h> // declaration of DllInstall
+
namespace {
HANDLE g_hModule;
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 6a8554eea66e..244d32a3d335 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -19,12 +19,12 @@
#ifdef _WIN32
//#include <Windows.h> // come from LibreOfficeKitInit.h
- long getTimeMS()
+ static long getTimeMS()
{
return GetTickCount();
}
- bool IsAbsolutePath(char const *pPath)
+ static bool IsAbsolutePath(char const *pPath)
{
if (pPath[1] != ':')
{
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index 2a4569591ca7..0d1091fa7d7e 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -49,7 +49,7 @@ void PrivateProfileStringListener::Initialize( const OUString& rFileName, const
maKey = rKey;
}
#ifdef _WIN32
-void lcl_getRegKeyInfo( const OString& sKeyInfo, HKEY& hBaseKey, OString& sSubKey )
+static void lcl_getRegKeyInfo( const OString& sKeyInfo, HKEY& hBaseKey, OString& sSubKey )
{
sal_Int32 nBaseKeyIndex = sKeyInfo.indexOf('\\');
if( nBaseKeyIndex > 0 )
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 58ec8f730c29..5441b3b22a42 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -77,7 +77,7 @@ void WinOpenGLContext::resetCurrent()
g_bAnyCurrent = false;
}
-void ensureDispatchTable()
+static void ensureDispatchTable()
{
thread_local bool bEpoxyDispatchMakeCurrentCalled = false;
if (!bEpoxyDispatchMakeCurrentCalled)
@@ -189,7 +189,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
}
}
-bool InitTempWindow(HWND& hwnd, int width, int height, const PIXELFORMATDESCRIPTOR& inPfd, GLWinWindow& glWin)
+static bool InitTempWindow(HWND& hwnd, int width, int height, const PIXELFORMATDESCRIPTOR& inPfd, GLWinWindow& glWin)
{
OpenGLZone aZone;
@@ -245,7 +245,7 @@ bool InitTempWindow(HWND& hwnd, int width, int height, const PIXELFORMATDESCRIPT
return true;
}
-bool WGLisExtensionSupported(const char *extension)
+static bool WGLisExtensionSupported(const char *extension)
{
OpenGLZone aZone;
@@ -284,7 +284,7 @@ bool WGLisExtensionSupported(const char *extension)
}
}
-bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
+static bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
bool bUseDoubleBufferedRendering, bool bRequestVirtualDevice)
{
OpenGLZone aZone;
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index d7f8da7471f9..1c67113322dc 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -85,7 +85,7 @@ void SalAbort( const OUString& rErrorText, bool )
}
}
-LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
+static LRESULT CALLBACK SalComWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
class SalYieldMutex : public comphelper::SolarMutex
{
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 017431ed7107..d446ec877a98 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -335,7 +335,7 @@ void WinSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcG
}
}
-void ImplCalcOutSideRgn( const RECT& rSrcRect,
+static void ImplCalcOutSideRgn( const RECT& rSrcRect,
int nLeft, int nTop, int nRight, int nBottom,
HRGN& rhInvalidateRgn )
{
@@ -1824,7 +1824,7 @@ bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
return bRet;
}
-basegfx::B2DPoint impPixelSnap(
+static basegfx::B2DPoint impPixelSnap(
const basegfx::B2DPolygon& rPolygon,
const basegfx::B2DHomMatrix& rObjectToDevice,
basegfx::B2DHomMatrix& rObjectToDeviceInv,
@@ -1866,7 +1866,7 @@ basegfx::B2DPoint impPixelSnap(
return rPolygon.getB2DPoint(nIndex);
}
-void impAddB2DPolygonToGDIPlusGraphicsPathReal(
+static void impAddB2DPolygonToGDIPlusGraphicsPathReal(
Gdiplus::GraphicsPath& rGraphicsPath,
const basegfx::B2DPolygon& rPolygon,
const basegfx::B2DHomMatrix& rObjectToDevice,
@@ -2274,7 +2274,7 @@ bool WinSalGraphicsImpl::drawPolyLine(
return true;
}
-void paintToGdiPlus(
+static void paintToGdiPlus(
Gdiplus::Graphics& rGraphics,
const SalTwoRect& rTR,
Gdiplus::Bitmap& rBitmap)
@@ -2305,7 +2305,7 @@ void paintToGdiPlus(
&aAttributes);
}
-void setInterpolationMode(
+static void setInterpolationMode(
Gdiplus::Graphics& rGraphics,
long rSrcWidth,
long rDestWidth,
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 664eedb6d269..4d21fde79da9 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -48,7 +48,7 @@
#undef max
#endif
-inline void ImplSetPixel4( sal_uInt8* pScanline, long nX, const BYTE cIndex )
+static inline 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 d49040201cd7..ba205d1c8d74 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -67,13 +67,13 @@ static o3tl::lru_map<sal_GlyphId, tools::Rectangle> g_BoundRectCache(3000);
static const int MAXFONTHEIGHT = 2048;
-inline FIXED FixedFromDouble( double d )
+static inline FIXED FixedFromDouble( double d )
{
const long l = static_cast<long>( d * 65536. );
return *reinterpret_cast<FIXED const *>(&l);
}
-inline int IntTimes256FromFixed(FIXED f)
+static inline int IntTimes256FromFixed(FIXED f)
{
int nFixedTimes256 = (f.value << 8) + ((f.fract+0x80) >> 8);
return nFixedTimes256;
@@ -493,7 +493,7 @@ static int ImplWeightToWin( FontWeight eWeight )
return 0;
}
-inline FontPitch ImplLogPitchToSal( BYTE nPitch )
+static inline FontPitch ImplLogPitchToSal( BYTE nPitch )
{
if ( nPitch & FIXED_PITCH )
return PITCH_FIXED;
@@ -501,7 +501,7 @@ inline FontPitch ImplLogPitchToSal( BYTE nPitch )
return PITCH_VARIABLE;
}
-inline FontPitch ImplMetricPitchToSal( BYTE nPitch )
+static inline FontPitch ImplMetricPitchToSal( BYTE nPitch )
{
// Grrrr! See NT help
if ( !(nPitch & TMPF_FIXED_PITCH) )
@@ -510,7 +510,7 @@ inline FontPitch ImplMetricPitchToSal( BYTE nPitch )
return PITCH_VARIABLE;
}
-inline BYTE ImplPitchToWin( FontPitch ePitch )
+static inline BYTE ImplPitchToWin( FontPitch ePitch )
{
if ( ePitch == PITCH_FIXED )
return FIXED_PITCH;
@@ -750,7 +750,7 @@ void WinSalGraphics::SetTextColor( Color nColor )
::SetTextColor( getHDC(), aCol );
}
-int CALLBACK SalEnumQueryFontProcExW( const LOGFONTW*,
+static int CALLBACK SalEnumQueryFontProcExW( const LOGFONTW*,
const TEXTMETRICW*,
DWORD, LPARAM lParam )
{
@@ -1013,7 +1013,7 @@ bool WinSalGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilitie
return mpWinFontEntry[0]->GetFontFace()->GetFontCapabilities(rFontCapabilities);
}
-int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
+static int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
const TEXTMETRICW* lpntme,
DWORD nFontType, LPARAM lParam )
{
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx
index e295264a9890..7db333117402 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -343,7 +343,7 @@ bool WinSalGraphics::hitTestNativeControl( ControlType,
return FALSE;
}
-bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
+static bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, const OUString& aStr)
{
HRESULT hr = vsAPI.DrawThemeBackground( hTheme, hDC, iPart, iState, &rc, nullptr);
@@ -359,7 +359,7 @@ bool ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, cons
return (hr == S_OK);
}
-tools::Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const tools::Rectangle& /* aRect */, THEMESIZE eTS = TS_TRUE )
+static tools::Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const tools::Rectangle& /* aRect */, THEMESIZE eTS = TS_TRUE )
{
SIZE aSz;
HRESULT hr = vsAPI.GetThemePartSize( hTheme, hDC, iPart, iState, nullptr, eTS, &aSz ); // TS_TRUE returns optimal size
@@ -371,7 +371,7 @@ tools::Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState
// Helper functions
-void ImplConvertSpinbuttonValues( ControlPart nControlPart, const ControlState& rState, const tools::Rectangle& rRect,
+static void ImplConvertSpinbuttonValues( ControlPart nControlPart, const ControlState& rState, const tools::Rectangle& rRect,
int* pLunaPart, int *pLunaState, RECT *pRect )
{
if( nControlPart == ControlPart::ButtonDown )
@@ -523,7 +523,7 @@ static tools::Rectangle GetMenuPopupMarkRegion(const ImplControlValue& rValue)
return aRet;
}
-bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
+static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ControlType nType,
ControlPart nPart,
ControlState nState,
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 4e2b7788ce05..a2b78b990920 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -1283,7 +1283,7 @@ std::unique_ptr<SalPrinter> WinSalInstance::CreatePrinter( SalInfoPrinter* pInfo
return std::unique_ptr<SalPrinter>(pPrinter);
}
-BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
+static BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{
SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 8b815f42c008..35da3a0b5f04 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1100,7 +1100,7 @@ void WinSalFrame::DrawMenuBar()
::DrawMenuBar( mhWnd );
}
-HWND ImplGetParentHwnd( HWND hWnd )
+static HWND ImplGetParentHwnd( HWND hWnd )
{
WinSalFrame* pFrame = GetWindowPtr( hWnd );
if( !pFrame || !pFrame->GetWindow())
@@ -2500,7 +2500,7 @@ OUString WinSalFrame::GetKeyName( sal_uInt16 nKeyCode )
return OUString( aKeyBuf, sal::static_int_cast< sal_uInt16 >(nKeyBufLen) );
}
-inline Color ImplWinColorToSal( COLORREF nColor )
+static inline Color ImplWinColorToSal( COLORREF nColor )
{
return Color( GetRValue( nColor ), GetGValue( nColor ), GetBValue( nColor ) );
}
@@ -5427,7 +5427,7 @@ static bool ImplSalWheelMousePos( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
return true;
}
-LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, bool& rDef )
+static LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, bool& rDef )
{
LRESULT nRet = 0;
static bool bInWheelMsg = false;
diff --git a/vcl/win/window/salmenu.cxx b/vcl/win/window/salmenu.cxx
index 0b14967bdc61..8caaf1227b9f 100644
--- a/vcl/win/window/salmenu.cxx
+++ b/vcl/win/window/salmenu.cxx
@@ -199,7 +199,7 @@ void WinSalMenu::RemoveItem( unsigned nPos )
}
}
-void ImplRemoveItemById( WinSalMenu *pSalMenu, unsigned nItemId )
+static void ImplRemoveItemById( WinSalMenu *pSalMenu, unsigned nItemId )
{
if( !pSalMenu )
return;
diff --git a/vcl/win/window/salobj.cxx b/vcl/win/window/salobj.cxx
index fcc2cd043f92..f03d2b71afce 100644
--- a/vcl/win/window/salobj.cxx
+++ b/vcl/win/window/salobj.cxx
@@ -66,7 +66,7 @@ WinSalObject* ImplFindSalObject( HWND hWndChild )
return nullptr;
}
-WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
+static WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
{
WinSalFrame* pFrame = nullptr;
WinSalObject* pObject = ImplFindSalObject( hWnd );
@@ -87,7 +87,7 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
return pFrame;
}
-LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
+static LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
{
// Used for Unicode and none Unicode
SalData* pSalData = GetSalData();
@@ -258,7 +258,7 @@ void ImplSalPostDispatchMsg( const MSG* pMsg )
pSalData->mnSalObjWantKeyEvt = 0;
}
-LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
+static LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
{
WinSalObject* pSysObj;
LRESULT nRet = 0;
@@ -375,7 +375,7 @@ LRESULT CALLBACK SalSysObjWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM l
return nRet;
}
-LRESULT CALLBACK SalSysObjWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+static LRESULT CALLBACK SalSysObjWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
int bDef = TRUE;
LRESULT nRet = SalSysObjWndProc( hWnd, nMsg, wParam, lParam, bDef );
@@ -384,7 +384,7 @@ LRESULT CALLBACK SalSysObjWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM
return nRet;
}
-LRESULT CALLBACK SalSysObjChildWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
+static LRESULT CALLBACK SalSysObjChildWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
{
LRESULT nRet = 0;
@@ -446,7 +446,7 @@ LRESULT CALLBACK SalSysObjChildWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPA
return nRet;
}
-LRESULT CALLBACK SalSysObjChildWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
+static LRESULT CALLBACK SalSysObjChildWndProcW( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam )
{
int bDef = TRUE;
LRESULT nRet = SalSysObjChildWndProc( hWnd, nMsg, wParam, lParam, bDef );
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index a560cedfcef0..9ec187480861 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2541,7 +2541,7 @@ BOOL CMAccessible::GetXInterfaceFromXAccessible(XAccessible* pXAcc, XInterface**
return FALSE;
}
-template<typename T> HRESULT
+template<typename T> static HRESULT
createAggInstance(CMAccessible &rOuter, void ** ppvObject)
{
// Note: CComAggObject has special handling for IUnknown - must
diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx
index 2982ca82e0e2..1025b597c08c 100644
--- a/winaccessibility/source/service/msaaservice_impl.cxx
+++ b/winaccessibility/source/service/msaaservice_impl.cxx
@@ -240,7 +240,7 @@ static void AccessBridgeUpdateOldTopWindows( const Reference< XMSAAService > &xA
* @param xContext No use here.
* @return The object interface.
*/
-Reference< XInterface > create_MSAAServiceImpl( Reference< XComponentContext > const & /*xContext*/ )
+static Reference< XInterface > create_MSAAServiceImpl( Reference< XComponentContext > const & /*xContext*/ )
{
Reference< XMSAAService > xAccMgr( new MSAAServiceImpl() );
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index cc1ea218d844..2a545ba568b5 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -93,7 +93,7 @@ CertErrorToString const arErrStrings[] =
{ 0x00080000, "CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE"}
};
-void traceTrustStatus(DWORD err)
+static void traceTrustStatus(DWORD err)
{
if (err == 0)
SAL_INFO("xmlsecurity.xmlsec", " " << arErrStrings[0].name);
@@ -281,7 +281,9 @@ static OUString get_system_name(const void *pvSystemStore,
return o3tl::toU(ppwszSystemName);
}
-extern "C" BOOL WINAPI cert_enum_physical_store_callback(const void *,
+extern "C" {
+
+static BOOL WINAPI cert_enum_physical_store_callback(const void *,
DWORD dwFlags,
LPCWSTR pwszStoreName,
PCERT_PHYSICAL_STORE_INFO,
@@ -296,7 +298,7 @@ extern "C" BOOL WINAPI cert_enum_physical_store_callback(const void *,
return TRUE;
}
-extern "C" BOOL WINAPI cert_enum_system_store_callback(const void *pvSystemStore,
+static BOOL WINAPI cert_enum_system_store_callback(const void *pvSystemStore,
DWORD dwFlags,
PCERT_SYSTEM_STORE_INFO,
void *,
@@ -319,6 +321,8 @@ extern "C" BOOL WINAPI cert_enum_system_store_callback(const void *pvSystemStore
return TRUE;
}
+}
+
#endif
//Methods from XSecurityEnvironment
@@ -750,7 +754,7 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificat
}
-HCERTSTORE getCertStoreForIntermediatCerts(
+static HCERTSTORE getCertStoreForIntermediatCerts(
const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts)
{
HCERTSTORE store = nullptr;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d88280573f5e..b8783440ea10 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -55,7 +55,7 @@ using ::com::sun::star::util::DateTime ;
"S" or "CN" (without ""). Do not use spaces at the beginning of the type name.
If the type name is not found then pair.first and pair.second are -1.
*/
-std::pair< sal_Int32, sal_Int32 >
+static std::pair< sal_Int32, sal_Int32 >
findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
{
std::pair< sal_Int32, sal_Int32 > retVal;
@@ -158,7 +158,7 @@ findTypeInDN(const OUString& rRawString, const OUString& sTypeName)
strings for type names. Instead it uses OIDs.
*/
-OUString replaceTagSWithTagST(OUString const & oldDN)
+static OUString replaceTagSWithTagST(OUString const & oldDN)
{
std::pair<sal_Int32, sal_Int32 > pairIndex = findTypeInDN(oldDN, "S");
@@ -480,7 +480,7 @@ X509Certificate_MSCryptImpl* X509Certificate_MSCryptImpl::getImplementation( con
return nullptr ;
}
-OUString findOIDDescription(char const *oid)
+static OUString findOIDDescription(char const *oid)
{
OUString ouOID = OUString::createFromAscii( oid );
for (int i=0; i<nOID; i++)
@@ -495,7 +495,7 @@ OUString findOIDDescription(char const *oid)
return OUString() ;
}
-css::uno::Sequence< sal_Int8 > getThumbprint(const CERT_CONTEXT* pCertContext, DWORD dwPropId)
+static css::uno::Sequence< sal_Int8 > getThumbprint(const CERT_CONTEXT* pCertContext, DWORD dwPropId)
{
if( pCertContext != nullptr )
{