Parcourir la source

WindowServer: Fix 'use of GNU old-style field designator'

Since C99 and C++20 have a standardized syntax for designated
initializer, we should use that instead of this GCC-specific extension.
While this currently works both in Clang and GCC, the former emits a
warning for it, while the latter has an [issue] open that plans to
deprecate it.

[issue]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88144
Daniel Bertalan il y a 4 ans
Parent
commit
7fb41d6250
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      Userland/Services/WindowServer/Screen.cpp

+ 5 - 5
Userland/Services/WindowServer/Screen.cpp

@@ -475,12 +475,12 @@ void Screen::constrain_pending_flush_rects()
             rects.add(intersected_rect);
     }
     fb_data.pending_flush_rects.clear_with_capacity();
-    for (auto& rect : rects.rects()) {
+    for (auto const& rect : rects.rects()) {
         fb_data.pending_flush_rects.append({
-            x : (unsigned)rect.x(),
-            y : (unsigned)rect.y(),
-            width : (unsigned)rect.width(),
-            height : (unsigned)rect.height()
+            .x = (unsigned)rect.x(),
+            .y = (unsigned)rect.y(),
+            .width = (unsigned)rect.width(),
+            .height = (unsigned)rect.height(),
         });
     }
 }