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/y2022/vision/ball_color.cc b/y2022/vision/ball_color.cc
index b1ebd85..930142f 100644
--- a/y2022/vision/ball_color.cc
+++ b/y2022/vision/ball_color.cc
@@ -13,8 +13,7 @@
#include "frc971/input/joystick_state_generated.h"
#include "frc971/vision/vision_generated.h"
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
namespace {
cv::Rect ArrayToRect(const std::array<int, 4> &values) {
@@ -144,5 +143,4 @@
return sum / num_pixels_selected;
}
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
diff --git a/y2022/vision/ball_color_main.cc b/y2022/vision/ball_color_main.cc
index 03e3033..5f05b34 100644
--- a/y2022/vision/ball_color_main.cc
+++ b/y2022/vision/ball_color_main.cc
@@ -9,8 +9,7 @@
// --override_hostname pi-7971-1 --ignore_timestamps true
DEFINE_string(config, "aos_config.json", "Path to the config file to use.");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
namespace {
using namespace frc971::vision;
@@ -28,8 +27,7 @@
}
} // namespace
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
diff --git a/y2022/vision/blob_detector.cc b/y2022/vision/blob_detector.cc
index 2c6ff44..70ff1b2 100644
--- a/y2022/vision/blob_detector.cc
+++ b/y2022/vision/blob_detector.cc
@@ -25,8 +25,7 @@
"Required difference between green pixels vs. blue when using "
"--use_outdoors");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
cv::Mat BlobDetector::ThresholdImage(cv::Mat bgr_image) {
cv::Mat binarized_image(cv::Size(bgr_image.cols, bgr_image.rows), CV_8UC1);
@@ -266,5 +265,4 @@
<< " ms";
}
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
diff --git a/y2022/vision/calibrate_extrinsics.cc b/y2022/vision/calibrate_extrinsics.cc
index d8b57dc..0a950ab 100644
--- a/y2022/vision/calibrate_extrinsics.cc
+++ b/y2022/vision/calibrate_extrinsics.cc
@@ -25,8 +25,7 @@
DEFINE_string(base_intrinsics, "",
"Intrinsics to use for extrinsics calibration.");
-namespace frc971 {
-namespace vision {
+namespace frc971::vision {
namespace chrono = std::chrono;
using aos::distributed_clock;
using aos::monotonic_clock;
@@ -263,8 +262,7 @@
}
} // namespace vision
-} // namespace vision
-} // namespace frc971
+} // namespace frc971::vision
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
diff --git a/y2022/vision/camera_reader.cc b/y2022/vision/camera_reader.cc
index 012a2db..a077d09 100644
--- a/y2022/vision/camera_reader.cc
+++ b/y2022/vision/camera_reader.cc
@@ -17,8 +17,7 @@
DEFINE_string(image_png, "", "A set of PNG images");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
using namespace frc971::vision;
@@ -235,5 +234,4 @@
}
}
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
diff --git a/y2022/vision/camera_reader_main.cc b/y2022/vision/camera_reader_main.cc
index 5f19d64..278f14b 100644
--- a/y2022/vision/camera_reader_main.cc
+++ b/y2022/vision/camera_reader_main.cc
@@ -14,8 +14,7 @@
"Exposure time when using --use_outdoors, in 100us increments; 0 "
"implies auto exposure");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
namespace {
using namespace frc971::vision;
@@ -59,8 +58,7 @@
}
} // namespace
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
diff --git a/y2022/vision/viewer.cc b/y2022/vision/viewer.cc
index 58db722..b0bcdac 100644
--- a/y2022/vision/viewer.cc
+++ b/y2022/vision/viewer.cc
@@ -36,8 +36,7 @@
"If true, display the target estimation graphically");
DEFINE_bool(sort_by_time, true, "If true, sort the images by time");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
namespace {
using namespace frc971::vision;
@@ -273,8 +272,7 @@
}
}
} // namespace
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
// Quick and lightweight viewer for images
int main(int argc, char **argv) {
diff --git a/y2022/vision/viewer_replay.cc b/y2022/vision/viewer_replay.cc
index 7e8c800..15427e4 100644
--- a/y2022/vision/viewer_replay.cc
+++ b/y2022/vision/viewer_replay.cc
@@ -26,8 +26,7 @@
DEFINE_string(logger_pi_log, "/tmp/logger_pi/", "Path to logger pi log");
DEFINE_string(roborio_log, "/tmp/roborio/", "Path to roborio log");
-namespace y2022 {
-namespace vision {
+namespace y2022::vision {
namespace {
using aos::monotonic_clock;
@@ -257,8 +256,7 @@
}
} // namespace
-} // namespace vision
-} // namespace y2022
+} // namespace y2022::vision
// Quick and lightweight viewer for image logs
int main(int argc, char **argv) {