Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/40095 )

Change subject: base: Style fixes in base/refcnt.hh
......................................................................

base: Style fixes in base/refcnt.hh

Change-Id: I8f4b2710bea1fe15baa1b482ff62fbab645a3690
---
M src/base/refcnt.hh
1 file changed, 43 insertions(+), 16 deletions(-)



diff --git a/src/base/refcnt.hh b/src/base/refcnt.hh
index 263666e..3106a6f 100644
--- a/src/base/refcnt.hh
+++ b/src/base/refcnt.hh
@@ -96,7 +96,12 @@

     /// Decrement the reference count and destroy the object if all
     /// references are gone.
-    void decref() const { if (--count <= 0) delete this; }
+    void
+    decref() const
+    {
+        if (--count <= 0)
+            delete this;
+    }
 };

 /**
@@ -228,11 +233,15 @@
     const RefCountingPtr &operator=(T *p) { set(p); return *this; }

     /// Copy the pointer from another RefCountingPtr
-    const RefCountingPtr &operator=(const RefCountingPtr &r)
-    { return operator=(r.data); }
+    const RefCountingPtr &
+    operator=(const RefCountingPtr &r)
+    {
+        return operator=(r.data);
+    }

     /// Move-assign the pointer from another RefCountingPtr
-    const RefCountingPtr &operator=(RefCountingPtr&& r)
+    const RefCountingPtr &
+    operator=(RefCountingPtr&& r)
     {
/* This happens regardless of whether the pointer is the same or not, * because of the move semantics, the rvalue needs to be 'destroyed'.
@@ -252,36 +261,54 @@

 /// Check for equality of two reference counting pointers.
 template<class T>
-inline bool operator==(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r)
-{ return l.get() == r.get(); }
+inline bool
+operator==(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r)
+{
+    return l.get() == r.get();
+}

 /// Check for equality of of a reference counting pointers and a
 /// regular pointer
 template<class T>
-inline bool operator==(const RefCountingPtr<T> &l, const T *r)
-{ return l.get() == r; }
+inline bool
+operator==(const RefCountingPtr<T> &l, const T *r)
+{
+    return l.get() == r;
+}

 /// Check for equality of of a reference counting pointers and a
 /// regular pointer
 template<class T>
-inline bool operator==(const T *l, const RefCountingPtr<T> &r)
-{ return l == r.get(); }
+inline bool
+operator==(const T *l, const RefCountingPtr<T> &r)
+{
+    return l == r.get();
+}

 /// Check for inequality of two reference counting pointers.
 template<class T>
-inline bool operator!=(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r)
-{ return l.get() != r.get(); }
+inline bool
+operator!=(const RefCountingPtr<T> &l, const RefCountingPtr<T> &r)
+{
+    return l.get() != r.get();
+}

 /// Check for inequality of of a reference counting pointers and a
 /// regular pointer
 template<class T>
-inline bool operator!=(const RefCountingPtr<T> &l, const T *r)
-{ return l.get() != r; }
+inline bool
+operator!=(const RefCountingPtr<T> &l, const T *r)
+{
+    return l.get() != r;
+}

 /// Check for inequality of of a reference counting pointers and a
 /// regular pointer
 template<class T>
-inline bool operator!=(const T *l, const RefCountingPtr<T> &r)
-{ return l != r.get(); }
+inline bool
+operator!=(const T *l, const RefCountingPtr<T> &r)
+{
+    return l != r.get();
+}

 #endif // __BASE_REFCNT_HH__

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40095
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8f4b2710bea1fe15baa1b482ff62fbab645a3690
Gerrit-Change-Number: 40095
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to