Clang-format aos
It has drifted... Clean it up a bit.
Change-Id: I2fe31a2187b4f690634ae6942786575db20192af
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/util/generate_test_log.cc b/aos/util/generate_test_log.cc
index 7338af8..12cc260 100644
--- a/aos/util/generate_test_log.cc
+++ b/aos/util/generate_test_log.cc
@@ -1,13 +1,14 @@
#include "aos/configuration.h"
#include "aos/events/logging/log_writer.h"
-#include "aos/init.h"
-#include "aos/json_to_flatbuffer.h"
-#include "gflags/gflags.h"
-#include "aos/testing/path.h"
#include "aos/events/ping_lib.h"
#include "aos/events/pong_lib.h"
+#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.");
+DEFINE_string(output_folder, "",
+ "Name of folder to write the generated logfile to.");
int main(int argc, char **argv) {
aos::InitGoogle(&argc, &argv);
diff --git a/aos/util/global_factory.h b/aos/util/global_factory.h
index 5e47972..2a4028e 100644
--- a/aos/util/global_factory.h
+++ b/aos/util/global_factory.h
@@ -67,7 +67,7 @@
class SubClassRegisterer {
public:
explicit SubClassRegisterer(const char *name) {
- (*GetMap())[name] = [](FactoryArgs &&... args) {
+ (*GetMap())[name] = [](FactoryArgs &&...args) {
return std::unique_ptr<BaseClass>(
new SubClass(std::forward<FactoryArgs>(args)...));
};
diff --git a/aos/util/global_factory_test.cc b/aos/util/global_factory_test.cc
index d50e931..da386b2 100644
--- a/aos/util/global_factory_test.cc
+++ b/aos/util/global_factory_test.cc
@@ -1,4 +1,5 @@
#include "aos/util/global_factory.h"
+
#include "gtest/gtest.h"
namespace aos {
diff --git a/aos/util/log_interval.h b/aos/util/log_interval.h
index b6410a9..d346852 100644
--- a/aos/util/log_interval.h
+++ b/aos/util/log_interval.h
@@ -1,11 +1,11 @@
#ifndef AOS_UTIL_LOG_INTERVAL_H_
#define AOS_UTIL_LOG_INTERVAL_H_
+#include <string>
+
#include "aos/logging/logging.h"
#include "aos/time/time.h"
-#include <string>
-
namespace aos {
namespace util {
diff --git a/aos/util/mcap_logger_test.cc b/aos/util/mcap_logger_test.cc
index 6e82a53..8bc3419 100644
--- a/aos/util/mcap_logger_test.cc
+++ b/aos/util/mcap_logger_test.cc
@@ -1,6 +1,7 @@
#include "aos/util/mcap_logger.h"
#include <iostream>
+
#include "flatbuffers/reflection_generated.h"
#include "gtest/gtest.h"
diff --git a/aos/util/options.h b/aos/util/options.h
index 39f7e8f..f393030 100644
--- a/aos/util/options.h
+++ b/aos/util/options.h
@@ -87,6 +87,6 @@
friend class Option;
};
-} // namespace options
+} // namespace aos
#endif // AOS_UTIL_OPTIONS_H_
diff --git a/aos/util/phased_loop.h b/aos/util/phased_loop.h
index c9e4933..307b400 100644
--- a/aos/util/phased_loop.h
+++ b/aos/util/phased_loop.h
@@ -41,8 +41,8 @@
// Returns the number of iterations which have passed (1 if this is called
// often enough). This can be < 1 iff monotonic_now goes backwards between
// calls.
- int Iterate(const monotonic_clock::time_point monotonic_now =
- monotonic_clock::now());
+ int Iterate(
+ const monotonic_clock::time_point monotonic_now = monotonic_clock::now());
// Sleeps until the next time and returns the number of iterations which have
// passed.
diff --git a/aos/util/phased_loop_test.cc b/aos/util/phased_loop_test.cc
index 96eeb5c..5e85ea0 100644
--- a/aos/util/phased_loop_test.cc
+++ b/aos/util/phased_loop_test.cc
@@ -1,8 +1,7 @@
#include "aos/util/phased_loop.h"
-#include "gtest/gtest.h"
-
#include "aos/time/time.h"
+#include "gtest/gtest.h"
namespace aos {
namespace time {
diff --git a/aos/util/scoped_pipe.cc b/aos/util/scoped_pipe.cc
index d677b07..e2e0ca5 100644
--- a/aos/util/scoped_pipe.cc
+++ b/aos/util/scoped_pipe.cc
@@ -1,6 +1,7 @@
#include "aos/util/scoped_pipe.h"
#include <fcntl.h>
+
#include "glog/logging.h"
namespace aos::util {
diff --git a/aos/util/top.cc b/aos/util/top.cc
index 22d67c8..9a6bbd0 100644
--- a/aos/util/top.cc
+++ b/aos/util/top.cc
@@ -153,7 +153,7 @@
std::set<pid_t> pids = pids_to_track_;
// Ensure that we check on the status of every process that we are already
// tracking.
- for (const auto & reading : readings_) {
+ for (const auto &reading : readings_) {
pids.insert(reading.first);
}
if (track_all_) {
diff --git a/aos/util/top_test.cc b/aos/util/top_test.cc
index 36afd64..3292927 100644
--- a/aos/util/top_test.cc
+++ b/aos/util/top_test.cc
@@ -28,7 +28,8 @@
event_loop_(&config_.message()) {
FLAGS_shm_base = shm_dir_;
- // Nuke the shm dir, to ensure we aren't being affected by any preexisting tests.
+ // Nuke the shm dir, to ensure we aren't being affected by any preexisting
+ // tests.
aos::util::UnlinkRecursive(shm_dir_);
}
~TopTest() {
diff --git a/aos/util/trapezoid_profile.h b/aos/util/trapezoid_profile.h
index 944c423..c5c957b 100644
--- a/aos/util/trapezoid_profile.h
+++ b/aos/util/trapezoid_profile.h
@@ -2,7 +2,6 @@
#define AOS_UTIL_TRAPEZOID_PROFILE_H_
#include "Eigen/Dense"
-
#include "aos/macros.h"
#include "aos/time/time.h"
diff --git a/aos/util/trapezoid_profile_test.cc b/aos/util/trapezoid_profile_test.cc
index 79795e1..afd64ea 100644
--- a/aos/util/trapezoid_profile_test.cc
+++ b/aos/util/trapezoid_profile_test.cc
@@ -1,8 +1,7 @@
-#include "gtest/gtest.h"
+#include "aos/util/trapezoid_profile.h"
#include "Eigen/Dense"
-
-#include "aos/util/trapezoid_profile.h"
+#include "gtest/gtest.h"
namespace aos {
namespace util {
@@ -20,10 +19,8 @@
}
// Runs an iteration.
- void RunIteration(double goal_position,
- double goal_velocity) {
- position_ = profile_.Update(goal_position,
- goal_velocity);
+ void RunIteration(double goal_position, double goal_velocity) {
+ position_ = profile_.Update(goal_position, goal_velocity);
}
const Eigen::Matrix<double, 2, 1> &position() { return position_; }
@@ -33,15 +30,15 @@
::testing::AssertionResult At(double position, double velocity) {
static const double kDoubleNear = 0.00001;
if (::std::abs(velocity - position_(1)) > kDoubleNear) {
- return ::testing::AssertionFailure() << "velocity is " << position_(1) <<
- " not " << velocity;
+ return ::testing::AssertionFailure()
+ << "velocity is " << position_(1) << " not " << velocity;
}
if (::std::abs(position - position_(0)) > kDoubleNear) {
- return ::testing::AssertionFailure() << "position is " << position_(0) <<
- " not " << position;
+ return ::testing::AssertionFailure()
+ << "position is " << position_(0) << " not " << position;
}
- return ::testing::AssertionSuccess() << "at " << position <<
- " moving at " << velocity;
+ return ::testing::AssertionSuccess()
+ << "at " << position << " moving at " << velocity;
}
private: