[Libreoffice-commits] core.git: compilerplugins/clang sal/cpprt
Stephan Bergmann
sbergman at redhat.com
Tue Jun 28 20:39:27 UTC 2016
compilerplugins/clang/staticmethods.cxx | 5 -----
sal/cpprt/operators_new_delete.cxx | 4 ++--
2 files changed, 2 insertions(+), 7 deletions(-)
New commits:
commit 0d3f9667bbc7b1a22d33dc92a2028fc712495a8e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jun 28 22:38:57 2016 +0200
AllocatorTraits::size can be static after all
Change-Id: If9ce8a094af878497e980cdcfaf11604d613e5b8
diff --git a/compilerplugins/clang/staticmethods.cxx b/compilerplugins/clang/staticmethods.cxx
index 7eac313..c533242 100644
--- a/compilerplugins/clang/staticmethods.cxx
+++ b/compilerplugins/clang/staticmethods.cxx
@@ -117,12 +117,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
if (aParentName == "BitmapInfoAccess") {
return true;
}
- // can't change it because in debug mode it can't be static
- // sal/cpprt/operators_new_delete.cxx
auto dc = loplugin::DeclCheck(pCXXMethodDecl->getParent());
- if (dc.Struct("AllocatorTraits").AnonymousNamespace().GlobalNamespace()) {
- return true;
- }
// in this case, the code is taking the address of the member function
// shell/source/unix/sysshell/recently_used_file_handler.cxx
if (dc.Struct("recently_used_item").AnonymousNamespace().GlobalNamespace())
diff --git a/sal/cpprt/operators_new_delete.cxx b/sal/cpprt/operators_new_delete.cxx
index 8cf69ff..40fdd33 100644
--- a/sal/cpprt/operators_new_delete.cxx
+++ b/sal/cpprt/operators_new_delete.cxx
@@ -40,7 +40,7 @@ struct AllocatorTraits
: m_signature (s)
{}
- std::size_t size (std::size_t n) const
+ static std::size_t size (std::size_t n)
{
n = std::max(n, std::size_t(1));
#if OSL_DEBUG_LEVEL > 0
@@ -105,7 +105,7 @@ static void default_handler()
static void* allocate (
std::size_t n, AllocatorTraits const & rTraits)
{
- n = rTraits.size (n);
+ n = AllocatorTraits::size (n);
for (;;)
{
void * p = rtl_allocateMemory (sal_Size(n));
More information about the Libreoffice-commits
mailing list