summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-15 19:13:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-17 09:05:38 +0200
commit206b5b2661be37efdff3c6aedb6f248c4636be79 (patch)
treeaf385e5b4725dcfea23988d9113cced8e9ccaf3c /lingucomponent
parenta85d3ba1c0de313b60324b9ecfa488bb99d69d06 (diff)
New loplugin:external
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx2
-rw-r--r--lingucomponent/source/languageguessing/guess.cxx2
-rw-r--r--lingucomponent/source/languageguessing/guesslang.cxx2
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx2
-rw-r--r--lingucomponent/source/numbertext/numbertext.cxx2
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx2
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx2
7 files changed, 7 insertions, 7 deletions
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 422e219a59c9..307a1b61f3ea 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -701,7 +701,7 @@ OUString Hyphenator::makeInitCap(const OUString& aTerm, CharClass const * pCC)
}
/// @throws Exception
-Reference< XInterface > Hyphenator_CreateInstance(
+static Reference< XInterface > Hyphenator_CreateInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/ )
{
Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new Hyphenator);
diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx
index e802c0ed95e1..680aa4fd75ad 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -39,7 +39,7 @@
using namespace std;
-inline bool isSeparator(const char c){
+static inline bool isSeparator(const char c){
return c == GUESS_SEPARATOR_OPEN || c == GUESS_SEPARATOR_SEP || c == GUESS_SEPARATOR_CLOSE || c == '\0';
}
diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index 3d2107956c7c..8e2fc213d089 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -336,7 +336,7 @@ Sequence<OUString> LangGuess_Impl::getSupportedServiceNames_Static( )
* Function to create a new component instance; is needed by factory helper implementation.
* @param xMgr service manager to if the components needs other component instances
*/
-Reference< XInterface > LangGuess_Impl_create(
+static Reference< XInterface > LangGuess_Impl_create(
Reference< XComponentContext > const & )
{
return static_cast< ::cppu::OWeakObject * >( new LangGuess_Impl );
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index c480df86aa8f..ab36d54f416a 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -60,7 +60,7 @@ OString Win_AddLongPathPrefix( const OString &rPathName )
#ifdef SYSTEM_DICTS
// find old style dictionaries in system directories
-void GetOldStyleDicsInDir(
+static void GetOldStyleDicsInDir(
OUString const & aSystemDir, OUString const & aFormatName,
OUString const & aSystemSuffix, OUString const & aSystemPrefix,
std::set< OUString >& aDicLangInUse,
diff --git a/lingucomponent/source/numbertext/numbertext.cxx b/lingucomponent/source/numbertext/numbertext.cxx
index ee3ecbab9818..094920bf5802 100644
--- a/lingucomponent/source/numbertext/numbertext.cxx
+++ b/lingucomponent/source/numbertext/numbertext.cxx
@@ -180,7 +180,7 @@ Sequence<OUString> NumberText_Impl::getSupportedServiceNames_Static()
* Function to create a new component instance; is needed by factory helper implementation.
* @param xMgr service manager to if the components needs other component instances
*/
-Reference<XInterface> NumberText_Impl_create(Reference<XComponentContext> const&)
+static Reference<XInterface> NumberText_Impl_create(Reference<XComponentContext> const&)
{
return static_cast<::cppu::OWeakObject*>(new NumberText_Impl);
}
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 72019218ccbe..b4bf958a045e 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -523,7 +523,7 @@ Reference< XSpellAlternatives > SAL_CALL SpellChecker::spell(
}
/// @throws Exception
-Reference< XInterface > SpellChecker_CreateInstance(
+static Reference< XInterface > SpellChecker_CreateInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/ )
{
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 6ea501e327df..7936d1f4d642 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -472,7 +472,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM
}
/// @throws Exception
-Reference< XInterface > Thesaurus_CreateInstance(
+static Reference< XInterface > Thesaurus_CreateInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/ )
{
Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new Thesaurus);