mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[project] Lose the battle between tabs & spaces
I'm a tabs guy. I like tabs, it's an elegant way to represent indentation instead of brute-forcing it. But I have to admit that the world seems to be going towards spaces, and tooling tends not to play nice with tabs. So here we go, changing the whole repo to spaces since I'm getting tired of all the inconsistent formatting.
This commit is contained in:
committed by
Justin C. Miller
parent
d36b2d8057
commit
8f529046a9
@@ -9,36 +9,36 @@ namespace elf {
|
||||
inline const file_header * fh(const void *data) { return reinterpret_cast<const file_header*>(data); }
|
||||
|
||||
file::file(const void *data, size_t size) :
|
||||
m_programs(offset_ptr<program_header>(data, fh(data)->ph_offset), fh(data)->ph_entsize, fh(data)->ph_num),
|
||||
m_sections(offset_ptr<section_header>(data, fh(data)->sh_offset), fh(data)->sh_entsize, fh(data)->sh_num),
|
||||
m_data(data),
|
||||
m_size(size)
|
||||
m_programs(offset_ptr<program_header>(data, fh(data)->ph_offset), fh(data)->ph_entsize, fh(data)->ph_num),
|
||||
m_sections(offset_ptr<section_header>(data, fh(data)->sh_offset), fh(data)->sh_entsize, fh(data)->sh_num),
|
||||
m_data(data),
|
||||
m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
file::valid() const
|
||||
{
|
||||
if (m_size < sizeof(file_header))
|
||||
return false;
|
||||
if (m_size < sizeof(file_header))
|
||||
return false;
|
||||
|
||||
const file_header *fheader = header();
|
||||
const file_header *fheader = header();
|
||||
|
||||
return
|
||||
fheader->magic == expected_magic &&
|
||||
fheader->word_size == wordsize::bits64 &&
|
||||
fheader->endianness == encoding::lsb &&
|
||||
fheader->os_abi == osabi::sysV &&
|
||||
fheader->file_type == filetype::executable &&
|
||||
fheader->machine_type == machine::x64 &&
|
||||
fheader->ident_version == 1 &&
|
||||
fheader->version == 1;
|
||||
return
|
||||
fheader->magic == expected_magic &&
|
||||
fheader->word_size == wordsize::bits64 &&
|
||||
fheader->endianness == encoding::lsb &&
|
||||
fheader->os_abi == osabi::sysV &&
|
||||
fheader->file_type == filetype::executable &&
|
||||
fheader->machine_type == machine::x64 &&
|
||||
fheader->ident_version == 1 &&
|
||||
fheader->version == 1;
|
||||
}
|
||||
|
||||
uintptr_t
|
||||
file::entrypoint() const
|
||||
{
|
||||
return static_cast<uintptr_t>(header()->entrypoint);
|
||||
return static_cast<uintptr_t>(header()->entrypoint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user