From b49ecdeb964810a9040698096c25aa41c7688e7f Mon Sep 17 00:00:00 2001 From: blakcwhite Date: Fri, 21 Jan 2022 10:51:36 +0800 Subject: [PATCH] suited to specification Signed-off-by: zhoushilin --- base/src/refbase.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/base/src/refbase.cpp b/base/src/refbase.cpp index fd15b82..d01f082 100755 --- a/base/src/refbase.cpp +++ b/base/src/refbase.cpp @@ -103,7 +103,7 @@ RefCounter::~RefCounter() { } -int RefCounter::IncStrongRefCount(const void* /* objectId */) +int RefCounter::IncStrongRefCount(const void*) { int curCount = atomicStrong_.load(std::memory_order_relaxed); @@ -117,7 +117,7 @@ int RefCounter::IncStrongRefCount(const void* /* objectId */) return curCount; } -int RefCounter::DecStrongRefCount(const void* /* objectId */) +int RefCounter::DecStrongRefCount(const void*) { int curCount = GetStrongRefCount(); if (curCount == INITIAL_PRIMARY_VALUE) { @@ -136,12 +136,12 @@ int RefCounter::GetStrongRefCount() return atomicStrong_.load(std::memory_order_relaxed); } -int RefCounter::IncWeakRefCount(const void* /* objectId */) +int RefCounter::IncWeakRefCount(const void*) { return atomicWeak_.fetch_add(1, std::memory_order_relaxed); } -int RefCounter::DecWeakRefCount(const void* /* objectId */) +int RefCounter::DecWeakRefCount(const void*) { int curCount = GetWeakRefCount(); if (curCount > 0) { @@ -237,7 +237,7 @@ RefBase::RefBase() : refs_(new RefCounter()) refs_->SetCallback(std::bind(&RefBase::RefPtrCallback, this)); } -RefBase::RefBase(const RefBase & /* other */) +RefBase::RefBase(const RefBase &) { refs_ = new RefCounter(); if (refs_ != nullptr) { @@ -257,7 +257,7 @@ void RefBase::RefPtrCallback() * RISK: If there is a reference count on the left of the equal sign, * it may cause a reference count exception */ -RefBase &RefBase::operator=(const RefBase & /* other */) +RefBase &RefBase::operator=(const RefBase &) { if (refs_ != nullptr) { refs_->RemoveCallback(); @@ -426,16 +426,16 @@ bool RefBase::IsExtendLifeTimeSet() return refs_->IsLifeTimeExtended(); } -void RefBase::OnFirstStrongRef(const void* /* objectId */) +void RefBase::OnFirstStrongRef(const void*) {} -void RefBase::OnLastStrongRef(const void* /* objectId */) +void RefBase::OnLastStrongRef(const void*) {} -void RefBase::OnLastWeakRef(const void* /* objectId */) +void RefBase::OnLastWeakRef(const void*) {} -bool RefBase::OnAttemptPromoted(const void* /* objectId */) +bool RefBase::OnAttemptPromoted(const void*) { return true; } -- Gitee