1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +00:00

Everywhere: Add sv suffix to strings relying on StringView(char const*)

Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -24,19 +24,19 @@ namespace HackStudio {
void DebugInfoWidget::init_toolbar()
{
m_continue_action = GUI::Action::create("Continue", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-continue.png").release_value_but_fixme_should_propagate_errors(), [](auto&) {
m_continue_action = GUI::Action::create("Continue", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-continue.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::Continue);
});
m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-over.png").release_value_but_fixme_should_propagate_errors(), [](auto&) {
m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-over.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceStepOver);
});
m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-in.png").release_value_but_fixme_should_propagate_errors(), [](auto&) {
m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-in.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceSingleStep);
});
m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-out.png").release_value_but_fixme_should_propagate_errors(), [](auto&) {
m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/debug-step-out.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) {
Debugger::the().set_requested_debugger_action(Debugger::DebuggerAction::SourceStepOut);
});
@ -106,7 +106,7 @@ RefPtr<GUI::Menu> DebugInfoWidget::get_context_menu_for_variable(const GUI::Mode
if (does_variable_support_writing(variable)) {
context_menu->add_action(GUI::Action::create("Change value", [&](auto&) {
String value;
if (GUI::InputBox::show(window(), value, "Enter new value:", "Set variable value") == GUI::InputBox::ExecResult::OK) {
if (GUI::InputBox::show(window(), value, "Enter new value:"sv, "Set variable value"sv) == GUI::InputBox::ExecResult::OK) {
auto& model = static_cast<VariablesModel&>(*m_variables_view->model());
model.set_variable_value(index, value, window());
}

View file

@ -154,7 +154,7 @@ int Debugger::debugger_loop()
return Debug::DebugSession::DebugDecision::SingleStep;
// We currently do no support stepping through assembly source
if (source_position.value().file_path.ends_with(".S"))
if (source_position.value().file_path.ends_with(".S"sv))
return Debug::DebugSession::DebugDecision::SingleStep;
VERIFY(source_position.has_value());

View file

@ -34,7 +34,7 @@ DisassemblyModel::DisassemblyModel(Debug::DebugSession const& debug_session, Ptr
auto maybe_kernel_base = Symbolication::kernel_base();
if (maybe_kernel_base.has_value() && containing_function.value().address_low >= maybe_kernel_base.value()) {
auto file_or_error = Core::MappedFile::map("/boot/Kernel.debug");
auto file_or_error = Core::MappedFile::map("/boot/Kernel.debug"sv);
if (file_or_error.is_error())
return;
kernel_elf = make<ELF::Image>(file_or_error.value()->bytes());

View file

@ -144,7 +144,7 @@ void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView
GUI::MessageBox::show(
parent_window,
String::formatted("String value \"{}\" could not be converted to a value of type {}.", string_value, variable->type_name),
"Set value failed",
"Set value failed"sv,
GUI::MessageBox::Type::Error);
}

View file

@ -33,7 +33,7 @@ private:
, m_regs(regs)
, m_inspector(inspector)
{
m_variable_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png").release_value_but_fixme_should_propagate_errors());
m_variable_icon.set_bitmap_for_size(16, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/inspector-object.png"sv).release_value_but_fixme_should_propagate_errors());
}
NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo> m_variables;
PtraceRegisters m_regs;