Run clang-format on the entire repo
This patch clang-formats the entire repo. Third-party code is
excluded.
I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/aos/actions/action_test.cc b/aos/actions/action_test.cc
index 2638cdc..e7a3c53 100644
--- a/aos/actions/action_test.cc
+++ b/aos/actions/action_test.cc
@@ -4,13 +4,14 @@
#include <memory>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/actions/actions.h"
#include "aos/actions/actions_generated.h"
#include "aos/actions/actor.h"
#include "aos/actions/test_action_generated.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/testing/path.h"
-#include "gtest/gtest.h"
namespace aos {
namespace common {
diff --git a/aos/actions/actor.cc b/aos/actions/actor.cc
index 7b2264d..6a91c74 100644
--- a/aos/actions/actor.cc
+++ b/aos/actions/actor.cc
@@ -2,8 +2,6 @@
namespace aos {
namespace common {
-namespace actions {
-
-} // namespace actions
+namespace actions {} // namespace actions
} // namespace common
} // namespace aos
diff --git a/aos/aos_cli_utils.h b/aos/aos_cli_utils.h
index 35fb61f..199c490 100644
--- a/aos/aos_cli_utils.h
+++ b/aos/aos_cli_utils.h
@@ -1,10 +1,11 @@
#ifndef AOS_AOS_CLI_UTILS_H_
#define AOS_AOS_CLI_UTILS_H_
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/shm_event_loop.h"
#include "aos/events/simulated_event_loop.h"
-#include "gflags/gflags.h"
namespace aos {
diff --git a/aos/aos_dump.cc b/aos/aos_dump.cc
index b76b1a3..ad50b0b 100644
--- a/aos/aos_dump.cc
+++ b/aos/aos_dump.cc
@@ -2,11 +2,12 @@
#include <iostream>
+#include "gflags/gflags.h"
+
#include "aos/aos_cli_utils.h"
#include "aos/configuration.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
DEFINE_int64(max_vector_size, 100,
"If positive, vectors longer than this will not be printed");
diff --git a/aos/aos_graph_channels.cc b/aos/aos_graph_channels.cc
index 7eb22ba..1a89223 100644
--- a/aos/aos_graph_channels.cc
+++ b/aos/aos_graph_channels.cc
@@ -3,12 +3,13 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
+#include "gflags/gflags.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
DEFINE_string(skip, "", "Applications to skip, seperated by ;");
diff --git a/aos/aos_graph_nodes.cc b/aos/aos_graph_nodes.cc
index 5b6fbe0..4ed9866 100644
--- a/aos/aos_graph_nodes.cc
+++ b/aos/aos_graph_nodes.cc
@@ -1,11 +1,12 @@
#include <iostream>
#include <map>
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
DEFINE_bool(all, false,
"If true, print out the channels for all nodes in the config file, "
diff --git a/aos/aos_send.cc b/aos/aos_send.cc
index b8cc9eb..210a2af 100644
--- a/aos/aos_send.cc
+++ b/aos/aos_send.cc
@@ -3,12 +3,13 @@
#include <iostream>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/aos_cli_utils.h"
#include "aos/configuration.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_double(rate, -1, "Rate at which to send the message (-1 to send once).");
diff --git a/aos/condition.cc b/aos/condition.cc
index 1b0e855..f7860be 100644
--- a/aos/condition.cc
+++ b/aos/condition.cc
@@ -4,9 +4,10 @@
#include <cinttypes>
#include <ctime>
+#include "glog/logging.h"
+
#include "aos/mutex/mutex.h"
#include "aos/type_traits/type_traits.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/condition_test.cc b/aos/condition_test.cc
index 9250846..c83dc19 100644
--- a/aos/condition_test.cc
+++ b/aos/condition_test.cc
@@ -8,6 +8,8 @@
#include <chrono>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/die.h"
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/core_lib.h"
@@ -18,7 +20,6 @@
#include "aos/testing/test_shm.h"
#include "aos/time/time.h"
#include "aos/type_traits/type_traits.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/config_flattener.cc b/aos/config_flattener.cc
index 8018484..5bd3cf7 100644
--- a/aos/config_flattener.cc
+++ b/aos/config_flattener.cc
@@ -1,12 +1,13 @@
#include <string>
#include <vector>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/util/file.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/configuration.cc b/aos/configuration.cc
index 4e1316d..ca11348 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -18,14 +18,15 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration_generated.h"
#include "aos/flatbuffer_merge.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/network/team_number.h"
#include "aos/unique_malloc_ptr.h"
#include "aos/util/file.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
namespace aos {
namespace {
diff --git a/aos/configuration_test.cc b/aos/configuration_test.cc
index cb44f1b..c4df812 100644
--- a/aos/configuration_test.cc
+++ b/aos/configuration_test.cc
@@ -1,16 +1,17 @@
#include "aos/configuration.h"
#include "absl/strings/strip.h"
+#include "flatbuffers/reflection.h"
+#include "glog/logging.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
#include "aos/events/ping_generated.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/flatbuffer_eq.h"
#include "aos/testing/path.h"
#include "aos/testing/test_logging.h"
#include "aos/util/file.h"
-#include "flatbuffers/reflection.h"
-#include "glog/logging.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
namespace aos {
namespace configuration {
diff --git a/aos/containers/error_list.h b/aos/containers/error_list.h
index 2fbd39e..42400fb 100644
--- a/aos/containers/error_list.h
+++ b/aos/containers/error_list.h
@@ -3,9 +3,10 @@
#include <iostream>
-#include "aos/containers/sized_array.h"
#include "flatbuffers/flatbuffers.h"
+#include "aos/containers/sized_array.h"
+
namespace aos {
// A de-duplicated sorted array based on SizedArray
diff --git a/aos/containers/error_list_test.cc b/aos/containers/error_list_test.cc
index 3ce23c4..b819ba5 100644
--- a/aos/containers/error_list_test.cc
+++ b/aos/containers/error_list_test.cc
@@ -1,8 +1,9 @@
#include "aos/containers/error_list.h"
-#include "aos/json_to_flatbuffer_generated.h"
#include "gtest/gtest.h"
+#include "aos/json_to_flatbuffer_generated.h"
+
namespace aos {
namespace testing {
diff --git a/aos/containers/resizeable_buffer.h b/aos/containers/resizeable_buffer.h
index ed0d23e..165dfee 100644
--- a/aos/containers/resizeable_buffer.h
+++ b/aos/containers/resizeable_buffer.h
@@ -18,8 +18,12 @@
public:
AllocatorResizeableBuffer() = default;
- AllocatorResizeableBuffer(const AllocatorResizeableBuffer &other) { *this = other; }
- AllocatorResizeableBuffer(AllocatorResizeableBuffer &&other) { *this = std::move(other); }
+ AllocatorResizeableBuffer(const AllocatorResizeableBuffer &other) {
+ *this = other;
+ }
+ AllocatorResizeableBuffer(AllocatorResizeableBuffer &&other) {
+ *this = std::move(other);
+ }
AllocatorResizeableBuffer &operator=(const AllocatorResizeableBuffer &other) {
resize(other.size());
memcpy(storage_.get(), other.storage_.get(), size());
diff --git a/aos/dump_rtprio.cc b/aos/dump_rtprio.cc
index 4ed9415..e1286e2 100644
--- a/aos/dump_rtprio.cc
+++ b/aos/dump_rtprio.cc
@@ -19,11 +19,12 @@
#include <set>
#include <string>
+#include "glog/logging.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/time/time.h"
#include "aos/util/top.h"
-#include "glog/logging.h"
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
diff --git a/aos/events/aos_timing_report_streamer.cc b/aos/events/aos_timing_report_streamer.cc
index 35a78b9..58b44e6 100644
--- a/aos/events/aos_timing_report_streamer.cc
+++ b/aos/events/aos_timing_report_streamer.cc
@@ -1,9 +1,10 @@
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/shm_event_loop.h"
#include "aos/events/timing_report_dump_lib.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
DEFINE_string(config, "aos_config.json", "The path to the config to use.");
DEFINE_string(application, "",
diff --git a/aos/events/channel_preallocated_allocator.h b/aos/events/channel_preallocated_allocator.h
index 76fb694..49eafef 100644
--- a/aos/events/channel_preallocated_allocator.h
+++ b/aos/events/channel_preallocated_allocator.h
@@ -1,9 +1,10 @@
#ifndef AOS_EVENTS_CHANNEL_PREALLOCATED_ALLOCATOR_
#define AOS_EVENTS_CHANNEL_PREALLOCATED_ALLOCATOR_
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/configuration.h"
#include "aos/configuration_generated.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos {
diff --git a/aos/events/epoll.cc b/aos/events/epoll.cc
index 71e3c9b..9a11197 100644
--- a/aos/events/epoll.cc
+++ b/aos/events/epoll.cc
@@ -8,9 +8,10 @@
#include <atomic>
#include <vector>
-#include "aos/time/time.h"
#include "glog/logging.h"
+#include "aos/time/time.h"
+
namespace aos {
namespace internal {
diff --git a/aos/events/event_loop.cc b/aos/events/event_loop.cc
index 2d932cc..8a5774f 100644
--- a/aos/events/event_loop.cc
+++ b/aos/events/event_loop.cc
@@ -1,10 +1,11 @@
#include "aos/events/event_loop.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/configuration_generated.h"
#include "aos/logging/implementations.h"
#include "aos/realtime.h"
-#include "glog/logging.h"
DEFINE_bool(timing_reports, true, "Publish timing reports.");
DEFINE_int32(timing_report_ms, 1000,
diff --git a/aos/events/event_loop.h b/aos/events/event_loop.h
index 8825464..5eaaf22 100644
--- a/aos/events/event_loop.h
+++ b/aos/events/event_loop.h
@@ -9,6 +9,9 @@
#include <string_view>
#include "absl/container/btree_set.h"
+#include "flatbuffers/flatbuffers.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/configuration_generated.h"
#include "aos/events/channel_preallocated_allocator.h"
@@ -22,8 +25,6 @@
#include "aos/time/time.h"
#include "aos/util/phased_loop.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
-#include "glog/logging.h"
DECLARE_bool(timing_reports);
DECLARE_int32(timing_report_ms);
diff --git a/aos/events/event_loop_event.h b/aos/events/event_loop_event.h
index a86f670..588b851 100644
--- a/aos/events/event_loop_event.h
+++ b/aos/events/event_loop_event.h
@@ -1,9 +1,10 @@
#ifndef AOS_EVENTS_EVENT_LOOP_EVENT_H
#define AOS_EVENTS_EVENT_LOOP_EVENT_H
-#include "aos/time/time.h"
#include "glog/logging.h"
+#include "aos/time/time.h"
+
namespace aos {
// Common interface to track when callbacks and timers should have happened.
diff --git a/aos/events/event_loop_param_test.cc b/aos/events/event_loop_param_test.cc
index 2076467..beb5e78 100644
--- a/aos/events/event_loop_param_test.cc
+++ b/aos/events/event_loop_param_test.cc
@@ -4,14 +4,15 @@
#include <unordered_map>
#include <unordered_set>
+#include "glog/logging.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
#include "aos/events/test_message_generated.h"
#include "aos/flatbuffer_merge.h"
#include "aos/logging/log_message_generated.h"
#include "aos/logging/logging.h"
#include "aos/realtime.h"
-#include "glog/logging.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/events/event_loop_param_test.h b/aos/events/event_loop_param_test.h
index fad8dea..d795a13 100644
--- a/aos/events/event_loop_param_test.h
+++ b/aos/events/event_loop_param_test.h
@@ -5,6 +5,8 @@
#include <string_view>
#include <vector>
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/test_message_generated.h"
#include "aos/events/test_message_schema.h"
@@ -15,7 +17,6 @@
#include "aos/network/message_bridge_client_schema.h"
#include "aos/network/message_bridge_server_schema.h"
#include "aos/network/timestamp_schema.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/events/event_loop_runtime_test.cc b/aos/events/event_loop_runtime_test.cc
index 8557e55..7a49fe1 100644
--- a/aos/events/event_loop_runtime_test.cc
+++ b/aos/events/event_loop_runtime_test.cc
@@ -1,10 +1,11 @@
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop_runtime_test_lib_rs_cxxgen.h"
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/testing/path.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace aos::events::testing {
namespace {
diff --git a/aos/events/event_loop_tmpl.h b/aos/events/event_loop_tmpl.h
index 39ab43e..6c132b2 100644
--- a/aos/events/event_loop_tmpl.h
+++ b/aos/events/event_loop_tmpl.h
@@ -5,9 +5,10 @@
#include <cstdint>
#include <type_traits>
-#include "aos/events/event_loop.h"
#include "glog/logging.h"
+#include "aos/events/event_loop.h"
+
namespace aos {
namespace event_loop_internal {
@@ -36,9 +37,8 @@
template <typename Watch>
void EventLoop::MakeWatcher(const std::string_view channel_name, Watch &&w) {
- using MessageType =
- typename event_loop_internal::watch_message_type_trait<decltype(
- &Watch::operator())>::message_type;
+ using MessageType = typename event_loop_internal::watch_message_type_trait<
+ decltype(&Watch::operator())>::message_type;
const Channel *channel = configuration::GetChannel(
configuration_, channel_name, MessageType::GetFullyQualifiedName(),
name(), node());
diff --git a/aos/events/event_scheduler.cc b/aos/events/event_scheduler.cc
index 2bd7cef..115b2c7 100644
--- a/aos/events/event_scheduler.cc
+++ b/aos/events/event_scheduler.cc
@@ -51,7 +51,8 @@
monotonic_clock::max_time);
}
- const monotonic_clock::time_point monotonic_time = events_list_.begin()->first;
+ const monotonic_clock::time_point monotonic_time =
+ events_list_.begin()->first;
if (cached_event_list_monotonic_time_ != monotonic_time) {
cached_event_list_time_ = ToDistributedClock(monotonic_time);
cached_event_list_monotonic_time_ = monotonic_time;
diff --git a/aos/events/event_scheduler.h b/aos/events/event_scheduler.h
index c508140..848a1cf 100644
--- a/aos/events/event_scheduler.h
+++ b/aos/events/event_scheduler.h
@@ -8,12 +8,13 @@
#include <utility>
#include <vector>
+#include "glog/logging.h"
+
#include "aos/events/epoll.h"
#include "aos/events/event_loop.h"
#include "aos/events/logging/boot_timestamp.h"
#include "aos/logging/implementations.h"
#include "aos/time/time.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/events/event_scheduler_test.cc b/aos/events/event_scheduler_test.cc
index c32399c..d328552 100644
--- a/aos/events/event_scheduler_test.cc
+++ b/aos/events/event_scheduler_test.cc
@@ -2,9 +2,10 @@
#include <chrono>
-#include "aos/network/testing_time_converter.h"
#include "gtest/gtest.h"
+#include "aos/network/testing_time_converter.h"
+
namespace aos {
namespace chrono = std::chrono;
diff --git a/aos/events/glib_main_loop_test.cc b/aos/events/glib_main_loop_test.cc
index 9f72e54..43f7c7a 100644
--- a/aos/events/glib_main_loop_test.cc
+++ b/aos/events/glib_main_loop_test.cc
@@ -2,13 +2,14 @@
#include <thread>
-#include "aos/configuration.h"
-#include "aos/events/shm_event_loop.h"
-#include "aos/testing/path.h"
#include "glib-2.0/glib.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/configuration.h"
+#include "aos/events/shm_event_loop.h"
+#include "aos/testing/path.h"
+
namespace aos {
namespace testing {
using aos::testing::ArtifactPath;
diff --git a/aos/events/logging/boot_timestamp.h b/aos/events/logging/boot_timestamp.h
index bd9b357..e9c7877 100644
--- a/aos/events/logging/boot_timestamp.h
+++ b/aos/events/logging/boot_timestamp.h
@@ -3,9 +3,10 @@
#include <iostream>
-#include "aos/time/time.h"
#include "glog/logging.h"
+#include "aos/time/time.h"
+
namespace aos::logger {
// Simple class representing a duration in time and a boot it is from. This
diff --git a/aos/events/logging/buffer_encoder.cc b/aos/events/logging/buffer_encoder.cc
index 5c1d4b2..6aba79a 100644
--- a/aos/events/logging/buffer_encoder.cc
+++ b/aos/events/logging/buffer_encoder.cc
@@ -4,9 +4,10 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include "aos/flatbuffers.h"
#include "glog/logging.h"
+#include "aos/flatbuffers.h"
+
namespace aos::logger {
DummyEncoder::DummyEncoder(size_t /*max_message_size*/, size_t buffer_size) {
diff --git a/aos/events/logging/buffer_encoder.h b/aos/events/logging/buffer_encoder.h
index ed5bef6..394992c 100644
--- a/aos/events/logging/buffer_encoder.h
+++ b/aos/events/logging/buffer_encoder.h
@@ -2,11 +2,12 @@
#define AOS_EVENTS_LOGGING_BUFFER_ENCODER_H_
#include "absl/types/span.h"
-#include "aos/containers/resizeable_buffer.h"
-#include "aos/events/logging/logger_generated.h"
#include "flatbuffers/flatbuffers.h"
#include "glog/logging.h"
+#include "aos/containers/resizeable_buffer.h"
+#include "aos/events/logging/logger_generated.h"
+
namespace aos::logger {
// Interface to encode data as it is written to a file.
diff --git a/aos/events/logging/buffer_encoder_param_test.h b/aos/events/logging/buffer_encoder_param_test.h
index 6085779..8b6648d 100644
--- a/aos/events/logging/buffer_encoder_param_test.h
+++ b/aos/events/logging/buffer_encoder_param_test.h
@@ -6,11 +6,12 @@
#include <random>
#include <vector>
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/events/logging/logfile_utils.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/testing/random_seed.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace aos::logger::testing {
diff --git a/aos/events/logging/buffer_encoder_test.cc b/aos/events/logging/buffer_encoder_test.cc
index d5e2e5d..7dda300 100644
--- a/aos/events/logging/buffer_encoder_test.cc
+++ b/aos/events/logging/buffer_encoder_test.cc
@@ -4,11 +4,12 @@
#include <fstream>
#include <string>
-#include "aos/events/logging/buffer_encoder_param_test.h"
#include "glog/logging.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "aos/events/logging/buffer_encoder_param_test.h"
+
namespace aos::logger::testing {
class DummyEncoderTest : public BufferEncoderBaseTest {};
diff --git a/aos/events/logging/log_backend.cc b/aos/events/logging/log_backend.cc
index 07bb780..918a6e6 100644
--- a/aos/events/logging/log_backend.cc
+++ b/aos/events/logging/log_backend.cc
@@ -5,9 +5,10 @@
#include <filesystem>
#include "absl/strings/str_cat.h"
-#include "aos/util/file.h"
#include "glog/logging.h"
+#include "aos/util/file.h"
+
DEFINE_bool(direct, false,
"If true, write using O_DIRECT and write 512 byte aligned blocks "
"whenever possible.");
diff --git a/aos/events/logging/log_backend.h b/aos/events/logging/log_backend.h
index 1b1417e..6f79bc3 100644
--- a/aos/events/logging/log_backend.h
+++ b/aos/events/logging/log_backend.h
@@ -10,6 +10,7 @@
#include <vector>
#include "absl/types/span.h"
+
#include "aos/time/time.h"
namespace aos::logger {
diff --git a/aos/events/logging/log_backend_test.cc b/aos/events/logging/log_backend_test.cc
index 928bb24..4e6987f 100644
--- a/aos/events/logging/log_backend_test.cc
+++ b/aos/events/logging/log_backend_test.cc
@@ -7,12 +7,13 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
-#include "aos/containers/resizeable_buffer.h"
-#include "aos/testing/tmpdir.h"
#include "glog/logging.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "aos/containers/resizeable_buffer.h"
+#include "aos/testing/tmpdir.h"
+
namespace aos::logger::testing {
namespace {
// Helper to write simple string to the log sink
diff --git a/aos/events/logging/log_cat.cc b/aos/events/logging/log_cat.cc
index b06cf20..31d12be 100644
--- a/aos/events/logging/log_cat.cc
+++ b/aos/events/logging/log_cat.cc
@@ -7,6 +7,8 @@
#include <vector>
#include "absl/strings/escaping.h"
+#include "gflags/gflags.h"
+
#include "aos/aos_cli_utils.h"
#include "aos/configuration.h"
#include "aos/events/logging/log_reader.h"
@@ -14,7 +16,6 @@
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/sha256.h"
-#include "gflags/gflags.h"
DEFINE_string(
name, "",
diff --git a/aos/events/logging/log_config_extractor.cc b/aos/events/logging/log_config_extractor.cc
index aa2eed0..da0c65f 100644
--- a/aos/events/logging/log_config_extractor.cc
+++ b/aos/events/logging/log_config_extractor.cc
@@ -1,16 +1,17 @@
-#include <iostream>
#include <filesystem>
+#include <iostream>
#include <vector>
+#include "flatbuffers/flatbuffers.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration_generated.h"
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/logfile_sorting.h"
#include "aos/flatbuffer_merge.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "flatbuffers/flatbuffers.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(output_path, "/tmp/",
"Destination folder for output files. If this flag is not used, "
diff --git a/aos/events/logging/log_edit.cc b/aos/events/logging/log_edit.cc
index 7e822ca..7d3ba2f 100644
--- a/aos/events/logging/log_edit.cc
+++ b/aos/events/logging/log_edit.cc
@@ -1,12 +1,13 @@
#include <iostream>
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/log_reader.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/util/file.h"
-#include "gflags/gflags.h"
DEFINE_string(logfile, "/tmp/logfile.bfbs",
"Name of the logfile to read from.");
diff --git a/aos/events/logging/log_namer.cc b/aos/events/logging/log_namer.cc
index 4b23268..0e914d9 100644
--- a/aos/events/logging/log_namer.cc
+++ b/aos/events/logging/log_namer.cc
@@ -7,12 +7,13 @@
#include <vector>
#include "absl/strings/str_cat.h"
+#include "flatbuffers/flatbuffers.h"
+#include "glog/logging.h"
+
#include "aos/events/logging/logfile_utils.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/flatbuffer_merge.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
-#include "glog/logging.h"
DECLARE_int32(flush_size);
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index 8842f4e..89a9319 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -8,10 +8,11 @@
#include <vector>
#include "absl/container/btree_map.h"
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/events/logging/logfile_utils.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos {
namespace logger {
diff --git a/aos/events/logging/log_reader.cc b/aos/events/logging/log_reader.cc
index cbe37d5..f805c66 100644
--- a/aos/events/logging/log_reader.cc
+++ b/aos/events/logging/log_reader.cc
@@ -11,6 +11,9 @@
#include "absl/strings/escaping.h"
#include "absl/types/span.h"
+#include "flatbuffers/flatbuffers.h"
+#include "openssl/sha.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/logging/boot_timestamp.h"
#include "aos/events/logging/logfile_sorting.h"
@@ -25,8 +28,6 @@
#include "aos/time/time.h"
#include "aos/util/file.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
-#include "openssl/sha.h"
DEFINE_bool(skip_missing_forwarding_entries, false,
"If true, drop any forwarding entries with missing data. If "
@@ -2340,7 +2341,8 @@
// handlers that would've happened before requested start time until that
// start time.
if (start_event_notifier_) {
- // Only call OnStart() if the start time for this node (realtime_start_time())
+ // Only call OnStart() if the start time for this node
+ // (realtime_start_time())
if (start_event_notifier_->realtime_event_time() >
realtime_start_time(boot_count())) {
VLOG(1) << "Skipping, " << start_event_notifier_->realtime_event_time()
diff --git a/aos/events/logging/log_reader.h b/aos/events/logging/log_reader.h
index 49babe5..3bdfca4 100644
--- a/aos/events/logging/log_reader.h
+++ b/aos/events/logging/log_reader.h
@@ -8,6 +8,8 @@
#include <tuple>
#include <vector>
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/condition.h"
#include "aos/events/event_loop.h"
#include "aos/events/logging/logfile_sorting.h"
@@ -24,7 +26,6 @@
#include "aos/time/time.h"
#include "aos/util/threaded_queue.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos {
namespace logger {
diff --git a/aos/events/logging/log_replayer.cc b/aos/events/logging/log_replayer.cc
index c91464c..7231a91 100644
--- a/aos/events/logging/log_replayer.cc
+++ b/aos/events/logging/log_replayer.cc
@@ -7,6 +7,10 @@
#include <string_view>
#include <vector>
+#include "flatbuffers/flatbuffers.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration_generated.h"
#include "aos/events/event_loop.h"
#include "aos/events/logging/log_reader.h"
@@ -21,9 +25,6 @@
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/util/file.h"
-#include "flatbuffers/flatbuffers.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(config, "", "If specified, overrides logged configuration.");
DEFINE_bool(
diff --git a/aos/events/logging/log_stats.cc b/aos/events/logging/log_stats.cc
index 8e3d451..ea265b5 100644
--- a/aos/events/logging/log_stats.cc
+++ b/aos/events/logging/log_stats.cc
@@ -3,12 +3,13 @@
#include <queue>
#include "absl/strings/str_format.h"
+#include "gflags/gflags.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
DEFINE_string(
name, "",
diff --git a/aos/events/logging/log_writer.h b/aos/events/logging/log_writer.h
index 65c68f4..f63ac3e 100644
--- a/aos/events/logging/log_writer.h
+++ b/aos/events/logging/log_writer.h
@@ -5,6 +5,8 @@
#include <string_view>
#include <vector>
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/logging/log_namer.h"
#include "aos/events/logging/logfile_utils.h"
@@ -14,7 +16,6 @@
#include "aos/network/remote_message_generated.h"
#include "aos/time/time.h"
#include "aos/uuid.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos {
namespace logger {
diff --git a/aos/events/logging/logfile_sorting.cc b/aos/events/logging/logfile_sorting.cc
index f0161c9..f6d12da 100644
--- a/aos/events/logging/logfile_sorting.cc
+++ b/aos/events/logging/logfile_sorting.cc
@@ -1,5 +1,7 @@
#include "aos/events/logging/logfile_sorting.h"
+#include <dirent.h>
+
#include <algorithm>
#include <map>
#include <string>
@@ -8,12 +10,12 @@
#include "absl/container/btree_map.h"
#include "absl/strings/str_join.h"
+
#include "aos/events/logging/logfile_utils.h"
#include "aos/flatbuffer_merge.h"
#include "aos/flatbuffers.h"
#include "aos/sha256.h"
#include "aos/time/time.h"
-#include "dirent.h"
#include "sys/stat.h"
#if ENABLE_S3
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index 490393d..304b3b3 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -10,13 +10,14 @@
#include <filesystem>
#include "absl/strings/escaping.h"
+#include "flatbuffers/flatbuffers.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/snappy_encoder.h"
#include "aos/flatbuffer_merge.h"
#include "aos/util/file.h"
-#include "flatbuffers/flatbuffers.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
#if defined(__x86_64__)
#define ENABLE_LZMA (!__has_feature(memory_sanitizer))
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index 0bf60a0..5d5d344 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -16,6 +16,8 @@
#include "absl/container/btree_set.h"
#include "absl/types/span.h"
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/containers/resizeable_buffer.h"
#include "aos/events/event_loop.h"
#include "aos/events/logging/boot_timestamp.h"
@@ -25,7 +27,6 @@
#include "aos/events/logging/logger_generated.h"
#include "aos/flatbuffers.h"
#include "aos/network/remote_message_generated.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos::logger {
diff --git a/aos/events/logging/logfile_utils_out_of_space_test_runner.cc b/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
index 71c537f..65591ba 100644
--- a/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
+++ b/aos/events/logging/logfile_utils_out_of_space_test_runner.cc
@@ -2,11 +2,12 @@
#include <array>
-#include "aos/events/logging/logfile_utils.h"
-#include "aos/init.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
+#include "aos/events/logging/logfile_utils.h"
+#include "aos/init.h"
+
DECLARE_int32(flush_size);
DEFINE_string(tmpfs, "", "tmpfs with the desired size");
diff --git a/aos/events/logging/logfile_utils_test.cc b/aos/events/logging/logfile_utils_test.cc
index 8d5b0fb..eaeb4b7 100644
--- a/aos/events/logging/logfile_utils_test.cc
+++ b/aos/events/logging/logfile_utils_test.cc
@@ -6,6 +6,12 @@
#include <string>
#include "absl/strings/escaping.h"
+#include "external/com_github_google_flatbuffers/src/annotated_binary_text_gen.h"
+#include "external/com_github_google_flatbuffers/src/binary_annotator.h"
+#include "flatbuffers/reflection_generated.h"
+#include "gflags/gflags.h"
+#include "gtest/gtest.h"
+
#include "aos/events/logging/logfile_sorting.h"
#include "aos/events/logging/test_message_generated.h"
#include "aos/flatbuffer_merge.h"
@@ -15,11 +21,6 @@
#include "aos/testing/random_seed.h"
#include "aos/testing/tmpdir.h"
#include "aos/util/file.h"
-#include "external/com_github_google_flatbuffers/src/annotated_binary_text_gen.h"
-#include "external/com_github_google_flatbuffers/src/binary_annotator.h"
-#include "flatbuffers/reflection_generated.h"
-#include "gflags/gflags.h"
-#include "gtest/gtest.h"
namespace aos {
namespace logger {
diff --git a/aos/events/logging/logger_main.cc b/aos/events/logging/logger_main.cc
index 0dbfc8d..631f41f 100644
--- a/aos/events/logging/logger_main.cc
+++ b/aos/events/logging/logger_main.cc
@@ -6,12 +6,13 @@
#ifdef LZMA
#include "aos/events/logging/lzma_encoder.h"
#endif
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/logging/snappy_encoder.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/logging/log_namer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(config, "aos_config.json", "Config file to use.");
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 7214a36..8b1b7fa 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -3,6 +3,10 @@
#include <filesystem>
#include "absl/strings/str_format.h"
+#include "glog/logging.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/log_writer.h"
@@ -17,9 +21,6 @@
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
#include "aos/util/file.h"
-#include "glog/logging.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
#ifdef LZMA
#include "aos/events/logging/lzma_encoder.h"
diff --git a/aos/events/logging/lzma_encoder.h b/aos/events/logging/lzma_encoder.h
index 3136d93..93508ca 100644
--- a/aos/events/logging/lzma_encoder.h
+++ b/aos/events/logging/lzma_encoder.h
@@ -7,10 +7,11 @@
#include <thread>
#include "absl/types/span.h"
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/containers/resizeable_buffer.h"
#include "aos/events/logging/buffer_encoder.h"
#include "aos/events/logging/logger_generated.h"
-#include "flatbuffers/flatbuffers.h"
#include "lzma.h"
namespace aos::logger {
diff --git a/aos/events/logging/lzma_encoder_test.cc b/aos/events/logging/lzma_encoder_test.cc
index 1e814ff..60444d3 100644
--- a/aos/events/logging/lzma_encoder_test.cc
+++ b/aos/events/logging/lzma_encoder_test.cc
@@ -1,10 +1,11 @@
#include "aos/events/logging/lzma_encoder.h"
-#include "aos/events/logging/buffer_encoder_param_test.h"
-#include "aos/util/file.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "aos/events/logging/buffer_encoder_param_test.h"
+#include "aos/util/file.h"
+
DECLARE_int32(lzma_threads);
namespace aos::logger::testing {
diff --git a/aos/events/logging/multinode_logger_test.cc b/aos/events/logging/multinode_logger_test.cc
index f9eb11e..44736a5 100644
--- a/aos/events/logging/multinode_logger_test.cc
+++ b/aos/events/logging/multinode_logger_test.cc
@@ -1,5 +1,8 @@
#include <algorithm>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/multinode_logger_test_lib.h"
#include "aos/events/message_counter.h"
@@ -8,8 +11,6 @@
#include "aos/network/remote_message_generated.h"
#include "aos/network/timestamp_generated.h"
#include "aos/testing/tmpdir.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
namespace aos {
namespace logger {
diff --git a/aos/events/logging/multinode_logger_test_lib.h b/aos/events/logging/multinode_logger_test_lib.h
index 7502e4d..f95c6cc 100644
--- a/aos/events/logging/multinode_logger_test_lib.h
+++ b/aos/events/logging/multinode_logger_test_lib.h
@@ -2,6 +2,9 @@
#define AOS_EVENTS_LOGGING_MULTINODE_LOGGER_TEST_LIB_H
#include "absl/strings/str_format.h"
+#include "glog/logging.h"
+#include "gmock/gmock.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/logging/log_writer.h"
#include "aos/events/logging/snappy_encoder.h"
@@ -9,8 +12,6 @@
#include "aos/network/testing_time_converter.h"
#include "aos/testing/path.h"
#include "aos/util/file.h"
-#include "glog/logging.h"
-#include "gmock/gmock.h"
#ifdef LZMA
#include "aos/events/logging/lzma_encoder.h"
diff --git a/aos/events/logging/realtime_replay_test.cc b/aos/events/logging/realtime_replay_test.cc
index 2d02766..a04da49 100644
--- a/aos/events/logging/realtime_replay_test.cc
+++ b/aos/events/logging/realtime_replay_test.cc
@@ -1,3 +1,5 @@
+#include "gtest/gtest.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/log_writer.h"
#include "aos/events/ping_lib.h"
@@ -6,7 +8,6 @@
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
-#include "gtest/gtest.h"
DECLARE_string(override_hostname);
diff --git a/aos/events/logging/s3_fetcher.h b/aos/events/logging/s3_fetcher.h
index cf00226..41bc114 100644
--- a/aos/events/logging/s3_fetcher.h
+++ b/aos/events/logging/s3_fetcher.h
@@ -45,7 +45,7 @@
void StartRequest();
};
-Aws::S3::S3Client& GetS3Client();
+Aws::S3::S3Client &GetS3Client();
struct ObjectName {
std::string bucket, key;
diff --git a/aos/events/logging/single_node_merge.cc b/aos/events/logging/single_node_merge.cc
index ec22b82..cc78c2b 100644
--- a/aos/events/logging/single_node_merge.cc
+++ b/aos/events/logging/single_node_merge.cc
@@ -2,11 +2,12 @@
#include <string>
#include <vector>
+#include "gflags/gflags.h"
+
#include "aos/events/logging/logfile_sorting.h"
#include "aos/events/logging/logfile_utils.h"
#include "aos/init.h"
#include "aos/network/multinode_timestamp_filter.h"
-#include "gflags/gflags.h"
// This is a simple application to match up data with timestamps for a node in a
// log. It doesn't solve the timestamp problem, but is still quite useful for
diff --git a/aos/events/logging/snappy_encoder.h b/aos/events/logging/snappy_encoder.h
index d698ee1..4b6130c 100644
--- a/aos/events/logging/snappy_encoder.h
+++ b/aos/events/logging/snappy_encoder.h
@@ -4,10 +4,11 @@
#include <string_view>
#include "absl/types/span.h"
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/containers/resizeable_buffer.h"
#include "aos/events/logging/buffer_encoder.h"
#include "aos/events/logging/logger_generated.h"
-#include "flatbuffers/flatbuffers.h"
#include "snappy-sinksource.h"
#include "snappy.h"
@@ -16,7 +17,8 @@
// Encodes buffers using snappy.
class SnappyEncoder final : public DataEncoder {
public:
- explicit SnappyEncoder(size_t max_message_size, size_t chunk_size = 128 * 1024);
+ explicit SnappyEncoder(size_t max_message_size,
+ size_t chunk_size = 128 * 1024);
size_t Encode(Copier *copy, size_t start_byte) final;
diff --git a/aos/events/logging/snappy_encoder_test.cc b/aos/events/logging/snappy_encoder_test.cc
index 7e61f3f..505a315 100644
--- a/aos/events/logging/snappy_encoder_test.cc
+++ b/aos/events/logging/snappy_encoder_test.cc
@@ -1,16 +1,18 @@
#include "aos/events/logging/snappy_encoder.h"
-#include "aos/events/logging/buffer_encoder_param_test.h"
-#include "aos/util/file.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "aos/events/logging/buffer_encoder_param_test.h"
+#include "aos/util/file.h"
+
namespace aos::logger::testing {
INSTANTIATE_TEST_SUITE_P(
Snappy, BufferEncoderTest,
::testing::Combine(::testing::Values([](size_t max_message_size) {
- return std::make_unique<SnappyEncoder>(max_message_size);
+ return std::make_unique<SnappyEncoder>(
+ max_message_size);
}),
::testing::Values([](std::string_view filename) {
return std::make_unique<SnappyDecoder>(filename);
diff --git a/aos/events/logging/timestamp_extractor.cc b/aos/events/logging/timestamp_extractor.cc
index ed319db..67cbc44 100644
--- a/aos/events/logging/timestamp_extractor.cc
+++ b/aos/events/logging/timestamp_extractor.cc
@@ -2,11 +2,12 @@
#include <string>
#include <vector>
+#include "gflags/gflags.h"
+
#include "aos/events/logging/logfile_sorting.h"
#include "aos/events/logging/logfile_utils.h"
#include "aos/init.h"
#include "aos/network/multinode_timestamp_filter.h"
-#include "gflags/gflags.h"
DECLARE_bool(timestamps_to_csv);
DEFINE_bool(skip_order_validation, false,
diff --git a/aos/events/logging/timestamp_plot.cc b/aos/events/logging/timestamp_plot.cc
index ddc8381..e266716 100644
--- a/aos/events/logging/timestamp_plot.cc
+++ b/aos/events/logging/timestamp_plot.cc
@@ -1,5 +1,6 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/str_split.h"
+
#include "aos/init.h"
#include "aos/util/file.h"
#include "frc971/analysis/in_process_plotter.h"
@@ -157,7 +158,8 @@
std::string_view node1, std::string_view node2, bool flip) {
std::vector<double> samplefile12_t;
std::vector<double> samplefile12_o;
- const std::string path = absl::StrCat("/tmp/timestamp_noncausal_", node1, "_", node2, ".csv");
+ const std::string path =
+ absl::StrCat("/tmp/timestamp_noncausal_", node1, "_", node2, ".csv");
if (!aos::util::PathExists(path)) {
return {};
diff --git a/aos/events/ping.cc b/aos/events/ping.cc
index 9333b61..83a066b 100644
--- a/aos/events/ping.cc
+++ b/aos/events/ping.cc
@@ -1,10 +1,11 @@
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/ping_lib.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(config, "pingpong_config.json", "Path to the config.");
diff --git a/aos/events/ping_lib.cc b/aos/events/ping_lib.cc
index e80fd75..8e7136d 100644
--- a/aos/events/ping_lib.cc
+++ b/aos/events/ping_lib.cc
@@ -1,10 +1,11 @@
#include "aos/events/ping_lib.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_int32(sleep_ms, 10, "Time to sleep between pings");
diff --git a/aos/events/pingpong_test.cc b/aos/events/pingpong_test.cc
index 9c874ef..d35192a 100644
--- a/aos/events/pingpong_test.cc
+++ b/aos/events/pingpong_test.cc
@@ -1,10 +1,11 @@
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/events/ping_lib.h"
#include "aos/events/pong_lib.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/path.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/events/pong.cc b/aos/events/pong.cc
index 59ddf5d..6a22b6b 100644
--- a/aos/events/pong.cc
+++ b/aos/events/pong.cc
@@ -1,10 +1,11 @@
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
#include "aos/events/pong_lib.h"
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
-#include "glog/logging.h"
DEFINE_string(config, "pingpong_config.json", "Path to the config.");
diff --git a/aos/events/pong_lib.cc b/aos/events/pong_lib.cc
index b274e58..93a551e 100644
--- a/aos/events/pong_lib.cc
+++ b/aos/events/pong_lib.cc
@@ -1,9 +1,10 @@
#include "aos/events/pong_lib.h"
+#include "glog/logging.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/events/shm_event_loop.cc b/aos/events/shm_event_loop.cc
index 89d0a9c..3e1be99 100644
--- a/aos/events/shm_event_loop.cc
+++ b/aos/events/shm_event_loop.cc
@@ -10,6 +10,8 @@
#include <iterator>
#include <stdexcept>
+#include "glog/logging.h"
+
#include "aos/events/aos_logging.h"
#include "aos/events/epoll.h"
#include "aos/events/event_loop_generated.h"
@@ -21,7 +23,6 @@
#include "aos/stl_mutex/stl_mutex.h"
#include "aos/util/file.h"
#include "aos/util/phased_loop.h"
-#include "glog/logging.h"
namespace {
diff --git a/aos/events/shm_event_loop.h b/aos/events/shm_event_loop.h
index eb69f3d..7b7e68f 100644
--- a/aos/events/shm_event_loop.h
+++ b/aos/events/shm_event_loop.h
@@ -4,6 +4,7 @@
#include <vector>
#include "absl/types/span.h"
+
#include "aos/events/epoll.h"
#include "aos/events/event_loop.h"
#include "aos/events/event_loop_generated.h"
diff --git a/aos/events/shm_event_loop_test.cc b/aos/events/shm_event_loop_test.cc
index 132ef20..55c4f03 100644
--- a/aos/events/shm_event_loop_test.cc
+++ b/aos/events/shm_event_loop_test.cc
@@ -2,12 +2,13 @@
#include <string_view>
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop_param_test.h"
#include "aos/events/test_message_generated.h"
#include "aos/network/team_number.h"
#include "aos/realtime.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/events/simulated_event_loop.cc b/aos/events/simulated_event_loop.cc
index c021a84..44b30f1 100644
--- a/aos/events/simulated_event_loop.cc
+++ b/aos/events/simulated_event_loop.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "absl/container/btree_map.h"
+
#include "aos/events/aos_logging.h"
#include "aos/events/simulated_network_bridge.h"
#include "aos/init.h"
diff --git a/aos/events/simulated_event_loop.h b/aos/events/simulated_event_loop.h
index 8242d6c..6d88aa6 100644
--- a/aos/events/simulated_event_loop.h
+++ b/aos/events/simulated_event_loop.h
@@ -11,6 +11,8 @@
#include <vector>
#include "absl/container/btree_map.h"
+#include "glog/logging.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/event_scheduler.h"
#include "aos/events/simple_channel.h"
@@ -18,7 +20,6 @@
#include "aos/flatbuffers.h"
#include "aos/ipc_lib/index.h"
#include "aos/uuid.h"
-#include "glog/logging.h"
namespace aos {
@@ -236,13 +237,13 @@
// args for the Main class. Returns a pointer to the class that was started
// if it was started, or nullptr.
template <class Main, class... Args>
- Main *MaybeStart(std::string_view name, Args &&... args);
+ Main *MaybeStart(std::string_view name, Args &&...args);
// Starts an application regardless of if the config says to or not. name is
// the name of the application, and args are the constructor args for the
// application. Returns a pointer to the class that was started.
template <class Main, class... Args>
- Main *AlwaysStart(std::string_view name, Args &&... args);
+ Main *AlwaysStart(std::string_view name, Args &&...args);
// Returns the simulated network delay for messages forwarded between nodes.
std::chrono::nanoseconds network_delay() const {
@@ -352,7 +353,7 @@
// application.
template <class... Args>
TypedApplication(NodeEventLoopFactory *node_factory, std::string_view name,
- Args &&... args)
+ Args &&...args)
: Application(node_factory, name),
main(event_loop.get(), std::forward<Args>(args)...) {
VLOG(1) << node_factory->scheduler_.distributed_now() << " "
@@ -371,7 +372,7 @@
};
template <class Main, class... Args>
-Main *NodeEventLoopFactory::MaybeStart(std::string_view name, Args &&... args) {
+Main *NodeEventLoopFactory::MaybeStart(std::string_view name, Args &&...args) {
const aos::Application *application =
configuration::GetApplication(configuration(), node(), name);
@@ -382,8 +383,7 @@
}
template <class Main, class... Args>
-Main *NodeEventLoopFactory::AlwaysStart(std::string_view name,
- Args &&... args) {
+Main *NodeEventLoopFactory::AlwaysStart(std::string_view name, Args &&...args) {
std::unique_ptr<TypedApplication<Main>> app =
std::make_unique<TypedApplication<Main>>(this, name,
std::forward<Args>(args)...);
diff --git a/aos/events/simulated_event_loop_test.cc b/aos/events/simulated_event_loop_test.cc
index 2922460..c5daa7e 100644
--- a/aos/events/simulated_event_loop_test.cc
+++ b/aos/events/simulated_event_loop_test.cc
@@ -4,6 +4,8 @@
#include <functional>
#include <string_view>
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop_param_test.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/events/message_counter.h"
@@ -16,7 +18,6 @@
#include "aos/network/testing_time_converter.h"
#include "aos/network/timestamp_generated.h"
#include "aos/testing/path.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/events/simulated_network_bridge.cc b/aos/events/simulated_network_bridge.cc
index 31f3f0e..682ec7b 100644
--- a/aos/events/simulated_network_bridge.cc
+++ b/aos/events/simulated_network_bridge.cc
@@ -1,6 +1,7 @@
#include "aos/events/simulated_network_bridge.h"
#include "absl/strings/str_cat.h"
+
#include "aos/configuration.h"
#include "aos/events/event_loop.h"
#include "aos/events/simulated_event_loop.h"
diff --git a/aos/events/timing_report_dump.cc b/aos/events/timing_report_dump.cc
index c71dcf5..bd80a04 100644
--- a/aos/events/timing_report_dump.cc
+++ b/aos/events/timing_report_dump.cc
@@ -1,10 +1,11 @@
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/log_reader.h"
#include "aos/events/timing_report_dump_lib.h"
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(application, "",
"Application filter to use. Empty for no filter.");
diff --git a/aos/events/timing_report_dump_lib.cc b/aos/events/timing_report_dump_lib.cc
index 94a979b..86936f1 100644
--- a/aos/events/timing_report_dump_lib.cc
+++ b/aos/events/timing_report_dump_lib.cc
@@ -56,7 +56,7 @@
const std::string kIndent = " ";
std::string MaybeNodeName(std::string_view prefix_if_node,
- const aos::Node *node) {
+ const aos::Node *node) {
if (node == nullptr) {
return "";
}
diff --git a/aos/events/timing_report_dump_lib.h b/aos/events/timing_report_dump_lib.h
index 93163a1..02bfb54 100644
--- a/aos/events/timing_report_dump_lib.h
+++ b/aos/events/timing_report_dump_lib.h
@@ -3,12 +3,13 @@
#include <map>
#include <string>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/event_loop.h"
#include "aos/events/event_loop_generated.h"
#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
namespace aos {
// A class to handle printing timing report statistics in a useful format on the
diff --git a/aos/events/timing_statistics.cc b/aos/events/timing_statistics.cc
index c89bebd..caf71da 100644
--- a/aos/events/timing_statistics.cc
+++ b/aos/events/timing_statistics.cc
@@ -1,8 +1,9 @@
#include "aos/events/timing_statistics.h"
-#include "aos/events/event_loop_generated.h"
#include "glog/logging.h"
+#include "aos/events/event_loop_generated.h"
+
namespace aos {
namespace internal {
diff --git a/aos/events/timing_statistics_test.cc b/aos/events/timing_statistics_test.cc
index 480cce3..9a7fefc 100644
--- a/aos/events/timing_statistics_test.cc
+++ b/aos/events/timing_statistics_test.cc
@@ -1,8 +1,9 @@
#include "aos/events/timing_statistics.h"
-#include "aos/flatbuffers.h"
#include "gtest/gtest.h"
+#include "aos/flatbuffers.h"
+
namespace aos {
namespace internal {
namespace testing {
diff --git a/aos/fast_string_builder.cc b/aos/fast_string_builder.cc
index 97d2fea..0445535 100644
--- a/aos/fast_string_builder.cc
+++ b/aos/fast_string_builder.cc
@@ -1,4 +1,4 @@
-#include "fast_string_builder.h"
+#include "aos/fast_string_builder.h"
namespace aos {
diff --git a/aos/fast_string_builder.h b/aos/fast_string_builder.h
index aa6b619..e9a4f27 100644
--- a/aos/fast_string_builder.h
+++ b/aos/fast_string_builder.h
@@ -72,14 +72,16 @@
template <typename T, typename>
void FastStringBuilder::AppendInt(T val, bool use_hex) {
if (use_hex) {
- // This is not fast like the decimal path, but hex should be used in limited cases.
+ // This is not fast like the decimal path, but hex should be used in limited
+ // cases.
std::stringstream ss;
ss << std::hex << val;
str_ += ss.str();
} else {
std::size_t index = str_.size();
Resize(absl::numbers_internal::kFastToBufferSize);
- char *end = absl::numbers_internal::FastIntToBuffer(val, str_.data() + index);
+ char *end =
+ absl::numbers_internal::FastIntToBuffer(val, str_.data() + index);
str_.resize(end - str_.data());
}
}
diff --git a/aos/flatbuffer_introspection.cc b/aos/flatbuffer_introspection.cc
index ddac795..4dd7f2a 100644
--- a/aos/flatbuffer_introspection.cc
+++ b/aos/flatbuffer_introspection.cc
@@ -10,10 +10,10 @@
using reflection::BaseType;
-void IntToString(int64_t val, reflection::BaseType type,
- FastStringBuilder *out, bool use_hex) {
- // For 1-byte types in hex mode, we need to cast to 2 bytes to get the desired output and
- // not unprintable characters.
+void IntToString(int64_t val, reflection::BaseType type, FastStringBuilder *out,
+ bool use_hex) {
+ // For 1-byte types in hex mode, we need to cast to 2 bytes to get the desired
+ // output and not unprintable characters.
if (use_hex) {
if (BaseType::UByte == type) {
out->AppendInt(static_cast<uint16_t>(val), true);
@@ -163,7 +163,8 @@
case BaseType::UInt:
case BaseType::Long:
case BaseType::ULong:
- IntOrEnumToString(GetAnyFieldI(*table, *field), type, enums, out, json_options.use_hex);
+ IntOrEnumToString(GetAnyFieldI(*table, *field), type, enums, out,
+ json_options.use_hex);
break;
case BaseType::Float:
case BaseType::Double:
diff --git a/aos/flatbuffer_introspection_test.cc b/aos/flatbuffer_introspection_test.cc
index e435709..a4b09f7 100644
--- a/aos/flatbuffer_introspection_test.cc
+++ b/aos/flatbuffer_introspection_test.cc
@@ -1,9 +1,10 @@
+#include "flatbuffers/reflection.h"
+#include "gtest/gtest.h"
+
#include "aos/json_to_flatbuffer.h"
#include "aos/json_to_flatbuffer_generated.h"
#include "aos/testing/path.h"
#include "aos/util/file.h"
-#include "flatbuffers/reflection.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/flatbuffer_merge.cc b/aos/flatbuffer_merge.cc
index f89165b..8e31596 100644
--- a/aos/flatbuffer_merge.cc
+++ b/aos/flatbuffer_merge.cc
@@ -2,10 +2,11 @@
#include <cstdio>
-#include "aos/flatbuffer_utils.h"
#include "flatbuffers/flatbuffers.h"
#include "flatbuffers/minireflect.h"
+#include "aos/flatbuffer_utils.h"
+
namespace aos {
namespace {
diff --git a/aos/flatbuffer_merge.h b/aos/flatbuffer_merge.h
index 4d2d395..c167464 100644
--- a/aos/flatbuffer_merge.h
+++ b/aos/flatbuffer_merge.h
@@ -4,9 +4,10 @@
#include <cstddef>
#include <string>
-#include "aos/flatbuffers.h"
#include "flatbuffers/flatbuffers.h"
+#include "aos/flatbuffers.h"
+
namespace aos {
// Merges 2 flat buffers with the provided type table into the builder. Returns
diff --git a/aos/flatbuffer_merge_test.cc b/aos/flatbuffer_merge_test.cc
index 89cecdb..4c59879 100644
--- a/aos/flatbuffer_merge_test.cc
+++ b/aos/flatbuffer_merge_test.cc
@@ -3,11 +3,12 @@
#include <string_view>
#include "absl/strings/escaping.h"
-#include "aos/json_to_flatbuffer.h"
-#include "aos/json_to_flatbuffer_generated.h"
#include "flatbuffers/minireflect.h"
#include "gtest/gtest.h"
+#include "aos/json_to_flatbuffer.h"
+#include "aos/json_to_flatbuffer_generated.h"
+
namespace aos {
namespace testing {
diff --git a/aos/flatbuffers.h b/aos/flatbuffers.h
index cdf5339..bea1225 100644
--- a/aos/flatbuffers.h
+++ b/aos/flatbuffers.h
@@ -5,11 +5,12 @@
#include <string_view>
#include "absl/types/span.h"
+#include "flatbuffers/flatbuffers.h" // IWYU pragma: export
+#include "glog/logging.h"
+
#include "aos/containers/resizeable_buffer.h"
#include "aos/macros.h"
#include "aos/util/file.h"
-#include "flatbuffers/flatbuffers.h" // IWYU pragma: export
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/flatbuffers_test.cc b/aos/flatbuffers_test.cc
index ae8d6e6..dbbe817 100644
--- a/aos/flatbuffers_test.cc
+++ b/aos/flatbuffers_test.cc
@@ -1,10 +1,11 @@
#include "aos/flatbuffers.h"
#include "absl/strings/str_cat.h"
+#include "gtest/gtest.h"
+
#include "aos/json_to_flatbuffer.h"
#include "aos/json_to_flatbuffer_generated.h"
#include "aos/testing/tmpdir.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/init.cc b/aos/init.cc
index 9b00f1c..7d4840c 100644
--- a/aos/init.cc
+++ b/aos/init.cc
@@ -11,10 +11,11 @@
#include <cstdlib>
#include <cstring>
-#include "aos/realtime.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
+#include "aos/realtime.h"
+
DEFINE_bool(coredump, false, "If true, write core dumps on failure.");
namespace aos {
diff --git a/aos/ipc_lib/aos_sync.cc b/aos/ipc_lib/aos_sync.cc
index 861a6fe..b8bd7a3 100644
--- a/aos/ipc_lib/aos_sync.cc
+++ b/aos/ipc_lib/aos_sync.cc
@@ -30,10 +30,11 @@
#include <type_traits>
#include "absl/base/call_once.h"
+#include "glog/logging.h"
+
#include "aos/macros.h"
#include "aos/thread_local.h"
#include "aos/util/compiler_memory_barrier.h"
-#include "glog/logging.h"
using ::aos::linux_code::ipc_lib::RunShmObservers;
diff --git a/aos/ipc_lib/core_lib.c b/aos/ipc_lib/core_lib.c
index a1e3315..bfe80c1 100644
--- a/aos/ipc_lib/core_lib.c
+++ b/aos/ipc_lib/core_lib.c
@@ -1,14 +1,12 @@
#include "aos/ipc_lib/core_lib.h"
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
#include "aos/ipc_lib/shared_mem_types.h"
-static uint8_t aos_8max(uint8_t l, uint8_t r) {
- return (l > r) ? l : r;
-}
+static uint8_t aos_8max(uint8_t l, uint8_t r) { return (l > r) ? l : r; }
void *shm_malloc_aligned(size_t length, uint8_t alignment) {
// minimum alignments from
// <http://software.intel.com/en-us/articles/data-alignment-when-migrating-to-64-bit-intel-architecture/>
@@ -28,8 +26,7 @@
void *msg = NULL;
aos_shm_core *shm_core = global_core->mem_struct;
- int result =
- mutex_grab(&shm_core->msg_alloc_lock);
+ int result = mutex_grab(&shm_core->msg_alloc_lock);
#ifdef NDEBUG
(void)result;
#else
@@ -40,12 +37,14 @@
shm_core->msg_alloc = (uint8_t *)shm_core->msg_alloc - align_extra;
msg = shm_core->msg_alloc;
if (msg <= global_core->shared_mem) {
- fprintf(stderr, "core_lib: RAN OUT OF SHARED MEMORY!!!----------------------------------------------------------\n");
+ fprintf(stderr,
+ "core_lib: RAN OUT OF SHARED "
+ "MEMORY!!!---------------------------------------------------------"
+ "-\n");
printf("if you didn't see the stderr output just then, you should have\n");
abort();
}
- //printf("alloc %p\n", msg);
+ // printf("alloc %p\n", msg);
mutex_unlock(&shm_core->msg_alloc_lock);
return msg;
}
-
diff --git a/aos/ipc_lib/event.cc b/aos/ipc_lib/event.cc
index 940dfbd..6b58e33 100644
--- a/aos/ipc_lib/event.cc
+++ b/aos/ipc_lib/event.cc
@@ -2,9 +2,10 @@
#include <chrono>
-#include "aos/type_traits/type_traits.h"
#include "glog/logging.h"
+#include "aos/type_traits/type_traits.h"
+
namespace aos {
Event::Event() : impl_(0) {
diff --git a/aos/ipc_lib/event_test.cc b/aos/ipc_lib/event_test.cc
index fb2421e..40c48b2 100644
--- a/aos/ipc_lib/event_test.cc
+++ b/aos/ipc_lib/event_test.cc
@@ -3,9 +3,10 @@
#include <chrono>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/testing/test_logging.h"
#include "aos/time/time.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/ipc_lib/eventfd_latency.cc b/aos/ipc_lib/eventfd_latency.cc
index 0507f26..efd326e 100644
--- a/aos/ipc_lib/eventfd_latency.cc
+++ b/aos/ipc_lib/eventfd_latency.cc
@@ -6,6 +6,8 @@
#include <random>
#include <thread>
+#include "gflags/gflags.h"
+
#include "aos/events/epoll.h"
#include "aos/init.h"
#include "aos/ipc_lib/latency_lib.h"
@@ -13,7 +15,6 @@
#include "aos/logging/logging.h"
#include "aos/realtime.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
// This is a demo program which uses named pipes to communicate.
// It measures both latency of a random timer thread, and latency of the
diff --git a/aos/ipc_lib/futex_latency.cc b/aos/ipc_lib/futex_latency.cc
index 1ec3fc1..80ba711 100644
--- a/aos/ipc_lib/futex_latency.cc
+++ b/aos/ipc_lib/futex_latency.cc
@@ -6,6 +6,8 @@
#include <random>
#include <thread>
+#include "gflags/gflags.h"
+
#include "aos/condition.h"
#include "aos/init.h"
#include "aos/ipc_lib/latency_lib.h"
@@ -14,7 +16,6 @@
#include "aos/mutex/mutex.h"
#include "aos/realtime.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
DEFINE_int32(seconds, 10, "Duration of the test to run");
DEFINE_int32(
diff --git a/aos/ipc_lib/index.h b/aos/ipc_lib/index.h
index c6a485f..4814075 100644
--- a/aos/ipc_lib/index.h
+++ b/aos/ipc_lib/index.h
@@ -6,9 +6,10 @@
#include <atomic>
#include <string>
-#include "aos/ipc_lib/shm_observers.h"
#include "glog/logging.h"
+#include "aos/ipc_lib/shm_observers.h"
+
namespace aos {
namespace ipc_lib {
diff --git a/aos/ipc_lib/ipc_comparison.cc b/aos/ipc_lib/ipc_comparison.cc
index fd1ff93..f15db53 100644
--- a/aos/ipc_lib/ipc_comparison.cc
+++ b/aos/ipc_lib/ipc_comparison.cc
@@ -19,6 +19,8 @@
#include <string>
#include <thread>
+#include "gflags/gflags.h"
+
#include "aos/condition.h"
#include "aos/init.h"
#include "aos/ipc_lib/event.h"
@@ -27,7 +29,6 @@
#include "aos/mutex/mutex.h"
#include "aos/realtime.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
DEFINE_string(method, "", "Which IPC method to use");
DEFINE_int32(messages, 1000000, "How many messages to send back and forth");
diff --git a/aos/ipc_lib/latency_lib.h b/aos/ipc_lib/latency_lib.h
index 2371efa..97bc434 100644
--- a/aos/ipc_lib/latency_lib.h
+++ b/aos/ipc_lib/latency_lib.h
@@ -7,9 +7,10 @@
#include <chrono>
-#include "aos/time/time.h"
#include "glog/logging.h"
+#include "aos/time/time.h"
+
namespace aos {
void TimerThread(monotonic_clock::time_point end_time, int timer_priority);
diff --git a/aos/ipc_lib/lockless_queue.cc b/aos/ipc_lib/lockless_queue.cc
index 8e0e3d8..3d2c0d1 100644
--- a/aos/ipc_lib/lockless_queue.cc
+++ b/aos/ipc_lib/lockless_queue.cc
@@ -11,11 +11,12 @@
#include <sstream>
#include "absl/strings/escaping.h"
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/ipc_lib/lockless_queue_memory.h"
#include "aos/realtime.h"
#include "aos/util/compiler_memory_barrier.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_bool(dump_lockless_queue_data, false,
"If true, print the data out when dumping the queue.");
diff --git a/aos/ipc_lib/lockless_queue.h b/aos/ipc_lib/lockless_queue.h
index f7a85c3..9cc97c0 100644
--- a/aos/ipc_lib/lockless_queue.h
+++ b/aos/ipc_lib/lockless_queue.h
@@ -9,6 +9,7 @@
#include <vector>
#include "absl/types/span.h"
+
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/data_alignment.h"
#include "aos/ipc_lib/index.h"
diff --git a/aos/ipc_lib/lockless_queue_death_test.cc b/aos/ipc_lib/lockless_queue_death_test.cc
index 13eb1f5..3ed3099 100644
--- a/aos/ipc_lib/lockless_queue_death_test.cc
+++ b/aos/ipc_lib/lockless_queue_death_test.cc
@@ -15,6 +15,10 @@
#include <memory>
#include <thread>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/lockless_queue.h"
#include "aos/ipc_lib/lockless_queue_memory.h"
@@ -23,9 +27,6 @@
#include "aos/realtime.h"
#include "aos/testing/prevent_exit.h"
#include "aos/testing/test_logging.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
namespace aos {
namespace ipc_lib {
diff --git a/aos/ipc_lib/lockless_queue_test.cc b/aos/ipc_lib/lockless_queue_test.cc
index b708ebc..34e2762 100644
--- a/aos/ipc_lib/lockless_queue_test.cc
+++ b/aos/ipc_lib/lockless_queue_test.cc
@@ -10,6 +10,9 @@
#include <random>
#include <thread>
+#include "gflags/gflags.h"
+#include "gtest/gtest.h"
+
#include "aos/events/epoll.h"
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/event.h"
@@ -17,8 +20,6 @@
#include "aos/ipc_lib/signalfd.h"
#include "aos/realtime.h"
#include "aos/util/phased_loop.h"
-#include "gflags/gflags.h"
-#include "gtest/gtest.h"
DEFINE_int32(min_iterations, 100,
"Minimum number of stress test iterations to run");
diff --git a/aos/ipc_lib/memory_mapped_queue.h b/aos/ipc_lib/memory_mapped_queue.h
index 784c559..653dc77 100644
--- a/aos/ipc_lib/memory_mapped_queue.h
+++ b/aos/ipc_lib/memory_mapped_queue.h
@@ -2,6 +2,7 @@
#define AOS_IPC_LIB_MEMORY_MAPPED_QUEUE_H_
#include "absl/types/span.h"
+
#include "aos/configuration.h"
#include "aos/ipc_lib/lockless_queue.h"
diff --git a/aos/ipc_lib/named_pipe_latency.cc b/aos/ipc_lib/named_pipe_latency.cc
index 11ea66e..032b72e 100644
--- a/aos/ipc_lib/named_pipe_latency.cc
+++ b/aos/ipc_lib/named_pipe_latency.cc
@@ -5,6 +5,8 @@
#include <random>
#include <thread>
+#include "gflags/gflags.h"
+
#include "aos/events/epoll.h"
#include "aos/init.h"
#include "aos/ipc_lib/latency_lib.h"
@@ -12,7 +14,6 @@
#include "aos/logging/logging.h"
#include "aos/realtime.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
// This is a demo program which uses named pipes to communicate.
// It measures both latency of a random timer thread, and latency of the
diff --git a/aos/ipc_lib/queue_racer.cc b/aos/ipc_lib/queue_racer.cc
index 414b7fb..7c0408d 100644
--- a/aos/ipc_lib/queue_racer.cc
+++ b/aos/ipc_lib/queue_racer.cc
@@ -4,9 +4,10 @@
#include <cstring>
#include <limits>
-#include "aos/ipc_lib/event.h"
#include "gtest/gtest.h"
+#include "aos/ipc_lib/event.h"
+
namespace aos {
namespace ipc_lib {
namespace {
diff --git a/aos/ipc_lib/shared_mem.cc b/aos/ipc_lib/shared_mem.cc
index c91bbe9..e5de366 100644
--- a/aos/ipc_lib/shared_mem.cc
+++ b/aos/ipc_lib/shared_mem.cc
@@ -11,9 +11,10 @@
#include <cstdlib>
#include <cstring>
+#include "glog/logging.h"
+
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/core_lib.h"
-#include "glog/logging.h"
// the path for the shared memory segment. see shm_open(3) for restrictions
#define AOS_SHM_NAME "/aos_shared_mem"
diff --git a/aos/ipc_lib/signal_stress.cc b/aos/ipc_lib/signal_stress.cc
index 57a4158..0559bce 100644
--- a/aos/ipc_lib/signal_stress.cc
+++ b/aos/ipc_lib/signal_stress.cc
@@ -5,6 +5,8 @@
#include <random>
#include <thread>
+#include "gflags/gflags.h"
+
#include "aos/events/epoll.h"
#include "aos/init.h"
#include "aos/ipc_lib/latency_lib.h"
@@ -12,7 +14,6 @@
#include "aos/logging/logging.h"
#include "aos/realtime.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
// This is a demo program which uses Real-Time posix signals to communicate.
// It measures both latency of a random timer thread, and latency of the
diff --git a/aos/ipc_lib/signalfd_test.cc b/aos/ipc_lib/signalfd_test.cc
index 1c8e750..40c0a13 100644
--- a/aos/ipc_lib/signalfd_test.cc
+++ b/aos/ipc_lib/signalfd_test.cc
@@ -1,9 +1,10 @@
#include "aos/ipc_lib/signalfd.h"
-#include "aos/testing/test_logging.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/testing/test_logging.h"
+
namespace aos {
namespace ipc_lib {
namespace testing {
diff --git a/aos/json_to_flatbuffer.cc b/aos/json_to_flatbuffer.cc
index fa1cf62..023deea 100644
--- a/aos/json_to_flatbuffer.cc
+++ b/aos/json_to_flatbuffer.cc
@@ -4,12 +4,13 @@
#include <cstdio>
#include <string_view>
-#include "aos/flatbuffer_utils.h"
-#include "aos/json_tokenizer.h"
#include "flatbuffers/flatbuffers.h"
#include "flatbuffers/minireflect.h"
#include "glog/logging.h"
+#include "aos/flatbuffer_utils.h"
+#include "aos/json_tokenizer.h"
+
// TODO(austin): Can we just do an Offset<void> ? It doesn't matter, so maybe
// just say that.
//
diff --git a/aos/json_to_flatbuffer.h b/aos/json_to_flatbuffer.h
index 6eab22a..01a3c3f 100644
--- a/aos/json_to_flatbuffer.h
+++ b/aos/json_to_flatbuffer.h
@@ -6,12 +6,13 @@
#include <string>
#include <string_view>
+#include "flatbuffers/flatbuffers.h"
+#include "flatbuffers/reflection.h"
+
#include "aos/fast_string_builder.h"
#include "aos/flatbuffer_utils.h"
#include "aos/flatbuffers.h"
#include "aos/util/file.h"
-#include "flatbuffers/flatbuffers.h"
-#include "flatbuffers/reflection.h"
namespace aos {
diff --git a/aos/json_to_flatbuffer_test.cc b/aos/json_to_flatbuffer_test.cc
index fddb431..d2b88f0 100644
--- a/aos/json_to_flatbuffer_test.cc
+++ b/aos/json_to_flatbuffer_test.cc
@@ -1,10 +1,11 @@
#include "aos/json_to_flatbuffer.h"
+#include "flatbuffers/minireflect.h"
+#include "gtest/gtest.h"
+
#include "aos/flatbuffer_merge.h"
#include "aos/json_to_flatbuffer_generated.h"
#include "aos/testing/path.h"
-#include "flatbuffers/minireflect.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/json_tokenizer.h b/aos/json_tokenizer.h
index dec2a32..892c575 100644
--- a/aos/json_tokenizer.h
+++ b/aos/json_tokenizer.h
@@ -4,6 +4,7 @@
#include <string>
#include <string_view>
#include <vector>
+
#include "flatbuffers/util.h"
namespace aos {
diff --git a/aos/libc/aos_strsignal.cc b/aos/libc/aos_strsignal.cc
index cf1aad1..b46e46e 100644
--- a/aos/libc/aos_strsignal.cc
+++ b/aos/libc/aos_strsignal.cc
@@ -2,9 +2,10 @@
#include <csignal>
-#include "aos/thread_local.h"
#include "glog/logging.h"
+#include "aos/thread_local.h"
+
const char *aos_strsignal(int signal) {
AOS_THREAD_LOCAL char buffer[512];
@@ -17,15 +18,15 @@
// sys_strsignal depricated in glibc2.32
#ifdef __GLIBC__
- #if __GLIBC_PREREQ(2, 32)
+#if __GLIBC_PREREQ(2, 32)
if (signal > 0 && signal < NSIG && sigdescr_np(signal) != nullptr) {
return sigdescr_np(signal);
}
- #else
+#else
if (signal > 0 && signal < NSIG && sys_siglist[signal] != nullptr) {
return sys_siglist[signal];
}
- #endif
+#endif
// If not using GLIBC assume we can use sys_siglist
#else
if (signal > 0 && signal < NSIG && sys_siglist[signal] != nullptr) {
diff --git a/aos/logging/context.cc b/aos/logging/context.cc
index 9eaac50..02ad3eb 100644
--- a/aos/logging/context.cc
+++ b/aos/logging/context.cc
@@ -18,10 +18,11 @@
extern char *program_invocation_name;
extern char *program_invocation_short_name;
+#include "glog/logging.h"
+
#include "aos/die.h"
#include "aos/logging/implementations.h"
#include "aos/thread_local.h"
-#include "glog/logging.h"
namespace aos {
namespace logging {
diff --git a/aos/logging/dynamic_logging.h b/aos/logging/dynamic_logging.h
index 7309bfc..0dfd181 100644
--- a/aos/logging/dynamic_logging.h
+++ b/aos/logging/dynamic_logging.h
@@ -1,8 +1,9 @@
#include <string>
+#include "glog/logging.h"
+
#include "aos/events/event_loop.h"
#include "aos/logging/dynamic_log_command_generated.h"
-#include "glog/logging.h"
// The purpose of this class is to listen for /aos aos.logging.DynamicLogCommand
// and make changes to the log level of the current application based on that
diff --git a/aos/logging/dynamic_logging_test.cc b/aos/logging/dynamic_logging_test.cc
index e9cb475..2d051a8 100644
--- a/aos/logging/dynamic_logging_test.cc
+++ b/aos/logging/dynamic_logging_test.cc
@@ -2,11 +2,12 @@
#include <sys/stat.h>
+#include "glog/logging.h"
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/testing/path.h"
-#include "glog/logging.h"
-#include "gtest/gtest.h"
using aos::testing::ArtifactPath;
diff --git a/aos/logging/implementations_test.cc b/aos/logging/implementations_test.cc
index 5f98c35..d08f85f 100644
--- a/aos/logging/implementations_test.cc
+++ b/aos/logging/implementations_test.cc
@@ -4,11 +4,12 @@
#include <cinttypes>
#include <string>
-#include "aos/logging/printf_formats.h"
-#include "aos/time/time.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/logging/printf_formats.h"
+#include "aos/time/time.h"
+
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
diff --git a/aos/logging/interface.cc b/aos/logging/interface.cc
index 336dbc0..233357d 100644
--- a/aos/logging/interface.cc
+++ b/aos/logging/interface.cc
@@ -6,10 +6,11 @@
#include <functional>
#include <type_traits>
+#include "glog/logging.h"
+
#include "aos/die.h"
#include "aos/logging/context.h"
#include "aos/logging/implementations.h"
-#include "glog/logging.h"
namespace aos {
namespace logging {
diff --git a/aos/logging/log_namer.cc b/aos/logging/log_namer.cc
index ed57caa..3deb89d 100644
--- a/aos/logging/log_namer.cc
+++ b/aos/logging/log_namer.cc
@@ -14,9 +14,10 @@
#include <ctime>
#include <string>
-#include "aos/configuration.h"
#include "glog/logging.h"
+#include "aos/configuration.h"
+
DEFINE_string(logging_folder,
#ifdef AOS_ARCHITECTURE_arm_frc
"",
diff --git a/aos/logging/log_namer.h b/aos/logging/log_namer.h
index 44e93bf..a993d31 100644
--- a/aos/logging/log_namer.h
+++ b/aos/logging/log_namer.h
@@ -1,8 +1,8 @@
#ifndef AOS_LOGGING_LOG_NAMER_H_
#define AOS_LOGGING_LOG_NAMER_H_
-#include <string>
#include <optional>
+#include <string>
namespace aos {
namespace logging {
diff --git a/aos/mutex/mutex.cc b/aos/mutex/mutex.cc
index 18d233d..5c5dcbe 100644
--- a/aos/mutex/mutex.cc
+++ b/aos/mutex/mutex.cc
@@ -4,9 +4,10 @@
#include <cstdio>
#include <cstring>
-#include "aos/type_traits/type_traits.h"
#include "glog/logging.h"
+#include "aos/type_traits/type_traits.h"
+
namespace aos {
// Lock and Unlock use the return values of mutex_lock/mutex_unlock
diff --git a/aos/mutex/mutex.h b/aos/mutex/mutex.h
index 1a2a028..869f429 100644
--- a/aos/mutex/mutex.h
+++ b/aos/mutex/mutex.h
@@ -1,10 +1,11 @@
#ifndef AOS_MUTEX_H_
#define AOS_MUTEX_H_
+#include "glog/logging.h"
+
#include "aos/ipc_lib/aos_sync.h"
#include "aos/macros.h"
#include "aos/type_traits/type_traits.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/mutex/mutex_test.cc b/aos/mutex/mutex_test.cc
index bd8a548..ea57362 100644
--- a/aos/mutex/mutex_test.cc
+++ b/aos/mutex/mutex_test.cc
@@ -7,6 +7,8 @@
#include <cmath>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/die.h"
#include "aos/ipc_lib/aos_sync.h"
#include "aos/ipc_lib/core_lib.h"
@@ -14,7 +16,6 @@
#include "aos/testing/test_shm.h"
#include "aos/time/time.h"
#include "aos/util/death_test_log_implementation.h"
-#include "gtest/gtest.h"
namespace aos {
namespace testing {
diff --git a/aos/network/log_web_proxy_main.cc b/aos/network/log_web_proxy_main.cc
index 34e40a2..7833808 100644
--- a/aos/network/log_web_proxy_main.cc
+++ b/aos/network/log_web_proxy_main.cc
@@ -4,13 +4,14 @@
// /path/to/logfile And then opening the plotting webpage at
// http://localhost:8080/graph.html
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/log_reader.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/flatbuffer_merge.h"
#include "aos/init.h"
#include "aos/network/web_proxy.h"
-#include "gflags/gflags.h"
DEFINE_string(data_dir, "www", "Directory to serve data files from");
DEFINE_string(node, "", "Directory to serve data files from");
@@ -64,8 +65,7 @@
}
aos::web_proxy::WebProxy web_proxy(
- event_loop.get(),
- reader.event_loop_factory()->scheduler_epoll(),
+ event_loop.get(), reader.event_loop_factory()->scheduler_epoll(),
aos::web_proxy::StoreHistory::kYes, FLAGS_buffer_size);
web_proxy.SetDataPath(FLAGS_data_dir.c_str());
diff --git a/aos/network/message_bridge_client_lib.cc b/aos/network/message_bridge_client_lib.cc
index 0aefb5c..38512c4 100644
--- a/aos/network/message_bridge_client_lib.cc
+++ b/aos/network/message_bridge_client_lib.cc
@@ -3,6 +3,9 @@
#include <chrono>
#include <string_view>
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/shm_event_loop.h"
#include "aos/network/connect_generated.h"
@@ -13,8 +16,6 @@
#include "aos/network/timestamp_generated.h"
#include "aos/unique_malloc_ptr.h"
#include "aos/util/file.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
// This application receives messages from another node and re-publishes them on
// this node.
diff --git a/aos/network/message_bridge_protocol.cc b/aos/network/message_bridge_protocol.cc
index 38e16b2..c661c4c 100644
--- a/aos/network/message_bridge_protocol.cc
+++ b/aos/network/message_bridge_protocol.cc
@@ -2,11 +2,12 @@
#include <string_view>
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/configuration.h"
#include "aos/flatbuffer_merge.h"
#include "aos/flatbuffers.h"
#include "aos/network/connect_generated.h"
-#include "flatbuffers/flatbuffers.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/message_bridge_server.cc b/aos/network/message_bridge_server.cc
index ec3cdc4..04b07c3 100644
--- a/aos/network/message_bridge_server.cc
+++ b/aos/network/message_bridge_server.cc
@@ -1,10 +1,11 @@
+#include "gflags/gflags.h"
+#include "glog/logging.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/logging/dynamic_logging.h"
#include "aos/network/message_bridge_server_lib.h"
#include "aos/sha256.h"
-#include "gflags/gflags.h"
-#include "glog/logging.h"
DEFINE_string(config, "aos_config.json", "Path to the config.");
DEFINE_int32(rt_priority, -1, "If > 0, run as this RT priority");
diff --git a/aos/network/message_bridge_server_lib.cc b/aos/network/message_bridge_server_lib.cc
index df6d4b1..a474e88 100644
--- a/aos/network/message_bridge_server_lib.cc
+++ b/aos/network/message_bridge_server_lib.cc
@@ -2,6 +2,9 @@
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
+#include "glog/logging.h"
+#include "glog/raw_logging.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/events/shm_event_loop.h"
@@ -12,8 +15,6 @@
#include "aos/network/remote_message_generated.h"
#include "aos/network/sctp_server.h"
#include "aos/network/timestamp_channel.h"
-#include "glog/logging.h"
-#include "glog/raw_logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/message_bridge_server_lib.h b/aos/network/message_bridge_server_lib.h
index 98e1dd0..d74a847 100644
--- a/aos/network/message_bridge_server_lib.h
+++ b/aos/network/message_bridge_server_lib.h
@@ -4,6 +4,8 @@
#include <deque>
#include "absl/types/span.h"
+#include "glog/logging.h"
+
#include "aos/events/logging/log_reader.h"
#include "aos/events/logging/logger_generated.h"
#include "aos/events/shm_event_loop.h"
@@ -16,7 +18,6 @@
#include "aos/network/sctp_server.h"
#include "aos/network/timestamp_channel.h"
#include "aos/network/timestamp_generated.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
@@ -65,7 +66,8 @@
// Needs to be called when a node (might have) disconnected.
// Returns the node index which [dis]connected, or -1 if it didn't match.
// reconnected is a vector of associations which have already connected.
- // This will potentially grow to the number of associations as we find reconnects.
+ // This will potentially grow to the number of associations as we find
+ // reconnects.
int NodeDisconnected(sctp_assoc_t assoc_id);
int NodeConnected(const Node *node, sctp_assoc_t assoc_id, int stream,
SctpServer *server, FixedAllocator *allocator,
diff --git a/aos/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index 681001e..153f1e5 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -2,6 +2,8 @@
#include <thread>
#include "absl/strings/str_cat.h"
+#include "gtest/gtest.h"
+
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
#include "aos/ipc_lib/event.h"
@@ -11,7 +13,6 @@
#include "aos/sha256.h"
#include "aos/testing/path.h"
#include "aos/util/file.h"
-#include "gtest/gtest.h"
DECLARE_string(boot_uuid);
@@ -423,54 +424,54 @@
// Wait until we are connected, then send.
int ping_count = 0;
int pi1_server_statistics_count = 0;
- ping_event_loop.MakeWatcher("/pi1/aos", [this, &ping_count, &ping_sender,
- &pi1_server_statistics_count,
- &long_data](
- const ServerStatistics &stats) {
- VLOG(1) << "/pi1/aos ServerStatistics " << FlatbufferToJson(&stats);
+ ping_event_loop.MakeWatcher(
+ "/pi1/aos",
+ [this, &ping_count, &ping_sender, &pi1_server_statistics_count,
+ &long_data](const ServerStatistics &stats) {
+ VLOG(1) << "/pi1/aos ServerStatistics " << FlatbufferToJson(&stats);
- ASSERT_TRUE(stats.has_connections());
- EXPECT_EQ(stats.connections()->size(), 1);
+ ASSERT_TRUE(stats.has_connections());
+ EXPECT_EQ(stats.connections()->size(), 1);
- bool connected = false;
- for (const ServerConnection *connection : *stats.connections()) {
- // Confirm that we are estimating the server time offset correctly. It
- // should be about 0 since we are on the same machine here.
- if (connection->has_monotonic_offset()) {
- EXPECT_LT(chrono::nanoseconds(connection->monotonic_offset()),
- chrono::milliseconds(1));
- EXPECT_GT(chrono::nanoseconds(connection->monotonic_offset()),
- chrono::milliseconds(-1));
- ++pi1_server_statistics_count;
- }
+ bool connected = false;
+ for (const ServerConnection *connection : *stats.connections()) {
+ // Confirm that we are estimating the server time offset correctly. It
+ // should be about 0 since we are on the same machine here.
+ if (connection->has_monotonic_offset()) {
+ EXPECT_LT(chrono::nanoseconds(connection->monotonic_offset()),
+ chrono::milliseconds(1));
+ EXPECT_GT(chrono::nanoseconds(connection->monotonic_offset()),
+ chrono::milliseconds(-1));
+ ++pi1_server_statistics_count;
+ }
- if (connection->node()->name()->string_view() ==
- pi2_client_event_loop->node()->name()->string_view()) {
- if (connection->state() == State::CONNECTED) {
- EXPECT_TRUE(connection->has_boot_uuid());
- EXPECT_EQ(connection->connection_count(), 1u);
- EXPECT_LT(monotonic_clock::time_point(chrono::nanoseconds(
- connection->connected_since_time())),
- monotonic_clock::now());
- connected = true;
- } else {
- EXPECT_FALSE(connection->has_connection_count());
- EXPECT_FALSE(connection->has_connected_since_time());
+ if (connection->node()->name()->string_view() ==
+ pi2_client_event_loop->node()->name()->string_view()) {
+ if (connection->state() == State::CONNECTED) {
+ EXPECT_TRUE(connection->has_boot_uuid());
+ EXPECT_EQ(connection->connection_count(), 1u);
+ EXPECT_LT(monotonic_clock::time_point(chrono::nanoseconds(
+ connection->connected_since_time())),
+ monotonic_clock::now());
+ connected = true;
+ } else {
+ EXPECT_FALSE(connection->has_connection_count());
+ EXPECT_FALSE(connection->has_connected_since_time());
+ }
+ }
}
- }
- }
- if (connected) {
- VLOG(1) << "Connected! Sent ping.";
- auto builder = ping_sender.MakeBuilder();
- builder.fbb()->CreateString(long_data);
- examples::Ping::Builder ping_builder =
- builder.MakeBuilder<examples::Ping>();
- ping_builder.add_value(ping_count + 971);
- EXPECT_EQ(builder.Send(ping_builder.Finish()), RawSender::Error::kOk);
- ++ping_count;
- }
- });
+ if (connected) {
+ VLOG(1) << "Connected! Sent ping.";
+ auto builder = ping_sender.MakeBuilder();
+ builder.fbb()->CreateString(long_data);
+ examples::Ping::Builder ping_builder =
+ builder.MakeBuilder<examples::Ping>();
+ ping_builder.add_value(ping_count + 971);
+ EXPECT_EQ(builder.Send(ping_builder.Finish()), RawSender::Error::kOk);
+ ++ping_count;
+ }
+ });
// Confirm both client and server statistics messages have decent offsets in
// them.
diff --git a/aos/network/multinode_timestamp_filter.cc b/aos/network/multinode_timestamp_filter.cc
index 32d345a..417845b 100644
--- a/aos/network/multinode_timestamp_filter.cc
+++ b/aos/network/multinode_timestamp_filter.cc
@@ -5,12 +5,13 @@
#include <map>
#include "absl/strings/str_join.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/boot_timestamp.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/network/timestamp_filter.h"
#include "aos/time/time.h"
-#include "glog/logging.h"
DEFINE_bool(timestamps_to_csv, false,
"If true, write all the time synchronization information to a set "
@@ -278,8 +279,7 @@
result.hessian = Eigen::MatrixXd::Zero(states(), states());
// Constrain the average of the times.
- result.A =
- Eigen::MatrixXd::Ones(1, states()) / static_cast<double>(states());
+ result.A = Eigen::MatrixXd::Ones(1, states()) / static_cast<double>(states());
result.Axmb = Eigen::VectorXd::Zero(1);
if (active_constraints.size() > 0 || all) {
diff --git a/aos/network/multinode_timestamp_filter.h b/aos/network/multinode_timestamp_filter.h
index 5864334..e3bfde2 100644
--- a/aos/network/multinode_timestamp_filter.h
+++ b/aos/network/multinode_timestamp_filter.h
@@ -7,13 +7,14 @@
#include "Eigen/Dense"
#include "absl/container/btree_set.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/boot_timestamp.h"
#include "aos/events/logging/logfile_utils.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/network/timestamp_filter.h"
#include "aos/time/time.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
@@ -317,7 +318,6 @@
// Points to solve equality constraints to.
absl::Span<const logger::BootTimestamp> points_;
-
};
// Helpers to convert times between the monotonic and distributed clocks for
@@ -552,8 +552,7 @@
void FlushAllSamples(bool finish);
// Adds the solution to last_distributed_.
- void UpdateSolution(
- std::vector<logger::BootTimestamp> result_times);
+ void UpdateSolution(std::vector<logger::BootTimestamp> result_times);
void WriteFilter(
NoncausalTimestampFilter *next_filter,
diff --git a/aos/network/multinode_timestamp_filter_test.cc b/aos/network/multinode_timestamp_filter_test.cc
index 209de06..1446e77 100644
--- a/aos/network/multinode_timestamp_filter_test.cc
+++ b/aos/network/multinode_timestamp_filter_test.cc
@@ -2,12 +2,13 @@
#include <chrono>
+#include "gtest/gtest.h"
+
#include "aos/configuration.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/macros.h"
#include "aos/network/testing_time_converter.h"
#include "aos/network/timestamp_filter.h"
-#include "gtest/gtest.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index ab70c20..b7b7a93 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -9,9 +9,10 @@
#include <cstring>
#include <string_view>
+#include "glog/logging.h"
+
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-#include "glog/logging.h"
DEFINE_int32(sinit_max_init_timeout, 0,
"Timeout in milliseconds for retrying the INIT packet when "
diff --git a/aos/network/sctp_client.h b/aos/network/sctp_client.h
index d7a2b43..5affecc 100644
--- a/aos/network/sctp_client.h
+++ b/aos/network/sctp_client.h
@@ -5,9 +5,10 @@
#include <cstdlib>
#include <string_view>
+#include "glog/logging.h"
+
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/sctp_lib.h b/aos/network/sctp_lib.h
index a852365..42cecea 100644
--- a/aos/network/sctp_lib.h
+++ b/aos/network/sctp_lib.h
@@ -10,10 +10,11 @@
#include <string_view>
#include <vector>
-#include "aos/unique_malloc_ptr.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
+#include "aos/unique_malloc_ptr.h"
+
namespace aos {
namespace message_bridge {
diff --git a/aos/network/sctp_lib_test.cc b/aos/network/sctp_lib_test.cc
index 53b285f..f297a82 100644
--- a/aos/network/sctp_lib_test.cc
+++ b/aos/network/sctp_lib_test.cc
@@ -1,8 +1,9 @@
#include "aos/network/sctp_lib.h"
-#include "aos/init.h"
#include "gflags/gflags.h"
+#include "aos/init.h"
+
DEFINE_string(host, "", "host to resolve");
DEFINE_int32(port, 2977, "port to use");
diff --git a/aos/network/sctp_server.cc b/aos/network/sctp_server.cc
index a78aa34..cfc8512 100644
--- a/aos/network/sctp_server.cc
+++ b/aos/network/sctp_server.cc
@@ -13,9 +13,10 @@
#include <memory>
#include <thread>
+#include "glog/logging.h"
+
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/sctp_server.h b/aos/network/sctp_server.h
index 800c2c1..6d0b44e 100644
--- a/aos/network/sctp_server.h
+++ b/aos/network/sctp_server.h
@@ -13,9 +13,10 @@
#include <cstring>
#include <memory>
+#include "glog/logging.h"
+
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/timestamp_channel.h b/aos/network/timestamp_channel.h
index d95edda..c8e88d9 100644
--- a/aos/network/timestamp_channel.h
+++ b/aos/network/timestamp_channel.h
@@ -5,10 +5,11 @@
#include <vector>
#include "absl/container/btree_map.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/event_loop.h"
#include "aos/network/remote_message_generated.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/timestamp_channel_test.cc b/aos/network/timestamp_channel_test.cc
index e3850ca..a217a74 100644
--- a/aos/network/timestamp_channel_test.cc
+++ b/aos/network/timestamp_channel_test.cc
@@ -1,12 +1,13 @@
#include "aos/network/timestamp_channel.h"
+#include "gtest/gtest.h"
+
#include "aos/configuration.h"
#include "aos/events/ping_generated.h"
#include "aos/events/shm_event_loop.h"
#include "aos/events/simulated_event_loop.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
-#include "gtest/gtest.h"
DECLARE_string(override_hostname);
diff --git a/aos/network/timestamp_filter.cc b/aos/network/timestamp_filter.cc
index 4664f6f..77d3726 100644
--- a/aos/network/timestamp_filter.cc
+++ b/aos/network/timestamp_filter.cc
@@ -7,6 +7,7 @@
#include "absl/numeric/int128.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
+
#include "aos/configuration.h"
#include "aos/time/time.h"
diff --git a/aos/network/timestamp_filter.h b/aos/network/timestamp_filter.h
index 3e2db01..8b597bd 100644
--- a/aos/network/timestamp_filter.h
+++ b/aos/network/timestamp_filter.h
@@ -8,10 +8,11 @@
#include <deque>
#include "absl/numeric/int128.h"
+#include "glog/logging.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/boot_timestamp.h"
#include "aos/time/time.h"
-#include "glog/logging.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/timestamp_filter_test.cc b/aos/network/timestamp_filter_test.cc
index e33fdd1..07f7d6d 100644
--- a/aos/network/timestamp_filter_test.cc
+++ b/aos/network/timestamp_filter_test.cc
@@ -2,11 +2,12 @@
#include <chrono>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
#include "aos/configuration.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/macros.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/web_proxy.cc b/aos/network/web_proxy.cc
index d384f72..d7ab418 100644
--- a/aos/network/web_proxy.cc
+++ b/aos/network/web_proxy.cc
@@ -1,11 +1,12 @@
#include "aos/network/web_proxy.h"
+#include "glog/logging.h"
+
#include "aos/flatbuffer_merge.h"
#include "aos/network/connect_generated.h"
#include "aos/network/web_proxy_generated.h"
#include "aos/network/web_proxy_utils.h"
#include "aos/seasocks/seasocks_logger.h"
-#include "glog/logging.h"
#include "internal/Embedded.h"
extern "C" {
diff --git a/aos/network/web_proxy.h b/aos/network/web_proxy.h
index e38dcea..5526d07 100644
--- a/aos/network/web_proxy.h
+++ b/aos/network/web_proxy.h
@@ -5,6 +5,8 @@
#include <map>
#include <set>
+#include "flatbuffers/flatbuffers.h"
+
#include "aos/events/event_loop.h"
#include "aos/events/shm_event_loop.h"
#include "aos/mutex/mutex.h"
@@ -12,7 +14,6 @@
#include "aos/network/rawrtc.h"
#include "aos/network/web_proxy_generated.h"
#include "aos/seasocks/seasocks_logger.h"
-#include "flatbuffers/flatbuffers.h"
#include "seasocks/Server.h"
#include "seasocks/StringUtil.h"
#include "seasocks/WebSocket.h"
diff --git a/aos/network/web_proxy_main.cc b/aos/network/web_proxy_main.cc
index 2a92a88..7684b06 100644
--- a/aos/network/web_proxy_main.cc
+++ b/aos/network/web_proxy_main.cc
@@ -1,8 +1,9 @@
+#include "gflags/gflags.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/flatbuffer_merge.h"
#include "aos/init.h"
#include "aos/network/web_proxy.h"
-#include "gflags/gflags.h"
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
DEFINE_string(data_dir, "www", "Directory to serve data files from");
diff --git a/aos/network/web_proxy_utils.h b/aos/network/web_proxy_utils.h
index de64329..c5e2716 100644
--- a/aos/network/web_proxy_utils.h
+++ b/aos/network/web_proxy_utils.h
@@ -1,4 +1,5 @@
#include "absl/types/span.h"
+
#include "aos/events/event_loop.h"
#include "aos/flatbuffers.h"
#include "aos/network/web_proxy_generated.h"
diff --git a/aos/realtime.cc b/aos/realtime.cc
index 2f5e1d9..14849a4 100644
--- a/aos/realtime.cc
+++ b/aos/realtime.cc
@@ -15,10 +15,11 @@
#include <cstdlib>
#include <cstring>
-#include "aos/thread_local.h"
#include "glog/logging.h"
#include "glog/raw_logging.h"
+#include "aos/thread_local.h"
+
DEFINE_bool(
die_on_malloc, true,
"If true, die when the application allocates memory in a RT section.");
diff --git a/aos/realtime_test.cc b/aos/realtime_test.cc
index 35936ee..97f21c8 100644
--- a/aos/realtime_test.cc
+++ b/aos/realtime_test.cc
@@ -1,10 +1,11 @@
#include "aos/realtime.h"
-#include "aos/init.h"
#include "glog/logging.h"
#include "glog/raw_logging.h"
#include "gtest/gtest.h"
+#include "aos/init.h"
+
DECLARE_bool(die_on_malloc);
namespace aos {
diff --git a/aos/seasocks/internal/Config.h b/aos/seasocks/internal/Config.h
index e99d356..77c455d 100644
--- a/aos/seasocks/internal/Config.h
+++ b/aos/seasocks/internal/Config.h
@@ -1,6 +1,8 @@
-// Generated by Comran from version 1.1.2 with the autoconf scripts from upstream
+// Generated by Comran from version 1.1.2 with the autoconf scripts from
+// upstream
/* src/main/c/internal/Config.h. Generated from Config.h.in by configure. */
-/* src/main/c/internal/Config.h.in. Generated from configure.ac by autoheader. */
+/* src/main/c/internal/Config.h.in. Generated from configure.ac by autoheader.
+ */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
@@ -194,8 +196,8 @@
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
-# define _Restrict
-# define __restrict__
+#define _Restrict
+#define __restrict__
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
diff --git a/aos/seasocks/seasocks_logger.cc b/aos/seasocks/seasocks_logger.cc
index 3cf3bd9..440a3ba 100644
--- a/aos/seasocks/seasocks_logger.cc
+++ b/aos/seasocks/seasocks_logger.cc
@@ -1,6 +1,7 @@
#include "aos/seasocks/seasocks_logger.h"
#include "glog/logging.h"
+
#include "seasocks/PrintfLogger.h"
namespace aos {
diff --git a/aos/starter/irq_affinity.cc b/aos/starter/irq_affinity.cc
index 7b74fe1..8b6bb2a 100644
--- a/aos/starter/irq_affinity.cc
+++ b/aos/starter/irq_affinity.cc
@@ -4,12 +4,13 @@
#include <sys/resource.h>
#include <sys/types.h>
+#include "gflags/gflags.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/starter/irq_affinity_lib.h"
#include "aos/starter/kthread_generated.h"
#include "aos/util/top.h"
-#include "gflags/gflags.h"
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
diff --git a/aos/starter/irq_affinity_lib.cc b/aos/starter/irq_affinity_lib.cc
index ccc4853..2128f52 100644
--- a/aos/starter/irq_affinity_lib.cc
+++ b/aos/starter/irq_affinity_lib.cc
@@ -5,6 +5,7 @@
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_split.h"
+
#include "aos/scoped/scoped_fd.h"
namespace aos {
@@ -165,7 +166,8 @@
} else {
// And then either "Level/Edge" and then the actions, or just
// the actions. Kernel has CONFIG_GENERIC_IRQ_SHOW_LEVEL
- // enabled if the string starts with either.. Strip it until someone finds a use.
+ // enabled if the string starts with either.. Strip it until
+ // someone finds a use.
if (absl::StartsWith(trailing_element, "Level")) {
trailing_element =
absl::StripAsciiWhitespace(trailing_element.substr(5));
diff --git a/aos/starter/irq_affinity_lib.h b/aos/starter/irq_affinity_lib.h
index ccb7d03..8bbad15 100644
--- a/aos/starter/irq_affinity_lib.h
+++ b/aos/starter/irq_affinity_lib.h
@@ -48,7 +48,6 @@
const std::vector<InterruptState> &states() const { return states_; }
private:
-
// Buffer to hold the contents of /proc/interrupts to avoid re-allocating
// continually.
std::vector<char> interrupts_content_;
diff --git a/aos/starter/irq_affinity_lib_test.cc b/aos/starter/irq_affinity_lib_test.cc
index 0fe240b..f491f6f 100644
--- a/aos/starter/irq_affinity_lib_test.cc
+++ b/aos/starter/irq_affinity_lib_test.cc
@@ -1,7 +1,7 @@
#include "aos/starter/irq_affinity_lib.h"
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
namespace aos::testing {
@@ -270,9 +270,10 @@
EXPECT_EQ(status.states()[0].interrupt_number, 8);
EXPECT_EQ(status.states()[0].chip_name, "IR-IO-APIC");
EXPECT_THAT(status.states()[0].count,
- ::testing::ElementsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
+ ::testing::ElementsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0));
EXPECT_EQ(status.states()[0].hwirq, "8-edge");
EXPECT_THAT(status.states()[0].actions, ::testing::ElementsAre("rtc0"));
}
-} // aos::testing
+} // namespace aos::testing
diff --git a/aos/starter/starter_cmd.cc b/aos/starter/starter_cmd.cc
index 9cf2436..6c172fe 100644
--- a/aos/starter/starter_cmd.cc
+++ b/aos/starter/starter_cmd.cc
@@ -8,11 +8,12 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
+#include "gflags/gflags.h"
+
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
+#include "aos/starter/starter_rpc_lib.h"
#include "aos/time/time.h"
-#include "gflags/gflags.h"
-#include "starter_rpc_lib.h"
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
// TODO(james): Bash autocompletion for node names.
diff --git a/aos/starter/starter_rpc_lib.cc b/aos/starter/starter_rpc_lib.cc
index 5f14e21..7f8f53c 100644
--- a/aos/starter/starter_rpc_lib.cc
+++ b/aos/starter/starter_rpc_lib.cc
@@ -1,9 +1,10 @@
-#include "starter_rpc_lib.h"
+#include "aos/starter/starter_rpc_lib.h"
+
+#include "glog/logging.h"
#include "aos/events/shm_event_loop.h"
#include "aos/flatbuffer_merge.h"
#include "aos/starter/starterd_lib.h"
-#include "glog/logging.h"
namespace aos {
namespace starter {
diff --git a/aos/starter/starter_test.cc b/aos/starter/starter_test.cc
index 94566ae..37efa98 100644
--- a/aos/starter/starter_test.cc
+++ b/aos/starter/starter_test.cc
@@ -3,16 +3,17 @@
#include <future>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/events/ping_generated.h"
#include "aos/events/pong_generated.h"
#include "aos/ipc_lib/event.h"
#include "aos/network/team_number.h"
+#include "aos/starter/starter_rpc_lib.h"
+#include "aos/starter/starterd_lib.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
#include "aos/util/file.h"
-#include "gtest/gtest.h"
-#include "starter_rpc_lib.h"
-#include "starterd_lib.h"
using aos::testing::ArtifactPath;
diff --git a/aos/starter/starterd.cc b/aos/starter/starterd.cc
index 19117de..d6caf3f 100644
--- a/aos/starter/starterd.cc
+++ b/aos/starter/starterd.cc
@@ -1,10 +1,11 @@
#include <pwd.h>
#include <sys/types.h>
+#include "gflags/gflags.h"
+
#include "aos/init.h"
#include "aos/starter/starterd_lib.h"
#include "aos/util/file.h"
-#include "gflags/gflags.h"
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
DEFINE_string(user, "",
@@ -41,7 +42,8 @@
constexpr int kUnchanged = -1;
if (setresgid(/* ruid */ gid, /* euid */ gid,
/* suid */ kUnchanged) != 0) {
- PLOG(FATAL) << "Failed to change GID to " << FLAGS_user << ", group " << gid;
+ PLOG(FATAL) << "Failed to change GID to " << FLAGS_user << ", group "
+ << gid;
}
if (setresuid(/* ruid */ uid, /* euid */ uid,
diff --git a/aos/starter/starterd_lib.cc b/aos/starter/starterd_lib.cc
index 30e0887..949c8a7 100644
--- a/aos/starter/starterd_lib.cc
+++ b/aos/starter/starterd_lib.cc
@@ -1,13 +1,14 @@
-#include "starterd_lib.h"
+#include "aos/starter/starterd_lib.h"
#include <algorithm>
#include <utility>
#include "absl/strings/str_format.h"
-#include "aos/json_to_flatbuffer.h"
#include "glog/logging.h"
#include "glog/stl_logging.h"
+#include "aos/json_to_flatbuffer.h"
+
// FLAGS_shm_base is defined elsewhere, declare it here so it can be used
// to override the shared memory folder for unit testing.
DECLARE_string(shm_base);
diff --git a/aos/starter/subprocess.cc b/aos/starter/subprocess.cc
index a05ab74..b86b12d 100644
--- a/aos/starter/subprocess.cc
+++ b/aos/starter/subprocess.cc
@@ -280,7 +280,7 @@
}
std::vector<char *> cargs = CArgs();
- const char* path = run_as_sudo_ ? kSudo : path_.c_str();
+ const char *path = run_as_sudo_ ? kSudo : path_.c_str();
execvp(path, cargs.data());
// If we got here, something went wrong
diff --git a/aos/starter/subprocess.h b/aos/starter/subprocess.h
index 99ad053..1f16168 100644
--- a/aos/starter/subprocess.h
+++ b/aos/starter/subprocess.h
@@ -112,7 +112,7 @@
private:
typedef aos::util::ScopedPipe::PipePair PipePair;
- static constexpr const char* const kSudo{"sudo"};
+ static constexpr const char *const kSudo{"sudo"};
void set_args(
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>
diff --git a/aos/starter/subprocess_test.cc b/aos/starter/subprocess_test.cc
index 71f701a..d7f8be4 100644
--- a/aos/starter/subprocess_test.cc
+++ b/aos/starter/subprocess_test.cc
@@ -1,10 +1,11 @@
#include "aos/starter/subprocess.h"
+#include "gtest/gtest.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
#include "aos/util/file.h"
-#include "gtest/gtest.h"
namespace aos::starter::testing {
diff --git a/aos/stl_mutex/stl_mutex.h b/aos/stl_mutex/stl_mutex.h
index e3a930e..5aaa6b6 100644
--- a/aos/stl_mutex/stl_mutex.h
+++ b/aos/stl_mutex/stl_mutex.h
@@ -3,9 +3,10 @@
#include <mutex>
+#include "glog/logging.h"
+
#include "aos/ipc_lib/aos_sync.h"
#include "aos/macros.h"
-#include "glog/logging.h"
namespace aos {
diff --git a/aos/stl_mutex/stl_mutex_test.cc b/aos/stl_mutex/stl_mutex_test.cc
index 5abd934..5e88c56 100644
--- a/aos/stl_mutex/stl_mutex_test.cc
+++ b/aos/stl_mutex/stl_mutex_test.cc
@@ -1,8 +1,9 @@
#include "aos/stl_mutex/stl_mutex.h"
-#include "aos/die.h"
#include "gtest/gtest.h"
+#include "aos/die.h"
+
namespace aos {
namespace testing {
diff --git a/aos/testing/flatbuffer_eq.h b/aos/testing/flatbuffer_eq.h
index 2f7b345..b560aaa 100644
--- a/aos/testing/flatbuffer_eq.h
+++ b/aos/testing/flatbuffer_eq.h
@@ -1,10 +1,11 @@
#ifndef AOS_TESTING_FLATBUFFER_EQ_H_
#define AOS_TESTING_FLATBUFFER_EQ_H_
+#include "gmock/gmock.h"
+
#include "aos/flatbuffer_merge.h"
#include "aos/flatbuffers.h"
#include "aos/json_to_flatbuffer.h"
-#include "gmock/gmock.h"
namespace aos {
namespace testing {
diff --git a/aos/testing/gtest_main.cc b/aos/testing/gtest_main.cc
index a6e944c..21f141f 100644
--- a/aos/testing/gtest_main.cc
+++ b/aos/testing/gtest_main.cc
@@ -2,11 +2,12 @@
#include <iostream>
-#include "aos/init.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/init.h"
+
DEFINE_bool(print_logs, false,
"Print the log messages as they are being generated.");
DEFINE_string(log_file, "",
diff --git a/aos/testing/test_logging.cc b/aos/testing/test_logging.cc
index d2466c9..ad2cc03 100644
--- a/aos/testing/test_logging.cc
+++ b/aos/testing/test_logging.cc
@@ -4,10 +4,11 @@
#include <vector>
#include "absl/base/call_once.h"
+#include "gtest/gtest.h"
+
#include "aos/logging/implementations.h"
#include "aos/stl_mutex/stl_mutex.h"
#include "aos/thread_local.h"
-#include "gtest/gtest.h"
using ::aos::logging::LogMessage;
diff --git a/aos/testing/test_logging_test.cc b/aos/testing/test_logging_test.cc
index e7f9806..f39c6cf 100644
--- a/aos/testing/test_logging_test.cc
+++ b/aos/testing/test_logging_test.cc
@@ -2,9 +2,10 @@
#include <thread>
-#include "aos/logging/logging.h"
#include "gtest/gtest.h"
+#include "aos/logging/logging.h"
+
namespace aos {
namespace testing {
diff --git a/aos/time/time.cc b/aos/time/time.cc
index 4f39c36..361616c 100644
--- a/aos/time/time.cc
+++ b/aos/time/time.cc
@@ -156,9 +156,8 @@
return std::nullopt;
}
- return realtime_clock::time_point(
- std::chrono::seconds(seconds) +
- std::chrono::nanoseconds(nanoseconds_data));
+ return realtime_clock::time_point(std::chrono::seconds(seconds) +
+ std::chrono::nanoseconds(nanoseconds_data));
}
#endif
diff --git a/aos/time/time_test.cc b/aos/time/time_test.cc
index 4fbf821..d5c82f2 100644
--- a/aos/time/time_test.cc
+++ b/aos/time/time_test.cc
@@ -2,11 +2,12 @@
#include <thread>
-#include "aos/macros.h"
-#include "aos/util/death_test_log_implementation.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/macros.h"
+#include "aos/util/death_test_log_implementation.h"
+
namespace aos {
namespace time {
namespace testing {
diff --git a/aos/util/config_validator_lib.h b/aos/util/config_validator_lib.h
index 61658e5..30a956a 100644
--- a/aos/util/config_validator_lib.h
+++ b/aos/util/config_validator_lib.h
@@ -1,9 +1,10 @@
#ifndef AOS_UTIL_CONFIG_VALIDATOR_H_
#define AOS_UTIL_CONFIG_VALIDATOR_H_
+#include "gtest/gtest.h"
+
#include "aos/configuration.h"
#include "aos/util/config_validator_config_generated.h"
-#include "gtest/gtest.h"
namespace aos::util {
void ConfigIsValid(const aos::Configuration *config,
diff --git a/aos/util/config_validator_lib_test.cc b/aos/util/config_validator_lib_test.cc
index c68695c..ee80ac4 100644
--- a/aos/util/config_validator_lib_test.cc
+++ b/aos/util/config_validator_lib_test.cc
@@ -1,8 +1,9 @@
#include "aos/util/config_validator_lib.h"
+#include "gtest/gtest-spi.h"
+
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/path.h"
-#include "gtest/gtest-spi.h"
using aos::testing::ArtifactPath;
namespace aos::util::testing {
diff --git a/aos/util/error_counter_test.cc b/aos/util/error_counter_test.cc
index 567d71d..0a786bf 100644
--- a/aos/util/error_counter_test.cc
+++ b/aos/util/error_counter_test.cc
@@ -1,8 +1,9 @@
#include "aos/util/error_counter.h"
+#include "gtest/gtest.h"
+
#include "aos/events/event_loop_generated.h"
#include "aos/flatbuffers.h"
-#include "gtest/gtest.h"
namespace aos::util::testing {
// Exercises the basic API for the ErrorCounter class, ensuring that everything
diff --git a/aos/util/file.h b/aos/util/file.h
index ddd5d47..3b2231a 100644
--- a/aos/util/file.h
+++ b/aos/util/file.h
@@ -12,10 +12,11 @@
#include "absl/strings/numbers.h"
#include "absl/types/span.h"
-#include "aos/scoped/scoped_fd.h"
#include "flatbuffers/util.h"
#include "glog/logging.h"
+#include "aos/scoped/scoped_fd.h"
+
namespace aos {
namespace util {
diff --git a/aos/util/file_test.cc b/aos/util/file_test.cc
index ba03ea5..712447e 100644
--- a/aos/util/file_test.cc
+++ b/aos/util/file_test.cc
@@ -3,9 +3,10 @@
#include <cstdlib>
#include <string>
+#include "gtest/gtest.h"
+
#include "aos/realtime.h"
#include "aos/testing/tmpdir.h"
-#include "gtest/gtest.h"
namespace aos {
namespace util {
diff --git a/aos/util/foxglove_websocket.cc b/aos/util/foxglove_websocket.cc
index 77dca20..44e24c8 100644
--- a/aos/util/foxglove_websocket.cc
+++ b/aos/util/foxglove_websocket.cc
@@ -1,7 +1,8 @@
+#include "gflags/gflags.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/init.h"
#include "aos/util/foxglove_websocket_lib.h"
-#include "gflags/gflags.h"
DEFINE_string(config, "aos_config.json", "Path to the config.");
DEFINE_uint32(port, 8765, "Port to use for foxglove websocket server.");
diff --git a/aos/util/foxglove_websocket_lib.cc b/aos/util/foxglove_websocket_lib.cc
index 06c551e..ab99400 100644
--- a/aos/util/foxglove_websocket_lib.cc
+++ b/aos/util/foxglove_websocket_lib.cc
@@ -1,9 +1,10 @@
#include "aos/util/foxglove_websocket_lib.h"
#include "absl/strings/escaping.h"
+#include "gflags/gflags.h"
+
#include "aos/flatbuffer_merge.h"
#include "aos/util/mcap_logger.h"
-#include "gflags/gflags.h"
DEFINE_uint32(sorting_buffer_ms, 100,
"Amount of time to buffer messages to sort them before sending "
diff --git a/aos/util/foxglove_websocket_lib.h b/aos/util/foxglove_websocket_lib.h
index 7c326c2..2590e27 100644
--- a/aos/util/foxglove_websocket_lib.h
+++ b/aos/util/foxglove_websocket_lib.h
@@ -3,9 +3,10 @@
#include <map>
#include <set>
-#include "aos/events/event_loop.h"
#include "foxglove/websocket/server.hpp"
+#include "aos/events/event_loop.h"
+
namespace aos {
// This class implements a live AOS -> Foxglove Websocket Protocol connection,
// making use of the implementation at
diff --git a/aos/util/generate_test_log.cc b/aos/util/generate_test_log.cc
index 12cc260..dda7912 100644
--- a/aos/util/generate_test_log.cc
+++ b/aos/util/generate_test_log.cc
@@ -1,3 +1,5 @@
+#include "gflags/gflags.h"
+
#include "aos/configuration.h"
#include "aos/events/logging/log_writer.h"
#include "aos/events/ping_lib.h"
@@ -5,7 +7,6 @@
#include "aos/init.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/path.h"
-#include "gflags/gflags.h"
DEFINE_string(output_folder, "",
"Name of folder to write the generated logfile to.");
diff --git a/aos/util/mcap_logger.cc b/aos/util/mcap_logger.cc
index 111d784..4fb727c 100644
--- a/aos/util/mcap_logger.cc
+++ b/aos/util/mcap_logger.cc
@@ -1,12 +1,13 @@
#include "aos/util/mcap_logger.h"
#include "absl/strings/str_replace.h"
-#include "aos/configuration_schema.h"
-#include "aos/flatbuffer_merge.h"
#include "lz4/lz4.h"
#include "lz4/lz4frame.h"
#include "single_include/nlohmann/json.hpp"
+#include "aos/configuration_schema.h"
+#include "aos/flatbuffer_merge.h"
+
DEFINE_uint64(mcap_chunk_size, 10'000'000,
"Size, in bytes, of individual MCAP chunks");
DEFINE_bool(fetch, false,
diff --git a/aos/util/mcap_logger.h b/aos/util/mcap_logger.h
index 50e9300..8032c763 100644
--- a/aos/util/mcap_logger.h
+++ b/aos/util/mcap_logger.h
@@ -1,11 +1,12 @@
#ifndef AOS_UTIL_MCAP_LOGGER_H_
#define AOS_UTIL_MCAP_LOGGER_H_
+#include "single_include/nlohmann/json.hpp"
+
#include "aos/configuration_generated.h"
#include "aos/events/event_loop.h"
#include "aos/fast_string_builder.h"
#include "aos/flatbuffer_utils.h"
-#include "single_include/nlohmann/json.hpp"
namespace aos {
diff --git a/aos/util/phased_loop_test.cc b/aos/util/phased_loop_test.cc
index de4483c..cfe0107 100644
--- a/aos/util/phased_loop_test.cc
+++ b/aos/util/phased_loop_test.cc
@@ -1,9 +1,10 @@
#include "aos/util/phased_loop.h"
-#include "aos/time/time.h"
#include "glog/logging.h"
#include "gtest/gtest.h"
+#include "aos/time/time.h"
+
namespace aos {
namespace time {
namespace testing {
diff --git a/aos/util/simulation_logger.cc b/aos/util/simulation_logger.cc
index 1f55ece..24691ef 100644
--- a/aos/util/simulation_logger.cc
+++ b/aos/util/simulation_logger.cc
@@ -1,4 +1,5 @@
#include "aos/util/simulation_logger.h"
+
#include "aos/events/logging/logfile_utils.h"
namespace aos::util {
@@ -30,7 +31,8 @@
std::vector<std::unique_ptr<LoggerState>> MakeLoggersForAllNodes(
aos::SimulatedEventLoopFactory *factory, std::string_view output_folder) {
std::vector<std::unique_ptr<LoggerState>> loggers;
- for (const aos::Node *node : configuration::GetNodes(factory->configuration())) {
+ for (const aos::Node *node :
+ configuration::GetNodes(factory->configuration())) {
loggers.emplace_back(
std::make_unique<LoggerState>(factory, node, output_folder));
}
diff --git a/aos/util/threaded_queue.h b/aos/util/threaded_queue.h
index 0b06632..943609e 100644
--- a/aos/util/threaded_queue.h
+++ b/aos/util/threaded_queue.h
@@ -38,9 +38,8 @@
// get called after setting done to true.
bool done = false;
};
- ThreadedQueue(
- std::function<PushResult(SharedState)> push_request_handler,
- SharedState initial_state);
+ ThreadedQueue(std::function<PushResult(SharedState)> push_request_handler,
+ SharedState initial_state);
~ThreadedQueue();
// Sets state. Triggers a new call to push_request_handler.
void SetState(const SharedState &state);
diff --git a/aos/util/threaded_queue_test.cc b/aos/util/threaded_queue_test.cc
index 4f27c57..c97792c 100644
--- a/aos/util/threaded_queue_test.cc
+++ b/aos/util/threaded_queue_test.cc
@@ -86,7 +86,6 @@
ASSERT_EQ(state, 0);
}
-
// Tests that we can exit early without any issues.
TEST(ThreadedQueueTest, ExitEarly) {
// There used to exist a deadlock in this case where StopPushing would
diff --git a/aos/util/top_test.cc b/aos/util/top_test.cc
index 3292927..7d413a4 100644
--- a/aos/util/top_test.cc
+++ b/aos/util/top_test.cc
@@ -6,11 +6,12 @@
#include <string>
#include <thread>
+#include "gtest/gtest.h"
+
#include "aos/events/shm_event_loop.h"
#include "aos/json_to_flatbuffer.h"
#include "aos/testing/path.h"
#include "aos/testing/tmpdir.h"
-#include "gtest/gtest.h"
namespace aos::util::testing {
diff --git a/aos/util/trapezoid_profile.h b/aos/util/trapezoid_profile.h
index c5c957b..944c423 100644
--- a/aos/util/trapezoid_profile.h
+++ b/aos/util/trapezoid_profile.h
@@ -2,6 +2,7 @@
#define AOS_UTIL_TRAPEZOID_PROFILE_H_
#include "Eigen/Dense"
+
#include "aos/macros.h"
#include "aos/time/time.h"
diff --git a/aos/uuid.h b/aos/uuid.h
index aabca37..1b63ac3 100644
--- a/aos/uuid.h
+++ b/aos/uuid.h
@@ -6,9 +6,10 @@
#include <string>
#include "absl/types/span.h"
-#include "aos/thread_local.h"
#include "flatbuffers/flatbuffers.h"
+#include "aos/thread_local.h"
+
namespace aos {
// Class to generate and hold a UUID.
diff --git a/aos/vision/blob/threshold_test.cc b/aos/vision/blob/threshold_test.cc
index 3bbef1d..67f7116 100644
--- a/aos/vision/blob/threshold_test.cc
+++ b/aos/vision/blob/threshold_test.cc
@@ -3,11 +3,12 @@
#include <random>
#include <vector>
-#include "aos/vision/blob/range_image.h"
-#include "aos/vision/image/image_types.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include "aos/vision/blob/range_image.h"
+#include "aos/vision/image/image_types.h"
+
namespace aos {
namespace vision {
namespace testing {
diff --git a/aos/vision/blob/transpose_test.cc b/aos/vision/blob/transpose_test.cc
index 374b5bf..6582b5d 100644
--- a/aos/vision/blob/transpose_test.cc
+++ b/aos/vision/blob/transpose_test.cc
@@ -3,9 +3,10 @@
#include <algorithm>
#include <string>
-#include "aos/vision/blob/test_utils.h"
#include "gtest/gtest.h"
+#include "aos/vision/blob/test_utils.h"
+
namespace aos {
namespace vision {
diff --git a/aos/vision/debug/blob_log-source.cc b/aos/vision/debug/blob_log-source.cc
index 006c09a..4dd5675 100644
--- a/aos/vision/debug/blob_log-source.cc
+++ b/aos/vision/debug/blob_log-source.cc
@@ -7,11 +7,12 @@
#include <functional>
#include <string>
+#include "glog/logging.h"
+
#include "aos/vision/blob/codec.h"
#include "aos/vision/blob/stream_view.h"
#include "aos/vision/debug/debug_framework.h"
#include "aos/vision/debug/overlay.h"
-#include "glog/logging.h"
namespace aos {
namespace vision {
diff --git a/aos/vision/events/socket_types.h b/aos/vision/events/socket_types.h
index 996edbb..237bdb1 100644
--- a/aos/vision/events/socket_types.h
+++ b/aos/vision/events/socket_types.h
@@ -7,9 +7,10 @@
#include <cstdint>
+#include "google/protobuf/message.h"
+
#include "aos/vision/events/tcp_server.h"
#include "aos/vision/image/image_types.h"
-#include "google/protobuf/message.h"
namespace aos {
namespace events {
diff --git a/aos/vision/image/jpeg_routines.cc b/aos/vision/image/jpeg_routines.cc
index d641627..b41729f 100644
--- a/aos/vision/image/jpeg_routines.cc
+++ b/aos/vision/image/jpeg_routines.cc
@@ -10,9 +10,10 @@
#include <cstdlib>
#include <cstring>
-#include "aos/logging/logging.h"
#include "third_party/libjpeg/jpeglib.h"
+#include "aos/logging/logging.h"
+
namespace aos {
namespace vision {