mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace ELF {
|
||||
|
||||
DynamicObject::DynamicObject(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
|
||||
DynamicObject::DynamicObject(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
|
||||
: m_filename(filename)
|
||||
, m_base_address(base_address)
|
||||
, m_dynamic_address(dynamic_section_address)
|
||||
|
@ -44,7 +44,7 @@ void DynamicObject::dump() const
|
|||
builder.append("\nd_tag tag_name value\n");
|
||||
size_t num_dynamic_sections = 0;
|
||||
|
||||
for_each_dynamic_entry([&](const DynamicObject::DynamicEntry& entry) {
|
||||
for_each_dynamic_entry([&](DynamicObject::DynamicEntry const& entry) {
|
||||
String name_field = String::formatted("({})", name_for_dtag(entry.tag()));
|
||||
builder.appendff("{:#08x} {:17} {:#08x}\n", entry.tag(), name_field, entry.val());
|
||||
num_dynamic_sections++;
|
||||
|
@ -64,7 +64,7 @@ void DynamicObject::dump() const
|
|||
|
||||
void DynamicObject::parse()
|
||||
{
|
||||
for_each_dynamic_entry([&](const DynamicEntry& entry) {
|
||||
for_each_dynamic_entry([&](DynamicEntry const& entry) {
|
||||
switch (entry.tag()) {
|
||||
case DT_INIT:
|
||||
m_init_offset = entry.ptr() - m_elf_base_address.get();
|
||||
|
@ -294,7 +294,7 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
|
|||
using BloomWord = FlatPtr;
|
||||
constexpr size_t bloom_word_size = sizeof(BloomWord) * 8;
|
||||
|
||||
const u32* hash_table_begin = (u32*)address().as_ptr();
|
||||
u32 const* hash_table_begin = (u32*)address().as_ptr();
|
||||
|
||||
const size_t num_buckets = hash_table_begin[0];
|
||||
const size_t num_omitted_symbols = hash_table_begin[1];
|
||||
|
@ -303,9 +303,9 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
|
|||
const u32 num_maskwords_bitmask = num_maskwords - 1;
|
||||
const u32 shift2 = hash_table_begin[3];
|
||||
|
||||
const BloomWord* bloom_words = (BloomWord const*)&hash_table_begin[4];
|
||||
const u32* const buckets = (u32 const*)&bloom_words[num_maskwords];
|
||||
const u32* const chains = &buckets[num_buckets];
|
||||
BloomWord const* bloom_words = (BloomWord const*)&hash_table_begin[4];
|
||||
u32 const* const buckets = (u32 const*)&bloom_words[num_maskwords];
|
||||
u32 const* const chains = &buckets[num_buckets];
|
||||
|
||||
BloomWord hash1 = hash_value;
|
||||
BloomWord hash2 = hash1 >> shift2;
|
||||
|
@ -317,7 +317,7 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
|
|||
size_t current_sym = buckets[hash1 % num_buckets];
|
||||
if (current_sym == 0)
|
||||
return {};
|
||||
const u32* current_chain = &chains[current_sym - num_omitted_symbols];
|
||||
u32 const* current_chain = &chains[current_sym - num_omitted_symbols];
|
||||
|
||||
for (hash1 &= ~1;; ++current_sym) {
|
||||
hash2 = *(current_chain++);
|
||||
|
@ -336,12 +336,12 @@ auto DynamicObject::HashSection::lookup_gnu_symbol(StringView name, u32 hash_val
|
|||
|
||||
StringView DynamicObject::symbol_string_table_string(ElfW(Word) index) const
|
||||
{
|
||||
return StringView { (const char*)base_address().offset(m_string_table_offset + index).as_ptr() };
|
||||
return StringView { (char const*)base_address().offset(m_string_table_offset + index).as_ptr() };
|
||||
}
|
||||
|
||||
const char* DynamicObject::raw_symbol_string_table_string(ElfW(Word) index) const
|
||||
char const* DynamicObject::raw_symbol_string_table_string(ElfW(Word) index) const
|
||||
{
|
||||
return (const char*)base_address().offset(m_string_table_offset + index).as_ptr();
|
||||
return (char const*)base_address().offset(m_string_table_offset + index).as_ptr();
|
||||
}
|
||||
|
||||
DynamicObject::InitializationFunction DynamicObject::init_section_function() const
|
||||
|
@ -350,7 +350,7 @@ DynamicObject::InitializationFunction DynamicObject::init_section_function() con
|
|||
return (InitializationFunction)init_section().address().as_ptr();
|
||||
}
|
||||
|
||||
const char* DynamicObject::name_for_dtag(ElfW(Sword) d_tag)
|
||||
char const* DynamicObject::name_for_dtag(ElfW(Sword) d_tag)
|
||||
{
|
||||
switch (d_tag) {
|
||||
case DT_NULL:
|
||||
|
@ -463,7 +463,7 @@ auto DynamicObject::lookup_symbol(StringView name) const -> Optional<SymbolLooku
|
|||
return lookup_symbol(HashSymbol { name });
|
||||
}
|
||||
|
||||
auto DynamicObject::lookup_symbol(const HashSymbol& symbol) const -> Optional<SymbolLookupResult>
|
||||
auto DynamicObject::lookup_symbol(HashSymbol const& symbol) const -> Optional<SymbolLookupResult>
|
||||
{
|
||||
auto result = hash_section().lookup_symbol(symbol);
|
||||
if (!result.has_value())
|
||||
|
@ -474,7 +474,7 @@ auto DynamicObject::lookup_symbol(const HashSymbol& symbol) const -> Optional<Sy
|
|||
return SymbolLookupResult { symbol_result.value(), symbol_result.size(), symbol_result.address(), symbol_result.bind(), this };
|
||||
}
|
||||
|
||||
NonnullRefPtr<DynamicObject> DynamicObject::create(const String& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
|
||||
NonnullRefPtr<DynamicObject> DynamicObject::create(String const& filename, VirtualAddress base_address, VirtualAddress dynamic_section_address)
|
||||
{
|
||||
return adopt_ref(*new DynamicObject(filename, base_address, dynamic_section_address));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue