lint: use the alternate form without prefix

This commit is contained in:
lief-agent
2026-08-29 14:06:59 +02:00
parent 9ec12e299e
commit 52199f0518
6 changed files with 14 additions and 14 deletions
+3 -3
View File
@@ -94,10 +94,10 @@ std::string Memory::Chunk::to_string() const {
}
if (size() == 0) {
return fmt::format("[0x{:016x}, ...]", addr());
return fmt::format("[{:#018x}, ...]", addr());
}
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
}
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
@@ -174,7 +174,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
int ret = ::mprotect((void*)pstart, len, posix_flags);
if (ret != 0) {
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
return make_error_code(lief_errors::runtime_error);
}
+1 -1
View File
@@ -310,7 +310,7 @@ size_t Module::size() const {
}
std::string Module::to_string() const {
return fmt::format("0x{:08x}: {}", imagebase(), name());
return fmt::format("{:#010x}: {}", imagebase(), name());
}
modules_t modules() {
+3 -3
View File
@@ -94,10 +94,10 @@ std::string Memory::Chunk::to_string() const {
}
if (size() == 0) {
return fmt::format("[0x{:016x}, ...]", addr());
return fmt::format("[{:#018x}, ...]", addr());
}
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
}
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
@@ -174,7 +174,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
int ret = ::mprotect(reinterpret_cast<void*>(pstart), len, posix_flags);
if (ret != 0) {
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
return make_error_code(lief_errors::runtime_error);
}
+3 -3
View File
@@ -98,10 +98,10 @@ std::string Memory::Chunk::to_string() const {
}
if (size() == 0) {
return fmt::format("[0x{:016x}, ...]", addr());
return fmt::format("[{:#018x}, ...]", addr());
}
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
}
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
@@ -180,7 +180,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
int ret = ::mprotect((void*)pstart, len, posix_flags);
if (ret != 0) {
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
return make_error_code(lief_errors::runtime_error);
}
+3 -3
View File
@@ -75,10 +75,10 @@ std::string Memory::Chunk::to_string() const {
}
if (size() == 0) {
return fmt::format("[0x{:016x}, ...]", addr());
return fmt::format("[{:#018x}, ...]", addr());
}
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
}
@@ -179,7 +179,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
DWORD old_perms = 0;
int ret = VirtualProtect((void*)pstart, len, win_perms, &old_perms);
if (ret == 0) {
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({}) failed: {}", pstart, pend,
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({}) failed: {}", pstart, pend,
perm_str(flags), win_perms, GetLastError());
return make_error_code(lief_errors::runtime_error);
}
+1 -1
View File
@@ -389,7 +389,7 @@ void* Module::dlsym(const std::string& name) const {
}
std::string Module::to_string() const {
return fmt::format("0x{:08x}: {}", imagebase(), name());
return fmt::format("{:#010x}: {}", imagebase(), name());
}
modules_t modules() {