summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods.cxx
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 /basic/source/runtime/methods.cxx
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 'basic/source/runtime/methods.cxx')
-rw-r--r--basic/source/runtime/methods.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index b9bdbec05748..629e3728980c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -327,7 +327,7 @@ void SbRtl_Asc(StarBASIC *, SbxArray & rPar, bool)
}
}
-void implChr( SbxArray& rPar, bool bChrW )
+static void implChr( SbxArray& rPar, bool bChrW )
{
if ( rPar.Count() < 2 )
{
@@ -631,7 +631,7 @@ void SbRtl_MkDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite)
// In OSL only empty directories can be deleted
// so we have to delete all files recursively
-void implRemoveDirRecursive( const OUString& aDirPath )
+static void implRemoveDirRecursive( const OUString& aDirPath )
{
DirectoryItem aItem;
FileBase::RC nRet = DirectoryItem::get( aDirPath, aItem );
@@ -2521,7 +2521,7 @@ void SbRtl_IsMissing(StarBASIC *, SbxArray & rPar, bool)
}
// Function looks for wildcards, removes them and always returns the pure path
-OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData )
+static OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData )
{
static sal_Char cDelim1 = '/';
static sal_Char cDelim2 = '\\';
@@ -2587,7 +2587,7 @@ OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData )
return aPathStr;
}
-inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLData )
+static inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLData )
{
bool bMatch = true;
@@ -2599,7 +2599,7 @@ inline bool implCheckWildcard( const OUString& rName, SbiRTLData const * pRTLDat
}
-bool isRootDir( const OUString& aDirURLStr )
+static bool isRootDir( const OUString& aDirURLStr )
{
INetURLObject aDirURLObj( aDirURLStr );
bool bRoot = false;
@@ -3725,7 +3725,7 @@ OUString getBasicTypeName( SbxDataType eType )
return OUString::createFromAscii(pTypeNames[nPos]);
}
-OUString getObjectTypeName( SbxVariable* pVar )
+static OUString getObjectTypeName( SbxVariable* pVar )
{
OUString sRet( "Object" );
if ( pVar )