Consistent formatting for Dawn/Tint.
This CL updates the clang format files to have a single shared format
between Dawn and Tint. The major changes are tabs are 4 spaces, lines
are 100 columns and namespaces are not indented.
Bug: dawn:1339
Change-Id: I4208742c95643998d9fd14e77a9cc558071ded39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87603
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/utils/defer.h b/src/tint/utils/defer.h
index ce586f9..f073fb9 100644
--- a/src/tint/utils/defer.h
+++ b/src/tint/utils/defer.h
@@ -24,38 +24,37 @@
/// Defer executes a function or function like object when it is destructed.
template <typename F>
class Defer {
- public:
- /// Constructor
- /// @param f the function to call when the Defer is destructed
- explicit Defer(F&& f) : f_(std::move(f)) {}
+ public:
+ /// Constructor
+ /// @param f the function to call when the Defer is destructed
+ explicit Defer(F&& f) : f_(std::move(f)) {}
- /// Move constructor
- Defer(Defer&&) = default;
+ /// Move constructor
+ Defer(Defer&&) = default;
- /// Destructor
- /// Calls the deferred function
- ~Defer() { f_(); }
+ /// Destructor
+ /// Calls the deferred function
+ ~Defer() { f_(); }
- private:
- Defer(const Defer&) = delete;
- Defer& operator=(const Defer&) = delete;
+ private:
+ Defer(const Defer&) = delete;
+ Defer& operator=(const Defer&) = delete;
- F f_;
+ F f_;
};
/// Constructor
/// @param f the function to call when the Defer is destructed
template <typename F>
inline Defer<F> MakeDefer(F&& f) {
- return Defer<F>(std::forward<F>(f));
+ return Defer<F>(std::forward<F>(f));
}
} // namespace tint::utils
/// TINT_DEFER(S) executes the statement(s) `S` when exiting the current lexical
/// scope.
-#define TINT_DEFER(S) \
- auto TINT_CONCAT(tint_defer_, __COUNTER__) = \
- ::tint::utils::MakeDefer([&] { S; })
+#define TINT_DEFER(S) \
+ auto TINT_CONCAT(tint_defer_, __COUNTER__) = ::tint::utils::MakeDefer([&] { S; })
#endif // SRC_TINT_UTILS_DEFER_H_