From 6f4c380d95429ef4615f0a9f40d6fec9e1469764 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 9 Dec 2019 17:45:40 +0100 Subject: AK: Use size_t for the length of strings Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this. --- Applications/Help/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Applications/Help/main.cpp') diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp index c21907ad7c..391bb73401 100644 --- a/Applications/Help/main.cpp +++ b/Applications/Help/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) go_forward_action->set_enabled(history.can_go_forward()); }; - auto open_page = [&](String path) { + auto open_page = [&](const String& path) { if (path.is_null()) { html_view->set_document(nullptr); return; @@ -73,7 +73,7 @@ int main(int argc, char* argv[]) return; } auto buffer = file->read_all(); - StringView source { (char*)buffer.data(), buffer.size() }; + StringView source { (const char*)buffer.data(), (size_t)buffer.size() }; MDDocument md_document; bool success = md_document.parse(source); -- cgit v1.2.3