1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibDebug+LibCoredump: Replace remaining reinterpret_casts and C casts

You misused your toys and I'm now taking them away, reflect on what you
did wrong for a bit.
This commit is contained in:
Ali Mohammad Pur 2022-01-27 04:51:17 +03:30 committed by Linus Groh
parent da3c4e5df5
commit e0db9cb876
10 changed files with 68 additions and 64 deletions

View file

@ -42,13 +42,13 @@ void LineProgram::parse_path_entries(Function<void(PathEntry& entry)> callback,
Vector<PathEntryFormat> format_descriptions;
for (u8 i = 0; i < path_entry_format_count; i++) {
size_t content_type = 0;
UnderlyingType<ContentType> content_type;
m_stream.read_LEB128_unsigned(content_type);
size_t data_form = 0;
UnderlyingType<AttributeDataForm> data_form;
m_stream.read_LEB128_unsigned(data_form);
format_descriptions.empend((ContentType)content_type, (AttributeDataForm)data_form);
format_descriptions.empend(static_cast<ContentType>(content_type), static_cast<AttributeDataForm>(data_form));
}
size_t paths_count = 0;
@ -66,7 +66,7 @@ void LineProgram::parse_path_entries(Function<void(PathEntry& entry)> callback,
entry.directory_index = value.as_unsigned();
break;
default:
dbgln_if(DWARF_DEBUG, "Unhandled path list attribute: {}", (int)format_description.type);
dbgln_if(DWARF_DEBUG, "Unhandled path list attribute: {}", to_underlying(format_description.type));
}
}
callback(entry);
@ -280,7 +280,7 @@ void LineProgram::run_program()
{
reset_registers();
while ((size_t)m_stream.offset() < m_unit_offset + sizeof(u32) + m_unit_header.length()) {
while (m_stream.offset() < m_unit_offset + sizeof(u32) + m_unit_header.length()) {
u8 opcode = 0;
m_stream >> opcode;