Skip to content

Commit 18d97a4

Browse files
committed
style: Run clang-format on hpp/cpp sources
1 parent 1cc9c30 commit 18d97a4

28 files changed

Lines changed: 85 additions & 85 deletions

src/kernel/visualization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct Visualization::Impl {
5050
};
5151
};
5252

53-
Config config {};
53+
Config config { };
5454
RclcppNode rclcpp { "visual" };
5555

5656
debug::StreamSession session;
@@ -98,7 +98,7 @@ struct Visualization::Impl {
9898
});
9999

100100
is_initialized = true;
101-
return {};
101+
return { };
102102
}
103103

104104
auto initialized() const noexcept { return is_initialized; }

src/module/capturer/common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ struct Adapter : public Impl, Interface {
3232
using Config = Impl::Config;
3333

3434
auto configure_yaml(const Yaml& yaml) noexcept -> NormalResult {
35-
auto config = Config {};
35+
auto config = Config { };
3636
auto result = config.serialize(yaml);
3737

3838
if (result.has_value()) {
3939
Impl::configure(config);
40-
return {};
40+
return { };
4141
} else {
4242
return std::unexpected { result.error() };
4343
}

src/module/capturer/hikcamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ auto Hikcamera::wait_image() noexcept -> ImageResult {
88
return std::unexpected { captured.error() };
99
}
1010

11-
auto image = std::make_unique<rmcs::Image>();
12-
image->mat = std::move(captured->mat);
11+
auto image = std::make_unique<rmcs::Image>();
12+
image->mat = std::move(captured->mat);
1313
image->timestamp = captured->timestamp;
1414

1515
return image;

src/module/capturer/local_video.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ struct LocalVideo::Impl {
156156
}
157157

158158
if (!playing && latest_image) {
159-
auto image = std::make_unique<Image>();
160-
image->mat = latest_image->mat.clone();
159+
auto image = std::make_unique<Image>();
160+
image->mat = latest_image->mat.clone();
161161
image->timestamp = latest_image->timestamp;
162162
return image;
163163
}
@@ -181,9 +181,9 @@ struct LocalVideo::Impl {
181181
if (frame.empty()) {
182182
return std::unexpected { "Read frame is empty, possibly due to IO error." };
183183
}
184-
image->mat = std::move(frame);
184+
image->mat = std::move(frame);
185185
image->timestamp = last_read_time;
186-
latest_image = Image {
186+
latest_image = Image {
187187
.mat = image->mat.clone(),
188188
.timestamp = last_read_time,
189189
};

src/module/capturer/video.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct VideoCapturer::Impl final {
2828
}
2929

3030
auto read(std::chrono::milliseconds) const -> cv::Mat {
31-
auto mat = cv::Mat {};
31+
auto mat = cv::Mat { };
3232
if (!capturer_->read(mat))
3333
throw std::runtime_error { "VideoCapturer: Some errors happened while reading video" };
3434

src/module/debug/action_throttler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ActionThrottler {
6666

6767
auto reset() noexcept -> void {
6868
limit.reset();
69-
metronome.last_reach_interval_timestamp = {};
69+
metronome.last_reach_interval_timestamp = { };
7070
}
7171

7272
auto enable() noexcept -> void { limit.enable(); }
@@ -75,7 +75,7 @@ class ActionThrottler {
7575
struct string_hash {
7676
using is_transparent = void;
7777
auto operator()(std::string_view sv) const -> std::size_t {
78-
return std::hash<std::string_view> {}(sv);
78+
return std::hash<std::string_view> { }(sv);
7979
}
8080
};
8181

src/module/identifier/adjacency_lightbar.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ auto AdjacencyLightbarFinder::set_armor_thickness(double thickness) -> void {
244244
}
245245

246246
auto AdjacencyLightbarFinder::find(
247-
const cv::Mat& image, const Armor2d& armor2d, const Armor3d& armor3d)
248-
-> std::optional<Result> {
247+
const cv::Mat& image, const Armor2d& armor2d, const Armor3d& armor3d) -> std::optional<Result> {
249248
return pimpl->find(image, armor2d, armor3d);
250249
}
251250

src/module/identifier/preprocess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using namespace rmcs;
66

77
auto PreProcess::process(const cv::Mat& image, cv::Mat& out) const noexcept -> void {
8-
auto gray_image = cv::Mat {};
8+
auto gray_image = cv::Mat { };
99
cv::cvtColor(image, gray_image, cv::COLOR_BGR2GRAY);
1010

1111
cv::threshold(gray_image, out, binarization_threshold, 255, cv::THRESH_BINARY);

src/utility/coroutine/common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ struct task {
5151

5252
static constexpr auto initial_suspend() noexcept {
5353
// Launch immediately
54-
return std::suspend_never {};
54+
return std::suspend_never { };
5555
}
5656
static constexpr auto final_suspend() noexcept {
5757
// Lazy destory
58-
return std::suspend_always {};
58+
return std::suspend_always { };
5959
}
6060
};
6161
std::coroutine_handle<promise_type> coroutine_handle;

src/utility/duck_type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class duck_array {
3838
auto at(this auto&& self, std::size_t index, auto&& f) -> void
3939
requires(std::invocable<decltype(f), Ts&> && ...)
4040
{
41-
self.impl_at(std::forward<decltype(f)>(f), index, std::index_sequence_for<Ts...> {});
41+
self.impl_at(std::forward<decltype(f)>(f), index, std::index_sequence_for<Ts...> { });
4242
}
4343

4444
constexpr auto foreach (this auto&& self, auto&& f) -> void

0 commit comments

Comments
 (0)