Nest all namespaces

The compiler supports this now.  We can type less going forward.
No functional changes.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/aos/events/epoll.cc b/aos/events/epoll.cc
index 340d0cd..8c5c3e1 100644
--- a/aos/events/epoll.cc
+++ b/aos/events/epoll.cc
@@ -15,8 +15,7 @@
 
 #include "aos/time/time.h"
 
-namespace aos {
-namespace internal {
+namespace aos::internal {
 
 TimerFd::TimerFd()
     : fd_(timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) {
@@ -298,5 +297,4 @@
       << ": Failed to " << operation << " epoll fd: " << event_data->fd;
 }
 
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal
diff --git a/aos/events/epoll_test.cc b/aos/events/epoll_test.cc
index b725747..e1be563 100644
--- a/aos/events/epoll_test.cc
+++ b/aos/events/epoll_test.cc
@@ -6,9 +6,7 @@
 #include "glog/logging.h"
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace internal {
-namespace testing {
+namespace aos::internal::testing {
 
 // A simple wrapper around both ends of a pipe along with some helpers to easily
 // read/write data through it.
@@ -204,6 +202,4 @@
   epoll_.Run();
 }
 
-}  // namespace testing
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal::testing
diff --git a/aos/events/event_loop_param_test.cc b/aos/events/event_loop_param_test.cc
index 5ec494f..58bfd9b 100644
--- a/aos/events/event_loop_param_test.cc
+++ b/aos/events/event_loop_param_test.cc
@@ -15,8 +15,7 @@
 #include "aos/logging/logging.h"
 #include "aos/realtime.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 namespace chrono = ::std::chrono;
 }  // namespace
@@ -3692,5 +3691,4 @@
   EXPECT_EQ(SendTestMessage(sender1), RawSender::Error::kMessagesSentTooFast);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/glib_main_loop_test.cc b/aos/events/glib_main_loop_test.cc
index aabab68..6fced6d 100644
--- a/aos/events/glib_main_loop_test.cc
+++ b/aos/events/glib_main_loop_test.cc
@@ -10,8 +10,7 @@
 #include "aos/events/shm_event_loop.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 using aos::testing::ArtifactPath;
 
 const FlatbufferDetachedBuffer<Configuration> &Config() {
@@ -128,5 +127,4 @@
   EXPECT_EQ(runs, 1);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/logging/config_remapper_test.cc b/aos/events/logging/config_remapper_test.cc
index a1fedb2..f33f421 100644
--- a/aos/events/logging/config_remapper_test.cc
+++ b/aos/events/logging/config_remapper_test.cc
@@ -14,8 +14,7 @@
 #include "aos/testing/tmpdir.h"
 #include "multinode_logger_test_lib.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 using namespace logger::testing;
 using namespace logger;
 namespace chrono = std::chrono;
@@ -97,5 +96,4 @@
   EXPECT_EQ(channel->type()->string_view(), "aos.timing.Report");
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/logging/log_namer.cc b/aos/events/logging/log_namer.cc
index 6682ae3..3bbca3b 100644
--- a/aos/events/logging/log_namer.cc
+++ b/aos/events/logging/log_namer.cc
@@ -19,8 +19,7 @@
 
 DECLARE_int32(flush_size);
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 
 NewDataWriter::NewDataWriter(LogNamer *log_namer, const Node *node,
                              const Node *logger_node,
@@ -1192,5 +1191,4 @@
                      &data_writer->writer);
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/log_writer.cc b/aos/events/logging/log_writer.cc
index bc81a4b..f840c22 100644
--- a/aos/events/logging/log_writer.cc
+++ b/aos/events/logging/log_writer.cc
@@ -13,8 +13,7 @@
 #include "aos/network/timestamp_channel.h"
 #include "aos/sha256.h"
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 namespace {
 using message_bridge::RemoteMessage;
 namespace chrono = std::chrono;
@@ -921,5 +920,4 @@
   }
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/logfile_sorting.cc b/aos/events/logging/logfile_sorting.cc
index f67a88a..2eaf00b 100644
--- a/aos/events/logging/logfile_sorting.cc
+++ b/aos/events/logging/logfile_sorting.cc
@@ -27,8 +27,7 @@
 DEFINE_bool(quiet_sorting, false,
             "If true, sort with minimal messages about truncated files.");
 
-namespace aos {
-namespace logger {
+namespace aos::logger {
 namespace {
 namespace chrono = std::chrono;
 
@@ -2381,5 +2380,4 @@
   return false;
 }
 
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger
diff --git a/aos/events/logging/logfile_utils_test.cc b/aos/events/logging/logfile_utils_test.cc
index ea56d8d..30a0ada 100644
--- a/aos/events/logging/logfile_utils_test.cc
+++ b/aos/events/logging/logfile_utils_test.cc
@@ -22,9 +22,7 @@
 #include "aos/testing/tmpdir.h"
 #include "aos/util/file.h"
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
 using aos::testing::ArtifactPath;
@@ -3386,6 +3384,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 5990a7a..3f0b182 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -26,9 +26,7 @@
 #include "aos/events/logging/lzma_encoder.h"
 #endif
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
@@ -579,6 +577,4 @@
   EXPECT_EQ(replay_count, sent_messages);
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/multinode_logger_test.cc b/aos/events/logging/multinode_logger_test.cc
index b8d07a2..3c438e3 100644
--- a/aos/events/logging/multinode_logger_test.cc
+++ b/aos/events/logging/multinode_logger_test.cc
@@ -12,9 +12,7 @@
 #include "aos/network/timestamp_generated.h"
 #include "aos/testing/tmpdir.h"
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 namespace chrono = std::chrono;
 using aos::message_bridge::RemoteMessage;
@@ -4682,6 +4680,4 @@
   auto result = ConfirmReadable(filenames);
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/logging/multinode_logger_test_lib.cc b/aos/events/logging/multinode_logger_test_lib.cc
index 9b3e00c..ed62a2e 100644
--- a/aos/events/logging/multinode_logger_test_lib.cc
+++ b/aos/events/logging/multinode_logger_test_lib.cc
@@ -11,9 +11,7 @@
 
 DECLARE_bool(force_timestamp_loading);
 
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
 
 using aos::testing::ArtifactPath;
 
@@ -626,6 +624,4 @@
   return result;
 }
 
-}  // namespace testing
-}  // namespace logger
-}  // namespace aos
+}  // namespace aos::logger::testing
diff --git a/aos/events/pingpong_test.cc b/aos/events/pingpong_test.cc
index d35192a..c52e8eb 100644
--- a/aos/events/pingpong_test.cc
+++ b/aos/events/pingpong_test.cc
@@ -7,8 +7,7 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 
 using aos::testing::ArtifactPath;
 
@@ -168,5 +167,4 @@
   EXPECT_EQ(pi2_ping_count, 1001);
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/shm_event_loop_test.cc b/aos/events/shm_event_loop_test.cc
index 2134687..4db0c7d 100644
--- a/aos/events/shm_event_loop_test.cc
+++ b/aos/events/shm_event_loop_test.cc
@@ -10,8 +10,7 @@
 #include "aos/network/team_number.h"
 #include "aos/realtime.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 namespace chrono = ::std::chrono;
 
@@ -447,5 +446,4 @@
 INSTANTIATE_TEST_SUITE_P(ShmEventLoopPinDeathTest, ShmEventLoopDeathTest,
                          ::testing::Values(ReadMethod::PIN));
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/simulated_event_loop_test.cc b/aos/events/simulated_event_loop_test.cc
index 23badae..050c9a3 100644
--- a/aos/events/simulated_event_loop_test.cc
+++ b/aos/events/simulated_event_loop_test.cc
@@ -19,8 +19,7 @@
 #include "aos/network/timestamp_generated.h"
 #include "aos/testing/path.h"
 
-namespace aos {
-namespace testing {
+namespace aos::testing {
 namespace {
 
 using aos::testing::ArtifactPath;
@@ -2462,5 +2461,4 @@
   }
 }
 
-}  // namespace testing
-}  // namespace aos
+}  // namespace aos::testing
diff --git a/aos/events/simulated_network_bridge.cc b/aos/events/simulated_network_bridge.cc
index 3ed39fa..5c97292 100644
--- a/aos/events/simulated_network_bridge.cc
+++ b/aos/events/simulated_network_bridge.cc
@@ -7,8 +7,7 @@
 #include "aos/events/simulated_event_loop.h"
 #include "aos/network/remote_message_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 // This class delays messages forwarded between two factories.
 //
@@ -760,5 +759,4 @@
   });
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/events/timing_statistics.cc b/aos/events/timing_statistics.cc
index caf71da..ea3f2d2 100644
--- a/aos/events/timing_statistics.cc
+++ b/aos/events/timing_statistics.cc
@@ -4,8 +4,7 @@
 
 #include "aos/events/event_loop_generated.h"
 
-namespace aos {
-namespace internal {
+namespace aos::internal {
 
 void RawFetcherTiming::set_timing_report(timing::Fetcher *new_fetcher) {
   fetcher = new_fetcher;
@@ -74,5 +73,4 @@
   timer->mutate_count(0);
 }
 
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal
diff --git a/aos/events/timing_statistics_test.cc b/aos/events/timing_statistics_test.cc
index 9a7fefc..a8a45eb 100644
--- a/aos/events/timing_statistics_test.cc
+++ b/aos/events/timing_statistics_test.cc
@@ -4,9 +4,7 @@
 
 #include "aos/flatbuffers.h"
 
-namespace aos {
-namespace internal {
-namespace testing {
+namespace aos::internal::testing {
 
 TEST(TimingStatistic, StatisticsTest) {
   flatbuffers::FlatBufferBuilder fbb;
@@ -67,6 +65,4 @@
   EXPECT_NEAR(statistic.message().standard_deviation(), 5.2372293656638, 1e-6);
 }
 
-}  // namespace testing
-}  // namespace internal
-}  // namespace aos
+}  // namespace aos::internal::testing