From 7fb41d6250bf6bba7d12e4c3ff82fef27de53109 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Thu, 22 Jul 2021 08:33:16 +0200 Subject: [PATCH] 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 --- Userland/Services/WindowServer/Screen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Services/WindowServer/Screen.cpp b/Userland/Services/WindowServer/Screen.cpp index 113dd9d755..d8aca0bb83 100644 --- a/Userland/Services/WindowServer/Screen.cpp +++ b/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(), }); } }