Other: fix ./clang-format to apply new-lines for else statements properly
All checks were successful
continuous-integration/drone/push Build is passing
gitea/skullc-peripherals/pipeline/head This commit looks good

This commit is contained in:
erki 2022-12-10 17:15:55 +02:00
parent 500c2704bb
commit ea99a8a6ba
5 changed files with 31 additions and 17 deletions

View File

@ -17,7 +17,7 @@ AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
BraceWrapping: BraceWrapping:
AfterCaseLabel: false AfterCaseLabel: true
AfterClass: true AfterClass: true
AfterControlStatement: Always AfterControlStatement: Always
AfterEnum: true AfterEnum: true
@ -25,8 +25,8 @@ BraceWrapping:
AfterNamespace: true AfterNamespace: true
AfterUnion: true AfterUnion: true
AfterStruct: true AfterStruct: true
BeforeCatch: false BeforeCatch: true
BeforeElse: false BeforeElse: true
IndentBraces: false IndentBraces: false
SplitEmptyFunction: false SplitEmptyFunction: false
SplitEmptyRecord: true SplitEmptyRecord: true

View File

@ -54,7 +54,8 @@ public:
{ {
left_.forward.setCompare(left); left_.forward.setCompare(left);
left_.backward.setCompare(0); left_.backward.setCompare(0);
} else }
else
{ {
left_.forward.setCompare(0); left_.forward.setCompare(0);
left_.backward.setCompare(-1 * left); left_.backward.setCompare(-1 * left);
@ -64,7 +65,8 @@ public:
{ {
right_.forward.setCompare(right); right_.forward.setCompare(right);
right_.backward.setCompare(0); right_.backward.setCompare(0);
} else }
else
{ {
right_.forward.setCompare(0); right_.forward.setCompare(0);
right_.backward.setCompare(-1 * right); right_.backward.setCompare(-1 * right);

View File

@ -65,7 +65,8 @@ public:
if (!notified) if (!notified)
{ {
return std::nullopt; return std::nullopt;
} else }
else
{ {
return current_value_; return current_value_;
} }
@ -78,7 +79,8 @@ public:
if (!waiting_thread_) if (!waiting_thread_)
{ {
return false; return false;
} else }
else
{ {
return waiting_thread_->notify(0, eNoAction); return waiting_thread_->notify(0, eNoAction);
} }
@ -91,7 +93,8 @@ public:
if (!waiting_thread_) if (!waiting_thread_)
{ {
return {false, pdFALSE}; return {false, pdFALSE};
} else }
else
{ {
auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction); auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction);
(void) discard; (void) discard;
@ -158,7 +161,8 @@ struct ExclusiveSignal<void> : public Signallable<void>
if (!waiting_thread_) if (!waiting_thread_)
{ {
return pdFALSE; return pdFALSE;
} else }
else
{ {
auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction); auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction);
(void) discard; (void) discard;

View File

@ -158,15 +158,18 @@ public:
if (dx == 0 && dy == 0) if (dx == 0 && dy == 0)
{ {
at(start) = color; at(start) = color;
} else if (dx == 0) }
else if (dx == 0)
{ {
for (; y < y_(stop); y++) for (; y < y_(stop); y++)
at({x, y}) = color; at({x, y}) = color;
} else if (dy == 0) }
else if (dy == 0)
{ {
for (; x < x_(stop); x++) for (; x < x_(stop); x++)
at({x, y}) = color; at({x, y}) = color;
} else }
else
{ {
// Bresenham's algorithm. // Bresenham's algorithm.
std::int32_t p = 2 * dy - dx; std::int32_t p = 2 * dy - dx;
@ -179,7 +182,8 @@ public:
{ {
y++; y++;
p = p + 2 * dy - 2 * dx; p = p + 2 * dy - 2 * dx;
} else }
else
{ {
p = p + 2 * dy; p = p + 2 * dy;
} }
@ -217,7 +221,8 @@ public:
{ {
y--; y--;
d = d + 4 * (x - y) + 10; d = d + 4 * (x - y) + 10;
} else }
else
{ {
d = d + 4 * x + 6; d = d + 4 * x + 6;
} }

View File

@ -68,7 +68,8 @@ public:
if (naive < _arr_end) if (naive < _arr_end)
{ {
return iterator(naive, _arr_begin, _arr_end); return iterator(naive, _arr_begin, _arr_end);
} else }
else
{ {
const pointer remainder = pointer(naive - _arr_end); const pointer remainder = pointer(naive - _arr_end);
return iterator(_arr_begin + difference_type(remainder), _arr_begin, return iterator(_arr_begin + difference_type(remainder), _arr_begin,
@ -82,7 +83,8 @@ public:
if (naive >= _arr_begin) if (naive >= _arr_begin)
{ {
return iterator(naive, _arr_begin, _arr_end); return iterator(naive, _arr_begin, _arr_end);
} else }
else
{ {
const pointer remainder = pointer(_arr_begin - naive); const pointer remainder = pointer(_arr_begin - naive);
return iterator(_arr_end - difference_type(remainder), _arr_begin, return iterator(_arr_end - difference_type(remainder), _arr_begin,
@ -202,7 +204,8 @@ public:
if (distance > 0) if (distance > 0)
{ {
return distance; return distance;
} else }
else
{ {
return head_ - tail_ + 1; return head_ - tail_ + 1;
} }