clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iabfeec3ff53427c317ef9c0b5bf06326ab9a1e17
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/average.cpp b/average.cpp
index 7b12d70..2cc5240 100644
--- a/average.cpp
+++ b/average.cpp
@@ -20,10 +20,9 @@
_previousAverageMap[sensorKey] = sensorValue;
}
-std::optional<int64_t> Average::calcAverage(int64_t preAverage,
- int64_t preInterval,
- int64_t curAverage,
- int64_t curInterval)
+std::optional<int64_t>
+ Average::calcAverage(int64_t preAverage, int64_t preInterval,
+ int64_t curAverage, int64_t curInterval)
{
int64_t value = 0;
// Estimate that the interval will overflow about 292471
@@ -43,9 +42,9 @@
// (a2*i2-a1*i1)/(i2-i1) =
// (a2*(i1+delta)-a1*i1)/delta =
// (a2-a1)(i1/delta)+a2
- value = (curAverage - preAverage) *
- (static_cast<double>(preInterval) / delta) +
- curAverage;
+ value =
+ (curAverage - preAverage) * (static_cast<double>(preInterval) / delta) +
+ curAverage;
return value;
}