summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-05 19:11:23 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-05 19:13:44 +0100
commit0cff25ac78cd0c4d144d1c8792a65db69b1e28e2 (patch)
tree48f96953ca3aa7d82737cde9c895b8e57cc25365 /DevTools
parentbe0034d2ca1de3b5a7960a6d4df5b2ad943311e6 (diff)
downloadserenity-0cff25ac78cd0c4d144d1c8792a65db69b1e28e2.zip
AK+IPCCompiler: Get rid of BufferStream overloads for size_t
Since BufferStream is about creating specific binary stream formats, let's not have a flaky type like size_t in there. Instead, clients of BufferStream can cast their size_t to the binary size they want to use. Account for this in IPCCompiler by making String lengths always 32-bit.
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/IPCCompiler/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/DevTools/IPCCompiler/main.cpp b/DevTools/IPCCompiler/main.cpp
index fcfcc18422..add0a44817 100644
--- a/DevTools/IPCCompiler/main.cpp
+++ b/DevTools/IPCCompiler/main.cpp
@@ -310,11 +310,11 @@ int main(int argc, char** argv)
dbg() << " " << parameter.type << " " << parameter.name << " = " << initial_value << ";";
if (parameter.type == "String") {
- dbg() << " size_t " << parameter.name << "_length = 0;";
+ dbg() << " u32 " << parameter.name << "_length = 0;";
dbg() << " stream >> " << parameter.name << "_length;";
dbg() << " if (" << parameter.name << "_length == 0) {";
dbg() << " " << parameter.name << " = String::empty();";
- dbg() << " } else if ((ssize_t)" << parameter.name << "_length == -1) {";
+ dbg() << " } else if ((i32)" << parameter.name << "_length == -1) {";
dbg() << " " << parameter.name << " = String();";
dbg() << " } else {";
dbg() << " char* " << parameter.name << "_buffer = nullptr;";
@@ -395,7 +395,7 @@ int main(int argc, char** argv)
for (auto& parameter : parameters) {
if (parameter.type == "String") {
dbg() << " if (m_" << parameter.name << ".is_null()) {";
- dbg() << " stream << (ssize_t)-1;";
+ dbg() << " stream << (i32)-1;";
dbg() << " } else {";
dbg() << " stream << m_" << parameter.name << ".length();";
dbg() << " stream << m_" << parameter.name << ";";