aboutsummaryrefslogtreecommitdiff
path: root/src/common/mac
diff options
context:
space:
mode:
authordmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-28 18:23:15 +0000
committerdmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-07-28 18:23:15 +0000
commit6e3869c19fbb94b739e45b495476ebdd925133ea (patch)
treefd9e37df7b64a8347ee1cd99efe4feb1f2ea10c5 /src/common/mac
parentReview: http://breakpad.appspot.com/135001 (diff)
downloadbreakpad-6e3869c19fbb94b739e45b495476ebdd925133ea.tar.xz
Review: http://breakpad.appspot.com/136001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@633 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac')
-rw-r--r--src/common/mac/macho_walker.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/mac/macho_walker.cc b/src/common/mac/macho_walker.cc
index aeec4ae1..3e8fe211 100644
--- a/src/common/mac/macho_walker.cc
+++ b/src/common/mac/macho_walker.cc
@@ -51,9 +51,9 @@ namespace MacFileUtilities {
MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
void *context)
- : callback_(callback),
+ : file_(0),
+ callback_(callback),
callback_context_(context),
- file_(0),
current_header_(NULL),
current_header_size_(0),
current_header_offset_(0) {
@@ -99,7 +99,7 @@ bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
*offset = current_header_offset_;
return true;
}
-
+
return false;
}
@@ -115,7 +115,7 @@ bool MachoWalker::FindHeader(int cpu_type, off_t &offset) {
// Figure out what type of file we've got
bool is_fat = false;
if (magic == FAT_MAGIC || magic == FAT_CIGAM) {
- is_fat = true;
+ is_fat = true;
}
else if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 &&
magic != MH_CIGAM_64) {
@@ -178,13 +178,13 @@ bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
bool swap = (header.magic == MH_CIGAM);
if (swap)
swap_mach_header(&header, NXHostByteOrder());
-
+
// 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));
header64.reserved = 0;
-
+
current_header_ = &header64;
current_header_size_ = sizeof(header); // 32-bit, not 64-bit
current_header_offset_ = offset;