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/frc971/orin/apriltag.cc b/frc971/orin/apriltag.cc
index 1cb0f88..dd253d1 100644
--- a/frc971/orin/apriltag.cc
+++ b/frc971/orin/apriltag.cc
@@ -22,8 +22,7 @@
#include "frc971/orin/threshold.h"
#include "frc971/orin/transform_output_iterator.h"
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
namespace {
typedef std::chrono::duration<float, std::milli> float_milli;
@@ -1151,5 +1150,4 @@
first_ = false;
}
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/apriltag_detect.cc b/frc971/orin/apriltag_detect.cc
index eecc056..69c93cc 100644
--- a/frc971/orin/apriltag_detect.cc
+++ b/frc971/orin/apriltag_detect.cc
@@ -31,8 +31,7 @@
zarray_t *poly1);
};
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
namespace {
void HostFitLine(LineFitMoments moments, double *lineparam01,
@@ -519,5 +518,4 @@
zarray_sort(detections_, detection_compare_function);
}
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/crcv_generator.cc b/frc971/orin/crcv_generator.cc
index 5c72385..a3f1f03 100644
--- a/frc971/orin/crcv_generator.cc
+++ b/frc971/orin/crcv_generator.cc
@@ -15,8 +15,8 @@
// ahead-of-time optimized functions as directed by command-line arguments.
// https://halide-lang.org/tutorials/tutorial_lesson_15_generators.html has an
// introduction to much of the magic in this file.
-namespace frc971 {
-namespace orin {
+
+namespace frc971::orin {
namespace {
template <typename T>
@@ -142,8 +142,7 @@
}
};
-} // namespace orin
-} // namespace frc971
+} // namespace frc971::orin
HALIDE_REGISTER_GENERATOR(frc971::orin::YCbCr, ycbcr)
HALIDE_REGISTER_GENERATOR(frc971::orin::YCbCr422, ycbcr422)
diff --git a/frc971/orin/cuda.cc b/frc971/orin/cuda.cc
index 89b1529..6bcc79c 100644
--- a/frc971/orin/cuda.cc
+++ b/frc971/orin/cuda.cc
@@ -7,8 +7,7 @@
sync, false,
"If true, force synchronization after each step to isolate errors better.");
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
size_t overall_memory = 0;
@@ -25,5 +24,4 @@
if (FLAGS_sync) CheckAndSynchronize(message);
}
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/line_fit_filter.cc b/frc971/orin/line_fit_filter.cc
index 954976a..737079f 100644
--- a/frc971/orin/line_fit_filter.cc
+++ b/frc971/orin/line_fit_filter.cc
@@ -8,8 +8,7 @@
// #define DEBUG_BLOB_NUMBER 401
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
static_assert(sizeof(LineFitPoint) == 40, "Size of LineFitPoint changed");
static_assert(sizeof(int4) == 16, "Size of int4 changed");
@@ -1231,5 +1230,4 @@
return os;
}
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/points.cc b/frc971/orin/points.cc
index dbf5496..7dc36f2 100644
--- a/frc971/orin/points.cc
+++ b/frc971/orin/points.cc
@@ -3,8 +3,7 @@
#include <iomanip>
#include <ostream>
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
std::ostream &operator<<(std::ostream &os, const QuadBoundaryPoint &point) {
std::ios_base::fmtflags original_flags = os.flags();
@@ -31,5 +30,4 @@
static_assert(sizeof(IndexPoint) == 8, "IndexPoint didn't pack right.");
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/threshold.cc b/frc971/orin/threshold.cc
index 79ccced..4254b71 100644
--- a/frc971/orin/threshold.cc
+++ b/frc971/orin/threshold.cc
@@ -4,8 +4,7 @@
#include "frc971/orin/cuda.h"
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
namespace {
// 1280 -> 2 * 128 * 5
@@ -202,5 +201,4 @@
}
}
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
diff --git a/frc971/orin/transform_output_iterator.h b/frc971/orin/transform_output_iterator.h
index 051baea..cdda637 100644
--- a/frc971/orin/transform_output_iterator.h
+++ b/frc971/orin/transform_output_iterator.h
@@ -1,8 +1,7 @@
#ifndef FRC971_TRANSFORM_OUTPUT_ITERATOR_
#define FRC971_TRANSFORM_OUTPUT_ITERATOR_
-namespace frc971 {
-namespace apriltag {
+namespace frc971::apriltag {
// template class that allows conversions at the output of a cub algorithm
template <typename InputType, typename OutputType, typename ConversionOp,
@@ -86,7 +85,6 @@
OutputType *ptr;
};
-} // namespace apriltag
-} // namespace frc971
+} // namespace frc971::apriltag
#endif // FRC971_TRANSFORM_OUTPUT_ITERATOR_