summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Point.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-12-22 20:40:33 -0500
committerAndreas Kling <kling@serenityos.org>2022-12-26 09:36:16 +0100
commit9b483625e653d2ea89533c99b501a2e296c4d366 (patch)
treea84ddbd6a8bae04104dd9617e3b99e5e1f8e9c4a /Userland/Libraries/LibGfx/Point.h
parent765c5b416f61f08dd68ea4b77a39e9380f2c8f9d (diff)
downloadserenity-9b483625e653d2ea89533c99b501a2e296c4d366.zip
LibIPC+Everywhere: Change IPC decoders to construct values in-place
Currently, the generated IPC decoders will default-construct the type to be decoded, then pass that value by reference to the concrete decoder. This, of course, requires that the type is default-constructible. This was an issue for decoding Variants, which had to require the first type in the Variant list is Empty, to ensure it is default constructible. Further, this made it possible for values to become uninitialized in user-defined decoders. This patch makes the decoder interface such that the concrete decoders themselves contruct the decoded type upon return from the decoder. To do so, the default decoders in IPC::Decoder had to be moved to the IPC namespace scope, as these decoders are now specializations instead of overloaded methods (C++ requires specializations to be in a namespace scope).
Diffstat (limited to 'Userland/Libraries/LibGfx/Point.h')
-rw-r--r--Userland/Libraries/LibGfx/Point.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h
index 452bc605dc..ea601edc5e 100644
--- a/Userland/Libraries/LibGfx/Point.h
+++ b/Userland/Libraries/LibGfx/Point.h
@@ -295,7 +295,7 @@ template<>
bool encode(Encoder&, Gfx::IntPoint const&);
template<>
-ErrorOr<void> decode(Decoder&, Gfx::IntPoint&);
+ErrorOr<Gfx::IntPoint> decode(Decoder&);
}