mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:37:35 +00:00
IPCCompiler: Use string hashes for IPC endpoint magic
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. :^)
This commit is contained in:
parent
f89c60664c
commit
59218007a3
25 changed files with 25 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
endpoint LanguageClient = 8002
|
||||
endpoint LanguageClient
|
||||
{
|
||||
AutoCompleteSuggestions(Vector<GUI::AutocompleteProvider::Entry> suggestions) =|
|
||||
DeclarationLocation(GUI::AutocompleteProvider::ProjectLocation location) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LanguageServer = 8001
|
||||
endpoint LanguageServer
|
||||
{
|
||||
Greet(String project_root) => ()
|
||||
|
||||
|
|
|
@ -164,11 +164,7 @@ int main(int argc, char** argv)
|
|||
lexer.consume_specific("endpoint");
|
||||
consume_whitespace();
|
||||
endpoints.last().name = lexer.consume_while([](char ch) { return !isspace(ch); });
|
||||
consume_whitespace();
|
||||
assert_specific('=');
|
||||
consume_whitespace();
|
||||
auto magic_string = lexer.consume_while([](char ch) { return !isspace(ch) && ch != '{'; });
|
||||
endpoints.last().magic = magic_string.to_int().value();
|
||||
endpoints.last().magic = Traits<String>::hash(endpoints.last().name);
|
||||
consume_whitespace();
|
||||
assert_specific('{');
|
||||
parse_messages();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue