diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2021-04-25 13:19:53 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-04-25 14:06:56 +0200 |
commit | 62af6cd4f9637b8937e59832f5af00f4556c496b (patch) | |
tree | bdf998938966c8fb949f655d95ba697e830eba87 /Userland/Libraries/LibIPC | |
parent | 64d05152f74fd2b6bb4cb723700335282fb32659 (diff) | |
download | serenity-62af6cd4f9637b8937e59832f5af00f4556c496b.zip |
IPCCompiler: Remove hardcoded endpoint magic, attempt deux
This patch removes the IPC endpoint numbers that needed to be specified
in the IPC files. Since the string hash is a (hopefully) collision free
number that depends on the name of the endpoint, we now use that
instead. :^)
Additionally, endpoint magic is now treated as a u32, because endpoint
numbers were never negative anyway.
For cases where the endpoint number does have to be hardcoded (a current
case is LookupServer because the endpoint number must be known in LibC),
the syntax has been made more explicit to avoid confusing those
unfamiliar. To hardcode the endpoint magic, the following syntax is now
used:
endpoint EndpointName [magic=1234]
Diffstat (limited to 'Userland/Libraries/LibIPC')
-rw-r--r-- | Userland/Libraries/LibIPC/Endpoint.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibIPC/Message.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibIPC/Endpoint.h b/Userland/Libraries/LibIPC/Endpoint.h index ee027a308c..96176899f4 100644 --- a/Userland/Libraries/LibIPC/Endpoint.h +++ b/Userland/Libraries/LibIPC/Endpoint.h @@ -21,7 +21,7 @@ class Endpoint { public: virtual ~Endpoint(); - virtual int magic() const = 0; + virtual u32 magic() const = 0; virtual String name() const = 0; virtual OwnPtr<Message> handle(const Message&) = 0; diff --git a/Userland/Libraries/LibIPC/Message.h b/Userland/Libraries/LibIPC/Message.h index b3ae172160..f2aae86633 100644 --- a/Userland/Libraries/LibIPC/Message.h +++ b/Userland/Libraries/LibIPC/Message.h @@ -20,7 +20,7 @@ class Message { public: virtual ~Message(); - virtual int endpoint_magic() const = 0; + virtual u32 endpoint_magic() const = 0; virtual int message_id() const = 0; virtual const char* message_name() const = 0; virtual MessageBuffer encode() const = 0; |