diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-15 19:13:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-17 09:05:38 +0200 |
commit | 206b5b2661be37efdff3c6aedb6f248c4636be79 (patch) | |
tree | af385e5b4725dcfea23988d9113cced8e9ccaf3c /animations | |
parent | a85d3ba1c0de313b60324b9ecfa488bb99d69d06 (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 'animations')
-rw-r--r-- | animations/source/animcore/animcore.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 5e0bff6362a8..12ba771046ab 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -491,112 +491,112 @@ AnimationNode::AnimationNode( const AnimationNode& rNode ) { } -Sequence<OUString> getSupportedServiceNames_PAR() +static Sequence<OUString> getSupportedServiceNames_PAR() { return { "com.sun.star.animations.ParallelTimeContainer" }; } -OUString getImplementationName_PAR() +static OUString getImplementationName_PAR() { return OUString( "animcore::ParallelTimeContainer" ); } -Sequence<OUString> getSupportedServiceNames_SEQ() +static Sequence<OUString> getSupportedServiceNames_SEQ() { return { "com.sun.star.animations.SequenceTimeContainer" }; } -OUString getImplementationName_SEQ() +static OUString getImplementationName_SEQ() { return OUString( "animcore::SequenceTimeContainer" ); } -Sequence<OUString> getSupportedServiceNames_ITERATE() +static Sequence<OUString> getSupportedServiceNames_ITERATE() { return { "com.sun.star.animations.IterateContainer" }; } -OUString getImplementationName_ITERATE() +static OUString getImplementationName_ITERATE() { return OUString( "animcore::IterateContainer" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATE() +static Sequence<OUString> getSupportedServiceNames_ANIMATE() { return { "com.sun.star.animations.Animate" }; } -OUString getImplementationName_ANIMATE() +static OUString getImplementationName_ANIMATE() { return OUString( "animcore::Animate" ); } -Sequence<OUString> getSupportedServiceNames_SET() +static Sequence<OUString> getSupportedServiceNames_SET() { return { "com.sun.star.animations.AnimateSet" }; } -OUString getImplementationName_SET() +static OUString getImplementationName_SET() { return OUString( "animcore::AnimateSet" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATECOLOR() +static Sequence<OUString> getSupportedServiceNames_ANIMATECOLOR() { return { "com.sun.star.animations.AnimateColor" }; } -OUString getImplementationName_ANIMATECOLOR() +static OUString getImplementationName_ANIMATECOLOR() { return OUString( "animcore::AnimateColor" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATEMOTION() +static Sequence<OUString> getSupportedServiceNames_ANIMATEMOTION() { return { "com.sun.star.animations.AnimateMotion" }; } -OUString getImplementationName_ANIMATEMOTION() +static OUString getImplementationName_ANIMATEMOTION() { return OUString( "animcore::AnimateMotion" ); } -Sequence<OUString> getSupportedServiceNames_ANIMATETRANSFORM() +static Sequence<OUString> getSupportedServiceNames_ANIMATETRANSFORM() { return { "com.sun.star.animations.AnimateTransform" }; } -OUString getImplementationName_ANIMATETRANSFORM() +static OUString getImplementationName_ANIMATETRANSFORM() { return OUString( "animcore::AnimateTransform" ); } -Sequence<OUString> getSupportedServiceNames_TRANSITIONFILTER() +static Sequence<OUString> getSupportedServiceNames_TRANSITIONFILTER() { return { "com.sun.star.animations.TransitionFilter" }; } -OUString getImplementationName_TRANSITIONFILTER() +static OUString getImplementationName_TRANSITIONFILTER() { return OUString( "animcore::TransitionFilter" ); } -Sequence<OUString> getSupportedServiceNames_AUDIO() +static Sequence<OUString> getSupportedServiceNames_AUDIO() { return { "com.sun.star.animations.Audio" }; } -OUString getImplementationName_AUDIO() +static OUString getImplementationName_AUDIO() { return OUString( "animcore::Audio" ); } -Sequence<OUString> getSupportedServiceNames_COMMAND() +static Sequence<OUString> getSupportedServiceNames_COMMAND() { return { "com.sun.star.animations.Command" }; } -OUString getImplementationName_COMMAND() +static OUString getImplementationName_COMMAND() { return OUString( "animcore::Command" ); } |