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/network/message_bridge_client.cc b/aos/network/message_bridge_client.cc
index ef727eb..4a1992a 100644
--- a/aos/network/message_bridge_client.cc
+++ b/aos/network/message_bridge_client.cc
@@ -12,8 +12,7 @@
     wants_sctp_authentication, false,
     "When set, try to use SCTP authentication if provided by the kernel");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 using ::aos::util::ReadFileToVecOrDie;
 
@@ -42,8 +41,7 @@
   return EXIT_SUCCESS;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
 
 int main(int argc, char **argv) {
   aos::InitGoogle(&argc, &argv);
diff --git a/aos/network/message_bridge_client_lib.cc b/aos/network/message_bridge_client_lib.cc
index bb233a9..620a069 100644
--- a/aos/network/message_bridge_client_lib.cc
+++ b/aos/network/message_bridge_client_lib.cc
@@ -34,8 +34,7 @@
 // To restore it, run:
 //   tc qdisc del dev eth0 root netem
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 
@@ -541,5 +540,4 @@
   sender.CheckOk(sender.Send(builder.Finish()));
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_client_status.cc b/aos/network/message_bridge_client_status.cc
index 272e49e..9ca8418 100644
--- a/aos/network/message_bridge_client_status.cc
+++ b/aos/network/message_bridge_client_status.cc
@@ -7,8 +7,7 @@
 #include "aos/events/event_loop.h"
 #include "aos/network/message_bridge_client_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 
@@ -240,5 +239,4 @@
                               kStatisticsPeriod);
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_protocol.cc b/aos/network/message_bridge_protocol.cc
index c661c4c..c527957 100644
--- a/aos/network/message_bridge_protocol.cc
+++ b/aos/network/message_bridge_protocol.cc
@@ -9,8 +9,7 @@
 #include "aos/flatbuffers.h"
 #include "aos/network/connect_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 aos::FlatbufferDetachedBuffer<aos::message_bridge::Connect> MakeConnectMessage(
     const Configuration *config, const Node *my_node,
@@ -66,5 +65,4 @@
   return fbb.Release();
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_retry_test.cc b/aos/network/message_bridge_retry_test.cc
index 4110a76..8229c99 100644
--- a/aos/network/message_bridge_retry_test.cc
+++ b/aos/network/message_bridge_retry_test.cc
@@ -18,10 +18,7 @@
 
 DECLARE_int32(force_wmem_max);
 
-namespace aos {
-
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 void SendPing(aos::Sender<examples::Ping> *sender, int value) {
   aos::Sender<examples::Ping>::Builder builder = sender->MakeBuilder();
@@ -136,6 +133,4 @@
                          ::testing::Values(Param{
                              "message_bridge_test_common_config.json", false}));
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/message_bridge_server.cc b/aos/network/message_bridge_server.cc
index be6cc8e..64c57f5 100644
--- a/aos/network/message_bridge_server.cc
+++ b/aos/network/message_bridge_server.cc
@@ -14,8 +14,7 @@
     wants_sctp_authentication, false,
     "When set, try to use SCTP authentication if provided by the kernel");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 using ::aos::util::ReadFileToVecOrDie;
 
@@ -43,8 +42,7 @@
   return EXIT_SUCCESS;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
 
 int main(int argc, char **argv) {
   aos::InitGoogle(&argc, &argv);
diff --git a/aos/network/message_bridge_server_lib.cc b/aos/network/message_bridge_server_lib.cc
index 4f582e7..a2df830 100644
--- a/aos/network/message_bridge_server_lib.cc
+++ b/aos/network/message_bridge_server_lib.cc
@@ -57,8 +57,7 @@
 
 DECLARE_bool(use_sctp_authentication);
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace chrono = std::chrono;
 
 // How often we should poll for the active SCTP authentication key.
@@ -862,5 +861,4 @@
   sender.CheckOk(sender.Send(builder.Finish()));
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_server_status.cc b/aos/network/message_bridge_server_status.cc
index f540b1e..0e8c6b0 100644
--- a/aos/network/message_bridge_server_status.cc
+++ b/aos/network/message_bridge_server_status.cc
@@ -12,8 +12,7 @@
 #include "aos/network/timestamp_filter.h"
 #include "aos/network/timestamp_generated.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 
 namespace chrono = std::chrono;
@@ -507,5 +506,4 @@
                               kPingPeriod);
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index cc46926..c211c89 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -16,10 +16,7 @@
 #include "aos/testing/path.h"
 #include "aos/util/file.h"
 
