From 98a9a1d7f92d314df337af9745fcb58167e1c4e5 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 19:17:08 +0200 Subject: [PATCH] Everywhere: Add break after the last case label before `default` We already do this in most places, so the style should be consistent. Also, Clang does not like it, as this could cause an unexpected compile error if some statements are added to the default label or a new label is added above it. --- Userland/DevTools/Profiler/TimelineTrack.cpp | 1 + Userland/Libraries/LibGUI/ColumnsView.cpp | 2 +- Userland/Libraries/LibWeb/CSS/StyleResolver.cpp | 1 + Userland/Services/Taskbar/TaskbarWindow.cpp | 1 + Userland/Utilities/du.cpp | 1 + Userland/Utilities/js.cpp | 1 + Userland/Utilities/sql.cpp | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/DevTools/Profiler/TimelineTrack.cpp b/Userland/DevTools/Profiler/TimelineTrack.cpp index b39eded946..a5af3371b4 100644 --- a/Userland/DevTools/Profiler/TimelineTrack.cpp +++ b/Userland/DevTools/Profiler/TimelineTrack.cpp @@ -41,6 +41,7 @@ void TimelineTrack::event(Core::Event& event) case GUI::Event::MouseDown: case GUI::Event::MouseMove: event.ignore(); + break; default: break; } diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index e0701a9fcd..4262feb0a2 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -298,8 +298,8 @@ void ColumnsView::move_cursor(CursorMovement movement, SelectionUpdate selection if (model.is_valid(cursor_index())) push_column(cursor_index()); update(); - break; } + break; default: break; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp index cd5b07ea5e..673f2e84df 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleResolver.cpp @@ -244,6 +244,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope case CSS::ValueID::LineThrough: case CSS::ValueID::Blink: set_property_expanding_shorthands(style, CSS::PropertyID::TextDecorationLine, value, document); + break; default: break; } diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 25f8de623a..3c2c36e116 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -345,6 +345,7 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event) case GUI::Event::WM_VirtualDesktopChanged: { auto& changed_event = static_cast(event); virtual_desktop_change_event(changed_event.current_row(), changed_event.current_column()); + break; } default: break; diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp index eb007193e0..a3314a8db3 100644 --- a/Userland/Utilities/du.cpp +++ b/Userland/Utilities/du.cpp @@ -184,6 +184,7 @@ int print_space_usage(const String& path, const DuOption& du_option, int max_dep break; case DuOption::TimeType::Status: time = path_stat.st_ctime; + break; default: break; } diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 7fb8f1a876..1fdebc743f 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -963,6 +963,7 @@ int main(int argc, char** argv) break; case JS::TokenCategory::Identifier: stylize({ start, end }, { Line::Style::Foreground(Line::Style::XtermColor::White), Line::Style::Bold }); + break; default: break; } diff --git a/Userland/Utilities/sql.cpp b/Userland/Utilities/sql.cpp index 2f8181afbb..3434191a16 100644 --- a/Userland/Utilities/sql.cpp +++ b/Userland/Utilities/sql.cpp @@ -165,6 +165,7 @@ int main() break; case SQL::AST::TokenCategory::Identifier: editor.stylize({ start, end }, { Line::Style::Foreground(Line::Style::XtermColor::White), Line::Style::Bold }); + break; default: break; }