From ca0bce28512bfa8029cc072bb7154b4b6c50c0a6 Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Tue, 16 Aug 2016 14:09:57 -0700 Subject: [PATCH] remove double casting --- .../resolve-system-dependencies.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc index 7aad8e1c5..8502444ba 100644 --- a/src/resolve-system-dependencies/resolve-system-dependencies.cc +++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc @@ -37,7 +37,6 @@ void writeCacheFile(const Path & file, std::set & deps) { std::string findDylibName(bool should_swap, ptrdiff_t dylib_command_start) { struct dylib_command *dylc = (struct dylib_command*)dylib_command_start; - return std::string((char*)(dylib_command_start + DO_SWAP(should_swap, dylc->dylib.name.offset))); } @@ -73,10 +72,11 @@ std::set runResolver(const Path & filename) { return std::set(); } - struct mach_header_64 *m_header = (struct mach_header_64 *)((ptrdiff_t)obj + mach64_offset); + ptrdiff_t mach_header_offset = (ptrdiff_t)obj + mach64_offset; + struct mach_header_64 *m_header = (struct mach_header_64 *)mach_header_offset; bool should_swap = magic == MH_CIGAM_64; - ptrdiff_t cmd_offset = (ptrdiff_t)m_header + sizeof(struct mach_header_64); + ptrdiff_t cmd_offset = mach_header_offset + sizeof(struct mach_header_64); std::set libs; for(uint32_t i = 0; i < DO_SWAP(should_swap, m_header->ncmds); i++) {