Browse Source

Add 'wl_list_for_each_safe' to the clang-format macro list

...and fix the formatting when it is used.
Frank Praznik 1 year ago
parent
commit
717f297849

+ 1 - 0
.clang-format

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

+ 1 - 2
src/video/wayland/SDL_waylanddatamanager.c

@@ -200,8 +200,7 @@ static void mime_data_list_free(struct wl_list *list)
     SDL_MimeDataList *mime_data = 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) {
             SDL_free(mime_data->data);
         }

+ 1 - 2
src/video/wayland/SDL_waylandevents.c

@@ -3107,8 +3107,7 @@ void Wayland_display_destroy_input(SDL_VideoData *d)
             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);
             SDL_free(tp);
         }

+ 1 - 2
src/video/wayland/SDL_waylandvideo.c

@@ -201,8 +201,7 @@ error:
 static void Wayland_FlushOutputOrder(SDL_VideoData *vid)
 {
     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);
         SDL_free(c);
     }