From c879ecf5096e112bd271801f9d919a853bc38bfb Mon Sep 17 00:00:00 2001 From: asynts Date: Sun, 20 Sep 2020 13:00:54 +0200 Subject: LibIPC: Use InputMemoryStream instead of BufferStream. --- DevTools/IPCCompiler/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'DevTools/IPCCompiler') diff --git a/DevTools/IPCCompiler/main.cpp b/DevTools/IPCCompiler/main.cpp index d0212ec489..5b092e9335 100644 --- a/DevTools/IPCCompiler/main.cpp +++ b/DevTools/IPCCompiler/main.cpp @@ -200,7 +200,7 @@ int main(int argc, char** argv) parse_endpoint(); out() << "#pragma once"; - out() << "#include "; + out() << "#include "; out() << "#include "; out() << "#include "; out() << "#include "; @@ -278,7 +278,7 @@ int main(int argc, char** argv) out() << " virtual i32 message_id() const override { return (int)MessageID::" << name << "; }"; out() << " static i32 static_message_id() { return (int)MessageID::" << name << "; }"; out() << " virtual const char* message_name() const override { return \"" << endpoint.name << "::" << name << "\"; }"; - out() << " static OwnPtr<" << name << "> decode(BufferStream& stream, size_t& size_in_bytes)"; + out() << " static OwnPtr<" << name << "> decode(InputMemoryStream& stream, size_t& size_in_bytes)"; out() << " {"; out() << " IPC::Decoder decoder(stream);"; @@ -349,10 +349,10 @@ int main(int argc, char** argv) out() << " virtual String name() const override { return \"" << endpoint.name << "\"; };"; out() << " static OwnPtr decode_message(const ByteBuffer& buffer, size_t& size_in_bytes)"; out() << " {"; - out() << " BufferStream stream(const_cast(buffer));"; + out() << " InputMemoryStream stream { buffer };"; out() << " i32 message_endpoint_magic = 0;"; out() << " stream >> message_endpoint_magic;"; - out() << " if (stream.handle_read_failure()) {"; + out() << " if (stream.handle_any_error()) {"; #ifdef GENERATE_DEBUG_CODE out() << " dbg() << \"Failed to read message endpoint magic\";"; #endif @@ -366,7 +366,7 @@ int main(int argc, char** argv) out() << " }"; out() << " i32 message_id = 0;"; out() << " stream >> message_id;"; - out() << " if (stream.handle_read_failure()) {"; + out() << " if (stream.handle_any_error()) {"; #ifdef GENERATE_DEBUG_CODE out() << " dbg() << \"Failed to read message ID\";"; #endif @@ -391,7 +391,7 @@ int main(int argc, char** argv) out() << " return nullptr;"; out() << " }"; - out() << " if (stream.handle_read_failure()) {"; + out() << " if (stream.handle_any_error()) {"; #ifdef GENERATE_DEBUG_CODE out() << " dbg() << \"Failed to read the message\";"; #endif -- cgit v1.2.3