-namespace aos {
-
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 // Note: All of these tests spin up ShmEventLoop's in separate threads to allow
 // us to run the "real" message bridge. This requires extra threading and timing
@@ -1440,6 +1437,4 @@
               true},
         Param{"message_bridge_test_common_config.json", false}));
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/message_bridge_test_lib.cc b/aos/network/message_bridge_test_lib.cc
index 16e4a4b..0062bfd 100644
--- a/aos/network/message_bridge_test_lib.cc
+++ b/aos/network/message_bridge_test_lib.cc
@@ -2,8 +2,7 @@
 
 DECLARE_string(boot_uuid);
 
-namespace aos {
-namespace message_bridge::testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::testing::ArtifactPath;
@@ -286,5 +285,4 @@
   pi2_test_thread.reset();
 }
 
-}  // namespace message_bridge::testing
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/multinode_timestamp_filter.cc b/aos/network/multinode_timestamp_filter.cc
index b4ebef4..0a0385e 100644
--- a/aos/network/multinode_timestamp_filter.cc
+++ b/aos/network/multinode_timestamp_filter.cc
@@ -64,8 +64,7 @@
 #define SOLVE_VLOG(solve_number, v) \
   LOG_IF(INFO, SOLVE_VLOG_IS_ON(solve_number, v))
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 using aos::logger::BootDuration;
@@ -3359,5 +3358,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/multinode_timestamp_filter_test.cc b/aos/network/multinode_timestamp_filter_test.cc
index 9aa76c0..e581a74 100644
--- a/aos/network/multinode_timestamp_filter_test.cc
+++ b/aos/network/multinode_timestamp_filter_test.cc
@@ -10,9 +10,7 @@
 #include "aos/network/testing_time_converter.h"
 #include "aos/network/timestamp_filter.h"
 
