Add -Wshadow + reformat switch cases

Adding -Wshadow will prevent unintentional variable overrides.

Also, wrapping switch cases with declarations with braces will make our
logic more robust by limiting lifetimes of variables.
This commit is contained in:
tokyo4j 2025-05-23 13:09:15 +09:00 committed by Johan Malm
parent e19f0fc267
commit 68bf55d724
4 changed files with 91 additions and 94 deletions

View file

@ -243,8 +243,6 @@ handle_commit(struct wl_listener *listener, void *data)
*
* This is not ideal, but it is the cleanest option.
*/
struct wlr_xdg_toplevel *toplevel =
xdg_toplevel_from_view(view);
toplevel->scheduled.width = view->current.width;
toplevel->scheduled.height = view->current.height;
}