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/frc971/shooter_interpolation/interpolation.h b/frc971/shooter_interpolation/interpolation.h
index dd0e316..bce532f 100644
--- a/frc971/shooter_interpolation/interpolation.h
+++ b/frc971/shooter_interpolation/interpolation.h
@@ -21,7 +21,7 @@
// power for a shot
YValue Get(double x) const;
- bool GetInRange(double x, YValue* type) const;
+ bool GetInRange(double x, YValue *type) const;
private:
// Contains the list of angle entries in the interpolation table
@@ -29,21 +29,20 @@
};
template <typename YValue>
-InterpolationTable<YValue>::InterpolationTable(const ::std::vector<Point> &table)
- : table_(table) {
- ::std::sort(table_.begin(), table_.end(),
- [](const Point &a, const Point &b) {
- return a.first < b.first;
- });
- }
+InterpolationTable<YValue>::InterpolationTable(
+ const ::std::vector<Point> &table)
+ : table_(table) {
+ ::std::sort(table_.begin(), table_.end(),
+ [](const Point &a, const Point &b) { return a.first < b.first; });
+}
template <typename YValue>
YValue InterpolationTable<YValue>::Get(double x) const {
// Points to to the smallest item such that it->first >= dist, or end() if no
// such item exists.
- auto it = ::std::lower_bound(table_.begin(), table_.end(), x,
- [](const Point &a,
- double dist) { return a.first < dist; });
+ auto it = ::std::lower_bound(
+ table_.begin(), table_.end(), x,
+ [](const Point &a, double dist) { return a.first < dist; });
if (it == table_.begin()) {
return it->second;
} else if (it == table_.end()) {
@@ -59,12 +58,12 @@
}
template <typename YValue>
-bool InterpolationTable<YValue>::GetInRange(double x, YValue* result) const {
+bool InterpolationTable<YValue>::GetInRange(double x, YValue *result) const {
// Points to to the smallest item such that it->first >= dist, or end() if no
// such item exists.
- auto it = ::std::lower_bound(table_.begin(), table_.end(), x,
- [](const Point &a,
- double dist) { return a.first < dist; });
+ auto it = ::std::lower_bound(
+ table_.begin(), table_.end(), x,
+ [](const Point &a, double dist) { return a.first < dist; });
if (it == table_.begin()) {
return false;
} else if (it == table_.end()) {