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
Notes: sideshowbarker 2024-07-18 07:17:00 +09:00

View File

@ -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(),
});
}
}