aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/support
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2017-11-28 09:13:27 -0800
committerGravatar Mark D. Roth <roth@google.com>2017-11-28 09:13:27 -0800
commitd3984c32c8e773a4d6caf6e3eb5536cbd7cddf17 (patch)
treed22e7f371373de83f17f5428c7bc68eb33885c09 /src/core/lib/support
parent3228489f0ba812b4d773136ddc697fb3e6b90bf1 (diff)
clang-format
Diffstat (limited to 'src/core/lib/support')
-rw-r--r--src/core/lib/support/debug_location.h1
-rw-r--r--src/core/lib/support/reference_counted.cc4
-rw-r--r--src/core/lib/support/reference_counted.h2
-rw-r--r--src/core/lib/support/reference_counted_ptr.h8
4 files changed, 6 insertions, 9 deletions
diff --git a/src/core/lib/support/debug_location.h b/src/core/lib/support/debug_location.h
index 0095941ce3..47c5082874 100644
--- a/src/core/lib/support/debug_location.h
+++ b/src/core/lib/support/debug_location.h
@@ -28,6 +28,7 @@ class DebugLocation {
bool Log() const { return true; }
const char* file() const { return file_; }
int line() const { return line_; }
+
private:
const char* file_;
const int line_;
diff --git a/src/core/lib/support/reference_counted.cc b/src/core/lib/support/reference_counted.cc
index 84ede18efe..222628a6fa 100644
--- a/src/core/lib/support/reference_counted.cc
+++ b/src/core/lib/support/reference_counted.cc
@@ -34,9 +34,7 @@ void ReferenceCounted::Ref(const DebugLocation& location, const char* reason) {
Ref();
}
-void ReferenceCounted::Ref() {
- gpr_ref(&refs_);
-}
+void ReferenceCounted::Ref() { gpr_ref(&refs_); }
bool ReferenceCounted::Unref(const DebugLocation& location,
const char* reason) {
diff --git a/src/core/lib/support/reference_counted.h b/src/core/lib/support/reference_counted.h
index 0076aa562c..42bedcbd3a 100644
--- a/src/core/lib/support/reference_counted.h
+++ b/src/core/lib/support/reference_counted.h
@@ -40,7 +40,7 @@ class ReferenceCounted {
protected:
// Allow Delete() to access destructor.
- template<typename T>
+ template <typename T>
friend void Delete(T*);
explicit ReferenceCounted(TraceFlag* trace_flag) : trace_flag_(trace_flag) {
diff --git a/src/core/lib/support/reference_counted_ptr.h b/src/core/lib/support/reference_counted_ptr.h
index e4599a5965..3782380943 100644
--- a/src/core/lib/support/reference_counted_ptr.h
+++ b/src/core/lib/support/reference_counted_ptr.h
@@ -27,15 +27,13 @@ namespace grpc_core {
// A smart pointer class for objects that provide Ref() and Unref() methods,
// such as those provided by the ReferenceCounted base class.
-template<typename T>
+template <typename T>
class ReferenceCountedPtr {
public:
ReferenceCountedPtr() {}
// If value is non-null, we take ownership of a ref to it.
- explicit ReferenceCountedPtr(T* value) {
- value_ = value;
- }
+ explicit ReferenceCountedPtr(T* value) { value_ = value; }
// Move support.
ReferenceCountedPtr(ReferenceCountedPtr&& other) {
@@ -80,7 +78,7 @@ class ReferenceCountedPtr {
T* value_ = nullptr;
};
-template<typename T, typename... Args>
+template <typename T, typename... Args>
inline ReferenceCountedPtr<T> MakeReferenceCounted(Args&&... args) {
return ReferenceCountedPtr<T>(New<T>(std::forward<Args>(args)...));
}