aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJude Taylor <me@jude.bio>2016-08-16 14:09:57 -0700
committerJude Taylor <me@jude.bio>2016-08-16 14:09:57 -0700
commitca0bce28512bfa8029cc072bb7154b4b6c50c0a6 (patch)
tree079b93086d4703a2071a96c6d6307cda383ecde7 /src
parentcfb77d6e5ba03f40743ba17eef20266909ac5640 (diff)
remove double casting
Diffstat (limited to 'src')
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc6
1 files 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<string> & 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<std::string> runResolver(const Path & filename) {
return std::set<string>();
}
- 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<string> libs;
for(uint32_t i = 0; i < DO_SWAP(should_swap, m_header->ncmds); i++) {