Add 'wl_list_for_each_safe' to the clang-format macro list

...and fix the formatting when it is used.
This commit is contained in:
Frank Praznik 2024-03-14 10:09:47 -04:00
parent 3875ef4552
commit 717f297849
4 changed files with 4 additions and 6 deletions

View File

@ -82,6 +82,7 @@ ForEachMacros:
"spa_list_for_each", "spa_list_for_each",
"spa_list_for_each_safe", "spa_list_for_each_safe",
"wl_list_for_each", "wl_list_for_each",
"wl_list_for_each_safe",
"wl_array_for_each", "wl_array_for_each",
"udev_list_entry_foreach", "udev_list_entry_foreach",
] ]

View File

@ -200,8 +200,7 @@ static void mime_data_list_free(struct wl_list *list)
SDL_MimeDataList *mime_data = NULL; SDL_MimeDataList *mime_data = NULL;
SDL_MimeDataList *next = NULL; SDL_MimeDataList *next = NULL;
wl_list_for_each_safe(mime_data, next, list, link) wl_list_for_each_safe (mime_data, next, list, link) {
{
if (mime_data->data) { if (mime_data->data) {
SDL_free(mime_data->data); SDL_free(mime_data->data);
} }

View File

@ -3107,8 +3107,7 @@ void Wayland_display_destroy_input(SDL_VideoData *d)
wl_touch_destroy(input->touch); wl_touch_destroy(input->touch);
} }
wl_list_for_each_safe(tp, tmp, &touch_points, link) wl_list_for_each_safe (tp, tmp, &touch_points, link) {
{
WAYLAND_wl_list_remove(&tp->link); WAYLAND_wl_list_remove(&tp->link);
SDL_free(tp); SDL_free(tp);
} }

View File

@ -201,8 +201,7 @@ error:
static void Wayland_FlushOutputOrder(SDL_VideoData *vid) static void Wayland_FlushOutputOrder(SDL_VideoData *vid)
{ {
SDL_WaylandConnectorName *c, *tmp; SDL_WaylandConnectorName *c, *tmp;
wl_list_for_each_safe(c, tmp, &vid->output_order, link) wl_list_for_each_safe (c, tmp, &vid->output_order, link) {
{
WAYLAND_wl_list_remove(&c->link); WAYLAND_wl_list_remove(&c->link);
SDL_free(c); SDL_free(c);
} }