From 928b1b04adc1cd49cc5d00069084e03675a320f3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 24 Sep 2018 15:41:53 +0200 Subject: loplugin:external (clang-cl) Including: * expanding STDAPI to its definition (as per "STDAPI"), to add __declspec(dllexport) into its middle, in extensions/source/activex/so_activex.cxx; as discussed in the comments at "Get rid of Windows .def files in setup_native, use __declspec(dllexport)", having a function both listed in a .def file EXPORTS and marking it dllexport is OK, and the latter helps the heuristics of loplugin:external; however, the relevant functions in extensions/source/activex/so_activex.cxx probably don't even need to be exported in the first place? * follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191 Reviewed-on: https://gerrit.libreoffice.org/60938 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 12 ++++++++---- .../source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'xmlsecurity') 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 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 getThumbprint(const CERT_CONTEXT* pCertContext, DWORD dwPropId) +static css::uno::Sequence< sal_Int8 > getThumbprint(const CERT_CONTEXT* pCertContext, DWORD dwPropId) { if( pCertContext != nullptr ) { -- cgit