-namespace aos {
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::monotonic_clock;
@@ -538,6 +536,4 @@
       << derivatives.df_slope_limited;
 }
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/rawrtc.cc b/aos/network/rawrtc.cc
index db4de07..e519b2e 100644
--- a/aos/network/rawrtc.cc
+++ b/aos/network/rawrtc.cc
@@ -17,8 +17,7 @@
 DEFINE_int32(max_ice_port, -1,
              "Maximum port number to use for ICE candidates.");
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 namespace {
 enum {
   TRANSPORT_BUFFER_LENGTH = 1048576,  // 1 MiB
@@ -299,5 +298,4 @@
   }
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index a9567a2..32347fd 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -18,8 +18,7 @@
              "Timeout in milliseconds for retrying the INIT packet when "
              "connecting to the message bridge server");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 SctpClient::SctpClient(std::string_view remote_host, int remote_port,
                        int streams, std::string_view local_host, int local_port,
@@ -67,5 +66,4 @@
 #endif
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/sctp_lib.cc b/aos/network/sctp_lib.cc
index 99a7f09..829ae67 100644
--- a/aos/network/sctp_lib.cc
+++ b/aos/network/sctp_lib.cc
@@ -26,8 +26,7 @@
 DEFINE_bool(disable_ipv6, false, "disable ipv6");
 DEFINE_int32(rmem, 0, "If nonzero, set rmem to this size.");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 namespace {
 const char *sac_state_tbl[] = {"COMMUNICATION_UP", "COMMUNICATION_LOST",
@@ -788,5 +787,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/sctp_server.cc b/aos/network/sctp_server.cc
index f4dba39..7f7a0ae 100644
--- a/aos/network/sctp_server.cc
+++ b/aos/network/sctp_server.cc
@@ -18,8 +18,7 @@
 #include "aos/network/sctp_lib.h"
 #include "aos/unique_malloc_ptr.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 SctpServer::SctpServer(int streams, std::string_view local_host, int local_port,
                        SctpAuthMethod requested_authentication)
@@ -109,5 +108,4 @@
 #endif
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/team_number.cc b/aos/network/team_number.cc
index 8885b52..28ee67a 100644
--- a/aos/network/team_number.cc
+++ b/aos/network/team_number.cc
@@ -13,8 +13,7 @@
     "If set, this forces the hostname of this node to be the provided "
     "hostname.");
 
-namespace aos {
-namespace network {
+namespace aos::network {
 namespace team_number_internal {
 
 std::optional<uint16_t> ParseRoborioTeamNumber(
@@ -150,5 +149,4 @@
   return number;
 }
 
-}  // namespace network
-}  // namespace aos
+}  // namespace aos::network
diff --git a/aos/network/team_number_test.cc b/aos/network/team_number_test.cc
index 68727e2..1ca3fc2 100644
--- a/aos/network/team_number_test.cc
+++ b/aos/network/team_number_test.cc
@@ -2,9 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace aos {
-namespace network {
-namespace testing {
+namespace aos::network::testing {
 
 using team_number_internal::ParsePiTeamNumber;
 using team_number_internal::ParseRoborioTeamNumber;
@@ -49,6 +47,4 @@
   EXPECT_FALSE(ParsePiNumber("pi-971"));
 }
 
-}  // namespace testing
-}  // namespace network
-}  // namespace aos
+}  // namespace aos::network::testing
diff --git a/aos/network/testing_time_converter.cc b/aos/network/testing_time_converter.cc
index 9dc5fff..255826e 100644
--- a/aos/network/testing_time_converter.cc
+++ b/aos/network/testing_time_converter.cc
@@ -9,8 +9,7 @@
 #include "aos/network/multinode_timestamp_filter.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 namespace chrono = std::chrono;
 
@@ -125,5 +124,4 @@
   return result;
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_channel.cc b/aos/network/timestamp_channel.cc
index 52032f5..778c2e7 100644
--- a/aos/network/timestamp_channel.cc
+++ b/aos/network/timestamp_channel.cc
@@ -10,8 +10,7 @@
             "channels are configured to have at least as great a frequency as "
             "the corresponding data channel.");
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 
 ChannelTimestampFinder::ChannelTimestampFinder(
     const Configuration *configuration, const std::string_view name,
@@ -143,5 +142,4 @@
   return result.first->second.get();
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_filter.cc b/aos/network/timestamp_filter.cc
index 9736679..914f993 100644
--- a/aos/network/timestamp_filter.cc
+++ b/aos/network/timestamp_filter.cc
@@ -11,8 +11,7 @@
 #include "aos/configuration.h"
 #include "aos/time/time.h"
 
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
 namespace {
 namespace chrono = std::chrono;
 using logger::BootDuration;
@@ -1786,5 +1785,4 @@
   }
 }
 
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge
diff --git a/aos/network/timestamp_filter_test.cc b/aos/network/timestamp_filter_test.cc
index 07f7d6d..f3b7290 100644
--- a/aos/network/timestamp_filter_test.cc
+++ b/aos/network/timestamp_filter_test.cc
@@ -9,9 +9,7 @@
 #include "aos/json_to_flatbuffer.h"
 #include "aos/macros.h"
 
-namespace aos {
-namespace message_bridge {
-namespace testing {
+namespace aos::message_bridge::testing {
 
 namespace chrono = std::chrono;
 using aos::monotonic_clock;
@@ -1673,6 +1671,4 @@
   EXPECT_EQ(estimator.GetFilter(node_b)->timestamps_size(), 2u);
 }
 
-}  // namespace testing
-}  // namespace message_bridge
-}  // namespace aos
+}  // namespace aos::message_bridge::testing
diff --git a/aos/network/web_proxy.cc b/aos/network/web_proxy.cc
index d48d700..15ebb66 100644
--- a/aos/network/web_proxy.cc
+++ b/aos/network/web_proxy.cc
@@ -34,8 +34,7 @@
               "If we have not received any ack's in this amount of time, we "
               "start to continue sending messages.");
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 WebsocketHandler::WebsocketHandler(::seasocks::Server *server,
                                    aos::EventLoop *event_loop,
                                    StoreHistory store_history,
@@ -699,5 +698,4 @@
   }
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy
diff --git a/aos/network/web_proxy_utils.cc b/aos/network/web_proxy_utils.cc
index d6148d4..f4468ab 100644
--- a/aos/network/web_proxy_utils.cc
+++ b/aos/network/web_proxy_utils.cc
@@ -1,7 +1,6 @@
 #include "aos/network/web_proxy_utils.h"
 
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
 
 namespace {
 // Recommended max size is 64KiB for compatibility reasons. 256KiB theoretically
@@ -98,5 +97,4 @@
   return buffers;
 }
 
-}  // namespace web_proxy
-}  // namespace aos
+}  // namespace aos::web_proxy