From 7bc9ba13bdc1f5c1aa2e889113af8ac71abae786 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Thu, 7 Apr 2022 17:22:26 +0000 Subject: [PATCH] Condense namespaces in tint/diagnostic. This PR condenses the namespaces in the tint/diagnostic folder. Change-Id: Id1b2afca99a8f6aeccb505682aa0f0b4b0b4bb05 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86037 Auto-Submit: Dan Sinclair Reviewed-by: Ben Clayton Commit-Queue: Ben Clayton --- src/tint/diagnostic/diagnostic.cc | 6 ++---- src/tint/diagnostic/diagnostic.h | 6 ++---- src/tint/diagnostic/diagnostic_test.cc | 6 ++---- src/tint/diagnostic/formatter.cc | 6 ++---- src/tint/diagnostic/formatter.h | 6 ++---- src/tint/diagnostic/formatter_test.cc | 6 ++---- src/tint/diagnostic/printer.cc | 6 ++---- src/tint/diagnostic/printer.h | 6 ++---- src/tint/diagnostic/printer_linux.cc | 6 ++---- src/tint/diagnostic/printer_other.cc | 6 ++---- src/tint/diagnostic/printer_test.cc | 6 ++---- src/tint/diagnostic/printer_windows.cc | 6 ++---- 12 files changed, 24 insertions(+), 48 deletions(-) diff --git a/src/tint/diagnostic/diagnostic.cc b/src/tint/diagnostic/diagnostic.cc index f7b36a4dec..bd3f297cf6 100644 --- a/src/tint/diagnostic/diagnostic.cc +++ b/src/tint/diagnostic/diagnostic.cc @@ -18,8 +18,7 @@ #include "src/tint/diagnostic/formatter.h" -namespace tint { -namespace diag { +namespace tint::diag { Diagnostic::Diagnostic() = default; Diagnostic::Diagnostic(const Diagnostic&) = default; @@ -44,5 +43,4 @@ std::string List::str() const { return Formatter{style}.format(*this); } -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/diagnostic.h b/src/tint/diagnostic/diagnostic.h index 28b0c6686a..95df55366a 100644 --- a/src/tint/diagnostic/diagnostic.h +++ b/src/tint/diagnostic/diagnostic.h @@ -22,8 +22,7 @@ #include "src/tint/source.h" -namespace tint { -namespace diag { +namespace tint::diag { /// Severity is an enumerator of diagnostic severities. enum class Severity { Note, Warning, Error, InternalCompilerError, Fatal }; @@ -246,7 +245,6 @@ class List { size_t error_count_ = 0; }; -} // namespace diag -} // namespace tint +} // namespace tint::diag #endif // SRC_TINT_DIAGNOSTIC_DIAGNOSTIC_H_ diff --git a/src/tint/diagnostic/diagnostic_test.cc b/src/tint/diagnostic/diagnostic_test.cc index 940971bb56..8bf65e61fa 100644 --- a/src/tint/diagnostic/diagnostic_test.cc +++ b/src/tint/diagnostic/diagnostic_test.cc @@ -17,8 +17,7 @@ #include "gtest/gtest.h" #include "src/tint/diagnostic/diagnostic.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { TEST(DiagListTest, OwnedFilesShared) { @@ -38,5 +37,4 @@ TEST(DiagListTest, OwnedFilesShared) { } } // namespace -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/formatter.cc b/src/tint/diagnostic/formatter.cc index 1eabe91889..262be862c5 100644 --- a/src/tint/diagnostic/formatter.cc +++ b/src/tint/diagnostic/formatter.cc @@ -21,8 +21,7 @@ #include "src/tint/diagnostic/diagnostic.h" #include "src/tint/diagnostic/printer.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { const char* to_str(Severity severity) { @@ -267,5 +266,4 @@ std::string Formatter::format(const List& list) const { Formatter::~Formatter() = default; -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/formatter.h b/src/tint/diagnostic/formatter.h index 209bacb472..179bb2dd95 100644 --- a/src/tint/diagnostic/formatter.h +++ b/src/tint/diagnostic/formatter.h @@ -17,8 +17,7 @@ #include -namespace tint { -namespace diag { +namespace tint::diag { class Diagnostic; class List; @@ -66,7 +65,6 @@ class Formatter { const Style style_; }; -} // namespace diag -} // namespace tint +} // namespace tint::diag #endif // SRC_TINT_DIAGNOSTIC_FORMATTER_H_ diff --git a/src/tint/diagnostic/formatter_test.cc b/src/tint/diagnostic/formatter_test.cc index cee4140cd0..fc342fb6cc 100644 --- a/src/tint/diagnostic/formatter_test.cc +++ b/src/tint/diagnostic/formatter_test.cc @@ -19,8 +19,7 @@ #include "gtest/gtest.h" #include "src/tint/diagnostic/diagnostic.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { Diagnostic Diag(Severity severity, @@ -306,5 +305,4 @@ TEST_F(DiagFormatterTest, RangeOOB) { } } // namespace -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/printer.cc b/src/tint/diagnostic/printer.cc index 54fd5f78ad..a3e93bcffd 100644 --- a/src/tint/diagnostic/printer.cc +++ b/src/tint/diagnostic/printer.cc @@ -14,8 +14,7 @@ #include "src/tint/diagnostic/printer.h" -namespace tint { -namespace diag { +namespace tint::diag { Printer::~Printer() = default; @@ -30,5 +29,4 @@ void StringPrinter::write(const std::string& str, const Style&) { stream << str; } -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/printer.h b/src/tint/diagnostic/printer.h index 570223b17d..cb38ac89e1 100644 --- a/src/tint/diagnostic/printer.h +++ b/src/tint/diagnostic/printer.h @@ -19,8 +19,7 @@ #include #include -namespace tint { -namespace diag { +namespace tint::diag { class List; @@ -77,7 +76,6 @@ class StringPrinter : public Printer { std::stringstream stream; }; -} // namespace diag -} // namespace tint +} // namespace tint::diag #endif // SRC_TINT_DIAGNOSTIC_PRINTER_H_ diff --git a/src/tint/diagnostic/printer_linux.cc b/src/tint/diagnostic/printer_linux.cc index fc40cf3500..9d0e315649 100644 --- a/src/tint/diagnostic/printer_linux.cc +++ b/src/tint/diagnostic/printer_linux.cc @@ -18,8 +18,7 @@ #include "src/tint/diagnostic/printer.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { bool supports_colors(FILE* f) { @@ -96,5 +95,4 @@ std::unique_ptr Printer::create(FILE* out, bool use_colors) { return std::make_unique(out, use_colors); } -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/printer_other.cc b/src/tint/diagnostic/printer_other.cc index 21498beb78..65ef0ac94d 100644 --- a/src/tint/diagnostic/printer_other.cc +++ b/src/tint/diagnostic/printer_other.cc @@ -16,8 +16,7 @@ #include "src/tint/diagnostic/printer.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { class PrinterOther : public Printer { @@ -38,5 +37,4 @@ std::unique_ptr Printer::create(FILE* out, bool) { return std::make_unique(out); } -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/printer_test.cc b/src/tint/diagnostic/printer_test.cc index f0cf374624..bfc9d4339a 100644 --- a/src/tint/diagnostic/printer_test.cc +++ b/src/tint/diagnostic/printer_test.cc @@ -16,8 +16,7 @@ #include "gtest/gtest.h" -namespace tint { -namespace diag { +namespace tint::diag { namespace { // Actually verifying that the expected colors are printed is exceptionally @@ -94,5 +93,4 @@ TEST_F(PrinterTest, BoldWithoutColors) { #endif // ENABLE_PRINTER_TESTS } // namespace -} // namespace diag -} // namespace tint +} // namespace tint::diag diff --git a/src/tint/diagnostic/printer_windows.cc b/src/tint/diagnostic/printer_windows.cc index 9dcb43c5a6..e8ebc1923b 100644 --- a/src/tint/diagnostic/printer_windows.cc +++ b/src/tint/diagnostic/printer_windows.cc @@ -19,8 +19,7 @@ #define WIN32_LEAN_AND_MEAN 1 #include -namespace tint { -namespace diag { +namespace tint::diag { namespace { struct ConsoleInfo { @@ -109,5 +108,4 @@ std::unique_ptr Printer::create(FILE* out, bool use_colors) { return std::make_unique(out, use_colors); } -} // namespace diag -} // namespace tint +} // namespace tint::diag