diff --git a/src/core/ref-count-base.h b/src/core/ref-count-base.h index 4ce8440c9..4fa704488 100644 --- a/src/core/ref-count-base.h +++ b/src/core/ref-count-base.h @@ -50,14 +50,15 @@ public: * conjunction with the Ptr template which would make calling Ref * unecessary and dangerous. */ - inline void Ref () const; + inline void Ref (void) const; /** * Decrement the reference count. This method should not be called * by user code. RefCountBase instances are expected to be used in * conjunction with the Ptr template which would make calling Ref * unecessary and dangerous. */ - inline void Unref () const; + inline void Unref (void) const; + private: // Note we make this mutable so that the const methods can still // change it. @@ -70,15 +71,16 @@ namespace ns3 { // Implementation of the in-line methods void -RefCountBase::Ref () const +RefCountBase::Ref (void) const { m_count++; } void -RefCountBase::Unref () const +RefCountBase::Unref (void) const { - if (--m_count == 0) + m_count--; + if (m_count == 0) { // All references removed, ok to delete delete this; }