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/y2023_bot3/autonomous/auto_splines.cc b/y2023_bot3/autonomous/auto_splines.cc
index 25277e9..b0577bf 100644
--- a/y2023_bot3/autonomous/auto_splines.cc
+++ b/y2023_bot3/autonomous/auto_splines.cc
@@ -3,8 +3,7 @@
#include "aos/flatbuffer_merge.h"
#include "frc971/control_loops/control_loops_generated.h"
-namespace y2023_bot3 {
-namespace autonomous {
+namespace y2023_bot3::autonomous {
namespace {
flatbuffers::Offset<frc971::MultiSpline> FixSpline(
@@ -172,5 +171,4 @@
return FixSpline(builder, multispline_builder.Finish(), alliance);
}
-} // namespace autonomous
-} // namespace y2023_bot3
+} // namespace y2023_bot3::autonomous
diff --git a/y2023_bot3/autonomous/autonomous_actor.cc b/y2023_bot3/autonomous/autonomous_actor.cc
index 7c722be..61811d7 100644
--- a/y2023_bot3/autonomous/autonomous_actor.cc
+++ b/y2023_bot3/autonomous/autonomous_actor.cc
@@ -20,8 +20,7 @@
DEFINE_bool(one_piece, false,
"End charged_up autonomous after first cube is placed.");
-namespace y2023_bot3 {
-namespace autonomous {
+namespace y2023_bot3::autonomous {
using ::frc971::ProfileParametersT;
@@ -287,5 +286,4 @@
}
}
-} // namespace autonomous
-} // namespace y2023_bot3
+} // namespace y2023_bot3::autonomous
diff --git a/y2023_bot3/constants.cc b/y2023_bot3/constants.cc
index 7f77d4d..be9ddbf 100644
--- a/y2023_bot3/constants.cc
+++ b/y2023_bot3/constants.cc
@@ -13,8 +13,7 @@
#include "aos/mutex/mutex.h"
#include "aos/network/team_number.h"
-namespace y2023_bot3 {
-namespace constants {
+namespace y2023_bot3::constants {
Values MakeValues(uint16_t team) {
LOG(INFO) << "creating a Constants for team: " << team;
@@ -38,5 +37,4 @@
Values MakeValues() { return MakeValues(aos::network::GetTeamNumber()); }
-} // namespace constants
-} // namespace y2023_bot3
+} // namespace y2023_bot3::constants
diff --git a/y2023_bot3/control_loops/drivetrain/drivetrain_base.cc b/y2023_bot3/control_loops/drivetrain/drivetrain_base.cc
index 5b30097..481cab0 100644
--- a/y2023_bot3/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2023_bot3/control_loops/drivetrain/drivetrain_base.cc
@@ -15,9 +15,7 @@
namespace chrono = ::std::chrono;
-namespace y2023_bot3 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2023_bot3::control_loops::drivetrain {
using ::frc971::constants::ShifterHallEffect;
@@ -85,6 +83,4 @@
return kDrivetrainConfig;
};
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2023_bot3
+} // namespace y2023_bot3::control_loops::drivetrain
diff --git a/y2023_bot3/control_loops/superstructure/superstructure.cc b/y2023_bot3/control_loops/superstructure/superstructure.cc
index e77245e..b730ffa 100644
--- a/y2023_bot3/control_loops/superstructure/superstructure.cc
+++ b/y2023_bot3/control_loops/superstructure/superstructure.cc
@@ -9,9 +9,7 @@
DEFINE_bool(ignore_distance, false,
"If true, ignore distance when shooting and obay joystick_reader");
-namespace y2023_bot3 {
-namespace control_loops {
-namespace superstructure {
+namespace y2023_bot3::control_loops::superstructure {
using ::aos::monotonic_clock;
@@ -51,6 +49,4 @@
(void)status->Send(status_builder.Finish());
}
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023_bot3
+} // namespace y2023_bot3::control_loops::superstructure
diff --git a/y2023_bot3/control_loops/superstructure/superstructure_lib_test.cc b/y2023_bot3/control_loops/superstructure/superstructure_lib_test.cc
index 370ec17..d9c9d15 100644
--- a/y2023_bot3/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2023_bot3/control_loops/superstructure/superstructure_lib_test.cc
@@ -16,10 +16,7 @@
DEFINE_string(output_folder, "",
"If set, logs all channels to the provided logfile.");
-namespace y2023_bot3 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2023_bot3::control_loops::superstructure::testing {
namespace {} // namespace
namespace chrono = std::chrono;
@@ -260,7 +257,4 @@
VerifyNearGoal();
}
-} // namespace testing
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2023_bot3
+} // namespace y2023_bot3::control_loops::superstructure::testing
diff --git a/y2023_bot3/joystick_reader.cc b/y2023_bot3/joystick_reader.cc
index 4c42bdc..9516d70 100644
--- a/y2023_bot3/joystick_reader.cc
+++ b/y2023_bot3/joystick_reader.cc
@@ -32,9 +32,7 @@
using frc971::input::driver_station::POVLocation;
using Side = frc971::control_loops::drivetrain::RobotSide;
-namespace y2023_bot3 {
-namespace input {
-namespace joysticks {
+namespace y2023_bot3::input::joysticks {
namespace superstructure = y2023_bot3::control_loops::superstructure;
@@ -101,9 +99,7 @@
::aos::Fetcher<superstructure::Status> superstructure_status_fetcher_;
};
-} // namespace joysticks
-} // namespace input
-} // namespace y2023_bot3
+} // namespace y2023_bot3::input::joysticks
int main(int argc, char **argv) {
::aos::InitGoogle(&argc, &argv);
diff --git a/y2023_bot3/wpilib_interface.cc b/y2023_bot3/wpilib_interface.cc
index 231f2c6..443fabd 100644
--- a/y2023_bot3/wpilib_interface.cc
+++ b/y2023_bot3/wpilib_interface.cc
@@ -71,8 +71,7 @@
namespace chrono = ::std::chrono;
using std::make_unique;
-namespace y2023_bot3 {
-namespace wpilib {
+namespace y2023_bot3::wpilib {
namespace {
constexpr double kMaxBringupPower = 12.0;
@@ -674,7 +673,6 @@
}
};
-} // namespace wpilib
-} // namespace y2023_bot3
+} // namespace y2023_bot3::wpilib
AOS_ROBOT_CLASS(::y2023_bot3::wpilib::WPILibRobot);