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/y2020/control_loops/drivetrain/drivetrain_base.cc b/y2020/control_loops/drivetrain/drivetrain_base.cc
index 7b42df5..3e05020 100644
--- a/y2020/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_base.cc
@@ -15,9 +15,7 @@
namespace chrono = ::std::chrono;
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2020::control_loops::drivetrain {
using ::frc971::constants::ShifterHallEffect;
@@ -77,6 +75,4 @@
return kDrivetrainConfig;
};
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain
diff --git a/y2020/control_loops/drivetrain/drivetrain_replay_test.cc b/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
index 0baf34b..731f02c 100644
--- a/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_replay_test.cc
@@ -27,10 +27,7 @@
DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
-namespace testing {
+namespace y2020::control_loops::drivetrain::testing {
class DrivetrainReplayTest : public ::testing::Test {
public:
@@ -135,7 +132,4 @@
EXPECT_LT(std::abs(status_fetcher_->theta()), 0.02);
}
-} // namespace testing
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain::testing
diff --git a/y2020/control_loops/drivetrain/localizer.cc b/y2020/control_loops/drivetrain/localizer.cc
index 8f8bf87..fabbb8e 100644
--- a/y2020/control_loops/drivetrain/localizer.cc
+++ b/y2020/control_loops/drivetrain/localizer.cc
@@ -6,9 +6,7 @@
"If true, send LocalizerDebug messages on every tick, even if "
"they would be empty.");
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2020::control_loops::drivetrain {
namespace {
// Converts a flatbuffer TransformationMatrix to an Eigen matrix. Technically,
@@ -499,6 +497,4 @@
return Zhat;
}
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain
diff --git a/y2020/control_loops/drivetrain/localizer_test.cc b/y2020/control_loops/drivetrain/localizer_test.cc
index 3e2cf6b..90076c0 100644
--- a/y2020/control_loops/drivetrain/localizer_test.cc
+++ b/y2020/control_loops/drivetrain/localizer_test.cc
@@ -19,10 +19,7 @@
// This file tests that the full 2020 localizer behaves sanely.
-namespace y2020 {
-namespace control_loops {
-namespace drivetrain {
-namespace testing {
+namespace y2020::control_loops::drivetrain::testing {
using aos::logger::BootTimestamp;
using frc971::control_loops::drivetrain::DrivetrainConfig;
@@ -622,7 +619,4 @@
RunFor(chrono::seconds(20));
}
-} // namespace testing
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::drivetrain::testing
diff --git a/y2020/control_loops/superstructure/shooter/shooter.cc b/y2020/control_loops/superstructure/shooter/shooter.cc
index c400e34..2792205 100644
--- a/y2020/control_loops/superstructure/shooter/shooter.cc
+++ b/y2020/control_loops/superstructure/shooter/shooter.cc
@@ -9,10 +9,7 @@
#include "y2020/control_loops/superstructure/finisher/finisher_plant.h"
#include "y2020/control_loops/superstructure/finisher/integral_finisher_plant.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace shooter {
+namespace y2020::control_loops::superstructure::shooter {
Shooter::Shooter()
: finisher_(
@@ -141,7 +138,4 @@
return status_builder.Finish();
}
-} // namespace shooter
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::shooter
diff --git a/y2020/control_loops/superstructure/superstructure.cc b/y2020/control_loops/superstructure/superstructure.cc
index b7d57b4..f951791 100644
--- a/y2020/control_loops/superstructure/superstructure.cc
+++ b/y2020/control_loops/superstructure/superstructure.cc
@@ -4,9 +4,7 @@
#include "aos/events/event_loop.h"
#include "aos/network/team_number.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
+namespace y2020::control_loops::superstructure {
using frc971::control_loops::AbsoluteAndAbsoluteEncoderProfiledJointStatus;
using frc971::control_loops::AbsoluteEncoderProfiledJointStatus;
@@ -313,6 +311,4 @@
}
}
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure
diff --git a/y2020/control_loops/superstructure/superstructure_lib_test.cc b/y2020/control_loops/superstructure/superstructure_lib_test.cc
index 8b34fc9..950593e 100644
--- a/y2020/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2020/control_loops/superstructure/superstructure_lib_test.cc
@@ -28,10 +28,7 @@
DEFINE_string(config, "y2020/aos_config.json",
"Name of the config file to replay using.");
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2020::control_loops::superstructure::testing {
namespace {
constexpr double kNoiseScalar = 0.01;
@@ -1473,7 +1470,4 @@
aos::Alliance::kBlue,
aos::Alliance::kInvalid));
-} // namespace testing
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::testing
diff --git a/y2020/control_loops/superstructure/turret/aiming.cc b/y2020/control_loops/superstructure/turret/aiming.cc
index 0b2c5f3..238beda 100644
--- a/y2020/control_loops/superstructure/turret/aiming.cc
+++ b/y2020/control_loops/superstructure/turret/aiming.cc
@@ -3,10 +3,7 @@
#include "y2020/constants.h"
#include "y2020/control_loops/drivetrain/drivetrain_base.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace turret {
+namespace y2020::control_loops::superstructure::turret {
using frc971::control_loops::Pose;
using frc971::control_loops::aiming::RobotState;
@@ -197,7 +194,4 @@
return builder.Finish();
}
-} // namespace turret
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::turret
diff --git a/y2020/control_loops/superstructure/turret/aiming_test.cc b/y2020/control_loops/superstructure/turret/aiming_test.cc
index b63d705..855f66a 100644
--- a/y2020/control_loops/superstructure/turret/aiming_test.cc
+++ b/y2020/control_loops/superstructure/turret/aiming_test.cc
@@ -7,11 +7,7 @@
#include "y2020/constants.h"
#include "y2020/control_loops/drivetrain/drivetrain_base.h"
-namespace y2020 {
-namespace control_loops {
-namespace superstructure {
-namespace turret {
-namespace testing {
+namespace y2020::control_loops::superstructure::turret::testing {
class TeamNumberEnvironment : public ::testing::Environment {
public:
@@ -259,8 +255,4 @@
EXPECT_EQ(0.0, goal->goal_velocity());
}
-} // namespace testing
-} // namespace turret
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2020
+} // namespace y2020::control_loops::superstructure::turret::testing