From c012822d49abdc61a7d42e8852f4da116af02f21 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 16 Mar 2023 12:15:16 +0200 Subject: [PATCH] BAN: Rename StringView suffix from _sv to sv --- BAN/BAN/String.cpp | 2 +- BAN/include/BAN/StringView.h | 2 +- config.sh | 4 ++-- kernel/kernel/FS/VirtualFileSystem.cpp | 2 +- kernel/kernel/Shell.cpp | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BAN/BAN/String.cpp b/BAN/BAN/String.cpp index 78031697cf..536cb3c299 100644 --- a/BAN/BAN/String.cpp +++ b/BAN/BAN/String.cpp @@ -12,7 +12,7 @@ namespace BAN String::String() { - MUST(copy_impl(""_sv)); + MUST(copy_impl(""sv)); } String::String(const String& other) diff --git a/BAN/include/BAN/StringView.h b/BAN/include/BAN/StringView.h index bdd1973a88..89cf2f3aac 100644 --- a/BAN/include/BAN/StringView.h +++ b/BAN/include/BAN/StringView.h @@ -44,7 +44,7 @@ namespace BAN } -inline BAN::StringView operator""_sv(const char* str, BAN::StringView::size_type len) { return BAN::StringView(str, len); } +inline BAN::StringView operator""sv(const char* str, BAN::StringView::size_type len) { return BAN::StringView(str, len); } namespace BAN::Formatter { diff --git a/config.sh b/config.sh index 2eea05d6dd..4467c04369 100644 --- a/config.sh +++ b/config.sh @@ -16,9 +16,9 @@ export LIBDIR=$EXEC_PREFIX/lib export INCLUDEDIR=$PREFIX/include export CFLAGS='-O2 -g' -export CPPFLAGS='--std=c++20' +export CPPFLAGS='--std=c++20 -Wno-literal-suffix' -export UBSAN=1 +export UBSAN=0 # Configure the cross-compiler to use the desired system root. export SYSROOT="$(pwd)/sysroot" diff --git a/kernel/kernel/FS/VirtualFileSystem.cpp b/kernel/kernel/FS/VirtualFileSystem.cpp index 9d357e454d..a3cb2d7127 100644 --- a/kernel/kernel/FS/VirtualFileSystem.cpp +++ b/kernel/kernel/FS/VirtualFileSystem.cpp @@ -91,7 +91,7 @@ namespace Kernel for (auto& partition : device->partitions()) { - if (partition.name() == "banan-root"_sv) + if (partition.name() == "banan-root"sv) { if (m_root_inode) dwarnln("multiple root partitions found"); diff --git a/kernel/kernel/Shell.cpp b/kernel/kernel/Shell.cpp index a7ad7d0a2b..4ab52a10da 100644 --- a/kernel/kernel/Shell.cpp +++ b/kernel/kernel/Shell.cpp @@ -20,14 +20,14 @@ namespace Kernel { using namespace BAN; - static auto s_default_prompt = "\\[\e[32m\\]user\\[\e[m\\]# "_sv; + static auto s_default_prompt = "\\[\e[32m\\]user\\[\e[m\\]# "sv; Shell::Shell(TTY* tty) : m_tty(tty) { Input::register_key_event_callback({ &Shell::key_event_callback, this }); set_prompt(s_default_prompt); - MUST(m_buffer.push_back(""_sv)); + MUST(m_buffer.push_back(""sv)); } void Shell::set_prompt(StringView prompt) @@ -76,7 +76,7 @@ namespace Kernel if (command.empty()) break; - MUST(result.push_back(""_sv)); + MUST(result.push_back(""sv)); char quoted = '\0'; bool escape = false; @@ -399,7 +399,7 @@ argument_done: TTY_PRINTLN("{}", res.error()); MUST(m_old_buffer.push_back(current_buffer)); m_buffer = m_old_buffer; - MUST(m_buffer.push_back(""_sv)); + MUST(m_buffer.push_back(""sv)); m_cursor_pos.line = m_buffer.size() - 1; } m_cursor_pos.col = 0;