summaryrefslogtreecommitdiff
path: root/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/ObjectFile/ELF/ELFHeader.cpp')
-rw-r--r--source/Plugins/ObjectFile/ELF/ELFHeader.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
index 16cbb6e5753b..3d4735286bf2 100644
--- a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -38,7 +38,7 @@ static bool GetMaxU64(const lldb_private::DataExtractor &data,
lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value) {
- if (GetMaxU64(data, offset, value, byte_size) == false) {
+ if (!GetMaxU64(data, offset, value, byte_size)) {
*offset = saved_offset;
return false;
}
@@ -60,7 +60,7 @@ static bool GetMaxS64(const lldb_private::DataExtractor &data,
lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value) {
- if (GetMaxS64(data, offset, value, byte_size) == false) {
+ if (!GetMaxS64(data, offset, value, byte_size)) {
*offset = saved_offset;
return false;
}
@@ -133,7 +133,7 @@ bool ELFHeader::Parse(lldb_private::DataExtractor &data,
return false;
// Read e_entry, e_phoff and e_shoff.
- if (GetMaxU64(data, offset, &e_entry, byte_size, 3) == false)
+ if (!GetMaxU64(data, offset, &e_entry, byte_size, 3))
return false;
// Read e_flags.
@@ -232,11 +232,11 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read sh_flags.
- if (GetMaxU64(data, offset, &sh_flags, byte_size) == false)
+ if (!GetMaxU64(data, offset, &sh_flags, byte_size))
return false;
// Read sh_addr, sh_off and sh_size.
- if (GetMaxU64(data, offset, &sh_addr, byte_size, 3) == false)
+ if (!GetMaxU64(data, offset, &sh_addr, byte_size, 3))
return false;
// Read sh_link and sh_info.
@@ -244,7 +244,7 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read sh_addralign and sh_entsize.
- if (GetMaxU64(data, offset, &sh_addralign, byte_size, 2) == false)
+ if (!GetMaxU64(data, offset, &sh_addralign, byte_size, 2))
return false;
return true;
@@ -332,7 +332,7 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data,
if (parsing_32) {
// Read st_value and st_size.
- if (GetMaxU64(data, offset, &st_value, byte_size, 2) == false)
+ if (!GetMaxU64(data, offset, &st_value, byte_size, 2))
return false;
// Read st_info and st_other.
@@ -376,7 +376,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
if (parsing_32) {
// Read p_offset, p_vaddr, p_paddr, p_filesz and p_memsz.
- if (GetMaxU64(data, offset, &p_offset, byte_size, 5) == false)
+ if (!GetMaxU64(data, offset, &p_offset, byte_size, 5))
return false;
// Read p_flags.
@@ -384,7 +384,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read p_align.
- if (GetMaxU64(data, offset, &p_align, byte_size) == false)
+ if (!GetMaxU64(data, offset, &p_align, byte_size))
return false;
} else {
// Read p_flags.
@@ -392,7 +392,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read p_offset, p_vaddr, p_paddr, p_filesz, p_memsz and p_align.
- if (GetMaxU64(data, offset, &p_offset, byte_size, 6) == false)
+ if (!GetMaxU64(data, offset, &p_offset, byte_size, 6))
return false;
}
@@ -420,10 +420,7 @@ bool ELFRel::Parse(const lldb_private::DataExtractor &data,
const unsigned byte_size = data.GetAddressByteSize();
// Read r_offset and r_info.
- if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false)
- return false;
-
- return true;
+ return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false;
}
//------------------------------------------------------------------------------
@@ -436,11 +433,11 @@ bool ELFRela::Parse(const lldb_private::DataExtractor &data,
const unsigned byte_size = data.GetAddressByteSize();
// Read r_offset and r_info.
- if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false)
+ if (!GetMaxU64(data, offset, &r_offset, byte_size, 2))
return false;
// Read r_addend;
- if (GetMaxS64(data, offset, &r_addend, byte_size) == false)
+ if (!GetMaxS64(data, offset, &r_addend, byte_size))
return false;
return true;