aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac/macho_walker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mac/macho_walker.cc')
-rw-r--r--src/common/mac/macho_walker.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc
index 1acd8665..a42128b8 100644
--- a/src/common/mac/macho_walker.cc
+++ b/src/common/mac/macho_walker.cc
@@ -47,8 +47,8 @@
namespace MacFileUtilities {
-MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
- void *context)
+MachoWalker::MachoWalker(const char* path, LoadCommandCallback callback,
+ void* context)
: file_(-1),
memory_(NULL),
memory_size_(0),
@@ -60,8 +60,8 @@ MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
file_ = open(path, O_RDONLY);
}
-MachoWalker::MachoWalker(void *memory, size_t size,
- LoadCommandCallback callback, void *context)
+MachoWalker::MachoWalker(void* memory, size_t size,
+ LoadCommandCallback callback, void* context)
: file_(-1),
memory_(memory),
memory_size_(size),
@@ -82,7 +82,7 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
cpu_subtype_t valid_cpu_subtype = cpu_subtype;
// if |cpu_type| is 0, use the native cpu type.
if (cpu_type == 0) {
- const NXArchInfo *arch = NXGetLocalArchInfo();
+ const NXArchInfo* arch = NXGetLocalArchInfo();
assert(arch);
valid_cpu_type = arch->cputype;
valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE;
@@ -98,7 +98,7 @@ bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
return false;
}
-bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
+bool MachoWalker::ReadBytes(void* buffer, size_t size, off_t offset) {
if (memory_) {
if (offset < 0)
return false;
@@ -109,14 +109,14 @@ bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
size = memory_size_ - static_cast<size_t>(offset);
result = false;
}
- memcpy(buffer, static_cast<char *>(memory_) + offset, size);
+ memcpy(buffer, static_cast<char*>(memory_) + offset, size);
return result;
} else {
return pread(file_, buffer, size, offset) == (ssize_t)size;
}
}
-bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
+bool MachoWalker::CurrentHeader(struct mach_header_64* header, off_t* offset) {
if (current_header_) {
memcpy(header, current_header_, sizeof(mach_header_64));
*offset = current_header_offset_;
@@ -128,7 +128,7 @@ bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
bool MachoWalker::FindHeader(cpu_type_t cpu_type,
cpu_subtype_t cpu_subtype,
- off_t &offset) {
+ off_t& offset) {
// Read the magic bytes that's common amongst all mach-o files
uint32_t magic;
if (!ReadBytes(&magic, sizeof(magic), 0))
@@ -211,7 +211,7 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
// Copy the data into the mach_header_64 structure. Since the 32-bit and
// 64-bit only differ in the last field (reserved), this is safe to do.
struct mach_header_64 header64;
- memcpy((void *)&header64, (const void *)&header, sizeof(header));
+ memcpy((void*)&header64, (const void*)&header, sizeof(header));
header64.reserved = 0;
current_header_ = &header64;