1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:47:35 +00:00

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
This commit is contained in:
Daniel Bertalan 2021-07-22 08:33:16 +02:00 committed by Andreas Kling
parent db840aaacd
commit 7fb41d6250

View file

@ -475,12 +475,12 @@ void Screen::constrain_pending_flush_rects()
rects.add(intersected_rect); rects.add(intersected_rect);
} }
fb_data.pending_flush_rects.clear_with_capacity(); 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({ fb_data.pending_flush_rects.append({
x : (unsigned)rect.x(), .x = (unsigned)rect.x(),
y : (unsigned)rect.y(), .y = (unsigned)rect.y(),
width : (unsigned)rect.width(), .width = (unsigned)rect.width(),
height : (unsigned)rect.height() .height = (unsigned)rect.height(),
}); });
} }
} }