Skip to content

Commit 717f297

Browse files
committed
Add 'wl_list_for_each_safe' to the clang-format macro list
...and fix the formatting when it is used.
1 parent 3875ef4 commit 717f297

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ ForEachMacros:
8282
"spa_list_for_each",
8383
"spa_list_for_each_safe",
8484
"wl_list_for_each",
85+
"wl_list_for_each_safe",
8586
"wl_array_for_each",
8687
"udev_list_entry_foreach",
8788
]

src/video/wayland/SDL_waylanddatamanager.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ static void mime_data_list_free(struct wl_list *list)
200200
SDL_MimeDataList *mime_data = NULL;
201201
SDL_MimeDataList *next = NULL;
202202

203-
wl_list_for_each_safe(mime_data, next, list, link)
204-
{
203+
wl_list_for_each_safe (mime_data, next, list, link) {
205204
if (mime_data->data) {
206205
SDL_free(mime_data->data);
207206
}

src/video/wayland/SDL_waylandevents.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,8 +3107,7 @@ void Wayland_display_destroy_input(SDL_VideoData *d)
31073107
wl_touch_destroy(input->touch);
31083108
}
31093109

3110-
wl_list_for_each_safe(tp, tmp, &touch_points, link)
3111-
{
3110+
wl_list_for_each_safe (tp, tmp, &touch_points, link) {
31123111
WAYLAND_wl_list_remove(&tp->link);
31133112
SDL_free(tp);
31143113
}

src/video/wayland/SDL_waylandvideo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ static SDL_bool Wayland_GetGNOMEPrimaryDisplayCoordinates(int *x, int *y)
201201
static void Wayland_FlushOutputOrder(SDL_VideoData *vid)
202202
{
203203
SDL_WaylandConnectorName *c, *tmp;
204-
wl_list_for_each_safe(c, tmp, &vid->output_order, link)
205-
{
204+
wl_list_for_each_safe (c, tmp, &vid->output_order, link) {
206205
WAYLAND_wl_list_remove(&c->link);
207206
SDL_free(c);
208207
}

0 commit comments

Comments
 (0)