From b0208ce433063df16aad357759a02bc08f596d9f Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 19:12:37 +0200 Subject: [PATCH] Everywhere: Forward declare structs as structs While structs being forward declared as classes is not strictly an issue, Clang complains as this is not portable code, since some ABIs treat classes declared as `class` and `struct` differently. It's easier to fix these than to reason about explicitly disabling another warning. --- Userland/DevTools/Profiler/TimelineHeader.h | 2 +- Userland/DevTools/Profiler/TimelineTrack.h | 2 +- Userland/Libraries/LibIPC/Stub.h | 2 +- Userland/Libraries/LibWeb/Forward.h | 2 +- Userland/Services/WindowServer/Compositor.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/DevTools/Profiler/TimelineHeader.h b/Userland/DevTools/Profiler/TimelineHeader.h index 35892de55d..f429cbb0cb 100644 --- a/Userland/DevTools/Profiler/TimelineHeader.h +++ b/Userland/DevTools/Profiler/TimelineHeader.h @@ -11,7 +11,7 @@ namespace Profiler { class Profile; -class Process; +struct Process; class TimelineHeader final : public GUI::Frame { C_OBJECT(TimelineHeader); diff --git a/Userland/DevTools/Profiler/TimelineTrack.h b/Userland/DevTools/Profiler/TimelineTrack.h index 9bbb97c59f..5a9ded5cc7 100644 --- a/Userland/DevTools/Profiler/TimelineTrack.h +++ b/Userland/DevTools/Profiler/TimelineTrack.h @@ -11,7 +11,7 @@ namespace Profiler { -class Process; +struct Process; class Profile; class TimelineView; diff --git a/Userland/Libraries/LibIPC/Stub.h b/Userland/Libraries/LibIPC/Stub.h index a4ac5aec21..a4a02808dc 100644 --- a/Userland/Libraries/LibIPC/Stub.h +++ b/Userland/Libraries/LibIPC/Stub.h @@ -16,7 +16,7 @@ class BufferStream; namespace IPC { class Message; -class MessageBuffer; +struct MessageBuffer; class Stub { public: diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index d82e0d8c22..320287fe2c 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -60,7 +60,7 @@ namespace Web::HTML { class CanvasRenderingContext2D; class CloseEvent; class DOMParser; -class EventHandler; +struct EventHandler; class HTMLAnchorElement; class HTMLAreaElement; class HTMLAudioElement; diff --git a/Userland/Services/WindowServer/Compositor.h b/Userland/Services/WindowServer/Compositor.h index c493627f38..cbb9e8819d 100644 --- a/Userland/Services/WindowServer/Compositor.h +++ b/Userland/Services/WindowServer/Compositor.h @@ -212,7 +212,7 @@ private: return iterate_flush_rects(m_flush_transparent_rects); } }; - friend class ScreenData; + friend struct ScreenData; Vector m_screen_data; IntrusiveList, &Overlay::m_list_node> m_overlay_list;