mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-25 04:22:50 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
Notes:
sideshowbarker
2024-07-17 16:21:09 +09:00
Author: https://github.com/IdanHo
Commit: 086969277e
Pull-request: https://github.com/SerenityOS/serenity/pull/12321
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/bgianfo ✅
1665 changed files with 8479 additions and 8479 deletions
|
@ -17,7 +17,7 @@ GUI::ModelIndex VariablesModel::index(int row, int column, const GUI::ModelIndex
|
|||
return {};
|
||||
return create_index(row, column, &m_variables[row]);
|
||||
}
|
||||
auto* parent = static_cast<const Debug::DebugInfo::VariableInfo*>(parent_index.internal_data());
|
||||
auto* parent = static_cast<Debug::DebugInfo::VariableInfo const*>(parent_index.internal_data());
|
||||
if (static_cast<size_t>(row) >= parent->members.size())
|
||||
return {};
|
||||
auto* child = &parent->members[row];
|
||||
|
@ -28,7 +28,7 @@ GUI::ModelIndex VariablesModel::parent_index(const GUI::ModelIndex& index) const
|
|||
{
|
||||
if (!index.is_valid())
|
||||
return {};
|
||||
auto* child = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
|
||||
auto* child = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
|
||||
auto* parent = child->parent;
|
||||
if (parent == nullptr)
|
||||
return {};
|
||||
|
@ -51,11 +51,11 @@ int VariablesModel::row_count(const GUI::ModelIndex& index) const
|
|||
{
|
||||
if (!index.is_valid())
|
||||
return m_variables.size();
|
||||
auto* node = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
|
||||
auto* node = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
|
||||
return node->members.size();
|
||||
}
|
||||
|
||||
static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& variable)
|
||||
static String variable_value_as_string(Debug::DebugInfo::VariableInfo const& variable)
|
||||
{
|
||||
if (variable.location_type != Debug::DebugInfo::VariableInfo::LocationType::Address)
|
||||
return "N/A";
|
||||
|
@ -65,7 +65,7 @@ static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& var
|
|||
if (variable.is_enum_type()) {
|
||||
auto value = Debugger::the().session()->peek(variable_address);
|
||||
VERIFY(value.has_value());
|
||||
auto it = variable.type->members.find_if([&enumerator_value = value.value()](const auto& enumerator) {
|
||||
auto it = variable.type->members.find_if([&enumerator_value = value.value()](auto const& enumerator) {
|
||||
return enumerator->constant_data.as_u32 == enumerator_value;
|
||||
});
|
||||
if (it.is_end())
|
||||
|
@ -94,7 +94,7 @@ static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& var
|
|||
return String::formatted("type: {} @ {:p}, ", variable.type_name, variable_address);
|
||||
}
|
||||
|
||||
static Optional<u32> string_to_variable_value(StringView string_value, const Debug::DebugInfo::VariableInfo& variable)
|
||||
static Optional<u32> string_to_variable_value(StringView string_value, Debug::DebugInfo::VariableInfo const& variable)
|
||||
{
|
||||
if (variable.is_enum_type()) {
|
||||
auto prefix_string = String::formatted("{}::", variable.type_name);
|
||||
|
@ -102,7 +102,7 @@ static Optional<u32> string_to_variable_value(StringView string_value, const Deb
|
|||
if (string_value.starts_with(prefix_string))
|
||||
string_to_use = string_value.substring_view(prefix_string.length(), string_value.length() - prefix_string.length());
|
||||
|
||||
auto it = variable.type->members.find_if([string_to_use](const auto& enumerator) {
|
||||
auto it = variable.type->members.find_if([string_to_use](auto const& enumerator) {
|
||||
return enumerator->name == string_to_use;
|
||||
});
|
||||
|
||||
|
@ -131,7 +131,7 @@ static Optional<u32> string_to_variable_value(StringView string_value, const Deb
|
|||
|
||||
void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView string_value, GUI::Window* parent_window)
|
||||
{
|
||||
auto variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
|
||||
auto variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
|
||||
|
||||
auto value = string_to_variable_value(string_value, *variable);
|
||||
|
||||
|
@ -150,7 +150,7 @@ void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView
|
|||
|
||||
GUI::Variant VariablesModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
|
||||
{
|
||||
auto* variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());
|
||||
auto* variable = static_cast<Debug::DebugInfo::VariableInfo const*>(index.internal_data());
|
||||
switch (role) {
|
||||
case GUI::ModelRole::Display: {
|
||||
auto value_as_string = variable_value_as_string(*variable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue